Imported Upstream version 1.2.12 10/315510/1 upstream upstream/1.2.12
authorJaechul Lee <jcsing.lee@samsung.com>
Fri, 2 Aug 2024 02:28:28 +0000 (11:28 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Fri, 2 Aug 2024 02:28:46 +0000 (11:28 +0900)
Change-Id: I8ee96b99e5955bd04c2a322533fe4cd297d70bc9

305 files changed:
ABOUT-NLS
INSTALL
Makefile.am
Makefile.in
README [deleted file]
README.md [new file with mode: 0644]
aclocal.m4
alsa-info/Makefile.am
alsa-info/Makefile.in
alsa-info/alsa-info.sh
alsa-info/alsa-info.sh.1 [new file with mode: 0644]
alsaconf/Makefile.in
alsaconf/po/Makefile.in
alsaconf/po/ka.po [new file with mode: 0644]
alsactl/90-alsa-restore.rules.in
alsactl/Makefile.am
alsactl/Makefile.in
alsactl/alsa-restore.service.in
alsactl/alsa-state.service.in
alsactl/alsa-store.service.in [deleted file]
alsactl/alsactl.1
alsactl/alsactl.c
alsactl/alsactl.h
alsactl/clean.c [new file with mode: 0644]
alsactl/daemon.c
alsactl/info.c [new file with mode: 0644]
alsactl/init/00main
alsactl/init/Makefile.in
alsactl/init/ca0106
alsactl/init/hda
alsactl/init_parse.c
alsactl/init_sysdeps.c
alsactl/init_sysfs.c
alsactl/init_ucm.c [new file with mode: 0644]
alsactl/lock.c
alsactl/monitor.c
alsactl/state.c
alsactl/utils.c
alsaloop/Makefile.in
alsaloop/alsaloop.1
alsaloop/alsaloop.c
alsaloop/alsaloop.h
alsaloop/control.c
alsaloop/pcmjob.c
alsamixer/Makefile.am
alsamixer/Makefile.in
alsamixer/alsamixer.1
alsamixer/alsamixer.rc.example [new file with mode: 0644]
alsamixer/bindings.c [new file with mode: 0644]
alsamixer/bindings.h [new file with mode: 0644]
alsamixer/card_select.c
alsamixer/cli.c
alsamixer/colors.c
alsamixer/colors.h
alsamixer/configparser.c [new file with mode: 0644]
alsamixer/configparser.h [new file with mode: 0644]
alsamixer/curskey.c [new file with mode: 0644]
alsamixer/curskey.h [new file with mode: 0644]
alsamixer/device_name.c
alsamixer/mainloop.c
alsamixer/mainloop.h
alsamixer/mem.c
alsamixer/menu_widget.c [new file with mode: 0644]
alsamixer/menu_widget.h [new file with mode: 0644]
alsamixer/mixer_clickable.c [new file with mode: 0644]
alsamixer/mixer_clickable.h [new file with mode: 0644]
alsamixer/mixer_controls.c
alsamixer/mixer_display.c
alsamixer/mixer_widget.c
alsamixer/mixer_widget.h
alsamixer/proc_files.c
alsamixer/textbox.c
alsamixer/utils.c
alsamixer/utils.h
alsamixer/volume_mapping.c
alsamixer/widget.c
alsamixer/widget.h
alsaucm/Makefile.am
alsaucm/Makefile.in
alsaucm/alsaucm.rst [new file with mode: 0644]
alsaucm/dump.c [new file with mode: 0644]
alsaucm/usecase.c
alsaucm/usecase.h [new file with mode: 0644]
amidi/Makefile.in
amidi/amidi.1
amidi/amidi.c
amixer/Makefile.am
amixer/Makefile.in
amixer/amixer.1
amixer/amixer.c
amixer/amixer.h
amixer/volume_mapping.c [new file with mode: 0644]
amixer/volume_mapping.h [new file with mode: 0644]
aplay/Makefile.in
aplay/aplay.1
aplay/aplay.c
aplay/arecord.1
aplay/formats.h
axfer/Makefile.am [new file with mode: 0644]
axfer/Makefile.in [new file with mode: 0644]
axfer/axfer-list.1 [new file with mode: 0644]
axfer/axfer-transfer.1 [new file with mode: 0644]
axfer/axfer.1 [new file with mode: 0644]
axfer/container-au.c [new file with mode: 0644]
axfer/container-raw.c [new file with mode: 0644]
axfer/container-riff-wave.c [new file with mode: 0644]
axfer/container-voc.c [new file with mode: 0644]
axfer/container.c [new file with mode: 0644]
axfer/container.h [new file with mode: 0644]
axfer/frame-cache.c [new file with mode: 0644]
axfer/frame-cache.h [new file with mode: 0644]
axfer/main.c [new file with mode: 0644]
axfer/mapper-multiple.c [new file with mode: 0644]
axfer/mapper-single.c [new file with mode: 0644]
axfer/mapper.c [new file with mode: 0644]
axfer/mapper.h [new file with mode: 0644]
axfer/misc.h [new file with mode: 0644]
axfer/subcmd-list.c [new file with mode: 0644]
axfer/subcmd-transfer.c [new file with mode: 0644]
axfer/subcmd.h [new file with mode: 0644]
axfer/test/Makefile.am [new file with mode: 0644]
axfer/test/Makefile.in [new file with mode: 0644]
axfer/test/container-test.c [new file with mode: 0644]
axfer/test/generator.c [new file with mode: 0644]
axfer/test/generator.h [new file with mode: 0644]
axfer/test/mapper-test.c [new file with mode: 0644]
axfer/waiter-epoll.c [new file with mode: 0644]
axfer/waiter-poll.c [new file with mode: 0644]
axfer/waiter-select.c [new file with mode: 0644]
axfer/waiter.c [new file with mode: 0644]
axfer/waiter.h [new file with mode: 0644]
axfer/xfer-libasound-irq-mmap.c [new file with mode: 0644]
axfer/xfer-libasound-irq-rw.c [new file with mode: 0644]
axfer/xfer-libasound-timer-mmap.c [new file with mode: 0644]
axfer/xfer-libasound.c [new file with mode: 0644]
axfer/xfer-libasound.h [new file with mode: 0644]
axfer/xfer-libffado.c [new file with mode: 0644]
axfer/xfer-options.c [new file with mode: 0644]
axfer/xfer.c [new file with mode: 0644]
axfer/xfer.h [new file with mode: 0644]
bat/Makefile.am [new file with mode: 0644]
bat/Makefile.in [new file with mode: 0644]
bat/alsa.c [new file with mode: 0644]
bat/alsa.h [new file with mode: 0644]
bat/alsabat-test.sh [new file with mode: 0755]
bat/alsabat.1 [new file with mode: 0644]
bat/analyze.c [new file with mode: 0644]
bat/analyze.h [new file with mode: 0644]
bat/bat-signal.h [new file with mode: 0644]
bat/bat.c [new file with mode: 0644]
bat/common.c [new file with mode: 0644]
bat/common.h [new file with mode: 0644]
bat/convert.c [new file with mode: 0644]
bat/convert.h [new file with mode: 0644]
bat/latencytest.c [new file with mode: 0644]
bat/latencytest.h [new file with mode: 0644]
bat/signal.c [new file with mode: 0644]
bat/tests/Makefile.am [new file with mode: 0644]
bat/tests/Makefile.in [new file with mode: 0644]
bat/tests/README [new file with mode: 0644]
bat/tests/analog_audio_playback_and_capture.sh [new file with mode: 0755]
bat/tests/asound_state/Makefile.am [new file with mode: 0644]
bat/tests/asound_state/Makefile.in [new file with mode: 0644]
bat/tests/asound_state/asound.state.Broadwell [new file with mode: 0644]
bat/tests/asound_state/asound.state.Haswell [new file with mode: 0644]
bat/tests/asound_state/asound.state.Skylake [new file with mode: 0644]
bat/tests/dp_audio_playback.sh [new file with mode: 0755]
bat/tests/dp_audio_subdevice_number.sh [new file with mode: 0755]
bat/tests/hdmi_audio_playback.sh [new file with mode: 0755]
bat/tests/hdmi_audio_subdevice_number.sh [new file with mode: 0755]
bat/tests/map_test_case [new file with mode: 0644]
bat/tinyalsa.c [new file with mode: 0644]
bat/tinyalsa.h [new file with mode: 0644]
compile [new file with mode: 0755]
config.guess
config.rpath
config.sub
configure
configure.ac
depcomp
gitcompile
iecset/Makefile.in
iecset/iecbits.c
iecset/iecset.c
include/Makefile.am
include/Makefile.in
include/aconfig.h.in
include/bswap.h [new file with mode: 0644]
include/os_compat.h [new file with mode: 0644]
include/version.h
install-sh
ltconfig [new file with mode: 0644]
ltmain.sh [new file with mode: 0644]
m4/Makefile.am
m4/Makefile.in
m4/gettext.m4
m4/host-cpu-c-abi.m4 [new file with mode: 0644]
m4/iconv.m4
m4/intlmacosx.m4 [new file with mode: 0644]
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
m4/libtool.m4 [new file with mode: 0644]
m4/ltoptions.m4 [new file with mode: 0644]
m4/ltsugar.m4 [new file with mode: 0644]
m4/ltversion.m4 [new file with mode: 0644]
m4/lt~obsolete.m4 [new file with mode: 0644]
m4/nls.m4
m4/po.m4
m4/progtest.m4
missing
nhlt/Makefile.am [new file with mode: 0644]
nhlt/Makefile.in [new file with mode: 0644]
nhlt/nhlt-dmic-info.1 [new file with mode: 0644]
nhlt/nhlt-dmic-info.c [new file with mode: 0644]
po/LINGUAS
po/Makefile.in.in
po/Makevars
po/Rules-quot
po/alsa-utils.pot
po/de.gmo
po/de.po
po/en@boldquot.header
po/en@quot.header
po/eu.gmo [new file with mode: 0644]
po/eu.po [new file with mode: 0644]
po/fr.gmo
po/fr.po
po/insert-header.sin
po/ja.gmo
po/ja.po
po/ka.gmo [new file with mode: 0644]
po/ka.po [new file with mode: 0644]
po/ko.gmo [new file with mode: 0644]
po/ko.po [new file with mode: 0644]
po/remove-potcdate.sin
po/sk.gmo [new file with mode: 0644]
po/sk.po [new file with mode: 0644]
seq/Makefile.am
seq/Makefile.in
seq/aconnect/Makefile.in
seq/aconnect/aconnect.1
seq/aconnect/aconnect.c
seq/aplaymidi/Makefile.in
seq/aplaymidi/aplaymidi.1
seq/aplaymidi/aplaymidi.c
seq/aplaymidi/arecordmidi.c
seq/aseqdump/Makefile.in
seq/aseqdump/aseqdump.1
seq/aseqdump/aseqdump.c
seq/aseqnet/Makefile.in
seq/aseqnet/README.aseqnet
seq/aseqnet/aseqnet.1
seq/aseqnet/aseqnet.c
seq/aseqsend/Makefile.am [new file with mode: 0644]
seq/aseqsend/Makefile.in [new file with mode: 0644]
seq/aseqsend/aseqsend.1 [new file with mode: 0644]
seq/aseqsend/aseqsend.c [new file with mode: 0644]
speaker-test/Makefile.am
speaker-test/Makefile.in
speaker-test/pink.c
speaker-test/samples/Makefile.am
speaker-test/samples/Makefile.in
speaker-test/samples/sample_map.csv [deleted file]
speaker-test/speaker-test.1
speaker-test/speaker-test.c
speaker-test/st2095.c [new file with mode: 0644]
speaker-test/st2095.h [new file with mode: 0644]
test-driver [new file with mode: 0755]
topology/Makefile.am [new file with mode: 0644]
topology/Makefile.in [new file with mode: 0644]
topology/alsatplg.rst [new file with mode: 0644]
topology/nhlt/Makefile.am [new file with mode: 0644]
topology/nhlt/Makefile.in [new file with mode: 0644]
topology/nhlt/intel/dmic-nhlt.c [new file with mode: 0644]
topology/nhlt/intel/dmic-nhlt.h [new file with mode: 0644]
topology/nhlt/intel/dmic/dmic-debug.c [new file with mode: 0644]
topology/nhlt/intel/dmic/dmic-debug.h [new file with mode: 0644]
topology/nhlt/intel/dmic/dmic-intel.h [new file with mode: 0644]
topology/nhlt/intel/dmic/dmic-internal.h [new file with mode: 0644]
topology/nhlt/intel/dmic/dmic-process.c [new file with mode: 0644]
topology/nhlt/intel/dmic/dmic-process.h [new file with mode: 0644]
topology/nhlt/intel/dmic/pdm-decim-fir.h [new file with mode: 0644]
topology/nhlt/intel/intel-nhlt.c [new file with mode: 0644]
topology/nhlt/intel/intel-nhlt.h [new file with mode: 0644]
topology/nhlt/intel/ssp-nhlt.c [new file with mode: 0644]
topology/nhlt/intel/ssp-nhlt.h [new file with mode: 0644]
topology/nhlt/intel/ssp/ssp-debug.c [new file with mode: 0644]
topology/nhlt/intel/ssp/ssp-debug.h [new file with mode: 0644]
topology/nhlt/intel/ssp/ssp-intel.h [new file with mode: 0644]
topology/nhlt/intel/ssp/ssp-internal.h [new file with mode: 0644]
topology/nhlt/intel/ssp/ssp-process.c [new file with mode: 0644]
topology/nhlt/intel/ssp/ssp-process.h [new file with mode: 0644]
topology/nhlt/nhlt-processor.c [new file with mode: 0644]
topology/nhlt/nhlt.h [new file with mode: 0644]
topology/pre-process-class.c [new file with mode: 0644]
topology/pre-process-dai.c [new file with mode: 0644]
topology/pre-process-dapm.c [new file with mode: 0644]
topology/pre-process-external.h [new file with mode: 0644]
topology/pre-process-object.c [new file with mode: 0644]
topology/pre-processor.c [new file with mode: 0644]
topology/pre-processor.h [new file with mode: 0644]
topology/topology.c [new file with mode: 0644]
topology/topology.h [new file with mode: 0644]
utils/Makefile.in

index b1de1b6..0a9d56d 100644 (file)
--- a/ABOUT-NLS
+++ b/ABOUT-NLS
@@ -1,1282 +1 @@
-1 Notes on the Free Translation Project
-***************************************
-
-Free software is going international!  The Free Translation Project is
-a way to get maintainers of free software, translators, and users all
-together, so that free software will gradually become able to speak many
-languages.  A few packages already provide translations for their
-messages.
-
-   If you found this `ABOUT-NLS' file inside a distribution, you may
-assume that the distributed package does use GNU `gettext' internally,
-itself available at your nearest GNU archive site.  But you do _not_
-need to install GNU `gettext' prior to configuring, installing or using
-this package with messages translated.
-
-   Installers will find here some useful hints.  These notes also
-explain how users should proceed for getting the programs to use the
-available translations.  They tell how people wanting to contribute and
-work on translations can contact the appropriate team.
-
-1.1 INSTALL Matters
-===================
-
-Some packages are "localizable" when properly installed; the programs
-they contain can be made to speak your own native language.  Most such
-packages use GNU `gettext'.  Other packages have their own ways to
-internationalization, predating GNU `gettext'.
-
-   By default, this package will be installed to allow translation of
-messages.  It will automatically detect whether the system already
-provides the GNU `gettext' functions.  Installers may use special
-options at configuration time for changing the default behaviour.  The
-command:
-
-     ./configure --disable-nls
-
-will _totally_ disable translation of messages.
-
-   When you already have GNU `gettext' installed on your system and run
-configure without an option for your new package, `configure' will
-probably detect the previously built and installed `libintl' library
-and will decide to use it.  If not, you may have to to use the
-`--with-libintl-prefix' option to tell `configure' where to look for it.
-
-   Internationalized packages usually have many `po/LL.po' files, where
-LL gives an ISO 639 two-letter code identifying the language.  Unless
-translations have been forbidden at `configure' time by using the
-`--disable-nls' switch, all available translations are installed
-together with the package.  However, the environment variable `LINGUAS'
-may be set, prior to configuration, to limit the installed set.
-`LINGUAS' should then contain a space separated list of two-letter
-codes, stating which languages are allowed.
-
-1.2 Using This Package
-======================
-
-As a user, if your language has been installed for this package, you
-only have to set the `LANG' environment variable to the appropriate
-`LL_CC' combination.  If you happen to have the `LC_ALL' or some other
-`LC_xxx' environment variables set, you should unset them before
-setting `LANG', otherwise the setting of `LANG' will not have the
-desired effect.  Here `LL' is an ISO 639 two-letter language code, and
-`CC' is an ISO 3166 two-letter country code.  For example, let's
-suppose that you speak German and live in Germany.  At the shell
-prompt, merely execute `setenv LANG de_DE' (in `csh'),
-`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
-This can be done from your `.login' or `.profile' file, once and for
-all.
-
-   You might think that the country code specification is redundant.
-But in fact, some languages have dialects in different countries.  For
-example, `de_AT' is used for Austria, and `pt_BR' for Brazil.  The
-country code serves to distinguish the dialects.
-
-   The locale naming convention of `LL_CC', with `LL' denoting the
-language and `CC' denoting the country, is the one use on systems based
-on GNU libc.  On other systems, some variations of this scheme are
-used, such as `LL' or `LL_CC.ENCODING'.  You can get the list of
-locales supported by your system for your language by running the
-command `locale -a | grep '^LL''.
-
-   Not all programs have translations for all languages.  By default, an
-English message is shown in place of a nonexistent translation.  If you
-understand other languages, you can set up a priority list of languages.
-This is done through a different environment variable, called
-`LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG'
-for the purpose of message handling, but you still need to have `LANG'
-set to the primary language; this is required by other parts of the
-system libraries.  For example, some Swedish users who would rather
-read translations in German than English for when Swedish is not
-available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
-
-   Special advice for Norwegian users: The language code for Norwegian
-bokma*l changed from `no' to `nb' recently (in 2003).  During the
-transition period, while some message catalogs for this language are
-installed under `nb' and some older ones under `no', it's recommended
-for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
-older translations are used.
-
-   In the `LANGUAGE' environment variable, but not in the `LANG'
-environment variable, `LL_CC' combinations can be abbreviated as `LL'
-to denote the language's main dialect.  For example, `de' is equivalent
-to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
-(Portuguese as spoken in Portugal) in this context.
-
-1.3 Translating Teams
-=====================
-
-For the Free Translation Project to be a success, we need interested
-people who like their own language and write it well, and who are also
-able to synergize with other translators speaking the same language.
-Each translation team has its own mailing list.  The up-to-date list of
-teams can be found at the Free Translation Project's homepage,
-`http://translationproject.org/', in the "Teams" area.
-
-   If you'd like to volunteer to _work_ at translating messages, you
-should become a member of the translating team for your own language.
-The subscribing address is _not_ the same as the list itself, it has
-`-request' appended.  For example, speakers of Swedish can send a
-message to `sv-request@li.org', having this message body:
-
-     subscribe
-
-   Keep in mind that team members are expected to participate
-_actively_ in translations, or at solving translational difficulties,
-rather than merely lurking around.  If your team does not exist yet and
-you want to start one, or if you are unsure about what to do or how to
-get started, please write to `coordinator@translationproject.org' to
-reach the coordinator for all translator teams.
-
-   The English team is special.  It works at improving and uniformizing
-the terminology in use.  Proven linguistic skills are praised more than
-programming skills, here.
-
-1.4 Available Packages
-======================
-
-Languages are not equally supported in all packages.  The following
-matrix shows the current state of internationalization, as of June
-2010.  The matrix shows, in regard of each package, for which languages
-PO files have been submitted to translation coordination, with a
-translation percentage of at least 50%.
-
-     Ready PO files       af am an ar as ast az be be@latin bg bn_IN bs ca
-                        +--------------------------------------------------+
-     a2ps               |                       []                      [] |
-     aegis              |                                                  |
-     ant-phone          |                                                  |
-     anubis             |                                                  |
-     aspell             |                []                             [] |
-     bash               |                                                  |
-     bfd                |                                                  |
-     bibshelf           |                []                                |
-     binutils           |                                                  |
-     bison              |                                                  |
-     bison-runtime      |                []                                |
-     bluez-pin          | []             []                                |
-     bombono-dvd        |                                                  |
-     buzztard           |                                                  |
-     cflow              |                                                  |
-     clisp              |                                                  |
-     coreutils          |                                   []          [] |
-     cpio               |                                                  |
-     cppi               |                                                  |
-     cpplib             |                                               [] |
-     cryptsetup         |                                                  |
-     dfarc              |                                                  |
-     dialog             |                             []                [] |
-     dico               |                                                  |
-     diffutils          |                                               [] |
-     dink               |                                                  |
-     doodle             |                                                  |
-     e2fsprogs          |                                               [] |
-     enscript           |                                               [] |
-     exif               |                                                  |
-     fetchmail          |                                               [] |
-     findutils          |                                   []             |
-     flex               |                                               [] |
-     freedink           |                                                  |
-     gas                |                                                  |
-     gawk               |                []                             [] |
-     gcal               |                                               [] |
-     gcc                |                                                  |
-     gettext-examples   | []             []                 []          [] |
-     gettext-runtime    |                                   []          [] |
-     gettext-tools      |                                   []          [] |
-     gip                |                                   []             |
-     gjay               |                                                  |
-     gliv               |                                   []             |
-     glunarclock        |                []                 []             |
-     gnubiff            |                                                  |
-     gnucash            |                                               [] |
-     gnuedu             |                                                  |
-     gnulib             |                                                  |
-     gnunet             |                                                  |
-     gnunet-gtk         |                                                  |
-     gnutls             |                                                  |
-     gold               |                                                  |
-     gpe-aerial         |                                                  |
-     gpe-beam           |                                                  |
-     gpe-bluetooth      |                                                  |
-     gpe-calendar       |                                                  |
-     gpe-clock          |                []                                |
-     gpe-conf           |                                                  |
-     gpe-contacts       |                                                  |
-     gpe-edit           |                                                  |
-     gpe-filemanager    |                                                  |
-     gpe-go             |                                                  |
-     gpe-login          |                                                  |
-     gpe-ownerinfo      |                []                                |
-     gpe-package        |                                                  |
-     gpe-sketchbook     |                                                  |
-     gpe-su             |                []                                |
-     gpe-taskmanager    |                []                                |
-     gpe-timesheet      |                []                                |
-     gpe-today          |                []                                |
-     gpe-todo           |                                                  |
-     gphoto2            |                                                  |
-     gprof              |                                   []             |
-     gpsdrive           |                                                  |
-     gramadoir          |                                                  |
-     grep               |                                                  |
-     grub               |                []                             [] |
-     gsasl              |                                                  |
-     gss                |                                                  |
-     gst-plugins-bad    |                                   []             |
-     gst-plugins-base   |                                   []             |
-     gst-plugins-good   |                                   []             |
-     gst-plugins-ugly   |                                   []             |
-     gstreamer          | []                                []          [] |
-     gtick              |                                                  |
-     gtkam              |                       []                         |
-     gtkorphan          |                                   []             |
-     gtkspell           | []             []     []                         |
-     gutenprint         |                                                  |
-     hello              |                                   []             |
-     help2man           |                                                  |
-     hylafax            |                                                  |
-     idutils            |                                                  |
-     indent             |                                   []          [] |
-     iso_15924          |                                                  |
-     iso_3166           | []          []        []          []  []   [] [] |
-     iso_3166_2         |                                                  |
-     iso_4217           |                                                  |
-     iso_639            |             [] []     []              []         |
-     iso_639_3          |                                                  |
-     jwhois             |                                                  |
-     kbd                |                                                  |
-     keytouch           |                                               [] |
-     keytouch-editor    |                                                  |
-     keytouch-keyboa... |                                               [] |
-     klavaro            |          []                                      |
-     latrine            |                                                  |
-     ld                 |                                   []             |
-     leafpad            |                                   []          [] |
-     libc               |                                   []          [] |
-     libexif            |                       ()                         |
-     libextractor       |                                                  |
-     libgnutls          |                                                  |
-     libgpewidget       |                                                  |
-     libgpg-error       |                                                  |
-     libgphoto2         |                                                  |
-     libgphoto2_port    |                                                  |
-     libgsasl           |                                                  |
-     libiconv           |                                   []             |
-     libidn             |                                                  |
-     lifelines          |                                                  |
-     liferea            |                             []                [] |
-     lilypond           |                                                  |
-     linkdr             |          []                                      |
-     lordsawar          |                                                  |
-     lprng              |                                                  |
-     lynx               |                                               [] |
-     m4                 |                                                  |
-     mailfromd          |                                                  |
-     mailutils          |                                                  |
-     make               |                                                  |
-     man-db             |                                                  |
-     man-db-manpages    |                                                  |
-     minicom            |                                                  |
-     mkisofs            |                                                  |
-     myserver           |                                                  |
-     nano               |                                   []          [] |
-     opcodes            |                                                  |
-     parted             |                                                  |
-     pies               |                                                  |
-     popt               |                                                  |
-     psmisc             |                                                  |
-     pspp               |                                               [] |
-     pwdutils           |                                                  |
-     radius             |                                               [] |
-     recode             |                       []                      [] |
-     rosegarden         |                                                  |
-     rpm                |                                                  |
-     rush               |                                                  |
-     sarg               |                                                  |
-     screem             |                                                  |
-     scrollkeeper       |                    [] []                      [] |
-     sed                |                []                             [] |
-     sharutils          |                                   []          [] |
-     shishi             |                                                  |
-     skencil            |                                                  |
-     solfege            |                                                  |
-     solfege-manual     |                                                  |
-     soundtracker       |                                                  |
-     sp                 |                                                  |
-     sysstat            |                                                  |
-     tar                |                                   []             |
-     texinfo            |                                                  |
-     tin                |                                                  |
-     unicode-han-tra... |                                                  |
-     unicode-transla... |                                                  |
-     util-linux-ng      |                                               [] |
-     vice               |                                                  |
-     vmm                |                                                  |
-     vorbis-tools       |                                                  |
-     wastesedge         |                                                  |
-     wdiff              |                                                  |
-     wget               |                       []                      [] |
-     wyslij-po          |                                                  |
-     xchat              |                []     []          []          [] |
-     xdg-user-dirs      | []    []    [] []     []    []    []  []      [] |
-     xkeyboard-config   |                                   []          [] |
-                        +--------------------------------------------------+
-                          af am an ar as ast az be be@latin bg bn_IN bs ca
-                           6  0  1  2  3 19   1 10     3    28   3    1 38
-
-                          crh cs da  de  el en en_GB en_ZA eo es et eu fa
-                        +-------------------------------------------------+
-     a2ps               |     [] []  []  []     []            [] []       |
-     aegis              |        []  []                       []          |
-     ant-phone          |        []  ()                                   |
-     anubis             |        []  []                                   |
-     aspell             |     [] []  []         []            []          |
-     bash               |     []                           [] []          |
-     bfd                |                                     []          |
-     bibshelf           |        []  []                       []          |
-     binutils           |                                     []          |
-     bison              |            []  []                               |
-     bison-runtime      |        []  []  []                      []       |
-     bluez-pin          |     [] []  []  []                [] []          |
-     bombono-dvd        |        []                                       |
-     buzztard           |     [] []  []                                   |
-     cflow              |        []  []                                   |
-     clisp              |        []  []     []                []          |
-     coreutils          |     [] []  []                          []       |
-     cpio               |                                                 |
-     cppi               |                                                 |
-     cpplib             |        []  []                       []          |
-     cryptsetup         |            []                                   |
-     dfarc              |        []  []                       []          |
-     dialog             |        []  []                    [] []    []    |
-     dico               |                                                 |
-     diffutils          |     [] []  []  []                [] []          |
-     dink               |        []  []                       []          |
-     doodle             |            []                                   |
-     e2fsprogs          |     []     []                       []          |
-     enscript           |        []  []         []                        |
-     exif               |     () []  []                                   |
-     fetchmail          |     [] []  ()  []     []            []          |
-     findutils          |     [] []  []                                   |
-     flex               |            []                       []          |
-     freedink           |        []  []                       []          |
-     gas                |                                     []          |
-     gawk               |        []  []                       []          |
-     gcal               |                                     []          |
-     gcc                |            []                       []          |
-     gettext-examples   |            []  []                [] []          |
-     gettext-runtime    |        []  []                    [] []          |
-     gettext-tools      |            []                       []    []    |
-     gip                |        []  []                       []    []    |
-     gjay               |            []                                   |
-     gliv               |     [] []  []                                   |
-     glunarclock        |        []  []                                   |
-     gnubiff            |            ()                                   |
-     gnucash            |     []     ()  ()     ()            ()          |
-     gnuedu             |        []                           []          |
-     gnulib             |            []                       []          |
-     gnunet             |                                                 |
-     gnunet-gtk         |        []                                       |
-     gnutls             |     []     []                                   |
-     gold               |                                     []          |
-     gpe-aerial         |     [] []  []                       []          |
-     gpe-beam           |     [] []  []                       []          |
-     gpe-bluetooth      |        []  []                                   |
-     gpe-calendar       |        []                                       |
-     gpe-clock          |     [] []  []                       []          |
-     gpe-conf           |     [] []  []                                   |
-     gpe-contacts       |        []  []                       []          |
-     gpe-edit           |        []  []                                   |
-     gpe-filemanager    |        []  []                       []          |
-     gpe-go             |     [] []  []                       []          |
-     gpe-login          |        []  []                                   |
-     gpe-ownerinfo      |     [] []  []                       []          |
-     gpe-package        |        []  []                       []          |
-     gpe-sketchbook     |     [] []  []                       []          |
-     gpe-su             |     [] []  []                       []          |
-     gpe-taskmanager    |     [] []  []                       []          |
-     gpe-timesheet      |     [] []  []                       []          |
-     gpe-today          |     [] []  []                       []          |
-     gpe-todo           |        []  []                       []          |
-     gphoto2            |     [] []  ()         []            []    []    |
-     gprof              |        []  []                       []          |
-     gpsdrive           |        []                           [] []       |
-     gramadoir          |        []  []                    []             |
-     grep               |     []                                          |
-     grub               |        []  []                                   |
-     gsasl              |            []                                   |
-     gss                |                                                 |
-     gst-plugins-bad    |     [] []  []                       []    []    |
-     gst-plugins-base   |     [] []  []                       []    []    |
-     gst-plugins-good   |     [] []  []  []                   []    []    |
-     gst-plugins-ugly   |     [] []  []  []                   []    []    |
-     gstreamer          |     [] []  []                       []    []    |
-     gtick              |        []  ()                    []             |
-     gtkam              |     [] []  ()                    [] []          |
-     gtkorphan          |     [] []  []                    []             |
-     gtkspell           |     [] []  []  []                [] []    []    |
-     gutenprint         |        []  []         []                        |
-     hello              |        []  []                    [] []          |
-     help2man           |            []                                   |
-     hylafax            |            []                       []          |
-     idutils            |        []  []                                   |
-     indent             |     [] []  []                    [] [] [] []    |
-     iso_15924          |        []      ()                [] []          |
-     iso_3166           | []  [] []  []  ()                [] [] [] ()    |
-     iso_3166_2         |                ()                               |
-     iso_4217           |     [] []  []  ()                   [] []       |
-     iso_639            | []  [] []  []  ()                [] []          |
-     iso_639_3          | []                                              |
-     jwhois             |                                     []          |
-     kbd                |     [] []  []  []                   []          |
-     keytouch           |        []  []                                   |
-     keytouch-editor    |        []  []                                   |
-     keytouch-keyboa... |        []                                       |
-     klavaro            |     [] []  []                    []             |
-     latrine            |        []  ()                                   |
-     ld                 |        []                           []          |
-     leafpad            |     [] []  []  []                   []    []    |
-     libc               |     [] []  []                       []          |
-     libexif            |        []  []         ()                        |
-     libextractor       |                                                 |
-     libgnutls          |     []                                          |
-     libgpewidget       |        []  []                                   |
-     libgpg-error       |     []     []                                   |
-     libgphoto2         |        []  ()                                   |
-     libgphoto2_port    |        []  ()                             []    |
-     libgsasl           |                                                 |
-     libiconv           |     [] []  []                    []    []       |
-     libidn             |     []     []                    []             |
-     lifelines          |        []  ()                                   |
-     liferea            |     []     []  []                   []    []    |
-     lilypond           |     []     []                       []          |
-     linkdr             |        []  []                       []          |
-     lordsawar          |        []                                       |
-     lprng              |                                                 |
-     lynx               |     [] []  []                          []       |
-     m4                 |     [] []  []  []                               |
-     mailfromd          |                                                 |
-     mailutils          |                                     []          |
-     make               |        []  []                       []          |
-     man-db             |                                                 |
-     man-db-manpages    |                                                 |
-     minicom            |     [] []  []                       []          |
-     mkisofs            |                                                 |
-     myserver           |                                                 |
-     nano               |            []                       []    []    |
-     opcodes            |            []                       []          |
-     parted             |     []     []                                   |
-     pies               |                                                 |
-     popt               |     [] []  []                    [] []          |
-     psmisc             |     []     []                             []    |
-     pspp               |                                     []          |
-     pwdutils           |        []                                       |
-     radius             |                                     []          |
-     recode             |     [] []  []  []                [] []          |
-     rosegarden         |     ()     ()                       ()          |
-     rpm                |        []  []                       []          |
-     rush               |                                                 |
-     sarg               |                                                 |
-     screem             |                                                 |
-     scrollkeeper       |     [] []  []         []            []          |
-     sed                |     []     []  []                [] [] []       |
-     sharutils          |        []  []                       [] []       |
-     shishi             |                                                 |
-     skencil            |        []  ()                       []          |
-     solfege            |            []                    []    []       |
-     solfege-manual     |                                  []    []       |
-     soundtracker       |        []  []                       []          |
-     sp                 |            []                                   |
-     sysstat            |        []  []                             []    |
-     tar                |     []     []                          [] []    |
-     texinfo            |            []                    [] []          |
-     tin                |            []                          []       |
-     unicode-han-tra... |                                                 |
-     unicode-transla... |                                                 |
-     util-linux-ng      |     [] []  []                       []          |
-     vice               |        ()  ()                                   |
-     vmm                |            []                                   |
-     vorbis-tools       |     []                           []             |
-     wastesedge         |        []                                       |
-     wdiff              |            []                       []          |
-     wget               |     []     []                          []       |
-     wyslij-po          |                                                 |
-     xchat              |     []     []  []                   [] []       |
-     xdg-user-dirs      | []  [] []  []  []                [] [] [] []    |
-     xkeyboard-config   | []  [] []  []                    [] []          |
-                        +-------------------------------------------------+
-                          crh cs da  de  el en en_GB en_ZA eo es et eu fa
-                           5  64 105 117 18  1   8     0   28 89 18 19  0
-
-                          fi  fr  ga gl gu he hi hr hu hy id  is it ja ka kn
-                        +----------------------------------------------------+
-     a2ps               | []  []                          []        []       |
-     aegis              |     []                                 []          |
-     ant-phone          |     []                                 []          |
-     anubis             | []  []                          []     []          |
-     aspell             |     []  []                      []     []          |
-     bash               | []  []                          []        []       |
-     bfd                | []  []                          []                 |
-     bibshelf           | []  []  []                      []     []          |
-     binutils           | []  []                          []                 |
-     bison              | []  []  []                      []                 |
-     bison-runtime      | []  []  []                      []     [] []       |
-     bluez-pin          | []  []  []                [] [] []  []    []       |
-     bombono-dvd        | []                                                 |
-     buzztard           |                                 []                 |
-     cflow              | []      []                      []                 |
-     clisp              |     []                                             |
-     coreutils          |     []  []                []    []     []          |
-     cpio               | []  []  []                      []                 |
-     cppi               | []  []                                             |
-     cpplib             | []  []                          []                 |
-     cryptsetup         |     []                          []     []          |
-     dfarc              | []  []                                 []          |
-     dialog             |     []  [] []                   []  [] [] []       |
-     dico               |                                                    |
-     diffutils          | []  []  [] []    []       []    []     [] []       |
-     dink               |     []                                             |
-     doodle             |         []                             []          |
-     e2fsprogs          |     []                          []                 |
-     enscript           |     []  []             []       []                 |
-     exif               | []  []                          []  [] [] []       |
-     fetchmail          |     []                          []     [] []       |
-     findutils          | []  []  []                []    []     []          |
-     flex               | []  []  []                                         |
-     freedink           | []  []                          []                 |
-     gas                |     []                          []                 |
-     gawk               |     []  []       []             []     () []       |
-     gcal               |     []                                             |
-     gcc                |                                 []                 |
-     gettext-examples   | []  []  []                []    []     [] []       |
-     gettext-runtime    | []  []  []                      []     [] []       |
-     gettext-tools      |     []                          []     [] []       |
-     gip                | []  []  [] []                   []        []       |
-     gjay               | []                                                 |
-     gliv               | []  ()                                             |
-     glunarclock        | []      []                []    []                 |
-     gnubiff            |     ()                          []     ()          |
-     gnucash            | ()  ()           ()       ()           () []       |
-     gnuedu             |     []                                 []          |
-     gnulib             | []  []  []                []           [] []       |
-     gnunet             |                                                    |
-     gnunet-gtk         |     []                                             |
-     gnutls             |     []                                 []          |
-     gold               | []                              []                 |
-     gpe-aerial         | []  []                          []                 |
-     gpe-beam           | []  []                          []        []       |
-     gpe-bluetooth      | []                              []     [] []       |
-     gpe-calendar       | []                                        []       |
-     gpe-clock          | []  []                    []    []        []       |
-     gpe-conf           | []  []                          []        []       |
-     gpe-contacts       | []  []                          []        []       |
-     gpe-edit           | []                              []        []       |
-     gpe-filemanager    | []                        []    []        []       |
-     gpe-go             | []  []                    []    []        []       |
-     gpe-login          | []                              []        []       |
-     gpe-ownerinfo      | []  []                    []    []        []       |
-     gpe-package        | []                              []        []       |
-     gpe-sketchbook     | []  []                          []        []       |
-     gpe-su             | []  []     []             []    []        []       |
-     gpe-taskmanager    | []  []                    []    []        []       |
-     gpe-timesheet      | []  []  []                      []        []       |
-     gpe-today          | []  []  [] []             []    []        []       |
-     gpe-todo           | []                              []        []       |
-     gphoto2            | []  []                    []    []     [] []       |
-     gprof              | []  []  []                      []                 |
-     gpsdrive           |            []                   []     []          |
-     gramadoir          |     []  []                      []                 |
-     grep               | []                                     []          |
-     grub               | []                        []    []     []          |
-     gsasl              | []  []  []                      []     []          |
-     gss                | []  []  []                      []     []          |
-     gst-plugins-bad    | []  []                    []    []     [] []       |
-     gst-plugins-base   | []  []                    []    []     [] []       |
-     gst-plugins-good   | []  []                    []    []     [] []       |
-     gst-plugins-ugly   | []  []                    []    []     [] []       |
-     gstreamer          | []  []                    []    []     []          |
-     gtick              | []  []  []                      []     []          |
-     gtkam              |     []                    []    []     [] []       |
-     gtkorphan          |     []                          []     []          |
-     gtkspell           | []  []  [] []             [] [] []     [] []       |
-     gutenprint         | []  []                    []           []          |
-     hello              | []      []                      []                 |
-     help2man           | []  []                                             |
-     hylafax            |                                 []                 |
-     idutils            | []  []  []                []    []     []          |
-     indent             | []  []  [] []             []    []     [] []       |
-     iso_15924          | []  ()                          []     []          |
-     iso_3166           | []  ()  [] [] [] [] [] [] []    []     [] []       |
-     iso_3166_2         |     ()                    []    []     []          |
-     iso_4217           | []  ()                    []    []     [] []       |
-     iso_639            | []  ()  []    []          []    []     [] []    [] |
-     iso_639_3          |     ()                                 []       [] |
-     jwhois             | []  []                    []    []     []          |
-     kbd                |     []                          []                 |
-     keytouch           | []  []  []                []    []     []          |
-     keytouch-editor    | []      []                []    []     []          |
-     keytouch-keyboa... | []      []                []    []     []          |
-     klavaro            |            []             []                       |
-     latrine            | []                              []     []          |
-     ld                 | []  []  []                      []                 |
-     leafpad            | []  []  []       []       []    []     [] ()       |
-     libc               | []  []     []                   []        []       |
-     libexif            |                                        []          |
-     libextractor       |                                                    |
-     libgnutls          |     []                                 []          |
-     libgpewidget       | []      []                      []        []       |
-     libgpg-error       |     []                                 []          |
-     libgphoto2         |     []                                 [] []       |
-     libgphoto2_port    |     []                                 [] []       |
-     libgsasl           | []  []  []                      []     []          |
-     libiconv           | []  []  []                      []     [] []       |
-     libidn             | []  []                          []     []          |
-     lifelines          |     ()                                             |
-     liferea            |     []                    []           [] []       |
-     lilypond           | []  []                                             |
-     linkdr             | []               []    [] []           []          |
-     lordsawar          |                                                    |
-     lprng              |                                 []                 |
-     lynx               |     []                    []    []     [] []       |
-     m4                 | []  []  [] []                   []        []       |
-     mailfromd          |                                                    |
-     mailutils          |     []                          []                 |
-     make               | []  []  [] []    []    []       []     [] []       |
-     man-db             |                                 []     []          |
-     man-db-manpages    |                                 []                 |
-     minicom            | []  []                    []    []        []       |
-     mkisofs            | []  []                          []     []          |
-     myserver           |                                                    |
-     nano               | []  []  [] []             []           []          |
-     opcodes            | []  []  []                      []                 |
-     parted             |     []                          []     [] []       |
-     pies               |                                                    |
-     popt               | []  []  [] []             []    []  [] [] []       |
-     psmisc             | []  []                          []                 |
-     pspp               |                                                    |
-     pwdutils           |     []                          []                 |
-     radius             |     []                          []                 |
-     recode             | []  []  [] []    []       []    []     []          |
-     rosegarden         | ()  ()                          ()     () ()       |
-     rpm                |                                 []        []       |
-     rush               |                                                    |
-     sarg               |     []                                             |
-     screem             |                                        [] []       |
-     scrollkeeper       | []                        []    []     []          |
-     sed                | []  []  [] []             []    []     [] []       |
-     sharutils          | []  []  []                []    []     [] []       |
-     shishi             |     []                                             |
-     skencil            |     []                                             |
-     solfege            | []  []     []                          []          |
-     solfege-manual     |     []     []                                      |
-     soundtracker       |     []                                 []          |
-     sp                 |     []                                    ()       |
-     sysstat            | []  []                          []     [] []       |
-     tar                | []  []  []                []    []     [] []       |
-     texinfo            |     []                          []     [] []       |
-     tin                |     []                                             |
-     unicode-han-tra... |                                                    |
-     unicode-transla... |     []  []                                         |
-     util-linux-ng      | []  []                    []    []     [] []       |
-     vice               |     ()                    ()           ()          |
-     vmm                |     []                                             |
-     vorbis-tools       |                                 []                 |
-     wastesedge         |     ()                                 ()          |
-     wdiff              | []                                                 |
-     wget               | []  []  []             [] []    []     [] []       |
-     wyslij-po          | []  []                          []                 |
-     xchat              | []  []        []    []    []    []     [] []    [] |
-     xdg-user-dirs      | []  []  [] [] [] [] []    []    []  [] [] []    [] |
-     xkeyboard-config   | []  []                    []    []     []          |
-                        +----------------------------------------------------+
-                          fi  fr  ga gl gu he hi hr hu hy id  is it ja ka kn
-                          105 121 53 20  4  8  3  5 53  2 120  5 84 67  0  4
-
-                          ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
-                        +-----------------------------------------------+
-     a2ps               |                               []              |
-     aegis              |                                               |
-     ant-phone          |                                               |
-     anubis             |                               []    []        |
-     aspell             |                         []                    |
-     bash               |                                               |
-     bfd                |                                               |
-     bibshelf           |                []             []              |
-     binutils           |                                               |
-     bison              |                               []              |
-     bison-runtime      |       []    [] []             []    []        |
-     bluez-pin          |    [] []    [] []             []              |
-     bombono-dvd        |                                               |
-     buzztard           |                                               |
-     cflow              |                                               |
-     clisp              |                                               |
-     coreutils          |          []                                   |
-     cpio               |                                               |
-     cppi               |                                               |
-     cpplib             |                                               |
-     cryptsetup         |                                               |
-     dfarc              |                   []                          |
-     dialog             |    []       [] []             []    []        |
-     dico               |                                               |
-     diffutils          |                []             []              |
-     dink               |                                               |
-     doodle             |                                               |
-     e2fsprogs          |                                               |
-     enscript           |                                               |
-     exif               |                []                             |
-     fetchmail          |                                               |
-     findutils          |                                               |
-     flex               |                                               |
-     freedink           |                                     []        |
-     gas                |                                               |
-     gawk               |                                               |
-     gcal               |                                               |
-     gcc                |                                               |
-     gettext-examples   |       []       []             [] []           |
-     gettext-runtime    | []                                            |
-     gettext-tools      | []                                            |
-     gip                |                []             []              |
-     gjay               |                                               |
-     gliv               |                                               |
-     glunarclock        |                []                             |
-     gnubiff            |                                               |
-     gnucash            | ()          ()                      ()     () |
-     gnuedu             |                                               |
-     gnulib             |                                               |
-     gnunet             |                                               |
-     gnunet-gtk         |                                               |
-     gnutls             |                               []              |
-     gold               |                                               |
-     gpe-aerial         |                []                             |
-     gpe-beam           |                []                             |
-     gpe-bluetooth      |                []                []           |
-     gpe-calendar       |                []                             |
-     gpe-clock          | []    []       []             [] []           |
-     gpe-conf           | []             []                             |
-     gpe-contacts       | []             []                             |
-     gpe-edit           |                []                             |
-     gpe-filemanager    | []             []                             |
-     gpe-go             | []             []                []           |
-     gpe-login          |                []                             |
-     gpe-ownerinfo      |                []             []              |
-     gpe-package        | []             []                             |
-     gpe-sketchbook     | []             []                             |
-     gpe-su             | []    []       []             [] [] []        |
-     gpe-taskmanager    | [] [] []       []             [] []           |
-     gpe-timesheet      |                []             []              |
-     gpe-today          |       []       []             [] []           |
-     gpe-todo           |                []                   []        |
-     gphoto2            |                                               |
-     gprof              |                               []              |
-     gpsdrive           |                                               |
-     gramadoir          |                                               |
-     grep               |                                               |
-     grub               |                                               |
-     gsasl              |                                               |
-     gss                |                                               |
-     gst-plugins-bad    |             [] []                [] []        |
-     gst-plugins-base   |             [] []                             |
-     gst-plugins-good   |                []                []           |
-     gst-plugins-ugly   |             [] []             [] [] []        |
-     gstreamer          |                                               |
-     gtick              |                                               |
-     gtkam              |                                     []        |
-     gtkorphan          |                []                      []     |
-     gtkspell           |       []    [] []       []    []    [] []     |
-     gutenprint         |                                               |
-     hello              | []             []             []              |
-     help2man           |                                               |
-     hylafax            |                                               |
-     idutils            |                                               |
-     indent             |                                               |
-     iso_15924          |             [] []                             |
-     iso_3166           | [] []       () [] [] []    []       []        |
-     iso_3166_2         |                                               |
-     iso_4217           |             []                      []        |
-     iso_639            |                      []    []                 |
-     iso_639_3          |                            []                 |
-     jwhois             |                []                             |
-     kbd                |                                               |
-     keytouch           |                []                             |
-     keytouch-editor    |                []                             |
-     keytouch-keyboa... |                []                             |
-     klavaro            |                                     []        |
-     latrine            |                []                             |
-     ld                 |                                               |
-     leafpad            | []          [] []                             |
-     libc               | []                                            |
-     libexif            |                                               |
-     libextractor       |                                               |
-     libgnutls          |                               []              |
-     libgpewidget       |                []             []              |
-     libgpg-error       |                                               |
-     libgphoto2         |                                               |
-     libgphoto2_port    |                                               |
-     libgsasl           |                                               |
-     libiconv           |                                               |
-     libidn             |                                               |
-     lifelines          |                                               |
-     liferea            |                                               |
-     lilypond           |                                               |
-     linkdr             |                                               |
-     lordsawar          |                                               |
-     lprng              |                                               |
-     lynx               |                                               |
-     m4                 |                                               |
-     mailfromd          |                                               |
-     mailutils          |                                               |
-     make               | []                                            |
-     man-db             |                                               |
-     man-db-manpages    |                                               |
-     minicom            |                                     []        |
-     mkisofs            |                                               |
-     myserver           |                                               |
-     nano               |                               []    []        |
-     opcodes            |                                               |
-     parted             |                                               |
-     pies               |                                               |
-     popt               | []             []                   []        |
-     psmisc             |                                               |
-     pspp               |                                               |
-     pwdutils           |                                               |
-     radius             |                                               |
-     recode             |                                               |
-     rosegarden         |                                               |
-     rpm                |                                               |
-     rush               |                                               |
-     sarg               |                                               |
-     screem             |                                               |
-     scrollkeeper       |                                     []     [] |
-     sed                |                                               |
-     sharutils          |                                               |
-     shishi             |                                               |
-     skencil            |                                               |
-     solfege            |                                     []        |
-     solfege-manual     |                                               |
-     soundtracker       |                                               |
-     sp                 |                                               |
-     sysstat            |                []                             |
-     tar                |       []                                      |
-     texinfo            |                                     []        |
-     tin                |                                               |
-     unicode-han-tra... |                                               |
-     unicode-transla... |                                               |
-     util-linux-ng      |                                               |
-     vice               |                                               |
-     vmm                |                                               |
-     vorbis-tools       |                                               |
-     wastesedge         |                                               |
-     wdiff              |                                               |
-     wget               |             []                                |
-     wyslij-po          |                                               |
-     xchat              | []             [] []                          |
-     xdg-user-dirs      | [] []       [] [] []       []       [] []     |
-     xkeyboard-config   | []    []    []                                |
-                        +-----------------------------------------------+
-                          ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
-                          20  5 10  1 13 48  4  2  2  4 24 10 20  3   1
-
-                          nl  nn or pa pl  ps pt pt_BR ro ru rw sk sl sq sr
-                        +---------------------------------------------------+
-     a2ps               | []           []     []  []   [] []       []    [] |
-     aegis              | []                      []      []                |
-     ant-phone          |                         []   []                   |
-     anubis             | []           []                 []                |
-     aspell             | []                           [] []    [] []       |
-     bash               | []                                    []          |
-     bfd                |                                 []                |
-     bibshelf           | []  []                                            |
-     binutils           |                                 []    []          |
-     bison              | []           []                 []                |
-     bison-runtime      | []           []     []  []   [] []       []       |
-     bluez-pin          | []           []         []   [] []    [] []    [] |
-     bombono-dvd        |     []                          ()                |
-     buzztard           | []  []                                            |
-     cflow              |              []                                   |
-     clisp              | []                              []                |
-     coreutils          | []           []     []  []      []       []       |
-     cpio               | []           []                 []                |
-     cppi               |              []                                   |
-     cpplib             | []                                                |
-     cryptsetup         | []                                                |
-     dfarc              |              []                                   |
-     dialog             | []           []         []      []                |
-     dico               |              []                                   |
-     diffutils          | []           []         []   [] []             [] |
-     dink               | ()                                                |
-     doodle             | []                                          []    |
-     e2fsprogs          | []           []                                   |
-     enscript           | []                      []   [] []       []       |
-     exif               | []           []              [] ()    []          |
-     fetchmail          | []           []                 []          []    |
-     findutils          | []           []     []          []       []       |
-     flex               | []           []         []   [] []                |
-     freedink           | []           []                                   |
-     gas                |                                                   |
-     gawk               | []           []         []   []                   |
-     gcal               |                                                   |
-     gcc                |                                                [] |
-     gettext-examples   | []           []     []       [] []    [] []    [] |
-     gettext-runtime    | []  []       []     []       [] []    [] []    [] |
-     gettext-tools      |              []              [] []    [] []    [] |
-     gip                | []           []                 []    []       [] |
-     gjay               |                                                   |
-     gliv               | []           []         []   [] []    []          |
-     glunarclock        | []                      []   []       []       [] |
-     gnubiff            | []                           ()                   |
-     gnucash            | []           ()         ()      ()                |
-     gnuedu             | []                                                |
-     gnulib             | []           []                 []       []       |
-     gnunet             |                                                   |
-     gnunet-gtk         |                                                   |
-     gnutls             | []           []                                   |
-     gold               |                                                   |
-     gpe-aerial         | []                  []  []   [] []       []    [] |
-     gpe-beam           | []                  []  []   [] []       []    [] |
-     gpe-bluetooth      | []                      []                        |
-     gpe-calendar       |                         []      []       []    [] |
-     gpe-clock          | []                  []  []   [] []    [] []    [] |
-     gpe-conf           | []                  []  []   [] []    [] []       |
-     gpe-contacts       |                         []   [] []       []    [] |
-     gpe-edit           | []           []                          []       |
-     gpe-filemanager    | []                              []       []       |
-     gpe-go             | []           []         []   [] []    [] []    [] |
-     gpe-login          | []                      []                        |
-     gpe-ownerinfo      | []                  []  []   [] []    [] []    [] |
-     gpe-package        | []                                       []       |
-     gpe-sketchbook     | []                  []  []   [] []       []    [] |
-     gpe-su             | []                  []  []   [] []    [] []    [] |
-     gpe-taskmanager    | []                  []  []   [] []    [] []    [] |
-     gpe-timesheet      | []                  []  []   [] []    [] []    [] |
-     gpe-today          | []                  []  []   [] []    [] []    [] |
-     gpe-todo           | []                      []      []       []    [] |
-     gphoto2            | []        [] []         []   [] []    []       [] |
-     gprof              | []                      []   []                   |
-     gpsdrive           | []                              []                |
-     gramadoir          | []                                    []          |
-     grep               | []           []                 []    []          |
-     grub               | []           []                 []                |
-     gsasl              | []           []                       []       [] |
-     gss                |              []              []       []          |
-     gst-plugins-bad    | []           []         []      []    []    []    |
-     gst-plugins-base   | []           []         []      []    []          |
-     gst-plugins-good   | []           []         []      []    []          |
-     gst-plugins-ugly   | []           []         []      []    [] []       |
-     gstreamer          | []           []         []      []    []          |
-     gtick              | []                              []    []          |
-     gtkam              | []        [] []         []      []    []          |
-     gtkorphan          | []                                                |
-     gtkspell           | []           []     []  []   [] []    [] [] [] [] |
-     gutenprint         | []                              []                |
-     hello              | []           []                       [] []       |
-     help2man           |              []                 []                |
-     hylafax            | []                                                |
-     idutils            | []           []         []   [] []                |
-     indent             | []           []         []   [] []    []       [] |
-     iso_15924          | []           []                 []       []       |
-     iso_3166           | []  [] [] [] []     ()  []   [] [] [] [] [] [] [] |
-     iso_3166_2         | []           []                          []       |
-     iso_4217           | []  []       []     []          [] []    []    [] |
-     iso_639            | []     [] [] []                 [] [] [] []    [] |
-     iso_639_3          |        [] []                                      |
-     jwhois             | []           []         []   []                   |
-     kbd                | []           []              []                   |
-     keytouch           | []           []                       []          |
-     keytouch-editor    | []           []                       []          |
-     keytouch-keyboa... | []           []                       []          |
-     klavaro            | []                      []                        |
-     latrine            |              []                 []                |
-     ld                 |                                                   |
-     leafpad            | []  []       []     []  []      []    [] []    [] |
-     libc               | []           []                 []    []          |
-     libexif            | []           []         ()            []          |
-     libextractor       |                                                   |
-     libgnutls          | []           []                                   |
-     libgpewidget       | []           []                          []       |
-     libgpg-error       |              []              []                   |
-     libgphoto2         | []           []                                   |
-     libgphoto2_port    | []           []         []      []    []          |
-     libgsasl           | []           []              []       []       [] |
-     libiconv           | []           []                       [] []    [] |
-     libidn             | []           []                                   |
-     lifelines          | []           []                                   |
-     liferea            | []           []     []  []   [] ()    ()    []    |
-     lilypond           | []                                                |
-     linkdr             | []                  []          []                |
-     lordsawar          |                                                   |
-     lprng              |              []                                   |
-     lynx               | []                      []      []                |
-     m4                 | []           []         []   [] []                |
-     mailfromd          |              []                                   |
-     mailutils          |              []                                   |
-     make               | []           []         []      []                |
-     man-db             | []           []                 []                |
-     man-db-manpages    | []           []                 []                |
-     minicom            |              []         []   [] []                |
-     mkisofs            | []           []                 []                |
-     myserver           |                                                   |
-     nano               | []           []         []      []                |
-     opcodes            | []                           []                   |
-     parted             | []           []                 []    []          |
-     pies               |              []                                   |
-     popt               | []           []     []          []                |
-     psmisc             | []           []                 []                |
-     pspp               | []                      []                        |
-     pwdutils           |              []                                   |
-     radius             | []           []                 []                |
-     recode             | []           []     []  []   [] []    [] []       |
-     rosegarden         |              ()                 ()                |
-     rpm                | []           []     []                            |
-     rush               | []           []                                   |
-     sarg               |                                                   |
-     screem             |                                                   |
-     scrollkeeper       | []  []       []              [] []    []    [] [] |
-     sed                | []           []     []  []   [] []    [] []    [] |
-     sharutils          | []           []                 []             [] |
-     shishi             |              []                                   |
-     skencil            |                     []  []                        |
-     solfege            | []           []         []      []                |
-     solfege-manual     | []           []         []                        |
-     soundtracker       |                                       []          |
-     sp                 |                                                   |
-     sysstat            | []           []         []      []                |
-     tar                | []           []                 []       []       |
-     texinfo            | []           []              [] []                |
-     tin                |                                 []                |
-     unicode-han-tra... |                                                   |
-     unicode-transla... |                                                   |
-     util-linux-ng      | []           []         []      []       []       |
-     vice               | []                                                |
-     vmm                | []                                                |
-     vorbis-tools       | []           []                                   |
-     wastesedge         | []                                                |
-     wdiff              | []           []                                   |
-     wget               | []           []     []  []      []    [] []       |
-     wyslij-po          | []  []       []                                   |
-     xchat              | []        [] []     []          []    [] [] [] [] |
-     xdg-user-dirs      | []  [] [] [] []  [] []  []   [] []    [] [] [] [] |
-     xkeyboard-config   | []           []                 []                |
-                        +---------------------------------------------------+
-                          nl  nn or pa pl  ps pt pt_BR ro ru rw sk sl sq sr
-                          135 10  4  7 105  1 29  62   47 91  3 54 46  9 37
-
-                          sv  sw ta te tg th tr uk vi  wa zh_CN zh_HK zh_TW
-                        +---------------------------------------------------+
-     a2ps               | []              [] [] [] []                       | 27
-     aegis              |                          []                       |  9
-     ant-phone          | []                 []    []      []               |  9
-     anubis             | []                 [] [] []                       | 15
-     aspell             |                       [] []  []                   | 20
-     bash               | []                    [] []                       | 12
-     bfd                |                          []                       |  6
-     bibshelf           | []                       []      []               | 16
-     binutils           |                       [] []                       |  8
-     bison              | []                       []                       | 12
-     bison-runtime      | []              []    [] []      []          []   | 29
-     bluez-pin          | []              [] [] [] []  []  []          []   | 37
-     bombono-dvd        |                          []                       |  4
-     buzztard           |                          []                       |  7
-     cflow              |                       [] []      []               |  9
-     clisp              |                                                   | 10
-     coreutils          | []                    [] []      []               | 22
-     cpio               | []                 [] [] []      []          []   | 13
-     cppi               |                       [] []                       |  5
-     cpplib             | []                 [] [] []      []          []   | 14
-     cryptsetup         | []                       []                       |  7
-     dfarc              |                          []                       |  9
-     dialog             | []  []          []       []  []  []          []   | 30
-     dico               |                       []                          |  2
-     diffutils          | []                 [] [] []      []          []   | 30
-     dink               |                                                   |  4
-     doodle             | []                       []                       |  7
-     e2fsprogs          | []                 []    []                       | 11
-     enscript           | []                 [] [] []                       | 17
-     exif               | []                       []      []               | 16
-     fetchmail          |                    []    []      []               | 17
-     findutils          | []                 [] [] []      []               | 20
-     flex               | []                 []    []                  []   | 15
-     freedink           |                          []                       | 10
-     gas                |                    []                             |  4
-     gawk               | []                 []    []      []               | 18
-     gcal               | []                 []                             |  5
-     gcc                | []                 []            []               |  7
-     gettext-examples   | []                 [] [] []      []    []    []   | 34
-     gettext-runtime    | []                 [] [] []      []    []    []   | 29
-     gettext-tools      | []                 [] [] []      []          []   | 22
-     gip                | []                       []      []          []   | 22
-     gjay               |                          []                       |  3
-     gliv               | []                 []    []                       | 14
-     glunarclock        | []                       []  []  []          []   | 19
-     gnubiff            | []                       []                       |  4
-     gnucash            |                    () [] ()      []          ()   | 10
-     gnuedu             |                          []                  []   |  7
-     gnulib             | []                    [] []      []               | 16
-     gnunet             |                          []                       |  1
-     gnunet-gtk         | []                 []    []                       |  5
-     gnutls             | []                       []      []               | 10
-     gold               |                          []                       |  4
-     gpe-aerial         | []                       []      []               | 18
-     gpe-beam           | []                       []      []               | 19
-     gpe-bluetooth      | []                       []      []               | 13
-     gpe-calendar       | []                       []  []  []               | 12
-     gpe-clock          | []                 []    []  []  []               | 28
-     gpe-conf           | []                       []  []  []               | 20
-     gpe-contacts       | []                       []      []               | 17
-     gpe-edit           | []                       []      []               | 12
-     gpe-filemanager    | []                       []  []  []               | 16
-     gpe-go             | []                 []    []  []  []               | 25
-     gpe-login          | []                       []      []               | 11
-     gpe-ownerinfo      | []                 []    []      []          []   | 25
-     gpe-package        | []                       []      []               | 13
-     gpe-sketchbook     | []                       []      []               | 20
-     gpe-su             | []                 []    []  []  []               | 30
-     gpe-taskmanager    | []                 []    []  []  []               | 29
-     gpe-timesheet      | []                 []    []      []          []   | 25
-     gpe-today          | []                 []    []  []  []          []   | 30
-     gpe-todo           | []                       []  []  []               | 17
-     gphoto2            | []                    [] []      []          []   | 24
-     gprof              | []                 []    []                       | 15
-     gpsdrive           | []                       []      []               | 11
-     gramadoir          | []                       []      []               | 11
-     grep               |                 []       []      []               | 10
-     grub               | []                       []      []               | 14
-     gsasl              | []                       []      []          []   | 14
-     gss                | []                       []      []               | 11
-     gst-plugins-bad    | []                 []    []      []               | 26
-     gst-plugins-base   | []                 [] [] []      []               | 24
-     gst-plugins-good   | []                 []    []      []               | 24
-     gst-plugins-ugly   | []                 [] [] []      []               | 29
-     gstreamer          | []                    [] []      []               | 22
-     gtick              |                       [] []      []               | 13
-     gtkam              | []                       []      []               | 20
-     gtkorphan          | []                       []      []               | 14
-     gtkspell           | []              [] [] [] []  []  []    []    []   | 45
-     gutenprint         | []                                                | 10
-     hello              | []              [] []    []      []          []   | 21
-     help2man           | []                       []                       |  7
-     hylafax            |                          []                       |  5
-     idutils            | []                 []    []      []               | 17
-     indent             | []                 [] [] []      []          []   | 30
-     iso_15924          |                 ()    [] ()      []          []   | 16
-     iso_3166           | []        []    () [] [] ()  []  []    []    ()   | 53
-     iso_3166_2         |                 ()    [] ()      []               |  9
-     iso_4217           | []              () [] [] ()      []    []         | 26
-     iso_639            | []     [] []    ()    [] ()  []  []    []    []   | 38
-     iso_639_3          |        []                ()                       |  8
-     jwhois             | []                 []    []      []          []   | 16
-     kbd                | []                 [] [] []      []               | 15
-     keytouch           | []                       []      []               | 16
-     keytouch-editor    | []                       []      []               | 14
-     keytouch-keyboa... | []                       []      []               | 14
-     klavaro            |                          []                       | 11
-     latrine            |                    []    []      []               | 10
-     ld                 | []                 []    []                  []   | 11
-     leafpad            | []                 [] [] []      []          []   | 33
-     libc               | []                 []    []      []          []   | 21
-     libexif            |                          []      ()               |  7
-     libextractor       |                          []                       |  1
-     libgnutls          | []                       []      []               |  9
-     libgpewidget       | []                       []      []               | 14
-     libgpg-error       | []                       []      []               |  9
-     libgphoto2         |                       [] []                       |  8
-     libgphoto2_port    | []                    [] []                  []   | 14
-     libgsasl           | []                       []      []               | 13
-     libiconv           | []                       []  []  []               | 21
-     libidn             | ()                       []      []               | 11
-     lifelines          | []                                                |  4
-     liferea            | []                 []            []               | 21
-     lilypond           |                          []                       |  7
-     linkdr             | []                 []    []      []          []   | 17
-     lordsawar          |                                                   |  1
-     lprng              |                          []                       |  3
-     lynx               | []                 [] [] []                       | 17
-     m4                 | []                       []      []          []   | 19
-     mailfromd          |                       [] []                       |  3
-     mailutils          |                          []                       |  5
-     make               | []                 []    []      []               | 21
-     man-db             | []                       []      []               |  8
-     man-db-manpages    |                                                   |  4
-     minicom            | []                       []                       | 16
-     mkisofs            |                          []      []               |  9
-     myserver           |                                                   |  0
-     nano               | []                       []      []          []   | 21
-     opcodes            | []                 []    []                       | 11
-     parted             | []                 [] [] []                  []   | 15
-     pies               |                       [] []                       |  3
-     popt               | []              [] []    []      []          []   | 27
-     psmisc             | []                       []                       | 11
-     pspp               |                                                   |  4
-     pwdutils           | []                       []                       |  6
-     radius             |                       [] []                       |  9
-     recode             | []                 []    []      []               | 28
-     rosegarden         | ()                                                |  0
-     rpm                | []                       []                  []   | 11
-     rush               |                       [] []                       |  4
-     sarg               |                                                   |  1
-     screem             |                          []                       |  3
-     scrollkeeper       | []                 [] [] []                  []   | 27
-     sed                | []                 []    []      []          []   | 30
-     sharutils          | []                 []    []      []          []   | 22
-     shishi             |                          []                       |  3
-     skencil            | []                       []                       |  7
-     solfege            | []                 []    []      []               | 16
-     solfege-manual     |                    []                             |  8
-     soundtracker       | []                 []    []                       |  9
-     sp                 |                    []                             |  3
-     sysstat            |                          []      []               | 15
-     tar                | []                 [] [] []      []          []   | 23
-     texinfo            | []                 [] [] []      []               | 17
-     tin                |                                                   |  4
-     unicode-han-tra... |                                                   |  0
-     unicode-transla... |                                                   |  2
-     util-linux-ng      | []                 [] [] []                       | 20
-     vice               | ()                 ()                             |  1
-     vmm                |                          []                       |  4
-     vorbis-tools       |                          []                       |  6
-     wastesedge         |                                                   |  2
-     wdiff              | []                       []                       |  7
-     wget               | []                 []    []      []          []   | 26
-     wyslij-po          |                       [] []                       |  8
-     xchat              | []              []    [] []      []          []   | 36
-     xdg-user-dirs      | []     [] []    [] [] [] []      []    []    []   | 63
-     xkeyboard-config   | []                    [] []                       | 22
-                        +---------------------------------------------------+
-       85 teams           sv  sw ta te tg th tr uk vi  wa zh_CN zh_HK zh_TW
-      178 domains         119  1  3  3  0 10 65 51 155 17  98     7    41    2618
-
-   Some counters in the preceding matrix are higher than the number of
-visible blocks let us expect.  This is because a few extra PO files are
-used for implementing regional variants of languages, or language
-dialects.
-
-   For a PO file in the matrix above to be effective, the package to
-which it applies should also have been internationalized and
-distributed as such by its maintainer.  There might be an observable
-lag between the mere existence a PO file and its wide availability in a
-distribution.
-
-   If June 2010 seems to be old, you may fetch a more recent copy of
-this `ABOUT-NLS' file on most GNU archive sites.  The most up-to-date
-matrix with full percentage details can be found at
-`http://translationproject.org/extra/matrix.html'.
-
-1.5 Using `gettext' in new packages
-===================================
-
-If you are writing a freely available program and want to
-internationalize it you are welcome to use GNU `gettext' in your
-package.  Of course you have to respect the GNU Library General Public
-License which covers the use of the GNU `gettext' library.  This means
-in particular that even non-free programs can use `libintl' as a shared
-library, whereas only free software can use `libintl' as a static
-library or use modified versions of `libintl'.
-
-   Once the sources are changed appropriately and the setup can handle
-the use of `gettext' the only thing missing are the translations.  The
-Free Translation Project is also available for packages which are not
-developed inside the GNU project.  Therefore the information given above
-applies also for every other Free Software Project.  Contact
-`coordinator@translationproject.org' to make the `.pot' files available
-to the translation teams.
-
+<https://www.gnu.org/software/gettext/manual/html_node/Users.html>
diff --git a/INSTALL b/INSTALL
index 544d5d2..5f20814 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -10,6 +10,9 @@ the develop package additionally to link with this library.
 
 alsaconf requires dialog or whiptail program to run properly.
 
+If systemd (minimum version 18) is installed it will be used to run
+alsactl to store and restore settings.
+
 Installation
 ------------
 
@@ -42,5 +45,12 @@ For compilation you can use these commands:
 
 The included gitcompile script does this job for you.
 
+To configure the build to install in a local directory, a command like the
+following can be used:
+
+       ./gitcompile --prefix="$PWD/build" \
+         --with-systemdsystemunitdir="$PWD/build/$(pkg-config systemd --variable=systemdsystemunitdir)" \
+         --with-udev-rules-dir="$PWD/build/$(pkg-config udev --variable=udevdir)"
+
 Note: Some automake packages have missing aclocal program. Use newer version
       in the case.
index b9f0004..b961506 100644 (file)
@@ -14,10 +14,13 @@ if ALSACONF
 SUBDIRS += alsaconf
 endif
 if HAVE_PCM
-SUBDIRS += aplay iecset speaker-test
+SUBDIRS += aplay iecset speaker-test axfer
 if ALSALOOP
 SUBDIRS += alsaloop
 endif
+if BAT
+SUBDIRS += bat
+endif
 endif
 if HAVE_SEQ
 SUBDIRS += seq
@@ -25,8 +28,14 @@ endif
 if HAVE_UCM
 SUBDIRS += alsaucm
 endif
+if HAVE_TOPOLOGY
+SUBDIRS += topology
+endif
+if NHLT
+SUBDIRS += nhlt
+endif
 
-EXTRA_DIST= config.rpath  TODO gitcompile
+EXTRA_DIST= README.md TODO gitcompile
 AUTOMAKE_OPTIONS=foreign
 ACLOCAL_AMFLAGS = -I m4
 
index a3d303b..9d33fb7 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -53,39 +91,56 @@ host_triplet = @host@
 @HAVE_MIXER_TRUE@am__append_2 = amixer
 @HAVE_RAWMIDI_TRUE@am__append_3 = amidi
 @ALSACONF_TRUE@am__append_4 = alsaconf
-@HAVE_PCM_TRUE@am__append_5 = aplay iecset speaker-test
+@HAVE_PCM_TRUE@am__append_5 = aplay iecset speaker-test axfer
 @ALSALOOP_TRUE@@HAVE_PCM_TRUE@am__append_6 = alsaloop
-@HAVE_SEQ_TRUE@am__append_7 = seq
-@HAVE_UCM_TRUE@am__append_8 = alsaucm
+@BAT_TRUE@@HAVE_PCM_TRUE@am__append_7 = bat
+@HAVE_SEQ_TRUE@am__append_8 = seq
+@HAVE_UCM_TRUE@am__append_9 = alsaucm
+@HAVE_TOPOLOGY_TRUE@am__append_10 = topology
+@NHLT_TRUE@am__append_11 = nhlt
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(top_srcdir)/alsaconf/po/Makefile.in \
-       $(top_srcdir)/configure ABOUT-NLS COPYING ChangeLog INSTALL \
-       TODO config.guess config.rpath config.sub install-sh missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+       $(am__configure_deps) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES = alsaconf/po/Makefile
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -93,14 +148,39 @@ am__can_run_installinfo = \
   esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       cscope distdir dist dist-all distcheck
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       cscope distdir distdir-am dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 DIST_SUBDIRS = include alsactl utils m4 po alsa-info alsamixer amixer \
-       amidi alsaconf aplay iecset speaker-test alsaloop seq alsaucm
+       amidi alsaconf aplay iecset speaker-test axfer alsaloop bat \
+       seq alsaucm topology nhlt
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+       $(top_srcdir)/alsaconf/po/Makefile.in ABOUT-NLS COPYING \
+       ChangeLog INSTALL TODO compile config.guess config.rpath \
+       config.sub install-sh ltconfig ltmain.sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -148,7 +228,11 @@ ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -166,11 +250,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -182,27 +273,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -215,6 +316,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -223,6 +325,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -233,7 +337,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -274,6 +380,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -284,13 +392,14 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 SUBDIRS = include alsactl utils m4 po alsa-info $(am__append_1) \
        $(am__append_2) $(am__append_3) $(am__append_4) \
        $(am__append_5) $(am__append_6) $(am__append_7) \
-       $(am__append_8)
-EXTRA_DIST = config.rpath  TODO gitcompile
+       $(am__append_8) $(am__append_9) $(am__append_10) \
+       $(am__append_11)
+EXTRA_DIST = README.md TODO gitcompile
 AUTOMAKE_OPTIONS = foreign
 ACLOCAL_AMFLAGS = -I m4
 DISTCHECK_CONFIGURE_FLAGS = \
@@ -314,15 +423,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            echo ' $(SHELL) ./config.status'; \
            $(SHELL) ./config.status;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -336,20 +444,28 @@ $(am__aclocal_m4_deps):
 alsaconf/po/Makefile: $(top_builddir)/config.status $(top_srcdir)/alsaconf/po/Makefile.in
        cd $(top_builddir) && $(SHELL) ./config.status $@
 
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool config.lt
+
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run 'make' without going through this Makefile.
 # To change the values of 'make' variables: instead of editing Makefiles,
 # (1) if the variable is set in 'config.status', edit 'config.status'
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        case "$@" in \
@@ -370,31 +486,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
-cscopelist-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-       done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -410,12 +508,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -427,15 +520,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -444,18 +533,16 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
-
 cscope: cscope.files
        test ! -s cscope.files \
          || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-
 clean-cscope:
        -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
 
-cscope.files: clean-cscope cscopelist-recursive cscopelist
-
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -472,7 +559,10 @@ distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
        -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        $(am__remove_distdir)
        test -d "$(distdir)" || mkdir "$(distdir)"
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -540,7 +630,7 @@ distdir: $(DISTFILES)
          ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
        || chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
        $(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -555,12 +645,22 @@ dist-xz: distdir
        tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
        $(am__post_remove_distdir)
 
+dist-zstd: distdir
+       tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+       $(am__post_remove_distdir)
+
 dist-tarZ: distdir
+       @echo WARNING: "Support for distribution archives compressed with" \
+                      "legacy program 'compress' is deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
        tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
        $(am__post_remove_distdir)
 
 dist-shar: distdir
-       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       @echo WARNING: "Support for shar distribution archives is" \
+                      "deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
        $(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -578,7 +678,7 @@ dist dist-all:
 distcheck: dist
        case '$(DIST_ARCHIVES)' in \
        *.tar.gz*) \
-         GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lz*) \
@@ -588,22 +688,25 @@ distcheck: dist
        *.tar.Z*) \
          uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
-         GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
        *.zip*) \
          unzip $(distdir).zip ;;\
+       *.tar.zst*) \
+         zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
        esac
-       chmod -R a-w $(distdir); chmod u+w $(distdir)
-       mkdir $(distdir)/_build
-       mkdir $(distdir)/_inst
+       chmod -R a-w $(distdir)
+       chmod u+w $(distdir)
+       mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
        chmod a-w $(distdir)
        test -d $(distdir)/_build || exit 0; \
        dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
          && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
          && am__cwd=`pwd` \
-         && $(am__cd) $(distdir)/_build \
-         && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+         && $(am__cd) $(distdir)/_build/sub \
+         && ../../configure \
            $(AM_DISTCHECK_CONFIGURE_FLAGS) \
            $(DISTCHECK_CONFIGURE_FLAGS) \
+           --srcdir=../.. --prefix="$$dc_install_base" \
          && $(MAKE) $(AM_MAKEFLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) dvi \
          && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -693,12 +796,13 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-recursive
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
        -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
+distclean-am: clean-am distclean-generic distclean-libtool \
+       distclean-tags
 
 dvi: dvi-recursive
 
@@ -749,7 +853,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-recursive
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-recursive
 
@@ -761,25 +865,27 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
-       cscopelist-recursive ctags-recursive install-am \
-       install-data-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am am--refresh check check-am clean clean-cscope \
-       clean-generic cscope cscopelist cscopelist-recursive ctags \
-       ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
-       dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \
-       distclean distclean-generic distclean-tags distcleancheck \
-       distdir distuninstallcheck dvi dvi-am html html-am info \
-       info-am install install-am install-data install-data-am \
-       install-data-hook install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-pdf install-pdf-am \
-       install-ps install-ps-am install-strip installcheck \
-       installcheck-am installdirs installdirs-am maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-       pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
+.MAKE: $(am__recursive_targets) install-am install-data-am \
+       install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--refresh check check-am clean clean-cscope clean-generic \
+       clean-libtool cscope cscopelist-am ctags ctags-am dist \
+       dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
+       dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \
+       distclean-generic distclean-libtool distclean-tags \
+       distcleancheck distdir distuninstallcheck dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-data-hook install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs installdirs-am \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
 
 
 rpm: dist
diff --git a/README b/README
deleted file mode 100644 (file)
index c7e0681..0000000
--- a/README
+++ /dev/null
@@ -1,20 +0,0 @@
-
-               Advanced Linux Sound Architecture - Utilities
-               =============================================
-
-This package contains the command line utilities for the ALSA project.
-The package can be compiled only with the installed ALSA driver and
-the ALSA C library.
-
-alsaconf       - the ALSA driver configurator script
-alsactl                - an utility for soundcard settings management
-aplay/arecord  - an utility for the playback / capture of .wav,.voc,.au files
-amixer         - a command line mixer
-alsamixer      - a ncurses mixer
-amidi          - a utility to send/receive sysex dumps or other MIDI data
-iecset         - a utility to show/set the IEC958 status bits
-
-You may give a look for more information about the ALSA project to URL
-http://www.alsa-project.org.
-
-                                       Jaroslav Kysela <perex@perex.cz>
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..50db0a7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+# alsa-utils
+## Advanced Linux Sound Architecture - Utilities
+
+[![Build alsa-utils](https://github.com/alsa-project/alsa-utils/workflows/Build%20alsa-utils/badge.svg?branch=master)](https://github.com/alsa-project/alsa-utils/actions/workflows/build.yml?query=branch%3Amaster++)
+
+This package contains the command line utilities for the ALSA project.
+The package can be compiled only with the installed ALSA driver and
+the ALSA C library (alsa-lib).
+
+Utility         | Description
+----------------|----------------------------------------------------
+alsaconf       | the ALSA driver configurator script
+alsa-info       | a script to gather information about ALSA subsystem
+alsactl                | an utility for soundcard settings management
+aplay/arecord  | an utility for the playback / capture of .wav,.voc,.au files
+axfer          | an utility to transfer audio data frame (enhancement of aplay)
+amixer         | a command line mixer
+alsamixer      | a ncurses mixer
+amidi          | a utility to send/receive sysex dumps or other MIDI data
+iecset         | a utility to show/set the IEC958 status bits
+speaker-test    | a speaker test utility
+alsaloop        | a software loopback for PCM devices
+alsaucm         | Use Case Manager utility
+alsabat         | a sound tester for ALSA sound card driver
+alsatplg        | ALSA topology compiler
+
+You may give a look for more information about the ALSA project to URL
+http://www.alsa-project.org.
index 2d6f36a..fda2299 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,7 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
@@ -24,38 +25,47 @@ dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
 dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
 dnl Jaroslav Kysela <perex@perex.cz>
 dnl Last modification: $Id: alsa.m4,v 1.24 2004/09/15 18:48:07 tiwai Exp $
+dnl
 dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
+dnl Test for libasound, and define ALSA_CFLAGS, ALSA_LIBS and
+dnl ALSA_TOPOLOGY_LIBS as appropriate.
+dnl
 dnl enables arguments --with-alsa-prefix=
-dnl                   --with-alsa-enc-prefix=
+dnl                   --with-alsa-inc-prefix=
 dnl                   --disable-alsatest
 dnl
 dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
 dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
 dnl
+
 AC_DEFUN([AM_PATH_ALSA],
 [dnl Save the original CFLAGS, LDFLAGS, and LIBS
 alsa_save_CFLAGS="$CFLAGS"
 alsa_save_LDFLAGS="$LDFLAGS"
 alsa_save_LIBS="$LIBS"
 alsa_found=yes
+alsa_topology_found=no
 
 dnl
 dnl Get the cflags and libraries for alsa
 dnl
 AC_ARG_WITH(alsa-prefix,
-[  --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)],
-[alsa_prefix="$withval"], [alsa_prefix=""])
+  AS_HELP_STRING([--with-alsa-prefix=PFX], [Prefix where Alsa library is installed(optional)]),
+  [alsa_prefix="$withval"], [alsa_prefix=""])
 
 AC_ARG_WITH(alsa-inc-prefix,
-[  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)],
-[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
+  AS_HELP_STRING([--with-alsa-inc-prefix=PFX], [Prefix where include libraries are (optional)]),
+  [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
+
+AC_ARG_ENABLE(alsa-topology,
+  AS_HELP_STRING([--enable-alsatopology], [Force to use the Alsa topology library]),
+  [enable_atopology="$enableval"],
+  [enable_atopology=no])
 
-dnl FIXME: this is not yet implemented
 AC_ARG_ENABLE(alsatest,
-[  --disable-alsatest      Do not try to compile and run a test Alsa program],
-[enable_alsatest="$enableval"],
-[enable_alsatest=yes])
+  AS_HELP_STRING([--disable-alsatest], [Do not try to compile and run a test Alsa program]),
+  [enable_alsatest="$enableval"],
+  [enable_alsatest=yes])
 
 dnl Add any special include directories
 AC_MSG_CHECKING(for ALSA CFLAGS)
@@ -65,6 +75,8 @@ if test "$alsa_inc_prefix" != "" ; then
 fi
 AC_MSG_RESULT($ALSA_CFLAGS)
 
+AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
+
 dnl add any special lib dirs
 AC_MSG_CHECKING(for ALSA LDFLAGS)
 if test "$alsa_prefix" != "" ; then
@@ -73,14 +85,15 @@ if test "$alsa_prefix" != "" ; then
 fi
 
 dnl add the alsa library
-ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
+ALSA_LIBS="$ALSA_LIBS -lasound -lm $LIBDL -lpthread"
 LIBS="$ALSA_LIBS $LIBS"
 AC_MSG_RESULT($ALSA_LIBS)
 
 dnl Check for a working version of libasound that is of the right version.
 if test "x$enable_alsatest" = "xyes"; then
-min_alsa_version=ifelse([$1], ,0.1.1,$1)
-AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
+
+AC_MSG_CHECKING([required libasound headers version])
+min_alsa_version=ifelse([$1], , 0.1.1, $1)
 no_alsa=""
     alsa_min_major_version=`echo $min_alsa_version | \
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
@@ -88,12 +101,14 @@ no_alsa=""
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
     alsa_min_micro_version=`echo $min_alsa_version | \
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+AC_MSG_RESULT($alsa_min_major_version.$alsa_min_minor_version.$alsa_min_micro_version)
 
-AC_LANG_SAVE
-AC_LANG_C
-AC_TRY_COMPILE([
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([for libasound headers version >= $alsa_min_major_version.$alsa_min_minor_version.$alsa_min_micro_version ($min_alsa_version)])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <alsa/asoundlib.h>
-], [
+#include <stdlib.h>
+]], [[
 /* ensure backward compatibility */
 #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
 #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
@@ -125,13 +140,37 @@ AC_TRY_COMPILE([
 #    endif
 #  endif
 exit(0);
-],
+]])],
   [AC_MSG_RESULT(found.)],
   [AC_MSG_RESULT(not present.)
    ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
    alsa_found=no]
 )
-AC_LANG_RESTORE
+AC_LANG_POP([C])
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([for libatopology (sound headers version > 1.1.9)])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <alsa/asoundlib.h>
+#include <alsa/topology.h>
+#include <stdlib.h>
+]], [[
+/* ensure backward compatibility */
+#if !defined(SND_LIB_VERSION)
+#define SND_LIB_VERSION 0
+#endif
+#if SND_LIB_VERSION > 0x00010109
+  exit(0);
+#else
+# error not present
+#endif
+exit(0);
+]])],
+  [AC_MSG_RESULT(yes)
+   enable_atopology="yes"],
+  [AC_MSG_RESULT(no)]
+)
+AC_LANG_POP([C])
 fi
 
 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
@@ -140,6 +179,20 @@ AC_CHECK_LIB([asound], [snd_ctl_open],,
        [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
         alsa_found=no]
 )
+if test "x$enable_atopology" = "xyes"; then
+alsa_topology_found=yes
+alsa_save_LIBS2="$LIBS"
+AC_CHECK_LIB([atopology], [snd_tplg_new],,
+       [ifelse([$3], , [AC_MSG_ERROR(No linkable libatopology was found.)])
+        alsa_topology_found=no,
+]
+)
+LIBS="$alsa_save_LIBS2"
+fi
+else
+if test "x$enable_atopology" = "xyes"; then
+  alsa_topology_found=yes
+fi
 fi
 
 if test "x$alsa_found" = "xyes" ; then
@@ -155,95 +208,83 @@ if test "x$alsa_found" = "xno" ; then
    LIBS="$alsa_save_LIBS"
    ALSA_CFLAGS=""
    ALSA_LIBS=""
+   ALSA_TOPOLOGY_LIBS=""
+fi
+
+dnl add the alsa topology library; must be at the end
+AC_MSG_CHECKING(for ALSA topology LDFLAGS)
+if test "x$alsa_topology_found" = "xyes"; then
+  ALSA_TOPOLOGY_LIBS="$ALSA_TOPOLOGY_LIBS -latopology"
 fi
+AC_MSG_RESULT($ALSA_TOPOLOGY_LIBS)
 
 dnl That should be it.  Now just export out symbols:
 AC_SUBST(ALSA_CFLAGS)
 AC_SUBST(ALSA_LIBS)
+AC_SUBST(ALSA_TOPOLOGY_LIBS)
 ])
 
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+# serial 11 (pkg-config-0.29.1)
 
-# intlmacosx.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Checks for special options needed on MacOS X.
-dnl Defines INTL_MACOSX_LIBS.
-AC_DEFUN([gt_INTL_MACOSX],
-[
-  dnl Check for API introduced in MacOS X 10.2.
-  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
-    [gt_cv_func_CFPreferencesCopyAppValue],
-    [gt_save_LIBS="$LIBS"
-     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
-     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
-       [CFPreferencesCopyAppValue(NULL, NULL)],
-       [gt_cv_func_CFPreferencesCopyAppValue=yes],
-       [gt_cv_func_CFPreferencesCopyAppValue=no])
-     LIBS="$gt_save_LIBS"])
-  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
-    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
-      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
-  fi
-  dnl Check for API introduced in MacOS X 10.3.
-  AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
-    [gt_save_LIBS="$LIBS"
-     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
-     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
-       [gt_cv_func_CFLocaleCopyCurrent=yes],
-       [gt_cv_func_CFLocaleCopyCurrent=no])
-     LIBS="$gt_save_LIBS"])
-  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
-    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
-      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
-  fi
-  INTL_MACOSX_LIBS=
-  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
-    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
-  fi
-  AC_SUBST([INTL_MACOSX_LIBS])
-])
-
-# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-# 
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -261,18 +302,19 @@ if test -n "$PKG_CONFIG"; then
                PKG_CONFIG=""
        fi
 fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+])dnl PKG_PROG_PKG_CONFIG
 
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists.  Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
 AC_DEFUN([PKG_CHECK_EXISTS],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 if test -n "$PKG_CONFIG" && \
@@ -282,22 +324,26 @@ m4_ifvaln([$3], [else
   $3])dnl
 fi])
 
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
 m4_define([_PKG_CONFIG],
 [if test -n "$$1"; then
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
                     [pkg_failed=yes])
  else
     pkg_failed=untried
 fi[]dnl
-])# _PKG_CONFIG
+])dnl _PKG_CONFIG
 
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -305,19 +351,17 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 else
         _pkg_short_errors_supported=no
 fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
 
 
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 AC_DEFUN([PKG_CHECK_MODULES],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
@@ -337,9 +381,9 @@ if test $pkg_failed = yes; then
        AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
@@ -352,7 +396,7 @@ $$1_PKG_ERRORS
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-_PKG_TEXT])
+_PKG_TEXT])[]dnl
         ])
 elif test $pkg_failed = untried; then
        AC_MSG_RESULT([no])
@@ -363,7 +407,7 @@ path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
         ])
 else
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
@@ -371,26 +415,175 @@ else
         AC_MSG_RESULT([yes])
        $3
 fi[]dnl
-])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+
+dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl   [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
+dnl   [DESCRIPTION], [DEFAULT])
+dnl ------------------------------------------
+dnl
+dnl Prepare a "--with-" configure option using the lowercase
+dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
+dnl PKG_CHECK_MODULES in a single macro.
+AC_DEFUN([PKG_WITH_MODULES],
+[
+m4_pushdef([with_arg], m4_tolower([$1]))
+
+m4_pushdef([description],
+           [m4_default([$5], [build with ]with_arg[ support])])
+
+m4_pushdef([def_arg], [m4_default([$6], [auto])])
+m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
+m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
+
+m4_case(def_arg,
+            [yes],[m4_pushdef([with_without], [--without-]with_arg)],
+            [m4_pushdef([with_without],[--with-]with_arg)])
+
+AC_ARG_WITH(with_arg,
+     AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
+    [AS_TR_SH([with_]with_arg)=def_arg])
+
+AS_CASE([$AS_TR_SH([with_]with_arg)],
+            [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
+            [auto],[PKG_CHECK_MODULES([$1],[$2],
+                                        [m4_n([def_action_if_found]) $3],
+                                        [m4_n([def_action_if_not_found]) $4])])
+
+m4_popdef([with_arg])
+m4_popdef([description])
+m4_popdef([def_arg])
 
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+])dnl PKG_WITH_MODULES
+
+dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl   [DESCRIPTION], [DEFAULT])
+dnl -----------------------------------------------
+dnl
+dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
+dnl check._[VARIABLE-PREFIX] is exported as make variable.
+AC_DEFUN([PKG_HAVE_WITH_MODULES],
+[
+PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
+
+AM_CONDITIONAL([HAVE_][$1],
+               [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
+])dnl PKG_HAVE_WITH_MODULES
+
+dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl   [DESCRIPTION], [DEFAULT])
+dnl ------------------------------------------------------
+dnl
+dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
+dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
+dnl and preprocessor variable.
+AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
+[
+PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
+
+AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
+        [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
+])dnl PKG_HAVE_DEFINE_WITH_MODULES
+
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.12'
+[am__api_version='1.16'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.12.2], [],
+m4_if([$1], [1.16.2], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -406,21 +599,19 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.12.2])dnl
+[AM_AUTOMAKE_VERSION([1.16.2])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
@@ -460,22 +651,19 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 ])
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2012 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
-
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
@@ -501,13 +689,12 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 17
 
 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -693,64 +880,56 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  AS_CASE([$CONFIG_FILES],
+          [*\'*], [eval set x "$CONFIG_FILES"],
+          [*], [set x $CONFIG_FILES])
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`AS_DIRNAME(["$am_mf"])`
+    am_filepart=`AS_BASENAME(["$am_mf"])`
+    AM_RUN_LOG([cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles]) || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  If GNU make was not used, consider
+    re-running the configure script with MAKE="gmake" (or whatever is
+    necessary).  You can also try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).])
+  fi
+  AS_UNSET([am_dirpart])
+  AS_UNSET([am_filepart])
+  AS_UNSET([am_mf])
+  AS_UNSET([am_rc])
+  rm -f conftest-deps.mk
 }
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
@@ -759,28 +938,31 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # -----------------------------
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 19
-
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
 # -----------------------------------------------
@@ -793,7 +975,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -823,8 +1005,7 @@ AC_SUBST([CYGPATH_W])
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
 [AC_DIAGNOSE([obsolete],
-[$0: two- and three-arguments forms are deprecated.  For more info, see:
-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+             [$0: two- and three-arguments forms are deprecated.])
 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
@@ -854,11 +1035,11 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -878,21 +1059,63 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
                  [_AM_DEPENDENCIES([OBJC])],
                  [m4_define([AC_PROG_OBJC],
                             m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-dnl Support for Objective C++ was only introduced in Autoconf 2.65,
-dnl but we still cater to Autoconf 2.62.
-m4_ifdef([AC_PROG_OBJCXX],
-[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
                  [_AM_DEPENDENCIES([OBJCXX])],
                  [m4_define([AC_PROG_OBJCXX],
-                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
+                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
 ])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
@@ -901,7 +1124,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
 
-
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
 # that is generated.  The stamp files are numbered to have different names.
@@ -923,20 +1145,18 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
-
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\    *)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -946,14 +1166,12 @@ if test x"${install_sh}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # Check whether the underlying file-system supports filenames
 # with a leading dot.  For instance MS-DOS doesn't.
 AC_DEFUN([AM_SET_LEADING_DOT],
@@ -970,14 +1188,12 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
-
 # AM_MAINTAINER_MODE([DEFAULT-MODE])
 # ----------------------------------
 # Control maintainer-specific portions of Makefiles.
@@ -1005,70 +1221,57 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 ]
 )
 
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
-
 # AM_MAKE_INCLUDE()
 # -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
 AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+      ['0:this is the am__doit target'],
+      [AS_CASE([$s],
+          [BSD], [am__include='.include' am__quote='"'],
+          [am__include='include' am__quote=''])])
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2012 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
-
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
 AC_DEFUN([AM_MISSING_PROG],
@@ -1076,11 +1279,10 @@ AC_DEFUN([AM_MISSING_PROG],
 $1=${$1-"${am_missing_run}$2"}
 AC_SUBST($1)])
 
-
 # AM_MISSING_HAS_RUN
 # ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
@@ -1093,57 +1295,22 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
   AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for 'mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl FIXME to be removed in Automake 1.13.
-AC_DIAGNOSE([obsolete],
-[$0: this macro is deprecated, and will soon be removed.
-You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead,
-and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.])
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
 AC_DEFUN([_AM_MANGLE_OPTION],
@@ -1167,15 +1334,77 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
 # AM_SANITY_CHECK
 # ---------------
@@ -1252,13 +1481,71 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
 # AM_PROG_INSTALL_STRIP
 # ---------------------
@@ -1282,14 +1569,12 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2006-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -1303,14 +1588,12 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
-
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
@@ -1324,85 +1607,130 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
+#
 AC_DEFUN([_AM_PROG_TAR],
 [# Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+
+# We'll loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of '-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
 
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
   rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
 m4_include([m4/gettext.m4])
+m4_include([m4/host-cpu-c-abi.m4])
 m4_include([m4/iconv.m4])
+m4_include([m4/intlmacosx.m4])
 m4_include([m4/lib-ld.m4])
 m4_include([m4/lib-link.m4])
 m4_include([m4/lib-prefix.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
 m4_include([m4/nls.m4])
 m4_include([m4/po.m4])
 m4_include([m4/progtest.m4])
index 356f1a9..6e35926 100644 (file)
@@ -1,2 +1,3 @@
-EXTRA_DIST = alsa-info.sh
+EXTRA_DIST = alsa-info.sh alsa-info.sh.1
 sbin_SCRIPTS = alsa-info.sh
+man_MANS = alsa-info.sh.1
index 68bc1dc..596aa6c 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,16 +89,19 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = alsa-info
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -92,8 +133,20 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(sbindir)"
+am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"
 SCRIPTS = $(sbin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -101,13 +154,22 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -125,11 +187,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -141,27 +210,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -174,6 +253,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -182,6 +262,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -192,7 +274,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -233,6 +317,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -243,9 +329,10 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
-EXTRA_DIST = alsa-info.sh
+xmlto_available = @xmlto_available@
+EXTRA_DIST = alsa-info.sh alsa-info.sh.1
 sbin_SCRIPTS = alsa-info.sh
+man_MANS = alsa-info.sh.1
 all: all-am
 
 .SUFFIXES:
@@ -261,14 +348,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign alsa-info/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign alsa-info/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -314,16 +400,66 @@ uninstall-sbinSCRIPTS:
        files=`for p in $$list; do echo "$$p"; done | \
               sed -e 's,.*/,,;$(transform)'`; \
        dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
 
-ctags: CTAGS
-CTAGS:
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man1: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man1dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.1[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
 
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -355,9 +491,9 @@ distdir: $(DISTFILES)
        done
 check-am: all-am
 check: check-am
-all-am: Makefile $(SCRIPTS)
+all-am: Makefile $(SCRIPTS) $(MANS)
 installdirs:
-       for dir in "$(DESTDIR)$(sbindir)"; do \
+       for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
@@ -392,7 +528,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
@@ -410,7 +546,7 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-man
 
 install-dvi: install-dvi-am
 
@@ -426,7 +562,7 @@ install-info: install-info-am
 
 install-info-am:
 
-install-man:
+install-man: install-man1
 
 install-pdf: install-pdf-am
 
@@ -444,7 +580,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -454,20 +590,27 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-sbinSCRIPTS
+uninstall-am: uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: all all-am check check-am clean clean-generic distclean \
-       distclean-generic distdir dvi dvi-am html html-am info info-am \
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       cscopelist-am ctags-am distclean distclean-generic \
+       distclean-libtool distdir dvi dvi-am html html-am info info-am \
        install install-am install-data install-data-am install-dvi \
        install-dvi-am install-exec install-exec-am install-html \
        install-html-am install-info install-info-am install-man \
-       install-pdf install-pdf-am install-ps install-ps-am \
-       install-sbinSCRIPTS install-strip installcheck installcheck-am \
-       installdirs maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
-       uninstall-am uninstall-sbinSCRIPTS
+       install-man1 install-pdf install-pdf-am install-ps \
+       install-ps-am install-sbinSCRIPTS install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+       uninstall-am uninstall-man uninstall-man1 \
+       uninstall-sbinSCRIPTS
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index acd8495..fda784d 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
-SCRIPT_VERSION=0.4.64
-CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog"
+SCRIPT_VERSION=0.5.3
+CHANGELOG='https://www.alsa-project.org/alsa-info.sh.changelog'
 
 #################################################################################
 #Copyright (C) 2007 Free Software Foundation.
@@ -22,34 +22,32 @@ CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog"
 
 ##################################################################################
 
-#The script was written for 2 main reasons:
-# 1. Remove the need for the devs/helpers to ask several questions before we can easily help the user.
-# 2. Allow newer/inexperienced ALSA users to give us all the info we need to help them.
+# The script was written for 2 main reasons:
+#  1. Remove the need for the devs/helpers to ask several questions before we can easily help the user.
+#  2. Allow newer/inexperienced ALSA users to give us all the info we need to help them.
 
 #Set the locale (this may or may not be a good idea.. let me know)
 export LC_ALL=C
 
-#Change the PATH variable, so we can run lspci (needed for some distros)
-PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin
+# Change the PATH variable, so we can run lspci (needed for some distros)
+PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin"
 BGTITLE="ALSA-Info v $SCRIPT_VERSION"
-PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc"
-#Define some simple functions
+PASTEBINKEY='C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc'
 
-pbcheck(){
-       [[ $UPLOAD = "no" ]] && return
+WGET="$(command -v wget)"
+REQUIRES=(mktemp grep pgrep awk date uname cat sort dmesg amixer alsactl)
 
-       if [[ -z $PASTEBIN ]]; then
-               [[ $(ping -c1 www.alsa-project.org) ]] || KEEP_FILES="yes" UPLOAD="no" PBERROR="yes"
-       else
-               [[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" UPLOAD="no" PBERROR="yes"
-       fi
-}
+#
+# Define some simple functions
+#
 
 update() {
-       SHFILE=`mktemp -t alsa-info.XXXXXXXXXX` || exit 1
-       wget -O $SHFILE "http://www.alsa-project.org/alsa-info.sh" >/dev/null 2>&1
-       REMOTE_VERSION=`grep SCRIPT_VERSION $SHFILE |head -n1 |sed 's/.*=//'`
-       if [ "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then
+       test -z "$WGET" || test ! -x "$WGET" && return
+
+       SHFILE=$(mktemp -t alsa-info.XXXXXXXXXX) || exit 1
+       wget -O $SHFILE "https://www.alsa-project.org/alsa-info.sh" >/dev/null 2>&1
+       REMOTE_VERSION=$(grep SCRIPT_VERSION $SHFILE | head -n1 | sed 's/.*=//')
+       if [ -s "$SHFILE" ] && [ "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then
                if [[ -n $DIALOG ]]
                then
                        OVERWRITE=
@@ -102,7 +100,7 @@ update() {
 }
 
 cleanup() {
-       if [ -n "$TEMPDIR" -a "$KEEP_FILES" != "yes" ]; then
+       if [ -n "$TEMPDIR" ] && [ "$KEEP_FILES" != "yes" ]; then
                rm -rf "$TEMPDIR" 2>/dev/null
        fi
        test -n "$KEEP_OUTPUT" || rm -f "$NFILE"
@@ -110,107 +108,96 @@ cleanup() {
 
 
 withaplay() {
-        echo "!!Aplay/Arecord output" >> $FILE
-        echo "!!--------------------" >> $FILE
-        echo "" >> $FILE
-               echo "APLAY" >> $FILE
-       echo "" >> $FILE 
-       aplay -l >> $FILE 2>&1
-        echo "" >> $FILE
-               echo "ARECORD" >> $FILE
-       echo "" >> $FILE
-       arecord -l >> $FILE 2>&1
-       echo "" >> $FILE
+        echo "!!Aplay/Arecord output" >> "$FILE"
+        echo "!!--------------------" >> "$FILE"
+        echo "" >> "$FILE"
+               echo "APLAY" >> "$FILE"
+       echo "" >> "$FILE"
+       aplay -l >> "$FILE" 2>&1
+        echo "" >> "$FILE"
+               echo "ARECORD" >> "$FILE"
+       echo "" >> "$FILE"
+       arecord -l >> "$FILE" 2>&1
+       echo "" >> "$FILE"
 }
 
-withlsmod() {
-       echo "!!All Loaded Modules" >> $FILE
-       echo "!!------------------" >> $FILE
-       echo "" >> $FILE
-       lsmod |awk {'print $1'} >> $FILE
-       echo "" >> $FILE
-       echo "" >> $FILE
+withmodules() {
+       echo "!!All Loaded Modules" >> "$FILE"
+       echo "!!------------------" >> "$FILE"
+       echo "" >> "$FILE"
+       awk '{print $1}' < /proc/modules | sort >> "$FILE"
+       echo "" >> "$FILE"
+       echo "" >> "$FILE"
 }
 
 withamixer() {
-        echo "!!Amixer output" >> $FILE
-        echo "!!-------------" >> $FILE
-        echo "" >> $FILE
-       for i in `grep "]: " /proc/asound/cards | awk -F ' ' '{ print $1} '` ; do
-       CARD_NAME=`grep "^ *$i " $TEMPDIR/alsacards.tmp|awk {'print $2'}`
-       echo "!!-------Mixer controls for card $i $CARD_NAME]" >> $FILE
-       echo "" >>$FILE
-       amixer -c$i info>> $FILE 2>&1
-       amixer -c$i>> $FILE 2>&1
-        echo "" >> $FILE
+        echo "!!Amixer output" >> "$FILE"
+        echo "!!-------------" >> "$FILE"
+        echo "" >> "$FILE"
+       for f in /proc/asound/card*/id; do
+               [ -f "$f" ] && read -r CARD_NAME < "$f" || continue
+               echo "!!-------Mixer controls for card $CARD_NAME" >> "$FILE"
+               echo "" >> "$FILE"
+               amixer -c "$CARD_NAME" info >> "$FILE" 2>&1
+               amixer -c "$CARD_NAME" >> "$FILE" 2>&1
+               echo "" >> "$FILE"
        done
-       echo "" >> $FILE
+       echo "" >> "$FILE"
 }
 
 withalsactl() {
-       echo "!!Alsactl output" >> $FILE
-        echo "!!--------------" >> $FILE
-        echo "" >> $FILE
-        exe=""
-        if [ -x /usr/sbin/alsactl ]; then
-               exe="/usr/sbin/alsactl"
-        fi
-        if [ -x /usr/local/sbin/alsactl ]; then
-               exe="/usr/local/sbin/alsactl"
-        fi
-        if [ -z "$exe" ]; then
-               exe=`whereis alsactl | cut -d ' ' -f 2`
-        fi
-       $exe -f $TEMPDIR/alsactl.tmp store
-       echo "--startcollapse--" >> $FILE
-       cat $TEMPDIR/alsactl.tmp >> $FILE
-       echo "--endcollapse--" >> $FILE
-       echo "" >> $FILE
-       echo "" >> $FILE
+       echo "!!Alsactl output" >> "$FILE"
+        echo "!!--------------" >> "$FILE"
+        echo "" >> "$FILE"
+       alsactl -f "$TEMPDIR/alsactl.tmp" store
+       echo "--startcollapse--" >> "$FILE"
+       cat "$TEMPDIR/alsactl.tmp" >> "$FILE"
+       echo "--endcollapse--" >> "$FILE"
+       echo "" >> "$FILE"
+       echo "" >> "$FILE"
 }
 
 withdevices() {
-        echo "!!ALSA Device nodes" >> $FILE
-        echo "!!-----------------" >> $FILE
-        echo "" >> $FILE
-        ls -la /dev/snd/* >> $FILE
-        echo "" >> $FILE
-        echo "" >> $FILE
+        echo "!!ALSA Device nodes" >> "$FILE"
+        echo "!!-----------------" >> "$FILE"
+        echo "" >> "$FILE"
+        ls -la /dev/snd/* >> "$FILE"
+        echo "" >> "$FILE"
+        echo "" >> "$FILE"
 }
 
 withconfigs() {
-if [[ -e $HOME/.asoundrc ]] || [[ -e /etc/asound.conf ]] || [[ -e $HOME/.asoundrc.asoundconf ]]
-then
-        echo "!!ALSA configuration files" >> $FILE
-        echo "!!------------------------" >> $FILE
-        echo "" >> $FILE
+if [[ -e "$HOME/.asoundrc" ]] || [[ -e "/etc/asound.conf" ]] || [[ -e "$HOME/.asoundrc.asoundconf" ]]; then
+        echo "!!ALSA configuration files" >> "$FILE"
+        echo "!!------------------------" >> "$FILE"
+        echo "" >> "$FILE"
 
         #Check for ~/.asoundrc
-        if [[ -e $HOME/.asoundrc ]]
+        if [[ -e "$HOME/.asoundrc" ]]
         then
-                echo "!!User specific config file (~/.asoundrc)" >> $FILE
-                echo "" >> $FILE
-                cat $HOME/.asoundrc >> $FILE
-                echo "" >> $FILE
-                echo "" >> $FILE
+                echo "!!User specific config file (~/.asoundrc)" >> "$FILE"
+                echo "" >> "$FILE"
+                cat "$HOME/.asoundrc" >> "$FILE"
+                echo "" >> "$FILE"
+                echo "" >> "$FILE"
         fi
        #Check for .asoundrc.asoundconf (seems to be Ubuntu specific)
-       if [[ -e $HOME/.asoundrc.asoundconf ]]
+       if [[ -e "$HOME/.asoundrc.asoundconf" ]]
        then
-               echo "!!asoundconf-generated config file" >> $FILE
-               echo "" >> $FILE
-               cat $HOME/.asoundrc.asoundconf >> $FILE
-               echo "" >> $FILE
-               echo "" >> $FILE
+               echo "!!asoundconf-generated config file" >> "$FILE"
+               echo "" >> "$FILE"
+               cat "$HOME/.asoundrc.asoundconf" >> "$FILE"
+               echo "" >> "$FILE"
+               echo "" >> "$FILE"
        fi
         #Check for /etc/asound.conf
         if [[ -e /etc/asound.conf ]]
         then
-                echo "!!System wide config file (/etc/asound.conf)" >> $FILE
-                echo "" >> $FILE
-                cat /etc/asound.conf >> $FILE
-                echo "" >> $FILE
-                echo "" >> $FILE
+                echo "!!System wide config file (/etc/asound.conf)" >> "$FILE"
+                echo "" >> "$FILE"
+                cat /etc/asound.conf >> "$FILE"
+                echo "" >> "$FILE"
+                echo "" >> "$FILE"
         fi
 fi
 }
@@ -221,16 +208,16 @@ withsysfs() {
     for i in /sys/class/sound/*; do
        case "$i" in
            */hwC?D?)
-               if [ -f $i/init_pin_configs ]; then
+               if [ -f "$i/init_pin_configs" ]; then
                    if [ -z "$printed" ]; then
-                       echo "!!Sysfs Files" >> $FILE
-                       echo "!!-----------" >> $FILE
-                       echo "" >> $FILE
+                       echo "!!Sysfs Files" >> "$FILE"
+                       echo "!!-----------" >> "$FILE"
+                       echo "" >> "$FILE"
                    fi
                    for f in init_pin_configs driver_pin_configs user_pin_configs init_verbs hints; do
-                       echo "$i/$f:" >> $FILE
-                       cat $i/$f >> $FILE
-                       echo >> $FILE
+                       echo "$i/$f:" >> "$FILE"
+                       cat "$i/$f" >> "$FILE"
+                       echo >> "$FILE"
                    done
                    printed=yes
                fi
@@ -238,17 +225,36 @@ withsysfs() {
            esac
     done
     if [ -n "$printed" ]; then
-       echo "" >> $FILE
+       echo "" >> "$FILE"
     fi
 }
 
 withdmesg() {
-       echo "!!ALSA/HDA dmesg" >> $FILE
-       echo "!!--------------" >> $FILE
-       echo "" >> $FILE
-       dmesg | grep -C1 -E 'ALSA|HDA|HDMI|snd[_-]|sound|hda.codec|hda.intel' >> $FILE
-       echo "" >> $FILE
-       echo "" >> $FILE
+       echo "!!ALSA/HDA dmesg" >> "$FILE"
+       echo "!!--------------" >> "$FILE"
+       echo "" >> "$FILE"
+       dmesg | grep -C1 -E 'ALSA|HDA|HDMI|snd[_-]|sound|audio|hda.codec|hda.intel' >> "$FILE"
+       echo "" >> "$FILE"
+       echo "" >> "$FILE"
+}
+
+withpackages() {
+       local RPM
+       local DPKG
+       RPM="$(command -v rpmquery)"
+       DPKG="$(command -v dpkg)"
+       [ -n "$RPM$DPKG" ] || return
+       local PATTERN='(alsa-(lib|oss|plugins|tools|(topology|ucm)-conf|utils|sof-firmware)|libalsa|tinycompress|sof-firmware)'
+       {
+        echo "!!Packages installed"
+        echo "!!--------------------"
+        echo ""
+       {
+               if [ -x "$RPM" ]; then "$RPM" -a; fi
+               if [ -x "$DPKG" ]; then "$DPKG" -l; fi
+       } | grep -E "$PATTERN"
+       echo ""
+       } >> "$FILE"
 }
 
 withall() {
@@ -257,25 +263,26 @@ withall() {
        withaplay
        withamixer
        withalsactl
-       withlsmod
+       withmodules
        withsysfs
        withdmesg
-       WITHALL="no"
+       withpackages
+       WITHALL=no
 }
 
 get_alsa_library_version() {
-       ALSA_LIB_VERSION=`grep VERSION_STR /usr/include/alsa/version.h 2>/dev/null|awk {'print $3'}|sed 's/"//g'`
+       ALSA_LIB_VERSION="$(grep VERSION_STR /usr/include/alsa/version.h 2>/dev/null | awk '{ print $3 }' | sed 's/"//g')"
 
        if [ -z "$ALSA_LIB_VERSION" ]; then
                if [ -f /etc/lsb-release ]; then
                        . /etc/lsb-release
                        case "$DISTRIB_ID" in
                                Ubuntu)
-                                       if which dpkg > /dev/null ; then
-                                               ALSA_LIB_VERSION=`dpkg -l libasound2 | tail -1 | awk '{print $3}' | cut -f 1 -d -`
+                                       if command -v dpkg > /dev/null ; then
+                                               ALSA_LIB_VERSION="$(dpkg -l libasound2 | tail -1 | awk '{ print $3 }' | cut -f 1 -d -)"
                                        fi
 
-                                       if [ "$ALSA_LIB_VERSION" = "<none>" ]; then
+                                       if [ "$ALSA_LIB_VERSION" = '<none>' ]; then
                                                ALSA_LIB_VERSION=""
                                        fi
                                        return
@@ -285,11 +292,11 @@ get_alsa_library_version() {
                                        ;;
                        esac
                elif [ -f /etc/debian_version ]; then
-                       if which dpkg > /dev/null ; then
-                               ALSA_LIB_VERSION=`dpkg -l libasound2 | tail -1 | awk '{print $3}' | cut -f 1 -d -`
+                       if command -v dpkg > /dev/null ; then
+                               ALSA_LIB_VERSION="$(dpkg -l libasound2 | tail -1 | awk '{ print $3 }' | cut -f 1 -d -)"
                        fi
 
-                       if [ "$ALSA_LIB_VERSION" = "<none>" ]; then
+                       if [ "$ALSA_LIB_VERSION" = '<none>' ]; then
                                ALSA_LIB_VERSION=""
                        fi
                        return
@@ -297,45 +304,53 @@ get_alsa_library_version() {
        fi
 }
 
+# Basic requires
+for prg in "${REQUIRES[@]}"; do
+  t="$(command -v "$prg")"
+  if test -z "$t"; then
+    echo "This script requires $prg utility to continue."
+    exit 1
+  fi
+done
 
-#Run checks to make sure the programs we need are installed.
-LSPCI=$(which lspci 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null);
-TPUT=$(which tput 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null);
-DIALOG=$(which dialog 2>/dev/null | sed 's|^[^/]*||' 2>/dev/null);
+# Run checks to make sure the programs we need are installed.
+LSPCI="$(command -v lspci)"
+TPUT="$(command -v tput)"
+DIALOG="$(command -v dialog)"
 
-#Check to see if sysfs is enabled in the kernel. We'll need this later on
-SYSFS=$(mount |grep sysfs|awk {'print $3'});
+# Check to see if sysfs is enabled in the kernel. We'll need this later on
+SYSFS="$(mount | grep sysfs | awk '{ print $3 }')"
 
-#Check modprobe config files for sound related options
-SNDOPTIONS=$(modprobe -c|sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p')
+# Check modprobe config files for sound related options
+SNDOPTIONS="$(modprobe -c | sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p')"
 
 KEEP_OUTPUT=
 NFILE=""
 
 PASTEBIN=""
-WWWSERVICE="www.alsa-project.org"
-WELCOME="yes"
-PROCEED="yes"
-UPLOAD="ask"
+WWWSERVICE='www.alsa-project.org'
+WELCOME=yes
+PROCEED=yes
+UPLOAD=ask
 REPEAT=""
 while [ -z "$REPEAT" ]; do
-REPEAT="no"
+REPEAT=no
 case "$1" in
        --update|--help|--about)
-               WELCOME="no"
-               PROCEED="no"
+               WELCOME=no
+               PROCEED=no
                ;;
        --upload)
-               UPLOAD="yes"
-               WELCOME="no"
+               UPLOAD=yes
+               WELCOME=no
                ;;
        --no-upload)
-               UPLOAD="no"
-               WELCOME="no"
+               UPLOAD=no
+               WELCOME=no
                ;;
        --pastebin)
-               PASTEBIN="yes"
-               WWWSERVICE="pastebin"
+               PASTEBIN=yes
+               WWWSERVICE=pastebin
                ;;
        --no-dialog)
                DIALOG=""
@@ -344,16 +359,14 @@ case "$1" in
                ;;
        --stdout)
                DIALOG=""
-               UPLOAD="no"
-               WELCOME="no"
-               TOSTDOUT="yes"
+               WELCOME=no
                ;;
 esac
 done
 
 
 #Script header output.
-if [ "$WELCOME" = "yes" ]; then
+if [ "$WELCOME" = yes ]; then
 greeting_message="\
 
 This script visits the following commands/files to collect diagnostic
@@ -361,10 +374,10 @@ information about your ALSA installation and sound related hardware.
 
   dmesg
   lspci
-  lsmod
   aplay
   amixer
   alsactl
+  rpm, dpkg
   /proc/asound/
   /sys/class/sound/
   ~/.asoundrc (etc.)
@@ -382,42 +395,41 @@ else
 fi # dialog
 fi # WELCOME
 
-#Set the output file
-TEMPDIR=`mktemp -t -d alsa-info.XXXXXXXXXX` || exit 1
+# Set the output file
+TEMPDIR="$(mktemp -t -d alsa-info.XXXXXXXXXX)" || exit 1
 FILE="$TEMPDIR/alsa-info.txt"
 if [ -z "$NFILE" ]; then
-       NFILE=`mktemp -t alsa-info.txt.XXXXXXXXXX` || exit 1
+       NFILE="$(mktemp -t alsa-info.txt.XXXXXXXXXX)" || exit 1
 fi
 
 trap cleanup 0
 
-if [ "$PROCEED" = "yes" ]; then
+if [ "$PROCEED" = yes ]; then
 
 if [ -z "$LSPCI" ]; then
        if [ -d /sys/bus/pci ]; then
                echo "This script requires lspci. Please install it, and re-run this script."
-               exit 0
        fi
 fi
 
-#Fetch the info and store in temp files/variables
-DISTRO=`grep -ihs "buntu\|SUSE\|Fedora\|PCLinuxOS\|MEPIS\|Mandriva\|Debian\|Damn\|Sabayon\|Slackware\|KNOPPIX\|Gentoo\|Zenwalk\|Mint\|Kubuntu\|FreeBSD\|Puppy\|Freespire\|Vector\|Dreamlinux\|CentOS\|Arch\|Xandros\|Elive\|SLAX\|Red\|BSD\|KANOTIX\|Nexenta\|Foresight\|GeeXboX\|Frugalware\|64\|SystemRescue\|Novell\|Solaris\|BackTrack\|KateOS\|Pardus" /etc/{issue,*release,*version}`
-KERNEL_VERSION=`uname -r`
-KERNEL_PROCESSOR=`uname -p`
-KERNEL_MACHINE=`uname -m`
-KERNEL_OS=`uname -o`
-[[ `uname -v | grep SMP`  ]] && KERNEL_SMP="Yes" || KERNEL_SMP="No" 
-ALSA_DRIVER_VERSION=`cat /proc/asound/version |head -n1|awk {'print $7'} |sed 's/\.$//'`
+# Fetch the info and store in temp files/variables
+TSTAMP=$(LANG=C TZ=UTC date)
+DISTRO=$(grep -ihs "buntu\|SUSE\|Fedora\|PCLinuxOS\|MEPIS\|Mandriva\|Debian\|Damn\|Sabayon\|Slackware\|KNOPPIX\|Gentoo\|Zenwalk\|Mint\|Kubuntu\|FreeBSD\|Puppy\|Freespire\|Vector\|Dreamlinux\|CentOS\|Arch\|Xandros\|Elive\|SLAX\|Red\|BSD\|KANOTIX\|Nexenta\|Foresight\|GeeXboX\|Frugalware\|64\|SystemRescue\|Novell\|Solaris\|BackTrack\|KateOS\|Pardus\|ALT" /etc/{issue,*release,*version})
+read -r KERNEL_RELEASE KERNEL_MACHINE KERNEL_PROCESSOR KERNEL_OS < <(uname -rpmo)
+read -r KERNEL_VERSION < <(uname -v)
+if [[ "$KERNEL_VERSION" = *SMP* ]]; then KERNEL_SMP=Yes; else KERNEL_SMP=No; fi
+ALSA_DRIVER_VERSION=$(cat /proc/asound/version | head -n1 | awk '{ print $7 }' | sed 's/\.$//')
 get_alsa_library_version
-ALSA_UTILS_VERSION=`amixer -v |awk {'print $3'}`
-LAST_CARD=$((`grep "]: " /proc/asound/cards | wc -l` - 1 ))
+ALSA_UTILS_VERSION=$(amixer -v | awk '{ print $3 }')
 
-ESDINST=$(which esd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
-PAINST=$(which pulseaudio 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
-ARTSINST=$(which artsd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
-JACKINST=$(which jackd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
-ROARINST=$(which roard 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
-DMIDECODE=$(which dmidecode 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
+ESDINST=$(command -v esd)
+PWINST=$(command -v pipewire)
+PAINST=$(command -v pulseaudio)
+ARTSINST=$(command -v artsd)
+JACKINST=$(command -v jackd)
+JACK2INST=$(command -v jackdbus)
+ROARINST=$(command -v roard)
+DMIDECODE=$(command -v dmidecode)
 
 #Check for DMI data
 if [ -d /sys/class/dmi/id ]; then
@@ -426,17 +438,49 @@ if [ -d /sys/class/dmi/id ]; then
     DMI_SYSTEM_PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null)
     DMI_SYSTEM_PRODUCT_VERSION=$(cat /sys/class/dmi/id/product_version 2>/dev/null)
     DMI_SYSTEM_FIRMWARE_VERSION=$(cat /sys/class/dmi/id/bios_version 2>/dev/null)
+    DMI_SYSTEM_SKU=$(cat /sys/class/dmi/id/product_sku 2>/dev/null)
+    DMI_BOARD_VENDOR=$(cat /sys/class/dmi/id/board_vendor 2>/dev/null)
+    DMI_BOARD_NAME=$(cat /sys/class/dmi/id/board_name 2>/dev/null)
 elif [ -x $DMIDECODE ]; then
     DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer 2>/dev/null)
     DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name 2>/dev/null)
     DMI_SYSTEM_PRODUCT_VERSION=$($DMIDECODE -s system-version 2>/dev/null)
     DMI_SYSTEM_FIRMWARE_VERSION=$($DMIDECODE -s bios-version 2>/dev/null)
+    DMI_SYSTEM_SKU=$($DMIDECODE -s system-sku-number 2>/dev/null)
+    DMI_BOARD_VENDOR=$($DMIDECODE -s baseboard-manufacturer 2>/dev/null)
+    DMI_BOARD_NAME=$($DMIDECODE -s baseboard-product-name 2>/dev/null)
+fi
+
+# Check for ACPI device status
+if [ -d /sys/bus/acpi/devices ]; then
+    for f in /sys/bus/acpi/devices/*/status; do
+       ACPI_STATUS=$(cat $f 2>/dev/null);
+       if [[ "$ACPI_STATUS" -ne 0 ]]; then
+           echo $f $'\t' $ACPI_STATUS >>$TEMPDIR/acpidevicestatus.tmp;
+       fi
+    done
+fi
+
+# Check for SoundWire ACPI _adr device status
+if [ -d /sys/bus/acpi/devices ]; then
+       for f in /sys/bus/acpi/devices/*/adr; do
+               ACPI_ADR=$(cat $f 2>/dev/null);
+               if [[ "$ACPI_ADR" -ne 0 ]]; then
+                       case $ACPI_ADR in
+                               0x??????025d*) echo "Realtek $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
+                               0x??????01fa*) echo "Cirrus Logic $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
+                               0x??????0102*) echo "TI $ACPI_ADR" >>$TEMPDIR/sdwstatus.tmp;;
+                       esac
+               fi
+       done
 fi
 
-cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp
-cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
+awk '{ print $2 " (card " $1 ")" }' < /proc/asound/modules > $TEMPDIR/alsamodules.tmp 2> /dev/null
+cat /proc/asound/cards > $TEMPDIR/alsacards.tmp
 if [[ ! -z "$LSPCI" ]]; then
-lspci |grep -i "multi\|audio">$TEMPDIR/lspci.tmp
+       for class in 0401 0402 0403; do
+               lspci -vvnn -d "::$class" | sed -n '/^[^\t]/,+1p'
+       done > $TEMPDIR/lspci.tmp
 fi
 
 #Check for HDA-Intel cards codec#*
@@ -446,6 +490,18 @@ cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null
 cat /proc/asound/card*/codec97\#0/ac97\#0-0 > $TEMPDIR/alsa-ac97.tmp 2> /dev/null
 cat /proc/asound/card*/codec97\#0/ac97\#0-0+regs > $TEMPDIR/alsa-ac97-regs.tmp 2> /dev/null
 
+#Check for USB descriptors
+if [ -x /usr/bin/lsusb ]; then
+    for f in /proc/asound/card[0-9]*/usbbus; do
+       test -f "$f" || continue
+       id=$(sed 's@/@:@' $f)
+       lsusb -v -s $id >> $TEMPDIR/lsusb.tmp 2> /dev/null
+    done
+fi
+
+#Check for USB stream setup
+cat /proc/asound/card*/stream[0-9]* > $TEMPDIR/alsa-usbstream.tmp 2> /dev/null
+
 #Check for USB mixer setup
 cat /proc/asound/card*/usbmixer > $TEMPDIR/alsa-usbmixer.tmp 2> /dev/null
 
@@ -459,7 +515,7 @@ echo "!!################################" >> $FILE
 echo "!!ALSA Information Script v $SCRIPT_VERSION" >> $FILE
 echo "!!################################" >> $FILE
 echo "" >> $FILE
-echo "!!Script ran on: `LANG=C TZ=UTC date`" >> $FILE
+echo "!!Script ran on: $TSTAMP" >> $FILE
 echo "" >> $FILE
 echo "" >> $FILE
 echo "!!Linux Distribution" >> $FILE
@@ -475,6 +531,21 @@ echo "Manufacturer:      $DMI_SYSTEM_MANUFACTURER" >> $FILE
 echo "Product Name:      $DMI_SYSTEM_PRODUCT_NAME" >> $FILE
 echo "Product Version:   $DMI_SYSTEM_PRODUCT_VERSION" >> $FILE
 echo "Firmware Version:  $DMI_SYSTEM_FIRMWARE_VERSION" >> $FILE
+echo "System SKU:        $DMI_SYSTEM_SKU" >> $FILE
+echo "Board Vendor:      $DMI_BOARD_VENDOR" >> $FILE
+echo "Board Name:        $DMI_BOARD_NAME" >> $FILE
+echo "" >> $FILE
+echo "" >> $FILE
+echo "!!ACPI Device Status Information" >> $FILE
+echo "!!---------------" >> $FILE
+echo "" >> $FILE
+cat $TEMPDIR/acpidevicestatus.tmp >> $FILE
+echo "" >> $FILE
+echo "" >> $FILE
+echo "!!ACPI SoundWire Device Status Information" >> $FILE
+echo "!!---------------" >> $FILE
+echo "" >> $FILE
+cat $TEMPDIR/sdwstatus.tmp >> $FILE
 echo "" >> $FILE
 echo "" >> $FILE
 echo "!!Kernel Information" >> $FILE
@@ -504,36 +575,50 @@ echo "" >> $FILE
 echo "!!Sound Servers on this system" >> $FILE
 echo "!!----------------------------" >> $FILE
 echo "" >> $FILE
+if [[ -n $PWINST ]];then
+[[ $(pgrep '^(.*/)?pipewire$') ]] && PWRUNNING="Yes" || PWRUNNING="No"
+echo "PipeWire:" >> $FILE
+echo "      Installed - Yes ($PWINST)" >> $FILE
+echo "      Running - $PWRUNNING" >> $FILE
+echo "" >> $FILE
+fi
 if [[ -n $PAINST ]];then
-[[ `pgrep '^(.*/)?pulseaudio$'` ]] && PARUNNING="Yes" || PARUNNING="No"
+[[ $(pgrep '^(.*/)?pulseaudio$') ]] && PARUNNING="Yes" || PARUNNING="No"
 echo "Pulseaudio:" >> $FILE
 echo "      Installed - Yes ($PAINST)" >> $FILE
 echo "      Running - $PARUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $ESDINST ]];then
-[[ `pgrep '^(.*/)?esd$'` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
+[[ $(pgrep '^(.*/)?esd$') ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
 echo "ESound Daemon:" >> $FILE
 echo "      Installed - Yes ($ESDINST)" >> $FILE
 echo "      Running - $ESDRUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $ARTSINST ]];then
-[[ `pgrep '^(.*/)?artsd$'` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
+[[ $(pgrep '^(.*/)?artsd$') ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
 echo "aRts:" >> $FILE
 echo "      Installed - Yes ($ARTSINST)" >> $FILE
 echo "      Running - $ARTSRUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $JACKINST ]];then
-[[ `pgrep '^(.*/)?jackd$'` ]] && JACKRUNNING="Yes" || JACKRUNNING="No"
+[[ $(pgrep '^(.*/)?jackd$') ]] && JACKRUNNING="Yes" || JACKRUNNING="No"
 echo "Jack:" >> $FILE
 echo "      Installed - Yes ($JACKINST)" >> $FILE
 echo "      Running - $JACKRUNNING" >> $FILE
 echo "" >> $FILE
 fi
+if [[ -n $JACK2INST ]];then
+[[ $(pgrep '^(.*/)?jackdbus$') ]] && JACK2RUNNING="Yes" || JACK2RUNNING="No"
+echo "Jack2:" >> $FILE
+echo "      Installed - Yes ($JACK2INST)" >> $FILE
+echo "      Running - $JACK2RUNNING" >> $FILE
+echo "" >> $FILE
+fi
 if [[ -n $ROARINST ]];then
-[[ `pgrep '^(.*/)?roard$'` ]] && ROARRUNNING="Yes" || ROARRUNNING="No"
+[[ $(pgrep '^(.*/)?roard$') ]] && ROARRUNNING="Yes" || ROARRUNNING="No"
 echo "RoarAudio:" >> $FILE
 echo "      Installed - Yes ($ROARINST)" >> $FILE
 echo "      Running - $ROARRUNNING" >> $FILE
@@ -558,16 +643,9 @@ echo "" >> $FILE
 cat $TEMPDIR/lspci.tmp >> $FILE
 echo "" >> $FILE
 echo "" >> $FILE
-echo "!!Advanced information - PCI Vendor/Device/Subsystem ID's" >> $FILE
-echo "!!-------------------------------------------------------" >> $FILE
-echo "" >> $FILE
-lspci -vvn |grep -A1 040[1-3] >> $FILE
-echo "" >> $FILE
-echo "" >> $FILE
 fi
 
-if [ "$SNDOPTIONS" ]
-then
+if [ "$SNDOPTIONS" ]; then
 echo "!!Modprobe options (Sound related)" >> $FILE
 echo "!!--------------------------------" >> $FILE
 echo "" >> $FILE
@@ -576,20 +654,47 @@ echo "" >> $FILE
 echo "" >> $FILE
 fi
 
-if [ -d "$SYSFS" ]
-then
-echo "!!Loaded sound module options" >> $FILE
-echo "!!---------------------------" >> $FILE
-echo "" >> $FILE
-for mod in `cat /proc/asound/modules|awk {'print $2'}`;do
-echo "!!Module: $mod" >> $FILE
-for params in `echo $SYSFS/module/$mod/parameters/*`; do
-       echo -ne "\t";
-       echo "$params : `cat $params`" | sed 's:.*/::';
-done >> $FILE
-echo "" >> $FILE
-done
-echo "" >> $FILE
+if [ -d "$SYSFS" ]; then
+       echo "!!Loaded sound module options" >> $FILE
+       echo "!!---------------------------" >> $FILE
+       echo "" >> $FILE
+       for mod in $(cat /proc/asound/modules | awk '{ print $2 }'); do
+               echo "!!Module: $mod" >> $FILE
+               for params in $(echo $SYSFS/module/$mod/parameters/*); do
+                       echo -ne "\t"
+                       value=$(cat $params)
+                       echo "$params : $value" | sed 's:.*/::'
+               done >> $FILE
+               echo "" >> $FILE
+       done
+       echo "" >> $FILE
+       echo "!!Sysfs card info" >> $FILE
+       echo "!!---------------" >> $FILE
+       echo "" >> $FILE
+       for cdir in $(echo $SYSFS/class/sound/card*); do
+               echo "!!Card: $cdir" >> $FILE
+               driver=$(readlink -f "$cdir/device/driver")
+               echo "Driver: $driver" >> $FILE
+               echo "Tree:" >> $FILE
+               tree --noreport $cdir -L 2 | sed -e 's/^/\t/g' >> $FILE
+               echo "" >> $FILE
+       done
+       echo "" >> $FILE
+       if [ -d $SYSFS/class/sound/ctl-led ]; then
+               echo "!!Sysfs ctl-led info" >> $FILE
+               echo "!!---------------" >> $FILE
+               echo "" >> $FILE
+               for path in $(echo $SYSFS/class/sound/ctl-led/[ms][ip]*/card*); do
+                       echo "!!CTL-LED: $path" >> $FILE
+                       if [ -r "$path/list" ]; then
+                               list=$(cat "$path/list")
+                               echo "List: $list" >> $FILE
+                       fi
+                       #echo "Tree:" >> $FILE
+                       #tree --noreport $path -L 2 | sed -e 's/^/\t/g' >> $FILE
+                       echo "" >> $FILE
+               done
+       fi
 fi
 
 if [ -s "$TEMPDIR/alsa-hda-intel.tmp" ]; then
@@ -616,6 +721,27 @@ if [ -s "$TEMPDIR/alsa-ac97.tmp" ]; then
        echo "" >> $FILE
 fi
 
+if [ -s "$TEMPDIR/lsusb.tmp" ]; then
+        echo "!!USB Descriptors" >> $FILE
+        echo "!!---------------" >> $FILE
+        echo "--startcollapse--" >> $FILE
+        cat $TEMPDIR/lsusb.tmp >> $FILE
+        echo "--endcollapse--" >> $FILE
+       echo "" >> $FILE
+       echo "" >> $FILE
+fi
+
+if [ -s "$TEMPDIR/alsa-usbstream.tmp" ]; then
+        echo "!!USB Stream information" >> $FILE
+        echo "!!----------------------" >> $FILE
+        echo "--startcollapse--" >> $FILE
+        echo "" >> $FILE
+        cat $TEMPDIR/alsa-usbstream.tmp >> $FILE
+        echo "--endcollapse--" >> $FILE
+       echo "" >> $FILE
+       echo "" >> $FILE
+fi
+
 if [ -s "$TEMPDIR/alsa-usbmixer.tmp" ]; then
         echo "!!USB Mixer information" >> $FILE
         echo "!!---------------------" >> $FILE
@@ -630,7 +756,6 @@ fi
 #If no command line options are specified, then run as though --with-all was specified
 if [ -z "$1" ]; then
        update
-       pbcheck 
 fi
 
 fi # proceed
@@ -642,26 +767,25 @@ if [ -n "$1" ]; then
        case "$1" in
                --pastebin)
                        update
-                       pbcheck
                        ;;
                --update)
                        update
                        exit
                        ;;
                --upload)
-                       UPLOAD="yes"
+                       UPLOAD=yes
                        ;;
                --no-upload)
-                       UPLOAD="no"
+                       UPLOAD=no
                        ;;
                --output)
                        shift
                        NFILE="$1"
-                       KEEP_OUTPUT="yes"
+                       KEEP_OUTPUT=yes
                        ;;
                --debug)
                        echo "Debugging enabled. $FILE and $TEMPDIR will not be deleted"
-                       KEEP_FILES="yes"
+                       KEEP_FILES=yes
                        echo ""
                        ;;
                --with-all)
@@ -669,60 +793,40 @@ if [ -n "$1" ]; then
                        ;;
                --with-aplay)
                        withaplay
-                       WITHALL="no"
+                       WITHALL=no
                        ;;
                --with-amixer)
                        withamixer
-                       WITHALL="no"
+                       WITHALL=no
                        ;;
                --with-alsactl)
                        withalsactl
-                       WITHALL="no"
+                       WITHALL=no
                        ;;
                --with-devices)
                        withdevices
-                       WITHALL="no"
+                       WITHALL=no
                        ;;
                --with-dmesg)
                        withdmesg
-                       WITHALL="no"
+                       WITHALL=no
                        ;;
                --with-configs)
-                       WITHALL="no"
-                       if [[ -e $HOME/.asoundrc ]] || [[ -e /etc/asound.conf ]]
-                       then
-                               echo "!!ALSA configuration files" >> $FILE
-                               echo "!!------------------------" >> $FILE
-                               echo "" >> $FILE
-
-                               #Check for ~/.asoundrc
-                               if [[ -e $HOME/.asoundrc ]]
-                               then
-                                       echo "!!User specific config file ($HOME/.asoundrc)" >> $FILE
-                                       echo "" >> $FILE
-                                       cat $HOME/.asoundrc >> $FILE
-                                       echo "" >> $FILE
-                                       echo "" >> $FILE
-                               fi
-
-                               #Check for /etc/asound.conf
-                               if [[ -e /etc/asound.conf ]]
-                               then
-                                       echo "!!System wide config file (/etc/asound.conf)" >> $FILE
-                                       echo "" >> $FILE
-                                       cat /etc/asound.conf >> $FILE
-                                       echo "" >> $FILE
-                                       echo "" >> $FILE
-                               fi
-                       fi
+                       withconfigs
+                       WITHALL=no
+                       ;;
+               --with-packages)
+                       withpackages
+                       WITHALL=no
                        ;;
                --stdout)
-                       UPLOAD="no"
+                       UPLOAD=no
                        if [ -z "$WITHALL" ]; then
                                withall
                        fi
-                       cat $FILE
-                       rm $FILE
+                       cat "$FILE"
+                       rm "$FILE"
+                       exit
                        ;;
                --about)
                        echo "Written/Tested by the following users of #alsa on irc.freenode.net:"
@@ -746,18 +850,19 @@ if [ -n "$1" ]; then
                        echo "      /etc/asound.conf if they exist)" 
                        echo "  --with-devices (shows the device nodes in /dev/snd/)"
                        echo "  --with-dmesg (shows the ALSA/HDA kernel messages)"
+                       echo "  --with-packages (includes known packages installed)"
                        echo ""
                        echo "  --output FILE (specify the file to output for no-upload mode)"
                        echo "  --update (check server for script updates)"
                        echo "  --upload (upload contents to remote server)"
                        echo "  --no-upload (do not upload contents to remote server)"
-                       echo "  --pastebin (use http://pastebin.ca) as remote server"
+                       echo "  --pastebin (use 'https://pastebin.ca') as remote server"
                        echo "      instead www.alsa-project.org"
                        echo "  --stdout (print alsa information to standard output"
                        echo "      instead of a file)"
                        echo "  --about (show some information about the script)"
                        echo "  --debug (will run the script as normal, but will not"
-                       echo "       delete $FILE)"
+                       echo "       delete ${FILE})"
                        exit 0
                        ;;
        esac
@@ -765,7 +870,7 @@ if [ -n "$1" ]; then
        done
 fi
 
-if [ "$PROCEED" = "no" ]; then
+if [ "$PROCEED" = no ]; then
        exit 1
 fi
 
@@ -773,92 +878,118 @@ if [ -z "$WITHALL" ]; then
        withall
 fi
 
-if [ "$UPLOAD" = "ask" ]; then
+# Check if wget is installed, and supports --post-file.
+if ! wget --help 2>/dev/null | grep -q post-file; then
+       # We couldn't find a suitable wget. If --upload was passed, tell the user to upload manually.
+       if [ "$UPLOAD" != yes ]; then
+               :
+       elif [ -n "$DIALOG" ]; then
+               if [ -z "$PASTEBIN" ]; then
+                       dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to 'https://www.alsa-project.org'.\nPossible reasons are:\n\n    1. Couldn't find 'wget' in your PATH\n    2. Your version of wget is less than 1.8.2\n\nPlease manually upload $NFILE to 'https://www.alsa-project.org/cardinfo-db' and submit your post." 25 100
+               else
+                       dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to 'https://www.pastebin.ca'.\nPossible reasons are:\n\n    1. Couldn't find 'wget' in your PATH\n    2. Your version of wget is less than 1.8.2\n\nPlease manually upload $NFILE to 'https://www.pastebin.ca/upload.php' and submit your post." 25 100
+               fi
+       else
+               if [ -z "$PASTEBIN" ]; then
+                       echo ""
+                       echo "Could not automatically upload output to 'https://www.alsa-project.org'"
+                       echo "Possible reasons are:"
+                       echo "    1. Couldn't find 'wget' in your PATH"
+                       echo "    2. Your version of wget is less than 1.8.2"
+                       echo ""
+                       echo "Please manually upload $NFILE to 'https://www.alsa-project.org/cardinfo-db' and submit your post."
+                       echo ""
+               else
+                       echo ""
+                       echo "Could not automatically upload output to 'https://www.pastebin.ca'"
+                       echo "Possible reasons are:"
+                       echo "    1. Couldn't find 'wget' in your PATH"
+                       echo "    2. Your version of wget is less than 1.8.2"
+                       echo ""
+                       echo "Please manually upload $NFILE to 'https://www.pastebin.ca/upload.php' and submit your post."
+                       echo ""
+               fi
+       fi
+       UPLOAD=no
+fi
+
+if [ "$UPLOAD" = ask ]; then
        if [ -n "$DIALOG" ]; then
                dialog --backtitle "$BGTITLE" --title "Information collected" --yes-label " UPLOAD / SHARE " --no-label " SAVE LOCALLY " --defaultno --yesno "\n\nAutomatically upload ALSA information to $WWWSERVICE?" 10 80
-               DIALOG_EXIT_CODE=$?
-               if [ $DIALOG_EXIT_CODE != 0 ]; then
-                       UPLOAD="no"
+               DIALOG_EXIT_CODE="$?"
+               if [ "$DIALOG_EXIT_CODE" != 0 ]; then
+                       UPLOAD=no
                else
-                       UPLOAD="yes"
+                       UPLOAD=yes
                fi
        else
                echo -n "Automatically upload ALSA information to $WWWSERVICE? [y/N] : "
                read -e CONFIRM
-               if [ "$CONFIRM" != "y" ]; then
-                       UPLOAD="no"
+               if [ "$CONFIRM" != y ]; then
+                       UPLOAD=no
                else
-                       UPLOAD="yes"
+                       UPLOAD=yes
                fi
        fi
 
 fi
 
-if [ "$UPLOAD" = "no" ]; then
+if [ "$UPLOAD" = no ]; then
 
-       if [ -z "$TOSTDOUT" ]; then
-               mv -f $FILE $NFILE || exit 1
-               KEEP_OUTPUT="yes"
-       fi
+       mv -f "$FILE" "$NFILE" || exit 1
+       KEEP_OUTPUT=yes
 
-       if [[ -n $DIALOG ]]
+       if [[ -n "$DIALOG" ]]
        then
-               if [[ -n $PBERROR ]]; then
-                       dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occurred while contacting the $WWWSERVICE.\n Your information was NOT automatically uploaded.\n\nYour ALSA information is in $NFILE" 10 100
-               else
-                       dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "\n\nYour ALSA information is in $NFILE" 10 60
-               fi
+               dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "\n\nYour ALSA information is in $NFILE" 10 60
        else
-               echo
-
-               if [[ -n $PBERROR ]]; then
-                       echo "An error occurred while contacting the $WWWSERVICE."
-                       echo "Your information was NOT automatically uploaded."
-                       echo ""
-                       echo "Your ALSA information is in $NFILE"
-                       echo ""
-               else
-                       if [ -z "$TOSTDOUT" ]; then
-                               echo ""
-                               echo "Your ALSA information is in $NFILE"
-                               echo ""
-                       fi
-               fi
+               echo ""
+               echo "Your ALSA information is in $NFILE"
+               echo ""
        fi
 
        exit
 
 fi # UPLOAD
 
-#Test that wget is installed, and supports --post-file. Upload $FILE if it does, and prompt user to upload file if it doesnt. 
-if
-WGET=$(which wget 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null); [[ -n "${WGET}" ]] && [[ -x "${WGET}" ]] && [[ `wget --help |grep post-file` ]]
-then
-
-if [[ -n $DIALOG ]]
+if [[ -n "$DIALOG" ]]
 then
+       dialog --backtitle "$BGTITLE" --infobox "Uploading information to $WWWSERVICE ..." 6 70
+else
+       echo -n "Uploading information to $WWWSERVICE ..."
+fi
 
-if [[ -z $PASTEBIN ]]; then
-       wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://www.alsa-project.org/cardinfo-db/" &>$TEMPDIR/wget.tmp || echo "Upload failed; exit"
-       { for i in 10 20 30 40 50 60 70 80 90; do
-               echo $i
-               sleep 0.2
-       done
-       echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.alsa-project.org ..." 6 70 0
+if [[ -z "$PASTEBIN" ]]; then
+       wget -O - --tries=5 --timeout=60 --post-file="$FILE" 'https://www.alsa-project.org/cardinfo-db/' &> "$TEMPDIR/wget.tmp"
 else
-       wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY&encrypt=t&encryptpw=blahblah" &>$TEMPDIR/wget.tmp || echo "Upload failed; exit"
-       { for i in 10 20 30 40 50 60 70 80 90; do
-               echo $i
-               sleep 0.2
-       done
-       echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.pastebin.ca ..." 6 70 0
+       wget -O - --tries=5 --timeout=60 --post-file="$FILE" 'https://pastebin.ca/quiet-paste.php?api='"${PASTEBINKEY}"'&encrypt=t&encryptpw=blahblah' &> "$TEMPDIR/wget.tmp"
 fi
 
+if [ "$?" -ne 0 ]; then
+       mv -f "$FILE" "$NFILE" || exit 1
+       KEEP_OUTPUT=yes
+
+       if [ -n "$DIALOG" ]; then
+               dialog --backtitle "$BGTITLE" --title "Information not uploaded" --msgbox "An error occurred while contacting $WWWSERVICE.\n Your information was NOT automatically uploaded.\n\nYour ALSA information is in $NFILE" 10 100
+       else
+               echo ""
+               echo "An error occurred while contacting $WWWSERVICE."
+               echo "Your information was NOT automatically uploaded."
+               echo ""
+               echo "Your ALSA information is in $NFILE"
+               echo ""
+       fi
+
+       exit
+fi
+
+if [ -n "$DIALOG" ]; then
+
 dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100 
-DIALOG_EXIT_CODE=$?
-if [ $DIALOG_EXIT_CODE = 0 ]; then
-       grep -v "alsa-info.txt" $FILE >$TEMPDIR/uploaded.txt
-       dialog --backtitle "$BGTITLE" --textbox $TEMPDIR/uploaded.txt 0 0
+DIALOG_EXIT_CODE="$?"
+if [ "$DIALOG_EXIT_CODE" = 0 ]; then
+       grep -v alsa-info.txt "$FILE" > "$TEMPDIR/uploaded.txt"
+       dialog --backtitle "$BGTITLE" --textbox "$TEMPDIR/uploaded.txt" 0 0
 fi
 
 clear
@@ -866,78 +997,23 @@ clear
 # no dialog
 else
 
-if [[ -z $PASTEBIN ]]; then
-       echo -n "Uploading information to www.alsa-project.org ... " 
-       wget -O - --tries=5 --timeout=60 --post-file=$FILE http://www.alsa-project.org/cardinfo-db/ &>$TEMPDIR/wget.tmp &
-else
-       echo -n "Uploading information to www.pastebin.ca ... " 
-       wget -O - --tries=5 --timeout=60 --post-file=$FILE http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY &>$TEMPDIR/wget.tmp &
-fi
-
-#Progess spinner for wget transfer.
-i=1
-sp="/-\|"
-echo -n ' '
-while pgrep wget &>/dev/null
-do
-       echo -en "\b${sp:i++%${#sp}:1}"
-done
-
-echo -e "\b Done!"
+echo -e " Done!"
 echo ""
 
-fi #dialog
+fi # dialog
 
-#See if tput is available, and use it if it is.        
-if [ -n "$TPUT" ]; then
-       if [[ -z $PASTEBIN ]]; then
-               FINAL_URL=`tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2 ; tput sgr0`
-       else
-               FINAL_URL=`tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p';tput sgr0`
-       fi
+if [ -z "$PASTEBIN" ]; then
+       FINAL_URL="$(grep 'SUCCESS:' "$TEMPDIR/wget.tmp" | cut -d ' ' -f 2)"
 else
-       if [[ -z $PASTEBIN ]]; then
-               FINAL_URL=`grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2`
-       else
-               FINAL_URL=`grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'`
-       fi
+       FINAL_URL="$(grep 'SUCCESS:' "$TEMPDIR/wget.tmp" | sed -n 's/.*\:\([0-9]\+\).*/https:\/\/pastebin.ca\/\1/p')"
+fi
+
+# See if tput is available, and use it if it is.
+if [ -x "$TPUT" ]; then
+       FINAL_URL="$(tput setaf 1; printf '%s' "$FINAL_URL"; tput sgr0)"
 fi
 
 # Output the URL of the uploaded file. 
 echo "Your ALSA information is located at $FINAL_URL"
 echo "Please inform the person helping you."
 echo ""
-
-# We couldnt find a suitable wget, so tell the user to upload manually.
-else
-       mv -f $FILE $NFILE || exit 1
-       KEEP_OUTPUT="yes"
-       if [[ -z $DIALOG ]]
-       then
-               if [[ -z $PASTEBIN ]]; then
-               echo ""
-               echo "Could not automatically upload output to http://www.alsa-project.org"
-               echo "Possible reasons are:"
-               echo "    1. Couldnt find 'wget' in your PATH"
-               echo "    2. Your version of wget is less than 1.8.2"
-               echo ""
-               echo "Please manually upload $NFILE to http://www.alsa-project.org/cardinfo-db/ and submit your post."
-               echo ""
-               else
-               echo ""
-               echo "Could not automatically upload output to http://www.pastebin.ca"
-               echo "Possible reasons are:"
-               echo "    1. Couldnt find 'wget' in your PATH"
-               echo "    2. Your version of wget is less than 1.8.2"
-               echo ""
-               echo "Please manually upload $NFILE to http://www.pastebin.ca/upload.php and submit your post."
-               echo ""
-               fi
-       else
-               if [[ -z $PASTEBIN ]]; then
-                       dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.alsa-project.org.\nPossible reasons are:\n\n    1. Couldn't find 'wget' in your PATH\n    2. Your version of wget is less than 1.8.2\n\nPlease manually upload $NFILE to http://www.alsa-project,org/cardinfo-db/ and submit your post." 25 100
-               else
-                       dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.pastebin.ca.\nPossible reasons are:\n\n    1. Couldn't find 'wget' in your PATH\n    2. Your version of wget is less than 1.8.2\n\nPlease manually upload $NFILE to http://www.pastebin.ca/upload.php and submit your post." 25 100
-               fi
-       fi
-fi
diff --git a/alsa-info/alsa-info.sh.1 b/alsa-info/alsa-info.sh.1
new file mode 100644 (file)
index 0000000..7168b3e
--- /dev/null
@@ -0,0 +1,62 @@
+.TH ALSA-INFO.SH 1 "13 January 2016"
+.SH NAME
+alsa-info.sh \- command\-line utility to gather information about
+the ALSA subsystem
+.SH SYNOPSIS
+\fBalsa-info.sh\fP [\fIoptions\fP]
+
+.SH DESCRIPTION
+\fBalsa-info.sh\fP is a command\-line utility gathering information
+about the ALSA subsystem. It is used mostly for debugging purposes.
+
+.SH OPTIONS
+.TP
+\fI\-\-upload\fP
+Upload contents to the server (www.alsa-project.org or pastebin.ca).
+.TP
+\fI\-\-no-upload\fP
+Do not upload contents to the remote server.
+.TP
+\fI\-\-stdout\fP
+Print information to standard output.
+.TP
+\fI\-\-output FILE\fP
+Specify file for output in no-upload mode.
+.TP
+\fI\-\-debug\fP
+Run utility as normal, but will not delete file (usually
+/tmp/alsa-info.txt).
+.TP
+\fI\-\-with-aplay\fP
+Includes output from \fIaplay -l\fP.
+.TP
+\fI\-\-with-amixer\fP
+Includes output from \fIamixer\fP.
+.TP
+\fI\-\-with-alsactl\fP
+Includes output from \fIalsactl\fP.
+.TP
+\fI\-\-with-configs\fP
+Includes output from ~/.asoundrc and /etc/asound.conf if they exist.
+.TP
+\fI\-\-update\fP
+Check server for updates.
+.TP
+\fI\-\-about\fP
+Print information about authors.
+
+.SH EXAMPLES
+
+.TP
+\fBalsa-info.sh \-\-no-upload\fR
+Will gather all information and show the output file.
+
+.SH SEE ALSO
+\fB
+aplay(1)
+amixer(1)
+alsactl(1)
+\fP
+
+.SH AUTHOR
+\fBalsa-info.sh\fP was created by the ALSA team, see \fI\-\-about\fP .
index 893ebb3..a11b08f 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,17 +89,19 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = alsaconf
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/alsaconf.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES = alsaconf
@@ -95,15 +135,28 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
 SCRIPTS = $(sbin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -114,12 +167,33 @@ NROFF = nroff
 MANS = $(man_MANS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       distdir
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/alsaconf.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -151,7 +225,11 @@ ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -169,11 +247,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -185,27 +270,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -218,6 +313,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -226,6 +322,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -236,7 +334,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -277,6 +377,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -287,7 +389,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 sbin_SCRIPTS = alsaconf
 man_MANS = alsaconf.8 alsaconf.fr.8
 EXTRA_DIST = $(man_MANS)
@@ -307,14 +409,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign alsaconf/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign alsaconf/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -363,20 +464,25 @@ uninstall-sbinSCRIPTS:
               sed -e 's,.*/,,;$(transform)'`; \
        dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir)
 
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run 'make' without going through this Makefile.
 # To change the values of 'make' variables: instead of editing Makefiles,
 # (1) if the variable is set in 'config.status', edit 'config.status'
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        case "$@" in \
@@ -397,31 +503,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
-cscopelist-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-       done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -437,12 +525,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -454,15 +537,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -471,9 +550,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
 
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -489,20 +569,10 @@ cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -597,7 +667,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-recursive
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-recursive
        -rm -f Makefile
@@ -649,7 +719,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-recursive
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-recursive
 
@@ -663,24 +733,24 @@ uninstall-am: uninstall-man uninstall-sbinSCRIPTS
 
 uninstall-man: uninstall-man8
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
-       cscopelist-recursive ctags-recursive install-am install-strip \
-       tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-am clean clean-generic cscopelist \
-       cscopelist-recursive ctags ctags-recursive distclean \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-man8 install-pdf \
-       install-pdf-am install-ps install-ps-am install-sbinSCRIPTS \
-       install-strip installcheck installcheck-am installdirs \
-       installdirs-am maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
-       tags-recursive uninstall uninstall-am uninstall-man \
-       uninstall-man8 uninstall-sbinSCRIPTS
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool cscopelist-am ctags \
+       ctags-am distclean distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-man8 install-pdf install-pdf-am install-ps \
+       install-ps-am install-sbinSCRIPTS install-strip installcheck \
+       installcheck-am installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am uninstall-man uninstall-man8 \
+       uninstall-sbinSCRIPTS
+
+.PRECIOUS: Makefile
 
 
 install-man8:
index f1fa9aa..ff163bc 100644 (file)
@@ -1,4 +1,4 @@
-POFILES = ja.po ru.po
+POFILES = ja.po ka.po ru.po
 
 DOMAIN = alsaconf
 GETTEXT_SRC = ../alsaconf.in
diff --git a/alsaconf/po/ka.po b/alsaconf/po/ka.po
new file mode 100644 (file)
index 0000000..a9815c7
--- /dev/null
@@ -0,0 +1,378 @@
+# Georgian translation for alsaconf.
+# Copyright (C) 2022 alsaconf's authors
+# This file is distributed under the same license as the alsaconf package.
+# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2022.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: alsaconf\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2022-10-22 22:12+0200\n"
+"PO-Revision-Date: 2022-10-22 22:41+0200\n"
+"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
+"Language-Team: Georgian <(nothing)>\n"
+"Language: ka\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 3.2\n"
+
+#: ../alsaconf.in:36
+msgid "-s"
+msgstr "-s"
+
+#: ../alsaconf.in:82
+msgid "ALSA configurator"
+msgstr "ALSA -ის მორგება"
+
+#: ../alsaconf.in:84
+msgid ""
+"usage: alsaconf [options]\n"
+"  -l|--legacy    check only legacy non-isapnp cards\n"
+"  -m|--modinfo   read module descriptions instead of reading card db\n"
+"  -s|--sound wav-file\n"
+"                 use the specified wav file as a test sound\n"
+"  -u|--uid uid   set the uid for the ALSA devices (default = 0) "
+"[obsoleted]\n"
+"  -g|--gid gid   set the gid for the ALSA devices (default = 0) "
+"[obsoleted]\n"
+"  -d|--devmode mode\n"
+"                 set the permission for ALSA devices (default = 0666) "
+"[obs.]\n"
+"  -r|--strict    set strict device mode (equiv. with -g 17 -d 0660) "
+"[obsoleted]\n"
+"  -L|--log file  logging on the specified file (for debugging purpose "
+"only)\n"
+"  -p|--probe card-name\n"
+"                 probe a legacy non-isapnp card and print module options\n"
+"  -P|--listprobe list the supported legacy card modules\n"
+"  -c|--config file\n"
+"                 specify the module config file\n"
+"  -R|--resources list available DMA and IRQ resources with debug for "
+"legacy\n"
+"  -h|--help      what you're reading"
+msgstr ""
+"გამოყენება: alsaconf [პარამეტრები]\n"
+"  -l|--legacy    მხოლოდ მოძველებული არა-isanpn ბარათების ძებნა\n"
+"  -m|--modinfo   ბარათების ბაზის მაგიერ მოდულების აღწერების წაკითხვა\n"
+"  -s|--sound wav-file\n"
+"                 სატესტო ხმად მითითებული WAV ფაილის გამოყენება\n"
+"  -u|--uid uid   ALSA -ის მოწყობილობების UID-ის მითითება (ნაგულისხმები = 0) "
+"[მოძველებულია]\n"
+"  -g|--gid gid   ALSA -ის მოწყობილობების GID-ის მითითება (ნაგულისხმები = 0) "
+"[მოძველებულია]\n"
+"  -d|--devmode რეჟიმი\n"
+"                 ALSA-ის მოწყობილობების ფაილების წვდომის მითითება "
+"(ნაგულისხმები = 0666) [მოძველებულია]\n"
+"  -r|--strict    მკაცრი მოწყობილობის რეჟიმი (იგივე, რაც -g 17 -d 0660) "
+"[მოძველებულია]\n"
+"  -L|--log ფაილი  ჟურნალის მითითებულ ფაილში ჩაწერა (მხოლოდ გამართვისას)\n"
+"  -p|--probe card-name\n"
+"                 მოძველებული არა-isanpnp ბარათების ძებნა და მოდულების "
+"პარამეტრების გამოტანა\n"
+"  -P|--listprobe მხარდაჭერილი მოძველებული ბარათების მოდულების ჩამონათვალი\n"
+"  -c|--config ფაილი\n"
+"                 მოდულის კონფიგურაციის ფაილის მითითება\n"
+"  -R|--resources ხელმისაწვდომი DMA და IRQ რესურსების ჩამონათვალი. მხოლოდ "
+"გამართვისთვის\n"
+"  -h|--help      რასაც კითხულობთ"
+
+#: ../alsaconf.in:254
+msgid "You must be root to use this script."
+msgstr "ამ სკრიპტის გამოსაყენებლად root-ის პრივილეგიებია საჭირო."
+
+#: ../alsaconf.in:298
+msgid "ERROR: The config file doesn't exist: "
+msgstr "შეცდომა: კონფიგურაციის ფაილი არ არსებობს: "
+
+#: ../alsaconf.in:352
+msgid "Error, dialog or whiptail not found."
+msgstr "შეცდომა: dialog და whiptail აღმოჩენილი არაა."
+
+#: ../alsaconf.in:358
+msgid "Error, awk not found. Can't continue."
+msgstr "შეცდომა: awk დაყენებული არაა. გაგრძელება შეუძლებელია."
+
+#: ../alsaconf.in:463
+msgid ""
+"\n"
+"                   ALSA  CONFIGURATOR\n"
+"                   version %s\n"
+"\n"
+"            This script is a configurator for\n"
+"    Advanced Linux Sound Architecture (ALSA) driver.\n"
+"\n"
+"\n"
+"  If ALSA is already running, you should close all sound\n"
+"  apps now and stop the sound driver.\n"
+"  alsaconf will try to do this, but it's not 100%% sure."
+msgstr ""
+"\n"
+"                   ALSA  -ის მომრგები\n"
+"                   ვერსია %s\n"
+"\n"
+"\t\t\t\t\tეს სკრიპტი \n"
+"    Advanced Linux Sound Architecture (ALSA) დრაივერის მორგებისთვისაა.\n"
+"\n"
+"\n"
+"  თუ ALSA უკვე გაშვებულია, თქვენ უნდა დახუროთ ხმის ყველა აპლიკაცია და\n"
+"  გააჩეროთ ხმის ბარათის დრაივერი.\n"
+"  alsaconf -ი ცდის, ეს გააკეთოს, მაგრამ პროცედურა 100%% -ით ყოველთვის არ "
+"მუშაობს."
+
+#: ../alsaconf.in:479
+msgid ""
+"\n"
+"\n"
+"     OK, sound driver is configured.\n"
+"\n"
+"                  ALSA  CONFIGURATOR\n"
+"\n"
+"          will prepare the card for playing now.\n"
+"\n"
+"     Now I'll run alsasound init script, then I'll use\n"
+"     amixer to raise the default volumes.\n"
+"     You can change the volume later via a mixer\n"
+"     program such as alsamixer or gamix.\n"
+"  \n"
+"  "
+msgstr ""
+"\n"
+"\n"
+"     ხმის ბარათის დრაივერის კონფიგურაცია დასრულდა.\n"
+"\n"
+"                ALSA -ის მომრგები\n"
+"\n"
+"       მოამზადებს ბარათს.\n"
+"\n"
+"    ახლა გავუშვებ alsasound-ის init-ის სკრიპტს, შემდეგ კი\n"
+"    amixer-ით ხმის სიძლიერეს ნაგულისხმებ დონეზე დავაყენებ.\n"
+"    ხმის სიძლიერის შეცვლა მოგვიანებით მიქსერის რომელიმე პროგრამით,\n"
+"    როგორიცაა alsamixer და gamix, შეგიძლიათ.\n"
+"  "
+
+#: ../alsaconf.in:544 ../alsaconf.in:549 ../alsaconf.in:554 ../alsaconf.in:559
+msgid "Can't create temp file, exiting..."
+msgstr "დროებითი ფაილების შექმნის შეცდომა. მუშაობის დასრულება..."
+
+#: ../alsaconf.in:669
+msgid "Building card database.."
+msgstr "ბარათების ბაზის აგება.."
+
+#: ../alsaconf.in:673
+msgid "No card database is found.."
+msgstr "ბარათების ბაზა ვერ ვიპოვე.."
+
+#: ../alsaconf.in:678
+msgid "Searching sound cards"
+msgstr "ხმის ბარათების ძებნა"
+
+#: ../alsaconf.in:832
+msgid ""
+"\n"
+"Configuring %s\n"
+"Do you want to modify %s (and %s if present)?"
+msgstr ""
+"\n"
+"%s-ის მორგება\n"
+"გნებავთ, შეცვალოთ %s (და %s, თუ ის არსებობს)?"
+
+#: ../alsaconf.in:837
+msgid ""
+"\n"
+"Configuring %s\n"
+"Do you want to modify %s?"
+msgstr ""
+"\n"
+"%s-ის მორგება\n"
+"გნებავთ, შეცვალოთ %s?"
+
+#: ../alsaconf.in:928
+msgid "Running update-modules..."
+msgstr "\"update-modules\"-ის გაშვება.."
+
+#: ../alsaconf.in:943
+msgid ""
+"\n"
+"       The mixer is set up now for for playing.\n"
+"       Shall I try to play a sound sample now?\n"
+"\n"
+"                           NOTE:\n"
+"If you have a big amplifier, lower your volumes or say no.\n"
+"    Otherwise check that your speaker volume is open,\n"
+"          and look if you can hear test sound.\n"
+msgstr ""
+"\n"
+"      მიქსერი ახლა დაკვრისთვის მზადაა.\n"
+"      დავუკრა სატესტო ხმა?\n"
+"\n"
+"                   გაფრთხილება:\n"
+"თუ დიდი გამაძლიერებელი გაქვთ, ჩაუწიეთ ხმას, ან აირჩიეთ \"არა\".\n"
+"    სხვა შემთხვევაში შეამოწმეთ, რომ დინამიკს ხმა ჩართული ჰქონდეს\n"
+"  და ნახეთ, გაიგებთ თუ არა ხმას.\n"
+
+#: ../alsaconf.in:961
+msgid ""
+"Saving the mixer setup used for this in @ASOUND_STATE_DIR@/asound.state."
+msgstr ""
+"ამისთვის გამოყენებული მიქსერის პარამეტრები @ASOUND_STATE_DIR@/asound.state -"
+"ში შეინახება."
+
+#: ../alsaconf.in:965
+msgid ""
+"\n"
+"===============================================================================\n"
+"\n"
+" Now ALSA is ready to use.\n"
+" For adjustment of volumes, use your favorite mixer.\n"
+"\n"
+" Have a lot of fun!\n"
+"\n"
+msgstr ""
+"\n"
+"===============================================================================\n"
+"\n"
+"ახლა ALSA გამოყენებისთვის მზადაა.\n"
+"ხმის ასაწევ ჩასაწევად თქვენი საყვარელი მიქსერის გამოყენება შეგიძლიათ.\n"
+"\n"
+"გაერთეთ!\n"
+"\n"
+
+#: ../alsaconf.in:1273
+msgid "WARNING"
+msgstr "გაფრთხილება"
+
+#: ../alsaconf.in:1274
+msgid ""
+"\n"
+"   Probing legacy ISA cards might make\n"
+"   your system unstable.\n"
+"\n"
+"        Do you want to proceed?\n"
+"\n"
+msgstr ""
+"\n"
+"   მიმდინარეობს მოძველებული ISA ბარათების ძებნა. ამან\n"
+"   თქვენი სისტემა არასტაბილური შეიძლება გახადოს.\n"
+"\n"
+"        გნებავთ, გააგრძელოთ?\n"
+"\n"
+
+#: ../alsaconf.in:1297
+msgid ""
+"No legacy drivers are available\n"
+"   for your machine"
+msgstr ""
+"თქვენი მანქანისთვის მოძველებული\n"
+"დრაივერები აღმოჩენილი არაა"
+
+#: ../alsaconf.in:1302
+msgid "Driver Selection"
+msgstr "დრაივერის არჩევანი"
+
+#: ../alsaconf.in:1303
+msgid ""
+"           Probing legacy ISA cards\n"
+"\n"
+"        Please select the drivers to probe:"
+msgstr ""
+"         მოძველებული ISA ბარათების ძებნა\n"
+"\n"
+"      აირჩიეთ ჩასატვირთი დრაივერები:"
+
+#: ../alsaconf.in:1310
+msgid ""
+"\n"
+" Shall I try all possible DMA and IRQ combinations?\n"
+" With this option, some unconventional configuration\n"
+" might be found, but it will take much longer time."
+msgstr ""
+"\n"
+"ვცადო DMA/IRQ-ის ყველა შესაძლო კომბინაცია?\n"
+"ამ პარამეტრით შეიძლება უჩვეულო კომბინაციებიც აღმოაჩნინოთ\n"
+"მაგრამ მას გაცილებით მეტი დრო სჭირდება."
+
+#: ../alsaconf.in:1320
+msgid "Probing legacy cards..   This may take a few minutes.."
+msgstr ""
+"მოძველებული ხმის ბარათების ძებნა.    ამას რამდენიმე წუთი შეიძლება "
+"დასჭირდეს.."
+
+#: ../alsaconf.in:1321
+msgid "Probing: "
+msgstr "ძებნა: "
+
+#: ../alsaconf.in:1327
+msgid " : FOUND!!"
+msgstr " : ვიპოვე!!"
+
+#: ../alsaconf.in:1333
+msgid "Result"
+msgstr "შედეგი"
+
+#: ../alsaconf.in:1334
+msgid "No legacy cards found"
+msgstr "მოძველებული ბარათები ვერ ვიპოვე"
+
+#: ../alsaconf.in:1393
+msgid ""
+"\n"
+" Looks like you having a Thinkpad 600E or 770 notebook.\n"
+" On this notebook, CS4236 driver should be used\n"
+" although CS46xx chip is detected.\n"
+"\n"
+" Shall I try to snd-cs4236 driver and probe\n"
+" the legacy ISA configuration?"
+msgstr ""
+"\n"
+"როგორც ჩანს, თქვენ Thinkpad 600E ან 770 ნოუთბუქი გაქვთ.\n"
+"ამ ნოუთბუქზე CS46xx ჩიპის მაგიერ CS4236 დრაივერის გამოყენებაა საჭირო\n"
+"\n"
+"ვცადო snd-cs4236 დრაივერი და მოვძებნო\n"
+"მოძველებული ICS კონფიგურაცია?"
+
+#: ../alsaconf.in:1407
+msgid ""
+"\n"
+" Looks like you having a Dell Dimension machine.\n"
+" On this machine, CS4232 driver should be used\n"
+" although CS46xx chip is detected.\n"
+"\n"
+" Shall I try to snd-cs4232 driver and probe\n"
+" the legacy ISA configuration?"
+msgstr ""
+"\n"
+"როგორც ჩანს, თქვენ Dell Dimension მანქანა გაქვთ.\n"
+"ამ მანქანაზე CS46xx ჩიპის მაგიერ CS4232 დრაივერის გამოყენებაა საჭირო\n"
+"\n"
+"ვცადო snd-cs4232 დრაივერი და მოვძებნო\n"
+"მოძველებული ICS კონფიგურაცია?"
+
+#: ../alsaconf.in:1424
+msgid "Soundcard Selection"
+msgstr "ხმის ბარათის არჩევანი"
+
+#: ../alsaconf.in:1425
+msgid ""
+"\n"
+"         Following card(s) are found on your system.\n"
+"         Choose a soundcard to configure:\n"
+msgstr ""
+"\n"
+"          თქვენს სისტემაში შემდეგი ხმის ბარათებია ნაპოვნი.\n"
+"          აირჩიეთ მოსარგები ხმის ბარათი:\n"
+
+#: ../alsaconf.in:1438
+msgid ""
+"\n"
+"        No supported PnP or PCI card found.\n"
+"\n"
+" Would you like to probe legacy ISA sound cards/chips?\n"
+"\n"
+msgstr ""
+"\n"
+"         მხარდაჭერილი PnP და PCI ბარათები აღმოჩენილი არაა.\n"
+"\n"
+"გნებავთ მოძველებული ISA ხმოვანი ბარათების/ჩიპების მოძებნა?\n"
+"\n"
index c0c1b23..1a411c9 100644 (file)
@@ -2,7 +2,7 @@ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", TEST==
 GOTO="alsa_restore_end"
 
 LABEL="alsa_restore_go"
-TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $attr{device/number}"
-TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $attr{device/number}"
+TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $devnode"
+TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $devnode"
 
 LABEL="alsa_restore_end"
index 47f06e9..fb32c4f 100644 (file)
@@ -7,12 +7,17 @@ man_MANS += alsactl_init.7
 endif
 EXTRA_DIST=alsactl.1 alsactl_init.xml
 
-alsactl_SOURCES=alsactl.c state.c lock.c utils.c init_parse.c daemon.c \
-                monitor.c
+AM_CFLAGS = -D_GNU_SOURCE
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+
+alsactl_SOURCES=alsactl.c state.c lock.c utils.c init_parse.c init_ucm.c \
+               daemon.c monitor.c clean.c info.c
 
 alsactl_CFLAGS=$(AM_CFLAGS) -D__USE_GNU \
                -DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\" \
-               -DSYS_LOCKFILE=\"$(ASOUND_LOCK_DIR)/asound.state.lock\" \
+               -DSYS_LOCKPATH=\"$(ASOUND_LOCK_DIR)\" \
+               -DSYS_LOCKFILE=\"asound.state.lock\" \
                -DSYS_PIDFILE=\"$(ALSACTL_PIDFILE_DIR)/alsactl.pid\"
 
 noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c \
@@ -25,20 +30,15 @@ if HAVE_SYSTEMD
 
 systemdsystemunit_DATA = \
        alsa-state.service \
-       alsa-restore.service \
-       alsa-store.service
+       alsa-restore.service
 
 install-data-hook:
        $(MKDIR_P) -m 0755 \
-               $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants \
-               $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants
-       ( cd $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants && \
+               $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants
+       ( cd $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants && \
                rm -f alsa-state.service alsa-restore.service && \
                $(LN_S) ../alsa-state.service alsa-state.service && \
                $(LN_S) ../alsa-restore.service alsa-restore.service)
-       ( cd $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants && \
-               rm -f alsa-store.service && \
-               $(LN_S) ../alsa-store.service alsa-store.service )
 
 endif
 
@@ -46,6 +46,7 @@ edit = \
        $(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
                  -e 's,@mydatadir\@,$(mydatadir),g' \
                  -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
+                 -e 's,@asoundrcfile\@,$(ASOUND_STATE_DIR)/asound.state,g' \
                                                        < $< > $@ || rm $@
 
 alsa-state.service: alsa-state.service.in
@@ -54,22 +55,17 @@ alsa-state.service: alsa-state.service.in
 alsa-restore.service: alsa-restore.service.in
        $(edit)
 
-alsa-store.service: alsa-store.service.in
-       $(edit)
-
 90-alsa-restore.rules: 90-alsa-restore.rules.in
        $(edit)
 
 EXTRA_DIST += \
        alsa-state.service.in \
        alsa-restore.service.in \
-       alsa-store.service.in \
        90-alsa-restore.rules.in
 
 CLEANFILES = \
        alsa-state.service \
        alsa-restore.service \
-       alsa-store.service \
        90-alsa-restore.rules
 
 %.7: %.xml
index d9aba92..70fc582 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -55,17 +93,20 @@ host_triplet = @host@
 sbin_PROGRAMS = alsactl$(EXEEXT)
 @USE_XMLTO_TRUE@am__append_1 = alsactl_init.7
 subdir = alsactl
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -76,29 +117,68 @@ am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
 PROGRAMS = $(sbin_PROGRAMS)
 am_alsactl_OBJECTS = alsactl-alsactl.$(OBJEXT) alsactl-state.$(OBJEXT) \
        alsactl-lock.$(OBJEXT) alsactl-utils.$(OBJEXT) \
-       alsactl-init_parse.$(OBJEXT) alsactl-daemon.$(OBJEXT) \
-       alsactl-monitor.$(OBJEXT)
+       alsactl-init_parse.$(OBJEXT) alsactl-init_ucm.$(OBJEXT) \
+       alsactl-daemon.$(OBJEXT) alsactl-monitor.$(OBJEXT) \
+       alsactl-clean.$(OBJEXT) alsactl-info.$(OBJEXT)
 alsactl_OBJECTS = $(am_alsactl_OBJECTS)
 alsactl_LDADD = $(LDADD)
-alsactl_LINK = $(CCLD) $(alsactl_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-       $(LDFLAGS) -o $@
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+alsactl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(alsactl_CFLAGS) \
+       $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/alsactl-alsactl.Po \
+       ./$(DEPDIR)/alsactl-clean.Po ./$(DEPDIR)/alsactl-daemon.Po \
+       ./$(DEPDIR)/alsactl-info.Po ./$(DEPDIR)/alsactl-init_parse.Po \
+       ./$(DEPDIR)/alsactl-init_ucm.Po ./$(DEPDIR)/alsactl-lock.Po \
+       ./$(DEPDIR)/alsactl-monitor.Po ./$(DEPDIR)/alsactl-state.Po \
+       ./$(DEPDIR)/alsactl-utils.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(alsactl_SOURCES)
 DIST_SOURCES = $(alsactl_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -139,12 +219,33 @@ DATA = $(systemdsystemunit_DATA) $(udevrules_DATA)
 HEADERS = $(noinst_HEADERS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       distdir
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -176,7 +277,11 @@ ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -194,11 +299,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -210,27 +322,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -243,6 +365,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -251,6 +374,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -261,7 +386,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -302,6 +429,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -312,18 +441,20 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 SUBDIRS = init
 man_MANS = alsactl.1 $(am__append_1)
 EXTRA_DIST = alsactl.1 alsactl_init.xml alsa-state.service.in \
-       alsa-restore.service.in alsa-store.service.in \
-       90-alsa-restore.rules.in
-alsactl_SOURCES = alsactl.c state.c lock.c utils.c init_parse.c daemon.c \
-                monitor.c
+       alsa-restore.service.in 90-alsa-restore.rules.in
+AM_CFLAGS = -D_GNU_SOURCE
+AM_CPPFLAGS = -I$(top_srcdir)/include
+alsactl_SOURCES = alsactl.c state.c lock.c utils.c init_parse.c init_ucm.c \
+               daemon.c monitor.c clean.c info.c
 
 alsactl_CFLAGS = $(AM_CFLAGS) -D__USE_GNU \
                -DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\" \
-               -DSYS_LOCKFILE=\"$(ASOUND_LOCK_DIR)/asound.state.lock\" \
+               -DSYS_LOCKPATH=\"$(ASOUND_LOCK_DIR)\" \
+               -DSYS_LOCKFILE=\"asound.state.lock\" \
                -DSYS_PIDFILE=\"$(ALSACTL_PIDFILE_DIR)/alsactl.pid\"
 
 noinst_HEADERS = alsactl.h list.h init_sysdeps.c init_utils_string.c \
@@ -334,25 +465,24 @@ udevrules_DATA = \
 
 @HAVE_SYSTEMD_TRUE@systemdsystemunit_DATA = \
 @HAVE_SYSTEMD_TRUE@    alsa-state.service \
-@HAVE_SYSTEMD_TRUE@    alsa-restore.service \
-@HAVE_SYSTEMD_TRUE@    alsa-store.service
+@HAVE_SYSTEMD_TRUE@    alsa-restore.service
 
 edit = \
        $(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
                  -e 's,@mydatadir\@,$(mydatadir),g' \
                  -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
+                 -e 's,@asoundrcfile\@,$(ASOUND_STATE_DIR)/asound.state,g' \
                                                        < $< > $@ || rm $@
 
 CLEANFILES = \
        alsa-state.service \
        alsa-restore.service \
-       alsa-store.service \
        90-alsa-restore.rules
 
 all: all-recursive
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -365,14 +495,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign alsactl/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign alsactl/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -392,10 +521,12 @@ install-sbinPROGRAMS: $(sbin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -406,8 +537,8 @@ install-sbinPROGRAMS: $(sbin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -416,16 +547,24 @@ uninstall-sbinPROGRAMS:
        @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(sbindir)" && rm -f $$files
 
 clean-sbinPROGRAMS:
-       -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
+       @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 alsactl$(EXEEXT): $(alsactl_OBJECTS) $(alsactl_DEPENDENCIES) $(EXTRA_alsactl_DEPENDENCIES) 
        @rm -f alsactl$(EXEEXT)
-       $(alsactl_LINK) $(alsactl_OBJECTS) $(alsactl_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(alsactl_LINK) $(alsactl_OBJECTS) $(alsactl_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -433,125 +572,192 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-alsactl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-daemon.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-init_parse.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-lock.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-monitor.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-state.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-alsactl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-clean.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-daemon.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-info.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-init_parse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-init_ucm.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-monitor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-state.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsactl-utils.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 alsactl-alsactl.o: alsactl.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-alsactl.o -MD -MP -MF $(DEPDIR)/alsactl-alsactl.Tpo -c -o alsactl-alsactl.o `test -f 'alsactl.c' || echo '$(srcdir)/'`alsactl.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-alsactl.Tpo $(DEPDIR)/alsactl-alsactl.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='alsactl.c' object='alsactl-alsactl.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-alsactl.o -MD -MP -MF $(DEPDIR)/alsactl-alsactl.Tpo -c -o alsactl-alsactl.o `test -f 'alsactl.c' || echo '$(srcdir)/'`alsactl.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-alsactl.Tpo $(DEPDIR)/alsactl-alsactl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='alsactl.c' object='alsactl-alsactl.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-alsactl.o `test -f 'alsactl.c' || echo '$(srcdir)/'`alsactl.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-alsactl.o `test -f 'alsactl.c' || echo '$(srcdir)/'`alsactl.c
 
 alsactl-alsactl.obj: alsactl.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-alsactl.obj -MD -MP -MF $(DEPDIR)/alsactl-alsactl.Tpo -c -o alsactl-alsactl.obj `if test -f 'alsactl.c'; then $(CYGPATH_W) 'alsactl.c'; else $(CYGPATH_W) '$(srcdir)/alsactl.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-alsactl.Tpo $(DEPDIR)/alsactl-alsactl.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='alsactl.c' object='alsactl-alsactl.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-alsactl.obj -MD -MP -MF $(DEPDIR)/alsactl-alsactl.Tpo -c -o alsactl-alsactl.obj `if test -f 'alsactl.c'; then $(CYGPATH_W) 'alsactl.c'; else $(CYGPATH_W) '$(srcdir)/alsactl.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-alsactl.Tpo $(DEPDIR)/alsactl-alsactl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='alsactl.c' object='alsactl-alsactl.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-alsactl.obj `if test -f 'alsactl.c'; then $(CYGPATH_W) 'alsactl.c'; else $(CYGPATH_W) '$(srcdir)/alsactl.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-alsactl.obj `if test -f 'alsactl.c'; then $(CYGPATH_W) 'alsactl.c'; else $(CYGPATH_W) '$(srcdir)/alsactl.c'; fi`
 
 alsactl-state.o: state.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-state.o -MD -MP -MF $(DEPDIR)/alsactl-state.Tpo -c -o alsactl-state.o `test -f 'state.c' || echo '$(srcdir)/'`state.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-state.Tpo $(DEPDIR)/alsactl-state.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='state.c' object='alsactl-state.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-state.o -MD -MP -MF $(DEPDIR)/alsactl-state.Tpo -c -o alsactl-state.o `test -f 'state.c' || echo '$(srcdir)/'`state.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-state.Tpo $(DEPDIR)/alsactl-state.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='state.c' object='alsactl-state.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-state.o `test -f 'state.c' || echo '$(srcdir)/'`state.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-state.o `test -f 'state.c' || echo '$(srcdir)/'`state.c
 
 alsactl-state.obj: state.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-state.obj -MD -MP -MF $(DEPDIR)/alsactl-state.Tpo -c -o alsactl-state.obj `if test -f 'state.c'; then $(CYGPATH_W) 'state.c'; else $(CYGPATH_W) '$(srcdir)/state.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-state.Tpo $(DEPDIR)/alsactl-state.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='state.c' object='alsactl-state.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-state.obj -MD -MP -MF $(DEPDIR)/alsactl-state.Tpo -c -o alsactl-state.obj `if test -f 'state.c'; then $(CYGPATH_W) 'state.c'; else $(CYGPATH_W) '$(srcdir)/state.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-state.Tpo $(DEPDIR)/alsactl-state.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='state.c' object='alsactl-state.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-state.obj `if test -f 'state.c'; then $(CYGPATH_W) 'state.c'; else $(CYGPATH_W) '$(srcdir)/state.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-state.obj `if test -f 'state.c'; then $(CYGPATH_W) 'state.c'; else $(CYGPATH_W) '$(srcdir)/state.c'; fi`
 
 alsactl-lock.o: lock.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-lock.o -MD -MP -MF $(DEPDIR)/alsactl-lock.Tpo -c -o alsactl-lock.o `test -f 'lock.c' || echo '$(srcdir)/'`lock.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-lock.Tpo $(DEPDIR)/alsactl-lock.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lock.c' object='alsactl-lock.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-lock.o -MD -MP -MF $(DEPDIR)/alsactl-lock.Tpo -c -o alsactl-lock.o `test -f 'lock.c' || echo '$(srcdir)/'`lock.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-lock.Tpo $(DEPDIR)/alsactl-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='lock.c' object='alsactl-lock.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-lock.o `test -f 'lock.c' || echo '$(srcdir)/'`lock.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-lock.o `test -f 'lock.c' || echo '$(srcdir)/'`lock.c
 
 alsactl-lock.obj: lock.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-lock.obj -MD -MP -MF $(DEPDIR)/alsactl-lock.Tpo -c -o alsactl-lock.obj `if test -f 'lock.c'; then $(CYGPATH_W) 'lock.c'; else $(CYGPATH_W) '$(srcdir)/lock.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-lock.Tpo $(DEPDIR)/alsactl-lock.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lock.c' object='alsactl-lock.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-lock.obj -MD -MP -MF $(DEPDIR)/alsactl-lock.Tpo -c -o alsactl-lock.obj `if test -f 'lock.c'; then $(CYGPATH_W) 'lock.c'; else $(CYGPATH_W) '$(srcdir)/lock.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-lock.Tpo $(DEPDIR)/alsactl-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='lock.c' object='alsactl-lock.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-lock.obj `if test -f 'lock.c'; then $(CYGPATH_W) 'lock.c'; else $(CYGPATH_W) '$(srcdir)/lock.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-lock.obj `if test -f 'lock.c'; then $(CYGPATH_W) 'lock.c'; else $(CYGPATH_W) '$(srcdir)/lock.c'; fi`
 
 alsactl-utils.o: utils.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-utils.o -MD -MP -MF $(DEPDIR)/alsactl-utils.Tpo -c -o alsactl-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-utils.Tpo $(DEPDIR)/alsactl-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='utils.c' object='alsactl-utils.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-utils.o -MD -MP -MF $(DEPDIR)/alsactl-utils.Tpo -c -o alsactl-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-utils.Tpo $(DEPDIR)/alsactl-utils.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='utils.c' object='alsactl-utils.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
 
 alsactl-utils.obj: utils.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-utils.obj -MD -MP -MF $(DEPDIR)/alsactl-utils.Tpo -c -o alsactl-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-utils.Tpo $(DEPDIR)/alsactl-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='utils.c' object='alsactl-utils.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-utils.obj -MD -MP -MF $(DEPDIR)/alsactl-utils.Tpo -c -o alsactl-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-utils.Tpo $(DEPDIR)/alsactl-utils.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='utils.c' object='alsactl-utils.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
 
 alsactl-init_parse.o: init_parse.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-init_parse.o -MD -MP -MF $(DEPDIR)/alsactl-init_parse.Tpo -c -o alsactl-init_parse.o `test -f 'init_parse.c' || echo '$(srcdir)/'`init_parse.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-init_parse.Tpo $(DEPDIR)/alsactl-init_parse.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='init_parse.c' object='alsactl-init_parse.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-init_parse.o -MD -MP -MF $(DEPDIR)/alsactl-init_parse.Tpo -c -o alsactl-init_parse.o `test -f 'init_parse.c' || echo '$(srcdir)/'`init_parse.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-init_parse.Tpo $(DEPDIR)/alsactl-init_parse.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='init_parse.c' object='alsactl-init_parse.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-init_parse.o `test -f 'init_parse.c' || echo '$(srcdir)/'`init_parse.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-init_parse.o `test -f 'init_parse.c' || echo '$(srcdir)/'`init_parse.c
 
 alsactl-init_parse.obj: init_parse.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-init_parse.obj -MD -MP -MF $(DEPDIR)/alsactl-init_parse.Tpo -c -o alsactl-init_parse.obj `if test -f 'init_parse.c'; then $(CYGPATH_W) 'init_parse.c'; else $(CYGPATH_W) '$(srcdir)/init_parse.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-init_parse.Tpo $(DEPDIR)/alsactl-init_parse.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='init_parse.c' object='alsactl-init_parse.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-init_parse.obj -MD -MP -MF $(DEPDIR)/alsactl-init_parse.Tpo -c -o alsactl-init_parse.obj `if test -f 'init_parse.c'; then $(CYGPATH_W) 'init_parse.c'; else $(CYGPATH_W) '$(srcdir)/init_parse.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-init_parse.Tpo $(DEPDIR)/alsactl-init_parse.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='init_parse.c' object='alsactl-init_parse.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-init_parse.obj `if test -f 'init_parse.c'; then $(CYGPATH_W) 'init_parse.c'; else $(CYGPATH_W) '$(srcdir)/init_parse.c'; fi`
+
+alsactl-init_ucm.o: init_ucm.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-init_ucm.o -MD -MP -MF $(DEPDIR)/alsactl-init_ucm.Tpo -c -o alsactl-init_ucm.o `test -f 'init_ucm.c' || echo '$(srcdir)/'`init_ucm.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-init_ucm.Tpo $(DEPDIR)/alsactl-init_ucm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='init_ucm.c' object='alsactl-init_ucm.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-init_parse.obj `if test -f 'init_parse.c'; then $(CYGPATH_W) 'init_parse.c'; else $(CYGPATH_W) '$(srcdir)/init_parse.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-init_ucm.o `test -f 'init_ucm.c' || echo '$(srcdir)/'`init_ucm.c
+
+alsactl-init_ucm.obj: init_ucm.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-init_ucm.obj -MD -MP -MF $(DEPDIR)/alsactl-init_ucm.Tpo -c -o alsactl-init_ucm.obj `if test -f 'init_ucm.c'; then $(CYGPATH_W) 'init_ucm.c'; else $(CYGPATH_W) '$(srcdir)/init_ucm.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-init_ucm.Tpo $(DEPDIR)/alsactl-init_ucm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='init_ucm.c' object='alsactl-init_ucm.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-init_ucm.obj `if test -f 'init_ucm.c'; then $(CYGPATH_W) 'init_ucm.c'; else $(CYGPATH_W) '$(srcdir)/init_ucm.c'; fi`
 
 alsactl-daemon.o: daemon.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-daemon.o -MD -MP -MF $(DEPDIR)/alsactl-daemon.Tpo -c -o alsactl-daemon.o `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-daemon.Tpo $(DEPDIR)/alsactl-daemon.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='daemon.c' object='alsactl-daemon.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-daemon.o -MD -MP -MF $(DEPDIR)/alsactl-daemon.Tpo -c -o alsactl-daemon.o `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-daemon.Tpo $(DEPDIR)/alsactl-daemon.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='daemon.c' object='alsactl-daemon.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-daemon.o `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-daemon.o `test -f 'daemon.c' || echo '$(srcdir)/'`daemon.c
 
 alsactl-daemon.obj: daemon.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-daemon.obj -MD -MP -MF $(DEPDIR)/alsactl-daemon.Tpo -c -o alsactl-daemon.obj `if test -f 'daemon.c'; then $(CYGPATH_W) 'daemon.c'; else $(CYGPATH_W) '$(srcdir)/daemon.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-daemon.Tpo $(DEPDIR)/alsactl-daemon.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='daemon.c' object='alsactl-daemon.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-daemon.obj -MD -MP -MF $(DEPDIR)/alsactl-daemon.Tpo -c -o alsactl-daemon.obj `if test -f 'daemon.c'; then $(CYGPATH_W) 'daemon.c'; else $(CYGPATH_W) '$(srcdir)/daemon.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-daemon.Tpo $(DEPDIR)/alsactl-daemon.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='daemon.c' object='alsactl-daemon.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-daemon.obj `if test -f 'daemon.c'; then $(CYGPATH_W) 'daemon.c'; else $(CYGPATH_W) '$(srcdir)/daemon.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-daemon.obj `if test -f 'daemon.c'; then $(CYGPATH_W) 'daemon.c'; else $(CYGPATH_W) '$(srcdir)/daemon.c'; fi`
 
 alsactl-monitor.o: monitor.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-monitor.o -MD -MP -MF $(DEPDIR)/alsactl-monitor.Tpo -c -o alsactl-monitor.o `test -f 'monitor.c' || echo '$(srcdir)/'`monitor.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-monitor.Tpo $(DEPDIR)/alsactl-monitor.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='monitor.c' object='alsactl-monitor.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-monitor.o -MD -MP -MF $(DEPDIR)/alsactl-monitor.Tpo -c -o alsactl-monitor.o `test -f 'monitor.c' || echo '$(srcdir)/'`monitor.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-monitor.Tpo $(DEPDIR)/alsactl-monitor.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='monitor.c' object='alsactl-monitor.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-monitor.o `test -f 'monitor.c' || echo '$(srcdir)/'`monitor.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-monitor.o `test -f 'monitor.c' || echo '$(srcdir)/'`monitor.c
 
 alsactl-monitor.obj: monitor.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-monitor.obj -MD -MP -MF $(DEPDIR)/alsactl-monitor.Tpo -c -o alsactl-monitor.obj `if test -f 'monitor.c'; then $(CYGPATH_W) 'monitor.c'; else $(CYGPATH_W) '$(srcdir)/monitor.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsactl-monitor.Tpo $(DEPDIR)/alsactl-monitor.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='monitor.c' object='alsactl-monitor.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-monitor.obj -MD -MP -MF $(DEPDIR)/alsactl-monitor.Tpo -c -o alsactl-monitor.obj `if test -f 'monitor.c'; then $(CYGPATH_W) 'monitor.c'; else $(CYGPATH_W) '$(srcdir)/monitor.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-monitor.Tpo $(DEPDIR)/alsactl-monitor.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='monitor.c' object='alsactl-monitor.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-monitor.obj `if test -f 'monitor.c'; then $(CYGPATH_W) 'monitor.c'; else $(CYGPATH_W) '$(srcdir)/monitor.c'; fi`
+
+alsactl-clean.o: clean.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-clean.o -MD -MP -MF $(DEPDIR)/alsactl-clean.Tpo -c -o alsactl-clean.o `test -f 'clean.c' || echo '$(srcdir)/'`clean.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-clean.Tpo $(DEPDIR)/alsactl-clean.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='clean.c' object='alsactl-clean.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-clean.o `test -f 'clean.c' || echo '$(srcdir)/'`clean.c
+
+alsactl-clean.obj: clean.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-clean.obj -MD -MP -MF $(DEPDIR)/alsactl-clean.Tpo -c -o alsactl-clean.obj `if test -f 'clean.c'; then $(CYGPATH_W) 'clean.c'; else $(CYGPATH_W) '$(srcdir)/clean.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-clean.Tpo $(DEPDIR)/alsactl-clean.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='clean.c' object='alsactl-clean.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-clean.obj `if test -f 'clean.c'; then $(CYGPATH_W) 'clean.c'; else $(CYGPATH_W) '$(srcdir)/clean.c'; fi`
+
+alsactl-info.o: info.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-info.o -MD -MP -MF $(DEPDIR)/alsactl-info.Tpo -c -o alsactl-info.o `test -f 'info.c' || echo '$(srcdir)/'`info.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-info.Tpo $(DEPDIR)/alsactl-info.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='info.c' object='alsactl-info.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-monitor.obj `if test -f 'monitor.c'; then $(CYGPATH_W) 'monitor.c'; else $(CYGPATH_W) '$(srcdir)/monitor.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-info.o `test -f 'info.c' || echo '$(srcdir)/'`info.c
+
+alsactl-info.obj: info.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -MT alsactl-info.obj -MD -MP -MF $(DEPDIR)/alsactl-info.Tpo -c -o alsactl-info.obj `if test -f 'info.c'; then $(CYGPATH_W) 'info.c'; else $(CYGPATH_W) '$(srcdir)/info.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsactl-info.Tpo $(DEPDIR)/alsactl-info.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='info.c' object='alsactl-info.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(alsactl_CFLAGS) $(CFLAGS) -c -o alsactl-info.obj `if test -f 'info.c'; then $(CYGPATH_W) 'info.c'; else $(CYGPATH_W) '$(srcdir)/info.c'; fi`
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -687,14 +893,13 @@ uninstall-udevrulesDATA:
 # (1) if the variable is set in 'config.status', edit 'config.status'
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        case "$@" in \
@@ -715,31 +920,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
-cscopelist-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-       done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -755,12 +942,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -772,15 +954,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -789,9 +967,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
 
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -807,20 +986,10 @@ cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -917,10 +1086,20 @@ maintainer-clean-generic:
 @HAVE_SYSTEMD_FALSE@install-data-hook:
 clean: clean-recursive
 
-clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
+clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \
+       mostlyclean-am
 
 distclean: distclean-recursive
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/alsactl-alsactl.Po
+       -rm -f ./$(DEPDIR)/alsactl-clean.Po
+       -rm -f ./$(DEPDIR)/alsactl-daemon.Po
+       -rm -f ./$(DEPDIR)/alsactl-info.Po
+       -rm -f ./$(DEPDIR)/alsactl-init_parse.Po
+       -rm -f ./$(DEPDIR)/alsactl-init_ucm.Po
+       -rm -f ./$(DEPDIR)/alsactl-lock.Po
+       -rm -f ./$(DEPDIR)/alsactl-monitor.Po
+       -rm -f ./$(DEPDIR)/alsactl-state.Po
+       -rm -f ./$(DEPDIR)/alsactl-utils.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -968,13 +1147,23 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/alsactl-alsactl.Po
+       -rm -f ./$(DEPDIR)/alsactl-clean.Po
+       -rm -f ./$(DEPDIR)/alsactl-daemon.Po
+       -rm -f ./$(DEPDIR)/alsactl-info.Po
+       -rm -f ./$(DEPDIR)/alsactl-init_parse.Po
+       -rm -f ./$(DEPDIR)/alsactl-init_ucm.Po
+       -rm -f ./$(DEPDIR)/alsactl-lock.Po
+       -rm -f ./$(DEPDIR)/alsactl-monitor.Po
+       -rm -f ./$(DEPDIR)/alsactl-state.Po
+       -rm -f ./$(DEPDIR)/alsactl-utils.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-recursive
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-recursive
 
@@ -989,14 +1178,13 @@ uninstall-am: uninstall-man uninstall-sbinPROGRAMS \
 
 uninstall-man: uninstall-man1 uninstall-man7
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
-       cscopelist-recursive ctags-recursive install-am \
-       install-data-am install-strip tags-recursive
+.MAKE: $(am__recursive_targets) install-am install-data-am \
+       install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-am clean clean-generic \
-       clean-sbinPROGRAMS cscopelist cscopelist-recursive ctags \
-       ctags-recursive distclean distclean-compile distclean-generic \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--depfiles check check-am clean clean-generic clean-libtool \
+       clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \
+       distclean-compile distclean-generic distclean-libtool \
        distclean-tags distdir dvi dvi-am html html-am info info-am \
        install install-am install-data install-data-am \
        install-data-hook install-dvi install-dvi-am install-exec \
@@ -1007,23 +1195,22 @@ uninstall-man: uninstall-man1 uninstall-man7
        install-systemdsystemunitDATA install-udevrulesDATA \
        installcheck installcheck-am installdirs installdirs-am \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags tags-recursive uninstall uninstall-am uninstall-man \
-       uninstall-man1 uninstall-man7 uninstall-sbinPROGRAMS \
-       uninstall-systemdsystemunitDATA uninstall-udevrulesDATA
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-man uninstall-man1 uninstall-man7 \
+       uninstall-sbinPROGRAMS uninstall-systemdsystemunitDATA \
+       uninstall-udevrulesDATA
+
+.PRECIOUS: Makefile
 
 
 @HAVE_SYSTEMD_TRUE@install-data-hook:
 @HAVE_SYSTEMD_TRUE@    $(MKDIR_P) -m 0755 \
-@HAVE_SYSTEMD_TRUE@            $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants \
-@HAVE_SYSTEMD_TRUE@            $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants
-@HAVE_SYSTEMD_TRUE@    ( cd $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants && \
+@HAVE_SYSTEMD_TRUE@            $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants
+@HAVE_SYSTEMD_TRUE@    ( cd $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants && \
 @HAVE_SYSTEMD_TRUE@            rm -f alsa-state.service alsa-restore.service && \
 @HAVE_SYSTEMD_TRUE@            $(LN_S) ../alsa-state.service alsa-state.service && \
 @HAVE_SYSTEMD_TRUE@            $(LN_S) ../alsa-restore.service alsa-restore.service)
-@HAVE_SYSTEMD_TRUE@    ( cd $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants && \
-@HAVE_SYSTEMD_TRUE@            rm -f alsa-store.service && \
-@HAVE_SYSTEMD_TRUE@            $(LN_S) ../alsa-store.service alsa-store.service )
 
 alsa-state.service: alsa-state.service.in
        $(edit)
@@ -1031,9 +1218,6 @@ alsa-state.service: alsa-state.service.in
 alsa-restore.service: alsa-restore.service.in
        $(edit)
 
-alsa-store.service: alsa-store.service.in
-       $(edit)
-
 90-alsa-restore.rules: 90-alsa-restore.rules.in
        $(edit)
 
index 245a439..80fd5fd 100644 (file)
@@ -4,14 +4,12 @@
 #
 
 [Unit]
-Description=Restore Sound Card State
+Description=Save/Restore Sound Card State
 ConditionPathExists=!@daemonswitch@
-DefaultDependencies=no
-After=alsa-state.service
-Before=shutdown.target
-Conflicts=shutdown.target
+ConditionPathExistsGlob=/dev/snd/control*
 
 [Service]
 Type=oneshot
+RemainAfterExit=true
 ExecStart=-@sbindir@/alsactl restore
-StandardOutput=syslog
+ExecStop=-@sbindir@/alsactl store
index 56c12c1..5a8fe5e 100644 (file)
@@ -6,10 +6,6 @@
 [Unit]
 Description=Manage Sound Card State (restore and store)
 ConditionPathExists=@daemonswitch@
-DefaultDependencies=no
-After=sysinit.target
-Before=shutdown.target
-Conflicts=shutdown.target
 
 [Service]
 Type=simple
diff --git a/alsactl/alsa-store.service.in b/alsactl/alsa-store.service.in
deleted file mode 100644 (file)
index f1a56bb..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Note that two different ALSA card state management schemes exist and they
-# can be switched using a file exist check - /etc/alsa/state-daemon.conf .
-#
-
-[Unit]
-Description=Store Sound Card State
-ConditionPathExists=!@daemonswitch@
-DefaultDependencies=no
-Before=shutdown.target
-
-[Service]
-Type=oneshot
-ExecStart=@sbindir@/alsactl store
-StandardOutput=syslog
index c515fdd..2a31a2f 100644 (file)
@@ -8,6 +8,10 @@ alsactl \- advanced controls for ALSA soundcard driver
 
 \fBalsactl\fP \fImonitor\fP <card # or id>
 
+\fBalsactl\fP \fIinfo\fP <card # or id>
+
+\fBalsactl\fP [\fIclean\fP] <card # or id or device> [[control identifiers]]
+
 .SH DESCRIPTION
 \fBalsactl\fP is used to control advanced settings for the ALSA
 soundcard drivers. It supports multiple soundcards. If your card has
@@ -16,31 +20,72 @@ you have come to the right place.
 
 .SH COMMANDS
 
-\fIstore\fP saves the current driver state for the selected soundcard
+.SS Introduction
+
+The \fI<card>\fP argument is optional. If no soundcards are specified,
+setup for all cards will be saved, loaded or monitored.
+
+.SS store <card>
+
+This command saves the current driver state for the selected soundcard
 to the configuration file.
 
-\fIrestore\fP loads driver state for the selected soundcard from the
+.SS restore <card>
+
+This command loads driver state for the selected soundcard from the
 configuration file. If restoring fails (eventually partly), the init
 action is called.
 
-\fInrestore\fP is like \fIrestore\fP, but it notifies also the daemon
+.SS nrestore <card>
+
+This command is like \fIrestore\fP, but it notifies also the daemon
 to do new rescan for available soundcards.
 
-\fIinit\fP tries to initialize all devices to a default state. If device
+.SS init <card>
+
+This command tries to initialize all devices to a default state. If device
 is not known, error code 99 is returned.
 
-\fIdaemon\fP manages to save periodically the sound state.
+.SS daemon
+
+This command manages to save periodically the sound state.
+
+.SS rdaemon
+
+This command is like \fIdaemon\fP but restore the sound state at first.
 
-\fIrdaemon\fP like \fIdaemon\fP but restore the sound state at first.
+.SS kill <cmd>
 
-\fIkill\fP notifies the daemon to do the specified operation (quit,
+This command notifies the daemon to do the specified operation (quit,
 rescan, save_and_quit).
 
-\fImonitor\fP is for monitoring the events received from the given
+.SS monitor <card>
+
+This command is for monitoring the events received from the given
 control device.
 
-If no soundcards are specified, setup for all cards will be saved,
-loaded or monitored.
+.SS info <card>
+
+This command shows the general information in the YAML format
+collected from the given control device (sound card).
+
+.SS clean <card> [filter]
+
+This command cleans the controls created by applications.
+
+The optional element identifiers are accepted as a filter. One extra
+argument is parsed as an element identifiers.
+
+\fIExample:\fP alsactl clean 0 "name='PCM'" "name='Mic Phantom'"
+
+.SS dump-state
+
+This command dumps the current state (all cards) to stdout.
+
+.SS dump-cfg
+
+This command dumps the current configuration (all cards) to stdout.
+Note that the configuration hooks are evaluated.
 
 .SH OPTIONS
 
@@ -61,6 +106,10 @@ Print alsactl version number.
 Select the configuration file to use. The default is /var/lib/alsa/asound.state.
 
 .TP
+\fI\-a, \-\-config-dir\fP
+Select the boot / hotplug ALSA configuration directory to use. The default is /var/lib/alsa.
+
+.TP
 \fI\-l, \-\-lock\fP
 Use the file locking to serialize the concurrent access to the state file (this
 option is default for the global state file).
@@ -81,7 +130,7 @@ as much as possible.  This option is set as default now.
 
 .TP
 \fI\-g, \-\-ignore\fP
-Used with store and restore commands. Do not show 'No soundcards found'
+Used with store, restore and init commands. Do not show 'No soundcards found'
 and do not set an error exit code when soundcards are not installed.
 
 .TP
@@ -142,6 +191,16 @@ Set the process priority (see 'man nice')
 \fI\-c, \-\-sched-idle\fP
 Set the process scheduling policy to idle (SCHED_IDLE).
 
+.TP
+\fI\-D, \-\-ucm-defaults\fP
+Execute also the 'defaults' section from the UCM configuration. The standard
+behaviour is to execute only 'once' section.
+
+.TP
+\fI\-U, \-\-no-ucm\fP
+Skip the UCM init even if available. It may be useful for the test the
+legacy init configuration.
+
 .SH FILES
 \fI/var/lib/alsa/asound.state\fP (or whatever file you specify with the
 \fB\-f\fP flag) is used to store current settings for your
index bcbc187..8ad991a 100644 (file)
@@ -16,7 +16,7 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
 #include <errno.h>
 #include <syslog.h>
 #include <sched.h>
-#include <alsa/asoundlib.h>
 #include "alsactl.h"
+#include "os_compat.h"
 
+#ifndef SYS_ASOUND_DIR
+#define SYS_ASOUND_DIR "/var/lib/alsa"
+#endif
 #ifndef SYS_ASOUNDRC
-#define SYS_ASOUNDRC "/var/lib/alsa/asound.state"
+#define SYS_ASOUNDRC SYS_ASOUND_DIR "/asound.state"
 #endif
 #ifndef SYS_PIDFILE
 #define SYS_PIDFILE "/var/run/alsactl.pid"
@@ -49,6 +52,7 @@ int do_lock = 0;
 int use_syslog = 0;
 char *command;
 char *statefile = NULL;
+char *lockpath = SYS_LOCKPATH;
 char *lockfile = SYS_LOCKFILE;
 
 #define TITLE  0x0100
@@ -74,8 +78,10 @@ static struct arg args[] = {
 { 'v', "version", "print version of this program" },
 { HEADER, NULL, "Available state options:" },
 { FILEARG | 'f', "file", "configuration file (default " SYS_ASOUNDRC ")" },
+{ FILEARG | 'a', "config-dir", "boot / hotplug configuration directory (default " SYS_ASOUND_DIR ")" },
 { 'l', "lock", "use file locking to serialize concurrent access" },
 { 'L', "no-lock", "do not use file locking to serialize concurrent access" },
+{ FILEARG | 'K', "lock-dir", "lock path (default " SYS_LOCKPATH ")" },
 { FILEARG | 'O', "lock-state-file", "state lock file path (default " SYS_LOCKFILE ")" },
 { 'F', "force", "try to restore the matching controls as much as possible" },
 { 0, NULL, "  (default mode)" },
@@ -96,6 +102,13 @@ static struct arg args[] = {
 { 's', "syslog", "use syslog for messages" },
 { INTARG | 'n', "nice", "set the process priority (see 'man nice')" },
 { 'c', "sched-idle", "set the process scheduling policy to idle (SCHED_IDLE)" },
+#ifdef HAVE_ALSA_USE_CASE_H
+{ 'D', "ucm-defaults", "execute also the UCM 'defaults' section" },
+{ 'U', "no-ucm", "don't init with UCM" },
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+{ 'X', "ucm-nodev", "show UCM no device errors" },
+#endif
+#endif
 { HEADER, NULL, "Available commands:" },
 { CARDCMD, "store", "save current driver setup for one or each soundcards" },
 { EMPCMD, NULL, "  to configuration file" },
@@ -107,6 +120,10 @@ static struct arg args[] = {
 { CARDCMD, "rdaemon", "like daemon but do the state restore at first" },
 { KILLCMD, "kill", "notify daemon to quit, rescan or save_and_quit" },
 { CARDCMD, "monitor", "monitor control events" },
+{ CARDCMD, "info", "general information" },
+{ CARDCMD, "clean", "clean application controls" },
+{ EMPCMD, "dump-state", "dump the state (for all cards)" },
+{ EMPCMD, "dump-cfg", "dump the configuration (expanded, for all cards)" },
 { 0, NULL, NULL }
 };
 
@@ -135,7 +152,7 @@ static void help(void)
                                strcat(buf, "<card>");
                        else if (sarg & KILLCMD)
                                strcat(buf, "<cmd>");
-                       printf("  %-8s  %-6s  %s\n", larg ? larg : "",
+                       printf("  %-10s  %-6s  %s\n", larg ? larg : "",
                                                        buf, a->comment);
                        continue;
                }
@@ -150,6 +167,49 @@ static void help(void)
        }
 }
 
+static int dump_config_tree(snd_config_t *top)
+{
+       snd_output_t *out;
+       int err;
+
+       err = snd_output_stdio_attach(&out, stdout, 0);
+       if (err < 0)
+               return err;
+       err = snd_config_save(top, out);
+       snd_output_close(out);
+       return err;
+}
+
+static int dump_state(const char *file)
+{
+       snd_config_t *top;
+       int err;
+
+       err = load_configuration(file, &top, NULL);
+       if (err < 0)
+               return err;
+       err = dump_config_tree(top);
+       snd_config_delete(top);
+       return err;
+}
+
+static int dump_configuration(void)
+{
+       snd_config_t *top, *cfg2;
+       int err;
+
+       err = snd_config_update_ref(&top);
+       if (err < 0)
+               return err;
+       /* expand cards.* tree */
+       err = snd_config_search_definition(top, "cards", "_dummy_", &cfg2);
+       if (err >= 0)
+               snd_config_delete(cfg2);
+       err = dump_config_tree(top);
+       snd_config_unref(top);
+       return err;
+}
+
 #define NO_NICE (-100000)
 
 static void do_nice(int use_nice, int sched_idle)
@@ -161,7 +221,7 @@ static void do_nice(int use_nice, int sched_idle)
        if (sched_idle) {
                if (sched_getparam(0, &sched_param) >= 0) {
                        sched_param.sched_priority = 0;
-                       if (!sched_setscheduler(0, SCHED_RR, &sched_param))
+                       if (sched_setscheduler(0, SCHED_IDLE, &sched_param) < 0)
                                error("sched_setparam failed: %s", strerror(errno));
                } else {
                        error("sched_getparam failed: %s", strerror(errno));
@@ -178,11 +238,13 @@ int main(int argc, char *argv[])
                "/dev/snd/hwC",
                NULL
        };
+       char *cfgdir = SYS_ASOUND_DIR;
        char *cfgfile = SYS_ASOUNDRC;
        char *initfile = DATADIR "/init/00main";
        char *pidfile = SYS_PIDFILE;
-       char *cardname, ncardname[16];
+       char *cardname, ncardname[21];
        char *cmd;
+       char *const *extra_args;
        const char *const *tmp;
        int removestate = 0;
        int init_fallback = 1; /* new default behavior */
@@ -191,12 +253,16 @@ int main(int argc, char *argv[])
        int daemoncmd = 0;
        int use_nice = NO_NICE;
        int sched_idle = 0;
+       int initflags = 0;
        struct arg *a;
        struct option *o;
        int i, j, k, res;
        struct option *long_option;
        char *short_option;
 
+#if SND_LIB_VER(1, 2, 5) >= SND_LIB_VERSION
+       initflags |= FLAG_UCM_NODEV;
+#endif
        long_option = calloc(ARRAY_SIZE(args), sizeof(struct option));
        if (long_option == NULL)
                exit(EXIT_FAILURE);
@@ -205,7 +271,7 @@ int main(int argc, char *argv[])
                free(long_option);
                exit(EXIT_FAILURE);
        }
-       for (i = j = k = 0; i < ARRAY_SIZE(args); i++) {
+       for (i = j = k = 0; i < (int)ARRAY_SIZE(args); i++) {
                a = &args[i];
                if ((a->sarg & 0xff) == 0)
                        continue;
@@ -235,12 +301,18 @@ int main(int argc, char *argv[])
                case 'f':
                        cfgfile = optarg;
                        break;
+               case 'a':
+                       cfgdir = optarg;
+                       break;
                case 'l':
                        do_lock = 1;
                        break;
                case 'L':
                        do_lock = -1;
                        break;
+               case 'K':
+                       lockpath = optarg;
+                       break;
                case 'O':
                        lockfile = optarg;
                        break;
@@ -263,6 +335,15 @@ int main(int argc, char *argv[])
                case 'I':
                        init_fallback = 0;
                        break;
+               case 'D':
+                       initflags |= FLAG_UCM_DEFAULTS;
+                       break;
+               case 'U':
+                       initflags |= FLAG_UCM_DISABLED;
+                       break;
+               case 'X':
+                       initflags |= FLAG_UCM_NODEV;
+                       break;
                case 'r':
                        statefile = optarg;
                        break;
@@ -335,6 +416,8 @@ int main(int argc, char *argv[])
                }
        }
 
+       extra_args = argc - optind > 2 ? argv + optind + 2 : NULL;
+
        /* the global system file should be always locked */
        if (strcmp(cfgfile, SYS_ASOUNDRC) == 0 && do_lock >= 0)
                do_lock = 1;
@@ -342,7 +425,11 @@ int main(int argc, char *argv[])
        /* when running in background, use syslog for reports */
        if (background) {
                use_syslog = 1;
-               daemon(0, 0);
+               if (daemon(0, 0)) {
+                       syslog(LOG_INFO, "alsactl " SND_UTIL_VERSION_STR " daemon cannot be started: %s", strerror(errno));
+                       res = EXIT_FAILURE;
+                       goto out;
+               }
        }
 
        cmd = argv[optind];
@@ -354,8 +441,10 @@ int main(int argc, char *argv[])
                        syslog(LOG_INFO, "alsactl " SND_UTIL_VERSION_STR " daemon started");
        }
 
+       snd_lib_error_set_handler(error_handler);
+
        if (!strcmp(cmd, "init")) {
-               res = init(initfile, cardname);
+               res = init(cfgdir, initfile, initflags | FLAG_UCM_FBOOT | FLAG_UCM_BOOT, cardname);
                snd_config_update_free_global();
        } else if (!strcmp(cmd, "store")) {
                res = save_state(cfgfile, cardname);
@@ -364,7 +453,7 @@ int main(int argc, char *argv[])
                   !strcmp(cmd, "nrestore")) {
                if (removestate)
                        remove(statefile);
-               res = load_state(cfgfile, initfile, cardname, init_fallback);
+               res = load_state(cfgdir, cfgfile, initfile, initflags, cardname, init_fallback);
                if (!strcmp(cmd, "rdaemon")) {
                        do_nice(use_nice, sched_idle);
                        res = state_daemon(cfgfile, cardname, period, pidfile);
@@ -378,6 +467,14 @@ int main(int argc, char *argv[])
                res = state_daemon_kill(pidfile, cardname);
        } else if (!strcmp(cmd, "monitor")) {
                res = monitor(cardname);
+       } else if (!strcmp(cmd, "info")) {
+               res = general_info(cardname);
+       } else if (!strcmp(cmd, "clean")) {
+               res = clean(cardname, extra_args);
+       } else if (!strcmp(cmd, "dump-state")) {
+               res = dump_state(cfgfile);
+       } else if (!strcmp(cmd, "dump-cfg")) {
+               res = dump_configuration();
        } else {
                fprintf(stderr, "alsactl: Unknown command '%s'...\n", cmd);
                res = -ENODEV;
index 4f969ec..6ae45e3 100644 (file)
@@ -1,3 +1,8 @@
+#include <stdbool.h>
+#include <alsa/asoundlib.h>
+
+#define LOCK_TIMEOUT 10
+
 extern int debugflag;
 extern int force_restore;
 extern int ignore_nocards;
@@ -5,36 +10,64 @@ extern int do_lock;
 extern int use_syslog;
 extern char *command;
 extern char *statefile;
+extern char *lockpath;
 extern char *lockfile;
 
+struct snd_card_iterator {
+       int card;
+       char name[16];
+       bool single;
+       bool first;
+};
+
 void info_(const char *fcn, long line, const char *fmt, ...);
 void error_(const char *fcn, long line, const char *fmt, ...);
 void cerror_(const char *fcn, long line, int cond, const char *fmt, ...);
 void dbg_(const char *fcn, long line, const char *fmt, ...);
+void error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...);
 
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define info(...) do { info_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
-#define error(...) do { error_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
-#define cerror(cond, ...) do { cerror_(__FUNCTION__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0)
-#define dbg(...) do { dbg_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
+#define info(...) do { info_(__func__, __LINE__, __VA_ARGS__); } while (0)
+#define error(...) do { error_(__func__, __LINE__, __VA_ARGS__); } while (0)
+#define cerror(cond, ...) do { cerror_(__func__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0)
+#define dbg(...) do { dbg_(__func__, __LINE__, __VA_ARGS__); } while (0)
 #else
-#define info(args...) do { info_(__FUNCTION__, __LINE__, ##args); }  while (0)
-#define error(args...) do { error_(__FUNCTION__, __LINE__, ##args); }  while (0)
-#define cerror(cond, ...) do { error_(__FUNCTION__, __LINE__, (cond) != 0, ##args); } while (0)
-#define dbg(args...) do { dbg_(__FUNCTION__, __LINE__, ##args); }  while (0)
+#define info(args...) do { info_(__func__, __LINE__, ##args); }  while (0)
+#define error(args...) do { error_(__func__, __LINE__, ##args); }  while (0)
+#define cerror(cond, ...) do { error_(__func__, __LINE__, (cond) != 0, ##args); } while (0)
+#define dbg(args...) do { dbg_(__func__, __LINE__, ##args); }  while (0)
 #endif 
 
-int init(const char *file, const char *cardname);
+#define FLAG_UCM_DISABLED      (1<<0)
+#define FLAG_UCM_FBOOT         (1<<1)
+#define FLAG_UCM_BOOT          (1<<2)
+#define FLAG_UCM_DEFAULTS      (1<<3)
+#define FLAG_UCM_NODEV         (1<<4)
+
+void snd_card_iterator_init(struct snd_card_iterator *iter, int cardno);
+int snd_card_iterator_sinit(struct snd_card_iterator *iter, const char *cardname);
+const char *snd_card_iterator_next(struct snd_card_iterator *iter);
+int snd_card_iterator_error(struct snd_card_iterator *iter);
+
+int load_configuration(const char *file, snd_config_t **top, int *open_failed);
+int init(const char *cfgdir, const char *file, int flags, const char *cardname);
+int init_ucm(int flags, int cardno);
 int state_lock(const char *file, int timeout);
-int state_unlock(int fd, const char *file);
+int state_unlock(int lock_fd, const char *file);
+int card_lock(int card_number, int timeout);
+int card_unlock(int lock_fd, int card_number);
 int save_state(const char *file, const char *cardname);
-int load_state(const char *file, const char *initfile, const char *cardname,
-              int do_init);
+int load_state(const char *cfgdir, const char *file,
+              const char *initfile, int initflags,
+              const char *cardname, int do_init);
 int power(const char *argv[], int argc);
 int monitor(const char *name);
+int general_info(const char *name);
 int state_daemon(const char *file, const char *cardname, int period,
                 const char *pidfile);
 int state_daemon_kill(const char *pidfile, const char *cmd);
+int clean(const char *cardname, char *const *extra_args);
+int snd_card_clean_cfgdir(const char *cfgdir, int cardno);
 
 /* utils */
 
diff --git a/alsactl/clean.c b/alsactl/clean.c
new file mode 100644 (file)
index 0000000..1eb82c0
--- /dev/null
@@ -0,0 +1,196 @@
+/*
+ *  Advanced Linux Sound Architecture Control Program
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ *   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
+ *
+ */
+
+#include "aconfig.h"
+#include "version.h"
+#include <getopt.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include "alsactl.h"
+
+static int clean_one_control(snd_ctl_t *handle, snd_ctl_elem_id_t *elem_id,
+                            snd_ctl_elem_id_t **filter)
+{
+       snd_ctl_elem_info_t *info;
+       char *s;
+       int err;
+
+       snd_ctl_elem_info_alloca(&info);
+       snd_ctl_elem_info_set_id(info, elem_id);
+       err = snd_ctl_elem_info(handle, info);
+       if (err < 0) {
+               s = snd_ctl_ascii_elem_id_get(elem_id);
+               error("Cannot read control info '%s': %s", s, snd_strerror(err));
+               free(s);
+               return err;
+       }
+
+       if (!snd_ctl_elem_info_is_user(info))
+               return 0;
+
+       s = snd_ctl_ascii_elem_id_get(elem_id);
+       dbg("Application control \"%s\" found.", s);
+       if (filter) {
+               for (; *filter; filter++) {
+                       if (snd_ctl_elem_id_compare_set(elem_id, *filter) == 0)
+                               break;
+               }
+               if (*filter == NULL) {
+                       free(s);
+                       return 0;
+               }
+       }
+
+       err = snd_ctl_elem_remove(handle, elem_id);
+       if (err < 0) {
+               error("Cannot remove control '%s': %s", s, snd_strerror(err));
+               free(s);
+               return err;
+       }
+       dbg("Application control \"%s\" removed.", s);
+       free(s);
+       return 0;
+}
+
+static void filter_controls_free(snd_ctl_elem_id_t **_filter)
+{
+       snd_ctl_elem_id_t **filter;
+
+       for (filter = _filter; filter; filter++)
+               free(*filter);
+       free(_filter);
+}
+
+static int filter_controls_parse(char *const *controls, snd_ctl_elem_id_t ***_filter)
+{
+       snd_ctl_elem_id_t **filter = NULL;
+       char *const *c;
+       char *s;
+       unsigned int count, idx;
+       int err;
+
+       if (!controls)
+               goto fin;
+       for (count = 0, c = controls; *c; c++, count++);
+       if (count == 0)
+               goto fin;
+       filter = calloc(count + 1, sizeof(snd_ctl_elem_id_t *));
+       if (filter == NULL) {
+nomem:
+               error("No enough memory...");
+               return -ENOMEM;
+       }
+       filter[count] = NULL;
+       for (idx = 0; idx < count; idx++) {
+               err = snd_ctl_elem_id_malloc(&filter[idx]);
+               if (err < 0) {
+                       filter_controls_free(filter);
+                       goto nomem;
+               }
+               err = snd_ctl_ascii_elem_id_parse(filter[idx], controls[idx]);
+               if (err < 0) {
+                       error("Cannot parse id '%s': %s", controls[idx], snd_strerror(err));
+                       filter_controls_free(filter);
+                       return err;
+               }
+               s = snd_ctl_ascii_elem_id_get(filter[idx]);
+               dbg("Add to filter: \"%s\"", s);
+               free(s);
+       }
+fin:
+       *_filter = filter;
+       return 0;
+}
+
+static int clean_controls(int cardno, char *const *controls)
+{
+       snd_ctl_t *handle;
+       snd_ctl_elem_list_t *list;
+       snd_ctl_elem_id_t *elem_id;
+       snd_ctl_elem_id_t **filter;
+       char name[32];
+       unsigned int idx, count;
+       int err;
+
+       snd_ctl_elem_id_alloca(&elem_id);
+       snd_ctl_elem_list_alloca(&list);
+
+       err = filter_controls_parse(controls, &filter);
+       if (err < 0)
+               return err;
+
+       sprintf(name, "hw:%d", cardno);
+       err = snd_ctl_open(&handle, name, 0);
+       if (err < 0) {
+               error("snd_ctl_open error: %s", snd_strerror(err));
+               filter_controls_free(filter);
+               return err;
+       }
+       dbg("Control device '%s' opened.", name);
+       err = snd_ctl_elem_list(handle, list);
+       if (err < 0) {
+               error("Cannot determine controls: %s", snd_strerror(err));
+               goto fin_err;
+       }
+       count = snd_ctl_elem_list_get_count(list);
+       if (count == 0)
+               goto fin_ok;
+       snd_ctl_elem_list_set_offset(list, 0);
+       if ((err = snd_ctl_elem_list_alloc_space(list, count)) < 0) {
+               error("No enough memory...");
+               goto fin_err;
+       }
+       if ((err = snd_ctl_elem_list(handle, list)) < 0) {
+               error("Cannot determine controls (2): %s", snd_strerror(err));
+               goto fin_err;
+       }
+       for (idx = 0; idx < count; idx++) {
+               snd_ctl_elem_list_get_id(list, idx, elem_id);
+               err = clean_one_control(handle, elem_id, filter);
+               if (err < 0)
+                       goto fin_err;
+       }
+fin_ok:
+       filter_controls_free(filter);
+       snd_ctl_close(handle);
+       return 0;
+fin_err:
+       filter_controls_free(filter);
+       snd_ctl_close(handle);
+       return err;
+}
+
+int clean(const char *cardname, char *const *extra_args)
+{
+       struct snd_card_iterator iter;
+       int err;
+
+       err = snd_card_iterator_sinit(&iter, cardname);
+       if (err < 0)
+               return err;
+       while (snd_card_iterator_next(&iter)) {
+               if ((err = clean_controls(iter.card, extra_args)))
+                       return err;
+       }
+       return snd_card_iterator_error(&iter);
+}
index 127701e..4b9d392 100644 (file)
@@ -15,7 +15,7 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
@@ -29,7 +29,6 @@
 #include <signal.h>
 #include <time.h>
 #include <poll.h>
-#include <alsa/asoundlib.h>
 #include "alsactl.h"
 
 struct id_list {
@@ -80,6 +79,8 @@ static void card_free(struct card **card)
 {
        struct card *c = *card;
 
+       if (c == NULL)
+               return;
        free_list(&c->blacklist);
        free_list(&c->whitelist);
        if (c->handle)
@@ -284,7 +285,7 @@ static long read_pid_file(const char *pidfile)
                        err = err < 0 ? -errno : -EIO;
                close(fd);
                pid_txt[11] = '\0';
-               return atol(pid_txt);
+               return err < 0 ? err : atol(pid_txt);
        } else {
                return -errno;
        }
@@ -293,7 +294,7 @@ static long read_pid_file(const char *pidfile)
 static int write_pid_file(const char *pidfile)
 {
        int fd, err;
-       char pid_txt[12];
+       char pid_txt[14];
 
        sprintf(pid_txt, "%10li\n", (long)getpid());
        fd = open(pidfile, O_WRONLY|O_CREAT|O_EXCL, 0600);
@@ -451,8 +452,10 @@ save:
 out:
        free(pfd);
        remove(pidfile);
-       for (i = 0; i < count; i++)
-               card_free(&cards[i]);
-       free(cards);
+       if (cards) {
+               for (i = 0; i < count; i++)
+                       card_free(&cards[i]);
+               free(cards);
+       }
        return 0;
 }
diff --git a/alsactl/info.c b/alsactl/info.c
new file mode 100644 (file)
index 0000000..1d648d8
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+ *  Advanced Linux Sound Architecture Control Program - General info
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ *   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
+ *
+ */
+
+#include "aconfig.h"
+#include "alsactl.h"
+
+static int pcm_device_list(snd_ctl_t *ctl, snd_pcm_stream_t stream, bool *first)
+{
+#ifdef __ALSA_PCM_H
+       int err, dev, idx;
+       unsigned int count;
+       snd_pcm_info_t *pcminfo;
+       snd_pcm_info_alloca(&pcminfo);
+       bool streamfirst, subfirst;
+
+       dev = -1;
+       streamfirst = true;
+       while (1) {
+               if ((err = snd_ctl_pcm_next_device(ctl, &dev)) < 0) {
+                       error("snd_ctl_pcm_next_device");
+                       return err;
+               }
+               if (dev < 0)
+                       break;
+               snd_pcm_info_set_device(pcminfo, dev);
+               snd_pcm_info_set_subdevice(pcminfo, 0);
+               snd_pcm_info_set_stream(pcminfo, stream);
+               if ((err = snd_ctl_pcm_info(ctl, pcminfo)) < 0) {
+                       if (err != -ENOENT)
+                               return err;
+                       continue;
+               }
+               if (*first) {
+                       printf("  pcm:\n");
+                       *first = false;
+               }
+               if (streamfirst) {
+                       printf("    - stream: %s\n      devices:\n", snd_pcm_stream_name(stream));
+                       streamfirst = false;
+               }
+               printf("        - device: %d\n          id: %s\n          name: %s\n",
+                               dev,
+                               snd_pcm_info_get_id(pcminfo),
+                               snd_pcm_info_get_name(pcminfo));
+               count = snd_pcm_info_get_subdevices_count(pcminfo);
+               subfirst = true;
+               for (idx = 0; idx < (int)count; idx++) {
+                       snd_pcm_info_set_subdevice(pcminfo, idx);
+                       if ((err = snd_ctl_pcm_info(ctl, pcminfo)) < 0) {
+                               error("control digital audio playback info (%s): %s", snd_ctl_name(ctl), snd_strerror(err));
+                               return err;
+                       }
+                       if (subfirst) {
+                               printf("          subdevices:\n");
+                               subfirst = false;
+                       }
+                       printf("            - subdevice: %d\n              name: %s\n",
+                                               idx, snd_pcm_info_get_subdevice_name(pcminfo));
+               }
+       }
+#endif
+       return 0;
+}
+
+static const char *snd_rawmidi_stream_name(snd_rawmidi_stream_t stream)
+{
+       if (stream == SND_RAWMIDI_STREAM_INPUT)
+               return "INPUT";
+       if (stream == SND_RAWMIDI_STREAM_OUTPUT)
+               return "OUTPUT";
+       return "???";
+}
+
+static int rawmidi_device_list(snd_ctl_t *ctl, snd_rawmidi_stream_t stream, bool *first)
+{
+#ifdef __ALSA_RAWMIDI_H
+       int err, dev, idx;
+       unsigned int count;
+       snd_rawmidi_info_t *info;
+       snd_rawmidi_info_alloca(&info);
+       bool streamfirst, subfirst;
+
+       dev = -1;
+       streamfirst = true;
+       while (1) {
+               if ((err = snd_ctl_rawmidi_next_device(ctl, &dev)) < 0) {
+                       error("snd_ctl_rawmidi_next_device");
+                       return err;
+               }
+               if (dev < 0)
+                       break;
+               snd_rawmidi_info_set_device(info, dev);
+               snd_rawmidi_info_set_subdevice(info, 0);
+               snd_rawmidi_info_set_stream(info, stream);
+               if ((err = snd_ctl_rawmidi_info(ctl, info)) < 0) {
+                       if (err != -ENOENT)
+                               return err;
+                       continue;
+               }
+               if (*first) {
+                       printf("  rawmidi:\n");
+                       *first = false;
+               }
+               if (streamfirst) {
+                       printf("    - stream: %s\n      devices:\n", snd_rawmidi_stream_name(stream));
+                       streamfirst = false;
+               }
+               printf("        - device: %d\n          id: %s\n          name: %s\n",
+                               dev,
+                               snd_rawmidi_info_get_id(info),
+                               snd_rawmidi_info_get_name(info));
+               count = snd_rawmidi_info_get_subdevices_count(info);
+               subfirst = true;
+               for (idx = 0; idx < (int)count; idx++) {
+                       snd_rawmidi_info_set_subdevice(info, idx);
+                       if ((err = snd_ctl_rawmidi_info(ctl, info)) < 0) {
+                               error("control digital audio playback info (%s): %s", snd_ctl_name(ctl), snd_strerror(err));
+                               return err;
+                       }
+                       if (subfirst) {
+                               printf("          subdevices:\n");
+                               subfirst = false;
+                       }
+                       printf("            - subdevice: %d\n              name: %s\n",
+                                               idx, snd_rawmidi_info_get_subdevice_name(info));
+               }
+       }
+#endif
+       return 0;
+}
+
+static int hwdep_device_list(snd_ctl_t *ctl)
+{
+#ifdef __ALSA_HWDEP_H
+       int err, dev;
+       snd_hwdep_info_t *info;
+       snd_hwdep_info_alloca(&info);
+       bool first;
+
+       dev = -1;
+       first = true;
+       while (1) {
+               if ((err = snd_ctl_hwdep_next_device(ctl, &dev)) < 0) {
+                       error("snd_ctl_pcm_next_device");
+                       return err;
+               }
+               if (dev < 0)
+                       break;
+               snd_hwdep_info_set_device(info, dev);
+               if ((err = snd_ctl_hwdep_info(ctl, info)) < 0) {
+                       if (err != -ENOENT)
+                               return err;
+                       continue;
+               }
+               if (first) {
+                       printf("  hwdep:\n");
+                       first = false;
+               }
+               printf("    - device: %d\n      id: %s\n      name: %s\n      iface: %d\n",
+                               dev,
+                               snd_hwdep_info_get_id(info),
+                               snd_hwdep_info_get_name(info),
+                               snd_hwdep_info_get_iface(info));
+       }
+#endif
+       return 0;
+}
+
+static int card_info(snd_ctl_t *ctl)
+{
+       snd_ctl_card_info_t *info;
+       snd_ctl_elem_list_t *clist;
+       int err;
+
+       snd_ctl_card_info_alloca(&info);
+       snd_ctl_elem_list_alloca(&clist);
+
+       if ((err = snd_ctl_card_info(ctl, info)) < 0) {
+               error("Control device %s hw info error: %s", snd_ctl_name(ctl), snd_strerror(err));
+               return err;
+       }
+       printf("#\n# Sound card\n#\n");
+       printf("- card: %i\n  id: %s\n  name: %s\n  longname: %s\n",
+               snd_ctl_card_info_get_card(info),
+               snd_ctl_card_info_get_id(info),
+               snd_ctl_card_info_get_name(info),
+               snd_ctl_card_info_get_longname(info));
+       printf("  driver_name: %s\n", snd_ctl_card_info_get_driver(info));
+       printf("  mixer_name: %s\n", snd_ctl_card_info_get_mixername(info));
+       printf("  components: %s\n", snd_ctl_card_info_get_components(info));
+       if ((err = snd_ctl_elem_list(ctl, clist)) < 0) {
+               error("snd_ctl_elem_list failure: %s", snd_strerror(err));
+       } else {
+               printf("  controls_count: %i\n", snd_ctl_elem_list_get_count(clist));
+       }
+       return err;
+}
+
+int general_card_info(int cardno)
+{
+       snd_ctl_t *ctl;
+       char dev[16];
+       bool first;
+       int err;
+
+       snprintf(dev, sizeof(dev), "hw:%i", cardno);
+       if ((err = snd_ctl_open(&ctl, dev, 0)) < 0) {
+               error("Control device %s open error: %s", dev, snd_strerror(err));
+               return err;
+       }
+       err = card_info(ctl);
+
+       first = true;
+       if (err >= 0)
+               err = pcm_device_list(ctl, SND_PCM_STREAM_PLAYBACK, &first);
+       if (err >= 0)
+               err = pcm_device_list(ctl, SND_PCM_STREAM_CAPTURE, &first);
+
+       first = true;
+       if (err >= 0)
+               err = rawmidi_device_list(ctl, SND_RAWMIDI_STREAM_INPUT, &first);
+       if (err >= 0)
+               err = rawmidi_device_list(ctl, SND_RAWMIDI_STREAM_OUTPUT, &first);
+
+       if (err >= 0)
+               err = hwdep_device_list(ctl);
+       snd_ctl_close(ctl);
+       return err;
+}
+
+int general_info(const char *cardname)
+{
+       struct snd_card_iterator iter;
+       int err;
+
+       err = snd_card_iterator_sinit(&iter, cardname);
+       if (err < 0)
+               return err;
+       while (snd_card_iterator_next(&iter)) {
+               if ((err = general_card_info(iter.card)))
+                       return err;
+       }
+       return snd_card_iterator_error(&iter);
+}
index 660df38..4f01b08 100644 (file)
@@ -1,4 +1,4 @@
-# This is toplevel configuration for for 'alsactl init'.
+# This is the toplevel configuration for 'alsactl init'.
 # See 'man alsactl_init' for syntax.
 
 # set root device directory in sysfs for soundcard for ATTR{} command
@@ -36,7 +36,7 @@ CARDINFO{driver}=="Test", INCLUDE="test", GOTO="init_end"
 
 LABEL="init_end"
 ACCESS=="postinit", INCLUDE="postinit"
-RESULT=="true", GOTO="00_mainend"
+RESULT=="true", GOTO="00main_end"
 ERROR="Found hardware: \"$cardinfo{driver}\" \"$cardinfo{mixername}\" \"$cardinfo{components}\" \"$attr{subsystem_vendor}\" \"$attr{subsystem_device}\"\n"
 ERROR="Hardware is initialized using a generic method\n"
 INCLUDE="default"
index d09d7e7..c77d978 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,20 +89,35 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = alsactl/init
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -101,13 +154,19 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(alsainitdir)"
 DATA = $(alsainit_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -125,11 +184,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -141,27 +207,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -174,6 +250,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -182,6 +259,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -192,7 +271,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -233,6 +314,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -243,7 +326,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 init_files = \
        00main default help info test \
        hda ca0106
@@ -266,14 +349,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign alsactl/init/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign alsactl/init/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -284,6 +366,12 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-alsainitDATA: $(alsainit_DATA)
        @$(NORMAL_INSTALL)
        @list='$(alsainit_DATA)'; test -n "$(alsainitdir)" || list=; \
@@ -305,16 +393,17 @@ uninstall-alsainitDATA:
        @list='$(alsainit_DATA)'; test -n "$(alsainitdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        dir='$(DESTDIR)$(alsainitdir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
+tags TAGS:
 
-ctags: CTAGS
-CTAGS:
+ctags CTAGS:
 
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -383,7 +472,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
@@ -435,7 +524,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -449,16 +538,20 @@ uninstall-am: uninstall-alsainitDATA
 
 .MAKE: install-am install-strip
 
-.PHONY: all all-am check check-am clean clean-generic distclean \
-       distclean-generic distdir dvi dvi-am html html-am info info-am \
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       cscopelist-am ctags-am distclean distclean-generic \
+       distclean-libtool distdir dvi dvi-am html html-am info info-am \
        install install-alsainitDATA install-am install-data \
        install-data-am install-dvi install-dvi-am install-exec \
        install-exec-am install-html install-html-am install-info \
        install-info-am install-man install-pdf install-pdf-am \
        install-ps install-ps-am install-strip installcheck \
        installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-       pdf-am ps ps-am uninstall uninstall-alsainitDATA uninstall-am
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+       uninstall-alsainitDATA uninstall-am
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 7afd4df..45fc833 100644 (file)
@@ -1,23 +1,23 @@
 # Configuration for CA0106 driver
 
 CTL{reset}="mixer"
-CTL{name}="Master Playback Volume", CTL{value}="-20dB"
-CTL{name}="Master Playback Switch", CTL{value}="on"
-CTL{name}="Analog Front Playback Volume", CTL{value}="0dB"
-CTL{name}="Analog Front Playback Switch", CTL{value}="on"
-CTL{name}="Analog Rear Playback Volume", CTL{value}="0dB"
-CTL{name}="Analog Rear Playback Switch", CTL{value}="on"
-CTL{name}="Analog Center/LFE Playback Volume", CTL{value}="0dB"
-CTL{name}="Analog Center/LFE Playback Switch", CTL{value}="on"
-CTL{name}="Analog Side Playback Volume", CTL{value}="0dB"
-CTL{name}="Analog Side Playback Switch", CTL{value}="on"
-CTL{name}="IEC958 Front Playback Volume", CTL{value}="0dB"
-CTL{name}="IEC958 Rear Playback Volume", CTL{value}="0dB"
-CTL{name}="IEC958 Center/LFE Playback Volume", CTL{value}="0dB"
+CTL{name}="Master Playback Volume", CTL{values}="-20dB"
+CTL{name}="Master Playback Switch", CTL{values}="on"
+CTL{name}="Analog Front Playback Volume", CTL{values}="0dB"
+CTL{name}="Analog Front Playback Switch", CTL{values}="on"
+CTL{name}="Analog Rear Playback Volume", CTL{values}="0dB"
+CTL{name}="Analog Rear Playback Switch", CTL{values}="on"
+CTL{name}="Analog Center/LFE Playback Volume", CTL{values}="0dB"
+CTL{name}="Analog Center/LFE Playback Switch", CTL{values}="on"
+CTL{name}="Analog Side Playback Volume", CTL{values}="0dB"
+CTL{name}="Analog Side Playback Switch", CTL{values}="on"
+CTL{name}="IEC958 Front Playback Volume", CTL{values}="0dB"
+CTL{name}="IEC958 Rear Playback Volume", CTL{values}="0dB"
+CTL{name}="IEC958 Center/LFE Playback Volume", CTL{values}="0dB"
 # capture
 CTL{name}="Analog Source Capture Enum", CTL{value}="Mic"
-CTL{name}="Mic Capture Volume", CTL{value}="6dB"
-CTL{name}="Shared Mic/Line in Capture Switch", CTL{value}="Mic in"
+CTL{name}="Mic Capture Volume", CTL{values}="6dB"
+CTL{name}="Shared Mic/Line in Capture Switch", CTL{values}="Mic in"
 
 # some variants have also AC97 mixer
 
index a6919f1..7581095 100644 (file)
@@ -11,29 +11,29 @@ RESULT="false", EXIT="return"
 LABEL="Acer Travelmate 8100"
 # playback
 CTL{reset}="mixer"
-CTL{name}="Master Playback Volume", CTL{value}="-21dB"
-CTL{name}="Master Playback Switch", CTL{value}="on"
-CTL{name}="Headphone Playback Switch", CTL{value}="on,on"
-CTL{name}="Front Playback Volume", CTL{value}="-29dB,-29dB"
-CTL{name}="Front Playback Switch", CTL{value}="on,on"
-CTL{name}="PCM Playback Volume", CTL{value}="0dB,0dB"
+CTL{name}="Master Playback Volume", CTL{values}="-21dB"
+CTL{name}="Master Playback Switch", CTL{values}="on"
+CTL{name}="Headphone Playback Switch", CTL{values}="on"
+CTL{name}="Front Playback Volume", CTL{values}="-29dB"
+CTL{name}="Front Playback Switch", CTL{values}="on"
+CTL{name}="PCM Playback Volume", CTL{values}="0dB"
 # capture
 CTL{name}="Input Source", CTL{value}="Mic"
-CTL{name}="Capture Volume", CTL{value}="20dB,20dB"
-CTL{name}="Capture Switch", CTL{value}="on,on"
+CTL{name}="Capture Volume", CTL{values}="20dB"
+CTL{name}="Capture Switch", CTL{values}="on"
 RESULT="true", EXIT="return"
 
 LABEL="Lenovo T61"
 # playback
 CTL{reset}="mixer"
-CTL{name}="Master Playback Volume", CTL{value}="-13.5dB"
-CTL{name}="Master Playback Switch", CTL{value}="on"
-CTL{name}="Headphone Playback Switch", CTL{value}="on,on"
-CTL{name}="Speaker Playback Switch", CTL{value}="on,on"
-CTL{name}="PCM Playback Volume", CTL{value}="0dB,0dB"
+CTL{name}="Master Playback Volume", CTL{values}="-13.5dB"
+CTL{name}="Master Playback Switch", CTL{values}="on"
+CTL{name}="Headphone Playback Switch", CTL{values}="on"
+CTL{name}="Speaker Playback Switch", CTL{values}="on"
+CTL{name}="PCM Playback Volume", CTL{values}="0dB"
 # capture
 CTL{name}="Input Source", CTL{value}="Internal Mic"
-CTL{name}="Internal Mic Boost", CTL{value}="1"
-CTL{name}="Capture Volume", CTL{value}="9dB,9dB"
-CTL{name}="Capture Switch", CTL{value}="on,on"
+CTL{name}="Internal Mic Boost", CTL{values}="1"
+CTL{name}="Capture Volume", CTL{values}="9dB"
+CTL{name}="Capture Switch", CTL{values}="on"
 RESULT="true", EXIT="return"
index 8a7173b..267db4b 100644 (file)
@@ -17,7 +17,7 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
@@ -37,7 +37,6 @@
 #include <sys/types.h>
 #include <dirent.h>
 #include <math.h>
-#include <alsa/asoundlib.h>
 #include "aconfig.h"
 #include "alsactl.h"
 #include "list.h"
@@ -187,7 +186,7 @@ static int init_space(struct space **space, int card)
                return -ENOMEM;
        res->ctl_id_changed = ~0;
        res->linenum = -1;
-       sprintf(device, "hw:%u", card);
+       sprintf(device, "hw:%d", card);
        err = snd_hctl_open(&res->ctl_handle, device, 0);
        if (err < 0)
                goto error;
@@ -375,7 +374,7 @@ static int set_ctl_value(struct space *space, const char *value, int all)
                        if (pos)
                                *(char *)pos = '\0';
                        remove_trailing_chars((char *)value, ' ');
-                       items = pos ? pos - value : strlen(value);
+                       items = pos ? (unsigned)(pos - value) : (unsigned)strlen(value);
                        if (items > 1 && value[items-1] == '%') {
                                val = convert_prange1(strtol(value, NULL, 0), snd_ctl_elem_info_get_min(space->ctl_info), snd_ctl_elem_info_get_max(space->ctl_info));
                                snd_ctl_elem_value_set_integer(space->ctl_value, idx, val);
@@ -465,12 +464,13 @@ static int set_ctl_value(struct space *space, const char *value, int all)
                        return -EINVAL;
                }
                for (idx = 0; idx < count; idx += 2) {
-                       val = hextodigit(*(value++)) << 4;
-                       val |= hextodigit(*(value++));
-                       if (val > 255) {
+                       int nibble1 = hextodigit(*(value++));
+                       int nibble2 = hextodigit(*(value++));
+                       if (nibble1 < 0 || nibble2 < 0) {
                                Perror(space, "bad ctl hexa value");
                                return -EINVAL;
                        }
+                       val = (nibble1 << 4) | nibble2;
                        snd_ctl_elem_value_set_byte(space->ctl_value, idx, val);
                }
                break;
@@ -480,7 +480,6 @@ static int set_ctl_value(struct space *space, const char *value, int all)
        }
        return 0;
   missing:
-       printf("%i %i\n", type, count);
        Perror(space, "missing some ctl values (line %i)", space->linenum);
        return -EINVAL;
 }
@@ -508,16 +507,16 @@ static int do_match(const char *key, enum key_op op,
 
 static int ctl_match(snd_ctl_elem_id_t *pattern, snd_ctl_elem_id_t *id)
 {
-       if (snd_ctl_elem_id_get_interface(pattern) != -1 &&
+       if ((int)snd_ctl_elem_id_get_interface(pattern) != -1 &&
            snd_ctl_elem_id_get_interface(pattern) != snd_ctl_elem_id_get_interface(id))
                return 0;
-       if (snd_ctl_elem_id_get_device(pattern) != -1 &&
+       if ((int)snd_ctl_elem_id_get_device(pattern) != -1 &&
            snd_ctl_elem_id_get_device(pattern) != snd_ctl_elem_id_get_device(id))
                return 0;
-       if (snd_ctl_elem_id_get_subdevice(pattern) != -1 &&
+       if ((int)snd_ctl_elem_id_get_subdevice(pattern) != -1 &&
            snd_ctl_elem_id_get_subdevice(pattern) != snd_ctl_elem_id_get_subdevice(id))
                return 0;
-       if (snd_ctl_elem_id_get_index(pattern) != -1 &&
+       if ((int)snd_ctl_elem_id_get_index(pattern) != -1 &&
            snd_ctl_elem_id_get_index(pattern) != snd_ctl_elem_id_get_index(id))
                return 0;
        if (fnmatch(snd_ctl_elem_id_get_name(pattern), snd_ctl_elem_id_get_name(id), 0) != 0)
@@ -656,7 +655,7 @@ static const char *elemid_get(struct space *space, const char *attr)
                        goto empty;
                val = min;
 dbvalue:
-               sprintf(res, "%li.%02idB", (long)(val / 100), (int)abs(val % 100));
+               sprintf(res, "%li.%02lidB", (long)(val / 100), labs(val % 100));
                return res;
        }
        if (strncasecmp(attr, "dBmax", 5) == 0) {
@@ -735,7 +734,7 @@ dbvalue:
                        elem = snd_hctl_elem_next(elem);
                }
                snd_ctl_elem_id_free(id);
-               sprintf(res, "%u", index);
+               sprintf(res, "%d", index);
                dbg("do_ctl_count found %s controls", res);
                return res;
        }
@@ -1243,7 +1242,8 @@ found:
 static
 int run_program1(struct space *space,
                 const char *command0, char *result,
-                size_t ressize, size_t *reslen, int log)
+                size_t ressize, size_t *reslen ATTRIBUTE_UNUSED,
+                int log ATTRIBUTE_UNUSED)
 {
        if (strncmp(command0, "__ctl_search", 12) == 0) {
                const char *res = elemid_get(space, "do_search");
@@ -1285,7 +1285,7 @@ static int conf_name_filter(const struct dirent *d)
        return ext && !strcmp(ext, ".conf");
 }
 
-static int parse_line(struct space *space, char *line, size_t linesize)
+static int parse_line(struct space *space, char *line, size_t linesize ATTRIBUTE_UNUSED)
 {
        char *linepos;
        char *key, *value, *attr, *temp;
@@ -1676,8 +1676,10 @@ static int parse(struct space *space, const char *filename)
        linenum = 0;
        linesize = 128;
        line = malloc(linesize);
-       if (line == NULL)
+       if (line == NULL) {
+               file_unmap(buf, bufsize);
                return -ENOMEM;
+       }
        space->filename = filename;
        while (!err && pos < bufsize && !space->quit) {
                count = line_width(buf, bufsize, pos);
@@ -1699,6 +1701,7 @@ static int parse(struct space *space, const char *filename)
                
                if (count > linesize - 1) {
                        free(line);
+                       line = NULL;
                        linesize = (count + 127 + 1) & ~127;
                        if (linesize > 2048) {
                                error("file %s, line %i too long", filename, linenum);
@@ -1741,52 +1744,44 @@ static int parse(struct space *space, const char *filename)
        return err ? err : -abs(space->exit_code);
 }
 
-int init(const char *filename, const char *cardname)
+int init(const char *cfgdir, const char *filename, int flags, const char *cardname)
 {
        struct space *space;
-       int err = 0, card, first;
+       struct snd_card_iterator iter;
+       int err = 0, lasterr = 0;
        
        sysfs_init();
-       if (!cardname) {
-               first = 1;
-               card = -1;
-               while (1) {
-                       if (snd_card_next(&card) < 0)
-                               break;
-                       if (card < 0) {
-                               if (first) {
-                                       error("No soundcards found...");
-                                       return -ENODEV;
-                               }
-                               break;
-                       }
-                       first = 0;
-                       err = init_space(&space, card);
-                       if (err == 0) {
-                               space->rootdir = new_root_dir(filename);
-                               if (space->rootdir != NULL)
-                                       err = parse(space, filename);
-                               free_space(space);
-                       }
-                       if (err < 0)
-                               break;
-               }
-       } else {
-               card = snd_card_get_index(cardname);
-               if (card < 0) {
-                       error("Cannot find soundcard '%s'...", cardname);
-                       goto error;
+       err = snd_card_iterator_sinit(&iter, cardname);
+       if (err < 0)
+               goto out;
+       while (snd_card_iterator_next(&iter)) {
+               err = snd_card_clean_cfgdir(cfgdir, iter.card);
+               if (err < 0) {
+                       if (lasterr == 0)
+                               lasterr = err;
+                       continue;
                }
-               memset(&space, 0, sizeof(space));
-               err = init_space(&space, card);
-               if (err == 0) {
-                       space->rootdir = new_root_dir(filename);
-                       if (space->rootdir  != NULL)
-                               err = parse(space, filename);
-                       free_space(space);
+               err = init_ucm(flags, iter.card);
+               if (err == 0)
+                       continue;
+               err = init_space(&space, iter.card);
+               if (err != 0)
+                       continue;
+               space->rootdir = new_root_dir(filename);
+               if (space->rootdir != NULL) {
+                       err = parse(space, filename);
+                       if (!cardname && err <= -99) { /* non-fatal errors */
+                               if (lasterr == 0)
+                                       lasterr = err;
+                               err = 0;
+                       }
                }
+               free_space(space);
+               if (err < 0)
+                       goto out;
        }
-  error:
+       err = lasterr ? lasterr : snd_card_iterator_error(&iter);
+out:
        sysfs_cleanup();
        return err;
 }
index 3aca1b4..f09b1ae 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #if defined(__GLIBC__) && !(defined(__UCLIBC__) && defined(__USE_BSD))
+#if !(__GLIBC_PREREQ(2, 38))
 static size_t strlcpy(char *dst, const char *src, size_t size)
 {
        size_t bytes = 0;
@@ -60,4 +61,5 @@ static size_t strlcat(char *dst, const char *src, size_t size)
        *q = '\0';
        return bytes;
 }
+#endif /* !(__GLIBC_PREREQ(2, 38)) */
 #endif /* __GLIBC__ */
index 0cbada2..57ef615 100644 (file)
@@ -34,6 +34,8 @@ static int sysfs_init(void)
        const char *env;
        char sysfs_test[PATH_SIZE];
 
+       INIT_LIST_HEAD(&attr_list);
+
        env = getenv("SYSFS_PATH");
        if (env) {
                strlcpy(sysfs_path, env, sizeof(sysfs_path));
@@ -43,13 +45,16 @@ static int sysfs_init(void)
        dbg("sysfs_path='%s'", sysfs_path);
 
        strlcpy(sysfs_test, sysfs_path, sizeof(sysfs_test));
-       strlcat(sysfs_test, "/kernel/uevent_helper", sizeof(sysfs_test));
+       strlcat(sysfs_test, "/kernel/uevent_seqnum", sizeof(sysfs_test));
        if (access(sysfs_test, F_OK)) {
-               error("sysfs path '%s' is invalid\n", sysfs_path);
-               return -errno;
+               strlcpy(sysfs_test, sysfs_path, sizeof(sysfs_test));
+               strlcat(sysfs_test, "/kernel/uevent_helper", sizeof(sysfs_test));
+               if (access(sysfs_test, F_OK)) {
+                       error("sysfs path '%s' is invalid", sysfs_path);
+                       return -errno;
+               }
        }
 
-       INIT_LIST_HEAD(&attr_list);
        return 0;
 }
 
@@ -108,11 +113,11 @@ static char *sysfs_attr_get_value(const char *devpath, const char *attr_name)
 
        if (S_ISLNK(statbuf.st_mode)) {
                /* links return the last element of the target path */
-               char link_target[PATH_SIZE];
+               char link_target[PATH_SIZE + 1];
                int len;
                const char *pos;
 
-               len = readlink(path_full, link_target, sizeof(link_target));
+               len = readlink(path_full, link_target, sizeof(link_target) - 1);
                if (len > 0) {
                        link_target[len] = '\0';
                        pos = strrchr(link_target, '/');
diff --git a/alsactl/init_ucm.c b/alsactl/init_ucm.c
new file mode 100644 (file)
index 0000000..31e8daf
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ *  Advanced Linux Sound Architecture Control Program - UCM Initialization
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ *   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
+ *
+ */
+
+#include "aconfig.h"
+#include <stddef.h>
+#include "alsactl.h"
+
+#ifdef HAVE_ALSA_USE_CASE_H
+
+#include <alsa/use-case.h>
+
+/*
+ * Keep it as simple as possible. Execute commands from the
+ * FixedBootSequence and BootSequence only.
+ */
+int init_ucm(int flags, int cardno)
+{
+       snd_use_case_mgr_t *uc_mgr;
+       char id[32], *nodev;
+       int err;
+
+       if (flags & FLAG_UCM_DISABLED) {
+               dbg("ucm disabled");
+               return -ENXIO;
+       }
+
+       nodev = (flags & FLAG_UCM_NODEV) ? "" : "-";
+       snprintf(id, sizeof(id), "%shw:%d", nodev, cardno);
+       err = snd_use_case_mgr_open(&uc_mgr, id);
+       dbg("ucm open '%s': %d", id, err);
+       if (err < 0)
+               return err;
+       if (flags & FLAG_UCM_FBOOT) {
+               err = snd_use_case_set(uc_mgr, "_fboot", NULL);
+               dbg("ucm _fboot: %d", err);
+               if (err == -ENOENT && (flags & FLAG_UCM_BOOT) != 0) {
+                       /* nothing */
+               } else if (err < 0) {
+                       goto _error;
+               }
+       }
+       if (flags & FLAG_UCM_BOOT) {
+               err = snd_use_case_set(uc_mgr, "_boot", NULL);
+               dbg("ucm _boot: %d", err);
+               if (err < 0)
+                       goto _error;
+               if ((flags & FLAG_UCM_DEFAULTS) != 0)
+                       err = snd_use_case_set(uc_mgr, "_defaults", NULL);
+       }
+_error:
+       snd_use_case_mgr_close(uc_mgr);
+       return err;
+}
+
+#else
+
+int init_ucm(int flags, int cardno)
+{
+       return -ENXIO;
+}
+
+#endif
index 9d7efcc..4927b70 100644 (file)
@@ -15,7 +15,7 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
+#include <signal.h>
+#include <sys/time.h>
 #include <sys/stat.h>
 #include "alsactl.h"
+#include "os_compat.h"
 
-static int state_lock_(const char *file, int lock, int timeout, int _fd)
+#define PATH_SIZE 512
+
+static int alarm_flag;
+
+static void signal_handler_alarm(int sig ATTRIBUTE_UNUSED)
+{
+       alarm_flag = 1;
+}
+
+static int state_lock_(const char *lock_file, int lock, int timeout, int _fd)
 {
        int fd = -1, err = 0;
        struct flock lck;
        struct stat st;
-       char lcktxt[12];
-       char *nfile = lockfile;
+       char lcktxt[14];
+       struct sigaction sig_alarm, sig_alarm_orig;
+       struct itimerval itv;
 
        if (do_lock <= 0)
                return 0;
@@ -53,21 +66,25 @@ static int state_lock_(const char *file, int lock, int timeout, int _fd)
                fd = _fd;
        }
        while (fd < 0 && timeout-- > 0) {
-               fd = open(nfile, O_RDWR);
+               fd = open(lock_file, O_RDWR);
                if (!lock && fd < 0) {
                        err = -EIO;
                        goto out;
                }
                if (fd < 0) {
-                       fd = open(nfile, O_RDWR|O_CREAT|O_EXCL, 0644);
+                       fd = open(lock_file, O_RDWR|O_CREAT|O_EXCL, 0644);
                        if (fd < 0) {
                                if (errno == EBUSY || errno == EAGAIN) {
                                        sleep(1);
-                                       timeout--;
-                               } else {
-                                       err = -errno;
-                                       goto out;
+                                       continue;
+                               }
+                               if (errno == EEXIST) {
+                                       fd = open(lock_file, O_RDWR);
+                                       if (fd >= 0)
+                                               break;
                                }
+                               err = -errno;
+                               goto out;
                        }
                }
        }
@@ -89,15 +106,31 @@ static int state_lock_(const char *file, int lock, int timeout, int _fd)
                        goto out;
                }
        }
-       while (timeout > 0) {
-               if (fcntl(fd, F_SETLK, &lck) < 0) {
-                       sleep(1);
-                       timeout--;
-               } else {
+       alarm_flag = 0;
+       memset(&sig_alarm, 0, sizeof(sig_alarm));
+       sigemptyset(&sig_alarm.sa_mask);
+       sig_alarm.sa_handler = signal_handler_alarm;
+       if (sigaction(SIGALRM, &sig_alarm, &sig_alarm_orig) < 0) {
+               err = -ENXIO;
+               goto out;
+       }
+       memset(&itv, 0, sizeof(itv));
+       itv.it_value.tv_sec = timeout;
+       if (setitimer(ITIMER_REAL, &itv, NULL) < 0) {
+               err = -ENXIO;
+               sigaction(SIGALRM, &sig_alarm_orig, NULL);
+               goto out;
+       }
+       while (alarm_flag == 0) {
+               if (fcntl(fd, F_SETLKW, &lck) == 0)
                        break;
-               }
+               if (errno == EAGAIN || errno == ERESTART)
+                       continue;
        }
-       if (timeout <= 0) {
+       memset(&itv, 0, sizeof(itv));
+       setitimer(ITIMER_REAL, &itv, NULL);
+       sigaction(SIGALRM, &sig_alarm_orig, NULL);
+       if (alarm_flag) {
                err = -EBUSY;
                goto out;
        }
@@ -116,11 +149,21 @@ out:
        return err;
 }
 
+static void state_lock_file(char *buf, size_t buflen)
+{
+       if (lockfile[0] == '/')
+               snprintf(buf, buflen, "%s", lockfile);
+       else
+               snprintf(buf, buflen, "%s/%s", lockpath, lockfile);
+}
+
 int state_lock(const char *file, int timeout)
 {
+       char fn[PATH_SIZE];
        int err;
 
-       err = state_lock_(file, 1, timeout, -1);
+       state_lock_file(fn, sizeof(fn));
+       err = state_lock_(fn, 1, timeout, -1);
        if (err < 0)
                error("file %s lock error: %s", file, strerror(-err));
        return err;
@@ -128,10 +171,41 @@ int state_lock(const char *file, int timeout)
 
 int state_unlock(int _fd, const char *file)
 {
+       char fn[PATH_SIZE];
        int err;
 
-       err = state_lock_(file, 0, 10, _fd);
+       state_lock_file(fn, sizeof(fn));
+       err = state_lock_(fn, 0, 10, _fd);
        if (err < 0)
                error("file %s unlock error: %s", file, strerror(-err));
        return err;
 }
+
+static void card_lock_file(char *buf, size_t buflen, int card_number)
+{
+       snprintf(buf, buflen, "%s/card%i.lock", lockpath, card_number);
+}
+
+int card_lock(int card_number, int timeout)
+{
+       char fn[PATH_SIZE];
+       int err;
+
+       card_lock_file(fn, sizeof(fn), card_number);
+       err = state_lock_(fn, 1, timeout, -1);
+       if (err < 0)
+               error("card %d lock error: %s", card_number, strerror(-err));
+       return err;
+}
+
+int card_unlock(int _fd, int card_number)
+{
+       char fn[PATH_SIZE];
+       int err;
+
+       card_lock_file(fn, sizeof(fn), card_number);
+       err = state_lock_(fn, 0, 10, _fd);
+       if (err < 0)
+               error("card %d unlock error: %s", card_number, strerror(-err));
+       return err;
+}
index 29379ad..36e9398 100644 (file)
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include "aconfig.h"
 #include "version.h"
 #include <stdio.h>
-#include <alsa/asoundlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/epoll.h>
+#include <sys/inotify.h>
+#include <limits.h>
+#include <time.h>
+#include <signal.h>
+#include <sys/signalfd.h>
+
+#include <stddef.h>
+#include "list.h"
+
+#include "alsactl.h"
+
+struct src_entry {
+       snd_ctl_t *handle;
+       char *name;
+       unsigned int pfd_count;
+       struct list_head list;
+};
+
+static void remove_source_entry(struct src_entry *entry)
+{
+       list_del(&entry->list);
+       if (entry->handle)
+               snd_ctl_close(entry->handle);
+       free(entry->name);
+       free(entry);
+}
+
+static void clear_source_list(struct list_head *srcs)
+{
+       struct src_entry *entry, *tmp;
+
+       list_for_each_entry_safe(entry, tmp, srcs, list)
+               remove_source_entry(entry);
+}
+
+static int insert_source_entry(struct list_head *srcs, snd_ctl_t *handle,
+                              const char *name)
+{
+       struct src_entry *entry;
+       int count;
+       int err;
+
+       entry = calloc(1, sizeof(*entry));
+       if (!entry)
+               return -ENOMEM;
+       INIT_LIST_HEAD(&entry->list);
+       entry->handle = handle;
+
+       entry->name = strdup(name);
+       if (!entry->name) {
+               err = -ENOMEM;
+               goto error;
+       }
+
+       count = snd_ctl_poll_descriptors_count(handle);
+       if (count < 0) {
+               err = count;
+               goto error;
+       }
+       if (count == 0) {
+               err = -ENXIO;
+               goto error;
+       }
+       entry->pfd_count = count;
+
+       list_add_tail(&entry->list, srcs);
+
+       return 0;
+error:
+       remove_source_entry(entry);
+       return err;
+}
 
 static int open_ctl(const char *name, snd_ctl_t **ctlp)
 {
@@ -42,7 +116,88 @@ static int open_ctl(const char *name, snd_ctl_t **ctlp)
        return 0;
 }
 
-static int print_event(int card, snd_ctl_t *ctl)
+static inline bool seek_entry_by_name(struct list_head *srcs, const char *name)
+{
+       struct src_entry *entry;
+
+       list_for_each_entry(entry, srcs, list) {
+               if (!strcmp(entry->name, name))
+                       return true;
+       }
+
+       return false;
+}
+
+static int prepare_source_entry(struct list_head *srcs, const char *name)
+{
+       snd_ctl_t *handle;
+       int err;
+
+       if (!name) {
+               struct snd_card_iterator iter;
+               const char *cardname;
+
+               snd_card_iterator_init(&iter, -1);
+               while ((cardname = snd_card_iterator_next(&iter))) {
+                       if (seek_entry_by_name(srcs, cardname))
+                               continue;
+                       err = open_ctl(cardname, &handle);
+                       if (err < 0)
+                               return err;
+                       err = insert_source_entry(srcs, handle, cardname);
+                       if (err < 0)
+                               return err;
+               }
+       } else {
+               if (seek_entry_by_name(srcs, name))
+                       return 0;
+               err = open_ctl(name, &handle);
+               if (err < 0)
+                       return err;
+               err = insert_source_entry(srcs, handle, name);
+               if (err < 0)
+                       return err;
+       }
+
+       return 0;
+}
+
+static int check_control_cdev(int infd, bool *retry)
+{
+       struct inotify_event *ev;
+       char *buf;
+       int err = 0;
+
+       buf = calloc(1, sizeof(*ev) + NAME_MAX);
+       if (!buf)
+               return -ENOMEM;
+
+       while (1) {
+               ssize_t len = read(infd, buf, sizeof(*ev) + NAME_MAX);
+               if (len < 0) {
+                       if (errno != EAGAIN)
+                               err = errno;
+                       break;
+               } else if (len == 0) {
+                       break;
+               }
+
+               size_t pos = 0;
+               while (pos < (size_t)len) {
+                       ev = (struct inotify_event *)(buf + pos);
+                       if ((ev->mask & IN_CREATE) &&
+                           strstr(ev->name, "controlC") == ev->name)
+                               *retry = true;
+                       pos += sizeof(*ev) + ev->len;
+               }
+       }
+
+       free(buf);
+
+       return err;
+}
+
+static int print_event(snd_ctl_t *ctl, const char *name)
 {
        snd_ctl_event_t *event;
        unsigned int mask;
@@ -56,9 +211,8 @@ static int print_event(int card, snd_ctl_t *ctl)
        if (snd_ctl_event_get_type(event) != SND_CTL_EVENT_ELEM)
                return 0;
 
-       if (card >= 0)
-               printf("card %d, ", card);
-       printf("#%d (%i,%i,%i,%s,%i)",
+       printf("node %s, #%d (%i,%i,%i,%s,%i)",
+              name,
               snd_ctl_event_elem_get_numid(event),
               snd_ctl_event_elem_get_interface(event),
               snd_ctl_event_elem_get_device(event),
@@ -81,65 +235,218 @@ static int print_event(int card, snd_ctl_t *ctl)
        if (mask & SND_CTL_EVENT_MASK_TLV)
                printf(" TLV");
        printf("\n");
+       fflush(stdout);
        return 0;
 }
 
-#define MAX_CARDS      256
+static int operate_dispatcher(int epfd, uint32_t op, struct epoll_event *epev,
+                             struct src_entry *entry)
+{
+       struct pollfd *pfds;
+       int count;
+       int i;
+       int err = 0;
 
-int monitor(const char *name)
+       pfds = calloc(entry->pfd_count, sizeof(*pfds));
+       if (!pfds)
+               return -ENOMEM;
+
+       count = snd_ctl_poll_descriptors(entry->handle, pfds, entry->pfd_count);
+       if (count < 0) {
+               err = count;
+               goto end;
+       }
+       if (count != (int)entry->pfd_count) {
+               err = -EIO;
+               goto end;
+       }
+
+       for (i = 0; i < (int)entry->pfd_count; ++i) {
+               err = epoll_ctl(epfd, op, pfds[i].fd, epev);
+               if (err < 0)
+                       break;
+       }
+end:
+       free(pfds);
+       return err;
+}
+
+static int prepare_dispatcher(int epfd, int sigfd, int infd,
+                             struct list_head *srcs)
 {
-       snd_ctl_t *ctls[MAX_CARDS];
-       int ncards = 0;
-       int show_cards;
-       int i, err = 0;
+       struct epoll_event ev = {0};
+       struct src_entry *entry;
+       int err = 0;
 
-       if (!name) {
-               int card = -1;
-               while (snd_card_next(&card) >= 0 && card >= 0) {
-                       char cardname[16];
-                       if (ncards >= MAX_CARDS) {
-                               fprintf(stderr, "alsactl: too many cards\n");
-                               err = -E2BIG;
-                               goto error;
-                       }
-                       sprintf(cardname, "hw:%d", card);
-                       err = open_ctl(cardname, &ctls[ncards]);
-                       if (err < 0)
-                               goto error;
-                       ncards++;
-               }
-               show_cards = 1;
-       } else {
-               err = open_ctl(name, &ctls[0]);
+       ev.events = EPOLLIN;
+       ev.data.fd = sigfd;
+       if (epoll_ctl(epfd, EPOLL_CTL_ADD, sigfd, &ev) < 0)
+               return -errno;
+
+       ev.events = EPOLLIN;
+       ev.data.fd = infd;
+       if (epoll_ctl(epfd, EPOLL_CTL_ADD, infd, &ev) < 0)
+               return -errno;
+
+       list_for_each_entry(entry, srcs, list) {
+               ev.events = EPOLLIN;
+               ev.data.ptr = (void *)entry;
+               err = operate_dispatcher(epfd, EPOLL_CTL_ADD, &ev, entry);
                if (err < 0)
-                       goto error;
-               ncards++;
-               show_cards = 0;
+                       break;
        }
 
-       for (;ncards > 0;) {
-               struct pollfd fds[ncards];
+       return err;
+}
+
+static int run_dispatcher(int epfd, int sigfd, int infd, struct list_head *srcs,
+                         bool *retry)
+{
+       struct src_entry *entry;
+       unsigned int max_ev_count;
+       struct epoll_event *epev;
+       int err = 0;
+
+       max_ev_count = 0;
+       list_for_each_entry(entry, srcs, list)
+               max_ev_count += entry->pfd_count;
 
-               for (i = 0; i < ncards; i++)
-                       snd_ctl_poll_descriptors(ctls[i], &fds[i], 1);
+       epev = calloc(max_ev_count, sizeof(*epev));
+       if (!epev)
+               return -ENOMEM;
 
-               err = poll(fds, ncards, -1);
-               if (err <= 0) {
-                       err = 0;
+       while (true) {
+               int count;
+               int i;
+
+               count = epoll_wait(epfd, epev, max_ev_count, -1);
+               if (count < 0) {
+                       if (errno == EINTR)
+                               continue;
+                       err = count;
                        break;
                }
+               if (count == 0)
+                       continue;
+
+               for (i = 0; i < count; ++i) {
+                       struct epoll_event *ev = epev + i;
 
-               for (i = 0; i < ncards; i++) {
-                       unsigned short revents;
-                       snd_ctl_poll_descriptors_revents(ctls[i], &fds[i], 1,
-                                                        &revents);
-                       if (revents & POLLIN)
-                               print_event(show_cards ? i : -1, ctls[i]);
+                       if (ev->data.fd == sigfd)
+                               goto end;
+
+                       if (ev->data.fd == infd) {
+                               err = check_control_cdev(infd, retry);
+                               if (err < 0 || *retry)
+                                       goto end;
+                               continue;
+                       }
+
+                       entry = ev->data.ptr;
+                       if (ev->events & EPOLLIN)
+                               print_event(entry->handle, entry->name);
+                       if (ev->events & EPOLLERR) {
+                               operate_dispatcher(epfd, EPOLL_CTL_DEL, NULL, entry);
+                               remove_source_entry(entry);
+                       }
                }
        }
+end:
+       free(epev);
+       return err;
+}
+
+static void clear_dispatcher(int epfd, int sigfd, int infd,
+                            struct list_head *srcs)
+{
+       struct src_entry *entry;
+
+       list_for_each_entry(entry, srcs, list)
+               operate_dispatcher(epfd, EPOLL_CTL_DEL, NULL, entry);
+
+       epoll_ctl(epfd, EPOLL_CTL_DEL, infd, NULL);
+
+       epoll_ctl(epfd, EPOLL_CTL_DEL, sigfd, NULL);
+}
+
+static int prepare_signalfd(int *sigfd)
+{
+       sigset_t mask;
+       int fd;
+
+       sigemptyset(&mask);
+       sigaddset(&mask, SIGINT);
+       sigaddset(&mask, SIGTERM);
+
+       if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0)
+               return -errno;
+
+       fd = signalfd(-1, &mask, 0);
+       if (fd < 0)
+               return -errno;
+       *sigfd = fd;
+
+       return 0;
+}
+
+int monitor(const char *name)
+{
+       LIST_HEAD(srcs);
+       int sigfd = 0;
+       int epfd;
+       int infd;
+       int wd = 0;
+       bool retry;
+       int err = 0;
+
+       err = prepare_signalfd(&sigfd);
+       if (err < 0)
+               return err;
+
+       epfd = epoll_create(1);
+       if (epfd < 0) {
+               close(sigfd);
+               return -errno;
+       }
+
+       infd = inotify_init1(IN_NONBLOCK);
+       if (infd < 0) {
+               err = -errno;
+               goto error;
+       }
+       wd = inotify_add_watch(infd, "/dev/snd/", IN_CREATE);
+       if (wd < 0) {
+               err = -errno;
+               goto error;
+       }
+retry:
+       retry = false;
+       err = prepare_source_entry(&srcs, name);
+       if (err < 0)
+               goto error;
+
+       err = prepare_dispatcher(epfd, sigfd, infd, &srcs);
+       if (err >= 0)
+               err = run_dispatcher(epfd, sigfd, infd, &srcs, &retry);
+       clear_dispatcher(epfd, sigfd, infd, &srcs);
+
+       if (retry) {
+               // A simple makeshift for timing gap between creation of nodes
+               // by devtmpfs and chmod() by udevd.
+               struct timespec req = { .tv_sec = 1 };
+               nanosleep(&req, NULL);
+               goto retry;
+       }
+error:
+       clear_source_list(&srcs);
+
+       if (wd > 0)
+               inotify_rm_watch(infd, wd);
+       close(infd);
+
+       close(epfd);
+
+       close(sigfd);
 
- error:
-       for (i = 0; i < ncards; i++)
-               snd_ctl_close(ctls[i]);
        return err;
 }
index 3908ec4..88996d4 100644 (file)
@@ -16,7 +16,7 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
@@ -27,7 +27,6 @@
 #include <stdio.h>
 #include <assert.h>
 #include <errno.h>
-#include <alsa/asoundlib.h>
 #include "alsactl.h"
 
 
@@ -230,7 +229,7 @@ static int get_control(snd_ctl_t *handle, snd_ctl_elem_id_t *id, snd_config_t *t
 {
        snd_ctl_elem_value_t *ctl;
        snd_ctl_elem_info_t *info;
-       snd_config_t *control, *comment, *item, *value;
+       snd_config_t *control, *comment, *item = NULL, *value;
        const char *s;
        char buf[256];
        unsigned int idx;
@@ -336,9 +335,9 @@ static int get_control(snd_ctl_t *handle, snd_ctl_elem_id_t *id, snd_config_t *t
                long long max = snd_ctl_elem_info_get_max64(info);
                long long step = snd_ctl_elem_info_get_step64(info);
                if (step)
-                       sprintf(buf, "%Li - %Li (step %Li)", min, max, step);
+                       sprintf(buf, "%lli - %lli (step %lli)", min, max, step);
                else
-                       sprintf(buf, "%Li - %Li", min, max);
+                       sprintf(buf, "%lli - %lli", min, max);
                err = snd_config_string_add(comment, "range", buf);
                if (err < 0) {
                        error("snd_config_string_add: %s", snd_strerror(err));
@@ -656,13 +655,16 @@ static long config_iface(snd_config_t *n)
        const char *str;
        switch (snd_config_get_type(n)) {
        case SND_CONFIG_TYPE_INTEGER:
-               snd_config_get_integer(n, &i);
+               if (snd_config_get_integer(n, &i) < 0)
+                       return -1;
                return i;
        case SND_CONFIG_TYPE_INTEGER64:
-               snd_config_get_integer64(n, &li);
+               if (snd_config_get_integer64(n, &li) < 0)
+                       return -1;
                return li;
        case SND_CONFIG_TYPE_STRING:
-               snd_config_get_string(n, &str);
+               if (snd_config_get_string(n, &str) < 0)
+                       return -1;
                break;
        default:
                return -1;
@@ -682,17 +684,20 @@ static int config_bool(snd_config_t *n, int doit)
 
        switch (snd_config_get_type(n)) {
        case SND_CONFIG_TYPE_INTEGER:
-               snd_config_get_integer(n, &val);
+               if (snd_config_get_integer(n, &val) < 0)
+                       return -1;
                if (val < 0 || val > 1)
                        return -1;
                return val;
        case SND_CONFIG_TYPE_INTEGER64:
-               snd_config_get_integer64(n, &lval);
+               if (snd_config_get_integer64(n, &lval) < 0)
+                       return -1;
                if (lval < 0 || lval > 1)
                        return -1;
                return (int) lval;
        case SND_CONFIG_TYPE_STRING:
-               snd_config_get_string(n, &str);
+               if (snd_config_get_string(n, &str) < 0)
+                       return -1;
                break;
        case SND_CONFIG_TYPE_COMPOUND:
                if (!force_restore || !doit)
@@ -719,13 +724,16 @@ static int config_enumerated(snd_config_t *n, snd_ctl_t *handle,
 
        switch (snd_config_get_type(n)) {
        case SND_CONFIG_TYPE_INTEGER:
-               snd_config_get_integer(n, &val);
+               if (snd_config_get_integer(n, &val) < 0)
+                       return -1;
                return val;
        case SND_CONFIG_TYPE_INTEGER64:
-               snd_config_get_integer64(n, &lval);
+               if (snd_config_get_integer64(n, &lval) < 0)
+                       return -1;
                return (int) lval;
        case SND_CONFIG_TYPE_STRING:
-               snd_config_get_string(n, &str);
+               if (snd_config_get_string(n, &str) < 0)
+                       return -1;
                break;
        case SND_CONFIG_TYPE_COMPOUND:
                if (!force_restore || !doit)
@@ -1118,7 +1126,7 @@ static int check_comment_range(snd_ctl_t *handle, snd_config_t *conf,
 }
 
 static int restore_config_value(snd_ctl_t *handle, snd_ctl_elem_info_t *info,
-                               snd_ctl_elem_iface_t type,
+                               snd_ctl_elem_type_t type,
                                snd_config_t *value,
                                snd_ctl_elem_value_t *ctl, int idx,
                                int doit)
@@ -1167,7 +1175,7 @@ static int restore_config_value(snd_ctl_t *handle, snd_ctl_elem_info_t *info,
 }
 
 static int restore_config_value2(snd_ctl_t *handle, snd_ctl_elem_info_t *info,
-                                snd_ctl_elem_iface_t type,
+                                snd_ctl_elem_type_t type,
                                 snd_config_t *value,
                                 snd_ctl_elem_value_t *ctl, int idx,
                                 unsigned int numid, int doit)
@@ -1248,6 +1256,8 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control,
                }
                if (strcmp(fld, "iface") == 0) {
                        iface = (snd_ctl_elem_iface_t)config_iface(n);
+                       if (iface < 0)
+                               return -EINVAL;
                        continue;
                }
                if (strcmp(fld, "device") == 0) {
@@ -1255,7 +1265,8 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control,
                                cerror(doit, "control.%d.%s is invalid", numid, fld);
                                return -EINVAL;
                        }
-                       snd_config_get_integer(n, &device);
+                       if (snd_config_get_integer(n, &device) < 0)
+                               return -EINVAL;
                        continue;
                }
                if (strcmp(fld, "subdevice") == 0) {
@@ -1263,7 +1274,8 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control,
                                cerror(doit, "control.%d.%s is invalid", numid, fld);
                                return -EINVAL;
                        }
-                       snd_config_get_integer(n, &subdevice);
+                       if (snd_config_get_integer(n, &subdevice) < 0)
+                               return -EINVAL;
                        continue;
                }
                if (strcmp(fld, "name") == 0) {
@@ -1271,7 +1283,8 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control,
                                cerror(doit, "control.%d.%s is invalid", numid, fld);
                                return -EINVAL;
                        }
-                       snd_config_get_string(n, &name);
+                       if (snd_config_get_string(n, &name) < 0)
+                               return -EINVAL;
                        continue;
                }
                if (strcmp(fld, "index") == 0) {
@@ -1279,7 +1292,8 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control,
                                cerror(doit, "control.%d.%s is invalid", numid, fld);
                                return -EINVAL;
                        }
-                       snd_config_get_integer(n, &index);
+                       if (snd_config_get_integer(n, &index) < 0)
+                               return -EINVAL;
                        continue;
                }
                if (strcmp(fld, "value") == 0) {
@@ -1336,7 +1350,7 @@ static int set_control(snd_ctl_t *handle, snd_config_t *control,
        if (err |= numid != numid1 && !force_restore)
                cerror(doit, "warning: numid mismatch (%d/%d) for control #%d", 
                      numid, numid1, numid);
-       if (err |= iface != iface1)
+       if (err |= (int)iface != iface1)
                cerror(doit, "warning: iface mismatch (%d/%d) for control #%d", iface, iface1, numid);
        if (err |= device != device1)
                cerror(doit, "warning: device mismatch (%ld/%ld) for control #%d", device, device1, numid);
@@ -1468,13 +1482,19 @@ static int set_controls(int card, snd_config_t *top, int doit)
 {
        snd_ctl_t *handle;
        snd_ctl_card_info_t *info;
+       snd_ctl_elem_list_t *list;
+       snd_ctl_elem_info_t *elem_info;
+       snd_ctl_elem_id_t *elem_id;
        snd_config_t *control;
        snd_config_iterator_t i, next;
-       int err, maxnumid = -1;
+       int err, maxnumid = -1, maxnumid2 = -1;
+       unsigned int idx, count = 0;
        char name[32], tmpid[16];
        const char *id;
        snd_ctl_card_info_alloca(&info);
-
+       snd_ctl_elem_list_alloca(&list);
+       snd_ctl_elem_info_alloca(&elem_info);
+       snd_ctl_elem_id_alloca(&elem_id);
        sprintf(name, "hw:%d", card);
        dbg("device='%s', doit=%i", name, doit);
        err = snd_ctl_open(&handle, name, 0);
@@ -1514,22 +1534,54 @@ static int set_controls(int card, snd_config_t *top, int doit)
                        goto _close;
        }
 
-       dbg("maxnumid=%i", maxnumid);
+       if (doit)
+               goto _close;
+
+       err = snd_ctl_elem_list(handle, list);
+       if (err < 0) {
+               error("Cannot determine controls: %s", snd_strerror(err));
+               goto _close;
+       }
+       count = snd_ctl_elem_list_get_count(list);
+       dbg("list count: %u", count);
+       if (count == 0)
+               goto _check;
+       snd_ctl_elem_list_set_offset(list, 0);
+       if (snd_ctl_elem_list_alloc_space(list, count) < 0) {
+               error("No enough memory...");
+               goto _close;
+       }
+       if ((err = snd_ctl_elem_list(handle, list)) < 0) {
+               error("Cannot determine controls (2): %s", snd_strerror(err));
+               goto _free;
+       }
+       maxnumid2 = 0;
+       /* skip non-readable elements */
+       for (idx = 0; idx < count; ++idx) {
+               snd_ctl_elem_info_clear(elem_info);
+               snd_ctl_elem_list_get_id(list, idx, elem_id);
+               snd_ctl_elem_info_set_id(elem_info, elem_id);
+               if (snd_ctl_elem_info(handle, elem_info) == 0) {
+                       if (!snd_ctl_elem_info_is_readable(elem_info))
+                               continue;
+                       maxnumid2++;
+               }
+       }
+
        /* check if we have additional controls in driver */
        /* in this case we should go through init procedure */
-       if (!doit && maxnumid >= 0) {
-               snd_ctl_elem_info_t *info;
-               snd_ctl_elem_info_alloca(&info);
-               snd_ctl_elem_info_set_numid(info, maxnumid+1);
-               if (snd_ctl_elem_info(handle, info) == 0) {
-                       /* not very informative */
-                       /* but value is used for check only */
-                       err = -EAGAIN;
-                       dbg("more controls than maxnumid?");
-                       goto _close;
-               }
+ _check:
+       dbg("maxnumid=%i maxnumid2=%i", maxnumid, maxnumid2);
+       if (maxnumid >= 0 && maxnumid != maxnumid2) {
+               /* not very informative */
+               /* but value is used for check only */
+               err = -EAGAIN;
+               dbg("more controls than maxnumid?");
        }
 
+ _free:
+       if (count > 0)
+               snd_ctl_elem_list_free_space(list);
  _close:
        snd_ctl_close(handle);
        dbg("result code: %i", err);
@@ -1545,6 +1597,7 @@ int save_state(const char *file, const char *cardname)
        int stdio;
        char *nfile = NULL;
        int lock_fd = -EINVAL;
+       struct snd_card_iterator iter;
 
        err = snd_config_top(&config);
        if (err < 0) {
@@ -1561,7 +1614,7 @@ int save_state(const char *file, const char *cardname)
                }
                strcpy(nfile, file);
                strcat(nfile, ".new");
-               lock_fd = state_lock(file, 10);
+               lock_fd = state_lock(file, LOCK_TIMEOUT);
                if (lock_fd < 0) {
                        err = lock_fd;
                        goto out;
@@ -1578,45 +1631,18 @@ int save_state(const char *file, const char *cardname)
 #endif
        }
 
-       if (!cardname) {
-               int card, first = 1;
-
-               card = -1;
-               /* find each installed soundcards */
-               while (1) {
-                       if (snd_card_next(&card) < 0)
-                               break;
-                       if (card < 0) {
-                               if (first) {
-                                       if (ignore_nocards) {
-                                               err = 0;
-                                               goto out;
-                                       } else {
-                                               error("No soundcards found...");
-                                               err = -ENODEV;
-                                               goto out;
-                                       }
-                               }
-                               break;
-                       }
-                       first = 0;
-                       if ((err = get_controls(card, config)))
-                               goto out;
-               }
-       } else {
-               int cardno;
-
-               cardno = snd_card_get_index(cardname);
-               if (cardno < 0) {
-                       error("Cannot find soundcard '%s'...", cardname);
-                       err = cardno;
-                       goto out;
-               }
-               if ((err = get_controls(cardno, config))) {
+       err = snd_card_iterator_sinit(&iter, cardname);
+       if (err < 0)
+               goto out;
+       while (snd_card_iterator_next(&iter)) {
+               if ((err = get_controls(iter.card, config)))
                        goto out;
-               }
        }
-       
+       if (iter.first) {
+               err = snd_card_iterator_error(&iter);
+               goto out;
+       }
+
        if (stdio) {
                err = snd_output_stdio_attach(&out, stdout, 0);
        } else {
@@ -1645,142 +1671,81 @@ out:
        return err;
 }
 
-int load_state(const char *file, const char *initfile, const char *cardname,
-              int do_init)
+int load_state(const char *cfgdir, const char *file,
+              const char *initfile, int initflags,
+              const char *cardname, int do_init)
 {
-       int err, finalerr = 0;
+       int err, finalerr = 0, open_failed, lock_fd;
+       struct snd_card_iterator iter;
        snd_config_t *config;
-       snd_input_t *in;
-       int stdio, lock_fd = -EINVAL;
+       const char *cardname1;
 
-       err = snd_config_top(&config);
-       if (err < 0) {
-               error("snd_config_top error: %s", snd_strerror(err));
+       config = NULL;
+       err = load_configuration(file, &config, &open_failed);
+       if (err < 0 && !open_failed)
                return err;
-       }
-       stdio = !strcmp(file, "-");
-       if (stdio) {
-               err = snd_input_stdio_attach(&in, stdin, 0);
-       } else {
-               lock_fd = state_lock(file, 10);
-               err = lock_fd >= 0 ? snd_input_stdio_open(&in, file, "r") : lock_fd;
-       }
-       if (err >= 0) {
-               err = snd_config_load(config, in);
-               snd_input_close(in);
-               if (lock_fd >= 0)
-                       state_unlock(lock_fd, file);
-               if (err < 0) {
-                       error("snd_config_load error: %s", snd_strerror(err));
-                       goto out;
-               }
-       } else {
-               int card, first = 1;
-               char cardname1[16];
 
-               if (lock_fd >= 0)
-                       state_unlock(lock_fd, file);
+       if (open_failed) {
                error("Cannot open %s for reading: %s", file, snd_strerror(err));
                finalerr = err;
-               if (cardname) {
-                       card = snd_card_get_index(cardname);
-                       if (card < 0) {
-                               error("Cannot find soundcard '%s'...", cardname);
-                               err = -ENODEV;
-                               goto out;
-                       }
-                       goto single;
-               } else {
-                       card = -1;
-               }
-               /* find each installed soundcards */
-               while (!cardname) {
-                       if (snd_card_next(&card) < 0)
-                               break;
-                       if (card < 0)
-                               break;
-single:
-                       first = 0;
+
+               err = snd_card_iterator_sinit(&iter, cardname);
+               if (err < 0)
+                       return err;
+               while ((cardname1 = snd_card_iterator_next(&iter)) != NULL) {
                        if (!do_init)
                                break;
-                       sprintf(cardname1, "%i", card);
-                       err = init(initfile, cardname1);
+                       lock_fd = card_lock(iter.card, LOCK_TIMEOUT);
+                       if (lock_fd < 0) {
+                               finalerr = lock_fd;
+                               initfailed(iter.card, "lock", err);
+                               continue;
+                       }
+                       err = init(cfgdir, initfile, initflags | FLAG_UCM_FBOOT | FLAG_UCM_BOOT, cardname1);
+                       card_unlock(lock_fd, iter.card);
                        if (err < 0) {
                                finalerr = err;
-                               initfailed(card, "init", err);
+                               initfailed(iter.card, "init", err);
                        }
-                       initfailed(card, "restore", -ENOENT);
+                       initfailed(iter.card, "restore", -ENOENT);
                }
-               if (first)
-                       finalerr = 0;   /* no cards, no error code */
                err = finalerr;
+               if (iter.first)
+                       err = 0;        /* no cards, no error code */
                goto out;
        }
 
-       if (!cardname) {
-               int card, first = 1;
-               char cardname1[16];
-
-               card = -1;
-               /* find each installed soundcards */
-               while (1) {
-                       if (snd_card_next(&card) < 0)
-                               break;
-                       if (card < 0) {
-                               if (first) {
-                                       if (ignore_nocards) {
-                                               err = 0;
-                                               goto out;
-                                       } else {
-                                               error("No soundcards found...");
-                                               err = -ENODEV;
-                                               goto out;
-                                       }
-                               }
-                               break;
-                       }
-                       first = 0;
-                       /* do a check if controls matches state file */
-                       if (do_init && set_controls(card, config, 0)) {
-                               sprintf(cardname1, "%i", card);
-                               err = init(initfile, cardname1);
-                               if (err < 0) {
-                                       initfailed(card, "init", err);
-                                       finalerr = err;
-                               }
-                       }
-                       if ((err = set_controls(card, config, 1))) {
-                               if (!force_restore)
-                                       finalerr = err;
-                               initfailed(card, "restore", err);
-                       }
-               }
-       } else {
-               int cardno;
-
-               cardno = snd_card_get_index(cardname);
-               if (cardno < 0) {
-                       error("Cannot find soundcard '%s'...", cardname);
-                       err = -ENODEV;
-                       goto out;
+       err = snd_card_iterator_sinit(&iter, cardname);
+       if (err < 0)
+               goto out;
+       while ((cardname1 = snd_card_iterator_next(&iter)) != NULL) {
+               lock_fd = card_lock(iter.card, LOCK_TIMEOUT);
+               if (lock_fd < 0) {
+                       initfailed(iter.card, "lock", lock_fd);
+                       finalerr = lock_fd;
+                       continue;
                }
+               /* error is ignored */
+               init_ucm(initflags | FLAG_UCM_FBOOT, iter.card);
                /* do a check if controls matches state file */
-               if (do_init && set_controls(cardno, config, 0)) {
-                       err = init(initfile, cardname);
+               if (do_init && set_controls(iter.card, config, 0)) {
+                       err = init(cfgdir, initfile, initflags | FLAG_UCM_BOOT, cardname1);
                        if (err < 0) {
-                               initfailed(cardno, "init", err);
+                               initfailed(iter.card, "init", err);
                                finalerr = err;
                        }
                }
-               if ((err = set_controls(cardno, config, 1))) {
-                       initfailed(cardno, "restore", err);
+               if ((err = set_controls(iter.card, config, 1))) {
                        if (!force_restore)
-                               goto out;
+                               finalerr = err;
+                       initfailed(iter.card, "restore", err);
                }
+               card_unlock(lock_fd, iter.card);
        }
-       err = finalerr;
+       err = finalerr ? finalerr : snd_card_iterator_error(&iter);
 out:
-       snd_config_delete(config);
+       if (config)
+               snd_config_delete(config);
        snd_config_update_free_global();
        return err;
 }
index 304df7c..d8cbf53 100644 (file)
@@ -15,7 +15,7 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
@@ -30,8 +30,7 @@
 #include <syslog.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
-
-#include <alsa/asoundlib.h>
+#include <limits.h>
 #include "alsactl.h"
 
 int file_map(const char *filename, char **buf, size_t *bufsize)
@@ -92,12 +91,12 @@ void initfailed(int cardnumber, const char *reason, int exitcode)
                return;
        sprintf(sexitcode, "%i", exitcode);
        fp = open(statefile, O_WRONLY|O_CREAT|O_APPEND, 0644);
-       write(fp, str, strlen(str));
-       write(fp, ":", 1);
-       write(fp, reason, strlen(reason));
-       write(fp, ":", 1);
-       write(fp, sexitcode, strlen(sexitcode));
-       write(fp, "\n", 1);
+       (void)write(fp, str, strlen(str));
+       (void)write(fp, ":", 1);
+       (void)write(fp, reason, strlen(reason));
+       (void)write(fp, ":", 1);
+       (void)write(fp, sexitcode, strlen(sexitcode));
+       (void)write(fp, "\n", 1);
        close(fp);
        free(str);
 }
@@ -107,11 +106,11 @@ static void syslog_(int prio, const char *fcn, long line,
 {
        char buf[1024];
 
-       snprintf(buf, sizeof(buf), "%s: %s:%ld", command, fcn, line);
+       snprintf(buf, sizeof(buf), "%s: %s:%ld", command, fcn, line);
        buf[sizeof(buf)-1] = '\0';
        vsnprintf(buf + strlen(buf), sizeof(buf)-strlen(buf), fmt, ap);
        buf[sizeof(buf)-1] = '\0';
-       syslog(LOG_INFO, "%s", buf);
+       syslog(prio, "%s", buf);
 }
 
 void info_(const char *fcn, long line, const char *fmt, ...)
@@ -177,3 +176,159 @@ void dbg_(const char *fcn, long line, const char *fmt, ...)
        }
        va_end(ap);
 }
+
+void error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...)
+{
+       char buf[2048];
+       va_list arg;
+
+       va_start(arg, fmt);
+       vsnprintf(buf, sizeof(buf), fmt, arg);
+       va_end(arg);
+       if (use_syslog)
+               syslog(LOG_ERR, "alsa-lib %s:%i:(%s) %s%s%s\n", file, line, function,
+                               buf, err ? ": " : "", err ? snd_strerror(err) : "");
+       else
+               fprintf(stderr, "alsa-lib %s:%i:(%s) %s%s%s\n", file, line, function,
+                               buf, err ? ": " : "", err ? snd_strerror(err) : "");
+}
+
+int load_configuration(const char *file, snd_config_t **top, int *open_failed)
+{
+       snd_config_t *config;
+       snd_input_t *in;
+       int err, stdio_flag, lock_fd = -EINVAL;
+
+       *top = NULL;
+       if (open_failed)
+               *open_failed = 0;
+       err = snd_config_top(&config);
+       if (err < 0) {
+               error("snd_config_top error: %s", snd_strerror(err));
+               return err;
+       }
+       stdio_flag = !strcmp(file, "-");
+       if (stdio_flag) {
+               err = snd_input_stdio_attach(&in, stdin, 0);
+       } else {
+               lock_fd = state_lock(file, LOCK_TIMEOUT);
+               err = lock_fd >= 0 ? snd_input_stdio_open(&in, file, "r") : lock_fd;
+       }
+       if (err < 0) {
+               if (open_failed)
+                       *open_failed = 1;
+               goto out;
+       }
+       err = snd_config_load(config, in);
+       snd_input_close(in);
+       if (err < 0) {
+               error("snd_config_load error: %s", snd_strerror(err));
+out:
+               if (lock_fd >= 0)
+                       state_unlock(lock_fd, file);
+               snd_config_delete(config);
+               snd_config_update_free_global();
+               return err;
+       } else {
+               if (lock_fd >= 0)
+                       state_unlock(lock_fd, file);
+               *top = config;
+               return 0;
+       }
+}
+
+void snd_card_iterator_init(struct snd_card_iterator *iter, int cardno)
+{
+       iter->card = cardno;
+       iter->single = cardno >= 0;
+       iter->first = true;
+       iter->name[0] = '\0';
+}
+
+int snd_card_iterator_sinit(struct snd_card_iterator *iter, const char *cardname)
+{
+       int cardno = -1;
+
+       if (cardname) {
+               if (strncmp(cardname, "hw:", 3) == 0)
+                       cardname += 3;
+               cardno = snd_card_get_index(cardname);
+               if (cardno < 0) {
+                       error("Cannot find soundcard '%s'...", cardname);
+                       return cardno;
+               }
+       }
+       snd_card_iterator_init(iter, cardno);
+       return 0;
+}
+
+const char *snd_card_iterator_next(struct snd_card_iterator *iter)
+{
+       if (iter->single) {
+               if (iter->first) {
+                       iter->first = false;
+                       goto retval;
+               }
+               return NULL;
+       }
+       if (snd_card_next(&iter->card) < 0) {
+               if (!ignore_nocards && iter->first)
+                       error("No soundcards found...");
+               return NULL;
+       }
+       iter->first = false;
+       if (iter->card < 0)
+               return NULL;
+retval:
+       snprintf(iter->name, sizeof(iter->name), "hw:%d", iter->card);
+
+       return (const char *)iter->name;
+}
+
+int snd_card_iterator_error(struct snd_card_iterator *iter)
+{
+       return iter->first ? (ignore_nocards ? 0 : -ENODEV) : 0;
+}
+
+static int cleanup_filename_filter(const struct dirent *dirent)
+{
+       size_t flen;
+
+       if (dirent == NULL)
+               return 0;
+       if (dirent->d_type == DT_DIR)
+               return 0;
+
+       flen = strlen(dirent->d_name);
+       if (flen <= 5)
+               return 0;
+
+       if (strncmp(&dirent->d_name[flen-5], ".conf", 5) == 0)
+               return 1;
+
+       return 0;
+}
+
+int snd_card_clean_cfgdir(const char *cfgdir, int cardno)
+{
+       char path[PATH_MAX];
+       struct dirent **list;
+       int lasterr = 0, n, j;
+
+       snprintf(path, sizeof(path), "%s/card%d.conf.d", cfgdir, cardno);
+       n = scandir(path, &list, cleanup_filename_filter, NULL);
+       if (n < 0) {
+               if (errno == ENOENT)
+                       return 0;
+               return -errno;
+       }
+       for (j = 0; j < n; j++) {
+               snprintf(path, sizeof(path), "%s/card%d.conf.d/%s", cfgdir, cardno, list[j]->d_name);
+               if (remove(path)) {
+                       error("Unable to remove file '%s'", path);
+                       lasterr = -errno;
+               }
+       }
+
+       return lasterr;
+}
index 42c72bf..350bdff 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -54,17 +92,20 @@ host_triplet = @host@
 @HAVE_SAMPLERATE_TRUE@am__append_1 = -lsamplerate
 bin_PROGRAMS = alsaloop$(EXEEXT)
 subdir = alsaloop
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -77,14 +118,46 @@ alsaloop_OBJECTS = $(am_alsaloop_OBJECTS)
 alsaloop_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 alsaloop_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/alsaloop.Po ./$(DEPDIR)/control.Po \
+       ./$(DEPDIR)/pcmjob.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(alsaloop_SOURCES)
 DIST_SOURCES = $(alsaloop_SOURCES)
 am__can_run_installinfo = \
@@ -123,15 +196,37 @@ man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
 HEADERS = $(noinst_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -149,11 +244,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -165,27 +267,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -198,6 +310,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -206,6 +319,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -216,7 +331,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -257,6 +374,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -267,7 +386,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 LDADD = -lm $(am__append_1)
 AM_CFLAGS = -D_GNU_SOURCE
@@ -278,7 +397,7 @@ EXTRA_DIST = alsaloop.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -291,14 +410,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign alsaloop/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign alsaloop/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -318,10 +436,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -332,8 +452,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -342,16 +462,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 alsaloop$(EXEEXT): $(alsaloop_OBJECTS) $(alsaloop_DEPENDENCIES) $(EXTRA_alsaloop_DEPENDENCIES) 
        @rm -f alsaloop$(EXEEXT)
-       $(LINK) $(alsaloop_OBJECTS) $(alsaloop_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(alsaloop_OBJECTS) $(alsaloop_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -359,23 +487,45 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsaloop.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/control.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcmjob.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsaloop.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/control.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcmjob.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -420,26 +570,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -451,15 +590,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -468,9 +603,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -486,20 +622,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -568,10 +694,12 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/alsaloop.Po
+       -rm -f ./$(DEPDIR)/control.Po
+       -rm -f ./$(DEPDIR)/pcmjob.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -617,13 +745,16 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/alsaloop.Po
+       -rm -f ./$(DEPDIR)/control.Po
+       -rm -f ./$(DEPDIR)/pcmjob.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -639,9 +770,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -649,9 +781,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 33fa4d1..006494d 100644 (file)
@@ -58,6 +58,11 @@ Use given CTL device for playback.
 Use given CTL device for capture.
 
 .TP
+\fI\-x <ctl_ascii_name>\fP | \fI\-\-prateshift=<ctl_ascii_name>\fP
+
+Specify ctl ascii name for playshift sync mode (see the Examples section).
+
+.TP
 \fI\-l <latency>\fP | \fI\-\-latency=<frames>\fP
 
 Requested latency in frames.
@@ -79,7 +84,7 @@ Default format is S16_LE.
 Channel count specification. Default value is 2.
 
 .TP
-\fI\-c <rate>\fP | \fI\-\-rate=<rate>\fP
+\fI\-r <rate>\fP | \fI\-\-rate=<rate>\fP
 
 Rate specification. Default value is 48000 (Hz).
 
@@ -195,10 +200,12 @@ Verbose xrun profiling.
 Set process wake timeout.
 
 .SH EXAMPLES
-
-.TP
+.nf
 \fBalsaloop \-C hw:0,0 \-P hw:1,0 \-t 50000\fR
 
+\fBalsaloop \-C hw:soundcard,0 \-P hw:Loopback,0 \-t 50000 \-S playshift \\
+\-x iface=PCM,name='PCM Rate Shift 100000',device=1\fR
+.ne
 .SH BUGS
 None known.
 .SH AUTHOR
index 3b20682..51fb646 100644 (file)
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -33,6 +34,7 @@
 #include <syslog.h>
 #include <signal.h>
 #include "alsaloop.h"
+#include "os_compat.h"
 
 struct loopback_thread {
        int threaded;
@@ -85,12 +87,17 @@ static int create_loopback_handle(struct loopback_handle **_handle,
        if (device == NULL)
                device = "hw:0,0";
        handle->device = strdup(device);
-       if (handle->device == NULL)
+       if (handle->device == NULL) {
+               free(handle);
                return -ENOMEM;
+       }
        if (ctldev) {
                handle->ctldev = strdup(ctldev);
-               if (handle->ctldev == NULL)
+               if (handle->ctldev == NULL) {
+                       free(handle->device);
+                       free(handle);
                        return -ENOMEM;
+               }
        } else {
                handle->ctldev = NULL;
        }
@@ -170,6 +177,7 @@ void help(void)
 "-C,--cdevice   capture device\n"
 "-X,--pctl      playback ctl device\n"
 "-Y,--cctl      capture ctl device\n"
+"-x,--prateshift playback 'PCM Rate Shift 100000' ascii ctl name\n"
 "-l,--latency   requested latency in frames\n"
 "-t,--tlatency  requested latency in usec (1/1000000sec)\n"
 "-f,--format    sample format\n"
@@ -357,6 +365,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
                {"cdevice", 1, NULL, 'C'},
                {"pctl", 1, NULL, 'X'},
                {"cctl", 1, NULL, 'Y'},
+               {"prateshift", 1, NULL, 'x'},
                {"latency", 1, NULL, 'l'},
                {"tlatency", 1, NULL, 't'},
                {"format", 1, NULL, 'f'},
@@ -386,6 +395,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
        char *arg_cdevice = NULL;
        char *arg_pctl = NULL;
        char *arg_cctl = NULL;
+       char *arg_prateshift = NULL;
        unsigned int arg_latency_req = 0;
        unsigned int arg_latency_reqtime = 10000;
        snd_pcm_format_t arg_format = SND_PCM_FORMAT_S16_LE;
@@ -395,7 +405,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
        snd_pcm_uframes_t arg_period_size = 0;
        unsigned long arg_loop_time = ~0UL;
        int arg_nblock = 0;
-       int arg_effect = 0;
+       // int arg_effect = 0;
        int arg_resample = 0;
 #ifdef USE_SAMPLERATE
        int arg_samplerate = SRC_SINC_FASTEST + 1;
@@ -415,7 +425,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
        while (1) {
                int c;
                if ((c = getopt_long(argc, argv,
-                               "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:z",
+                               "hdg:P:C:X:Y:x:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:z",
                                long_option, NULL)) < 0)
                        break;
                switch (c) {
@@ -441,6 +451,9 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
                case 'Y':
                        arg_cctl = strdup(optarg);
                        break;
+               case 'x':
+                       arg_prateshift = strdup(optarg);
+                       break;
                case 'l':
                        err = atoi(optarg);
                        arg_latency_req = err >= 4 ? err : 4;
@@ -480,7 +493,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
                        arg_nblock = 1;
                        break;
                case 'e':
-                       arg_effect = 1;
+                       // arg_effect = 1;
                        break;
                case 'n':
                        arg_resample = 1;
@@ -517,6 +530,8 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
                                arg_sync = SYNC_TYPE_PLAYRATESHIFT;
                        else if (optarg[0] == 'r')
                                arg_sync = SYNC_TYPE_SAMPLERATE;
+                       else if (optarg[0] == 'a')
+                               arg_sync = SYNC_TYPE_AUTO;
                        else
                                arg_sync = atoi(optarg);
                        if (arg_sync < 0 || arg_sync > SYNC_TYPE_LAST)
@@ -622,6 +637,9 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
                        logit(LOG_CRIT, "Unable to add ossmixer controls.\n");
                        exit(EXIT_FAILURE);
                }
+               if (arg_prateshift)
+                       play->prateshift_name = arg_prateshift;
+
 #ifdef USE_SAMPLERATE
                loop->src_enable = arg_samplerate > 0;
                if (loop->src_enable)
@@ -803,7 +821,7 @@ static void send_to_all(int sig)
        }
 }
 
-static void signal_handler(int sig)
+static void signal_handler(int sig ATTRIBUTE_UNUSED)
 {
        quit = 1;
        send_to_all(SIGUSR2);
index 8dc445a..a5539ef 100644 (file)
@@ -14,7 +14,7 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
@@ -109,6 +109,7 @@ struct loopback_handle {
        snd_pcm_uframes_t buf_count;    /* filled samples */
        snd_pcm_uframes_t buf_size;     /* buffer size in frames */
        snd_pcm_uframes_t buf_over;     /* capture buffer overflow */
+       int stall;
        /* statistics */
        snd_pcm_uframes_t max;
        unsigned long long counter;
@@ -121,10 +122,12 @@ struct loopback_handle {
        unsigned int ctl_pollfd_count;
        snd_ctl_elem_value_t *ctl_notify;
        snd_ctl_elem_value_t *ctl_rate_shift;
+       snd_ctl_elem_value_t *ctl_pitch;
        snd_ctl_elem_value_t *ctl_active;
        snd_ctl_elem_value_t *ctl_format;
        snd_ctl_elem_value_t *ctl_rate;
        snd_ctl_elem_value_t *ctl_channels;
+       char *prateshift_name; /* ascii name for the playback rate shift ctl elem */
 };
 
 struct loopback {
index 8383d79..d3a7718 100644 (file)
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
+#include "aconfig.h"
 #include <ctype.h>
 #include <syslog.h>
 #include <alsa/asoundlib.h>
+#include <sys/time.h>
 #include "alsaloop.h"
+#include "os_compat.h"
 
 static char *id_str(snd_ctl_elem_id_t *id)
 {
@@ -185,8 +188,7 @@ static int copy_value(struct loopback_control *dst,
                      struct loopback_control *src)
 {
        snd_ctl_elem_type_t type;
-       unsigned int count;
-       int i;
+       unsigned int i, count;
 
        type = snd_ctl_elem_info_get_type(dst->info);
        count = snd_ctl_elem_info_get_count(dst->info);
@@ -227,7 +229,7 @@ static int oss_set(struct loopback *loop,
        if (verbose)
                snd_output_printf(loop->output, "%s: Initialize OSS volume %s: %s", loop->id, file, buf);
        fd = open(file, O_WRONLY);
-       if (fd >= 0 && write(fd, buf, strlen(buf)) == strlen(buf)) {
+       if (fd >= 0 && write(fd, buf, strlen(buf)) == (ssize_t)strlen(buf)) {
                close(fd);
                return 0;
        }
index f32180c..ffb439b 100644 (file)
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -33,6 +34,7 @@
 #include <syslog.h>
 #include <pthread.h>
 #include "alsaloop.h"
+#include "os_compat.h"
 
 #define XRUN_PROFILE_UNKNOWN (-10000000)
 
@@ -120,7 +122,7 @@ static int setparams_stream(struct loopback_handle *lhandle,
        }
        err = snd_pcm_hw_params_set_rate_resample(handle, params, lhandle->resample);
        if (err < 0) {
-               logit(LOG_CRIT, "Resample setup failed for %s (val %i): %s\n", lhandle->id, lhandle->resample, snd_strerror(err));
+               logit(LOG_CRIT, "Resample setup failed for %s (val %u): %s\n", lhandle->id, lhandle->resample, snd_strerror(err));
                return err;
        }
        err = snd_pcm_hw_params_set_access(handle, params, lhandle->access);
@@ -135,13 +137,13 @@ static int setparams_stream(struct loopback_handle *lhandle,
        }
        err = snd_pcm_hw_params_set_channels(handle, params, lhandle->channels);
        if (err < 0) {
-               logit(LOG_CRIT, "Channels count (%i) not available for %s: %s\n", lhandle->channels, lhandle->id, snd_strerror(err));
+               logit(LOG_CRIT, "Channels count (%u) not available for %s: %s\n", lhandle->channels, lhandle->id, snd_strerror(err));
                return err;
        }
        rrate = lhandle->rate_req;
        err = snd_pcm_hw_params_set_rate_near(handle, params, &rrate, 0);
        if (err < 0) {
-               logit(LOG_CRIT, "Rate %iHz not available for %s: %s\n", lhandle->rate_req, lhandle->id, snd_strerror(err));
+               logit(LOG_CRIT, "Rate %uHz not available for %s: %s\n", lhandle->rate_req, lhandle->id, snd_strerror(err));
                return err;
        }
        rrate = 0;
@@ -151,8 +153,8 @@ static int setparams_stream(struct loopback_handle *lhandle,
 #ifdef USE_SAMPLERATE
            !lhandle->loopback->src_enable &&
 #endif
-           (int)rrate != lhandle->rate) {
-               logit(LOG_CRIT, "Rate does not match (requested %iHz, got %iHz, resample %i)\n", lhandle->rate, rrate, lhandle->resample);
+           rrate != lhandle->rate) {
+               logit(LOG_CRIT, "Rate does not match (requested %uHz, got %uHz, resample %u)\n", lhandle->rate, rrate, lhandle->resample);
                return -EINVAL;
        }
        lhandle->pitch = (double)lhandle->rate_req / (double)lhandle->rate;
@@ -282,6 +284,42 @@ static int setparams_set(struct loopback_handle *lhandle,
        return 0;
 }
 
+static int increase_playback_avail_min(struct loopback_handle *lhandle)
+{
+       snd_pcm_t *handle = lhandle->handle;
+       snd_pcm_sw_params_t *swparams;
+       struct timespec ts;
+       int err;
+
+       if (lhandle->avail_min + (lhandle->period_size / 2) > lhandle->buffer_size) {
+               /* avoid 100% CPU usage for broken plugins */
+               ts.tv_sec = 0;
+               ts.tv_nsec = 10000;
+               nanosleep(&ts, NULL);
+               return 0;
+       }
+       snd_pcm_sw_params_alloca(&swparams);
+       err = snd_pcm_sw_params_current(handle, swparams);
+       if (err < 0) {
+               logit(LOG_CRIT, "Unable to determine current swparams for %s: %s\n", lhandle->id, snd_strerror(err));
+               return err;
+       }
+       err = snd_pcm_sw_params_set_avail_min(handle, swparams, lhandle->avail_min + 4);
+       if (err < 0) {
+               logit(LOG_CRIT, "Unable to set avail min for %s: %s\n", lhandle->id, snd_strerror(err));
+               return err;
+       }
+       snd_pcm_sw_params_get_avail_min(swparams, &lhandle->avail_min);
+       if (verbose > 6)
+               snd_output_printf(lhandle->loopback->output, "%s: change avail_min=%li\n", lhandle->id, lhandle->avail_min);
+       err = snd_pcm_sw_params(handle, swparams);
+       if (err < 0) {
+               logit(LOG_CRIT, "Unable to set sw params for %s: %s\n", lhandle->id, snd_strerror(err));
+               return err;
+       }
+       return 0;
+}
+
 static int setparams(struct loopback *loop, snd_pcm_uframes_t bufsize)
 {
        int err;
@@ -520,13 +558,13 @@ static void buf_add_src(struct loopback *loop)
                if (capt->format == SND_PCM_FORMAT_S32)
                        src_int_to_float_array((int *)(capt->buf +
                                                pos1 * capt->frame_size),
-                                        loop->src_data.data_in +
+                                        (float *)loop->src_data.data_in +
                                           pos * capt->channels,
                                         count1 * capt->channels);
                else
                        src_short_to_float_array((short *)(capt->buf +
                                                pos1 * capt->frame_size),
-                                        loop->src_data.data_in +
+                                        (float *)loop->src_data.data_in +
                                           pos * capt->channels,
                                         count1 * capt->channels);
                count -= count1;
@@ -587,7 +625,7 @@ static void buf_add_src(struct loopback *loop)
        }
 }
 #else
-static void buf_add_src(struct loopback *loop)
+static void buf_add_src(struct loopback *loop ATTRIBUTE_UNUSED)
 {
 }
 #endif
@@ -648,7 +686,7 @@ static int readit(struct loopback_handle *lhandle)
                if ((err = suspend(lhandle)) < 0)
                        return err;
        }
-       if (avail > buf_avail(lhandle)) {
+       if ((snd_pcm_uframes_t)avail > buf_avail(lhandle)) {
                lhandle->buf_over += avail - buf_avail(lhandle);
                avail = buf_avail(lhandle);
        } else if (avail == 0) {
@@ -687,7 +725,7 @@ static int readit(struct loopback_handle *lhandle)
                               r, lhandle->frame_size, lhandle->loopback->cfile);
 #endif
                res += r;
-               if (lhandle->max < res)
+               if (lhandle->max < (snd_pcm_uframes_t)res)
                        lhandle->max = res;
                lhandle->counter += r;
                lhandle->buf_count += r;
@@ -766,9 +804,9 @@ static snd_pcm_sframes_t remove_samples(struct loopback *loop,
        struct loopback_handle *capt = loop->capt;
 
        if (loop->play->buf == loop->capt->buf) {
-               if (count > loop->play->buf_count)
+               if ((snd_pcm_uframes_t)count > loop->play->buf_count)
                        count = loop->play->buf_count;
-               if (count > loop->capt->buf_count)
+               if ((snd_pcm_uframes_t)count > loop->capt->buf_count)
                        count = loop->capt->buf_count;
                capt->buf_count -= count;
                play->buf_pos += count;
@@ -777,11 +815,11 @@ static snd_pcm_sframes_t remove_samples(struct loopback *loop,
                return count;
        }
        if (capture_preferred) {
-               if (count > capt->buf_count)
+               if ((snd_pcm_uframes_t)count > capt->buf_count)
                        count = capt->buf_count;
                capt->buf_count -= count;
        } else {
-               if (count > play->buf_count)
+               if ((snd_pcm_uframes_t)count > play->buf_count)
                        count = play->buf_count;
                play->buf_count -= count;
        }
@@ -792,7 +830,7 @@ static int xrun_sync(struct loopback *loop)
 {
        struct loopback_handle *play = loop->play;
        struct loopback_handle *capt = loop->capt;
-       snd_pcm_uframes_t fill = get_whole_latency(loop);
+       snd_pcm_sframes_t fill = get_whole_latency(loop);
        snd_pcm_sframes_t pdelay, cdelay, delay1, pdelay1, cdelay1, diff;
        int err;
 
@@ -892,7 +930,7 @@ static int xrun_sync(struct loopback *loop)
        }
        if (delay1 > fill) {
                diff = (delay1 - fill) / play->pitch;
-               if (diff > play->buf_count)
+               if ((snd_pcm_uframes_t)diff > play->buf_count)
                        diff = play->buf_count;
                if (verbose > 6)
                        snd_output_printf(loop->output,
@@ -907,7 +945,7 @@ static int xrun_sync(struct loopback *loop)
        }
        if (delay1 > fill) {
                diff = (delay1 - fill) / capt->pitch;
-               if (diff > capt->buf_count)
+               if ((snd_pcm_uframes_t)diff > capt->buf_count)
                        diff = capt->buf_count;
                if (verbose > 6)
                        snd_output_printf(loop->output,
@@ -926,20 +964,21 @@ static int xrun_sync(struct loopback *loop)
                if (verbose > 6)
                        snd_output_printf(loop->output,
                                "sync: xrun_pending, silence filling %li / buf_count=%li\n", (long)diff, play->buf_count);
-               if (fill > delay1 && play->buf_count < diff) {
+               if (fill > delay1 && play->buf_count < (snd_pcm_uframes_t)diff) {
                        diff = diff - play->buf_count;
                        if (verbose > 6)
                                snd_output_printf(loop->output,
                                        "sync: playback silence added %li samples\n", (long)diff);
                        play->buf_pos -= diff;
                        play->buf_pos %= play->buf_size;
-                       if ((err = snd_pcm_format_set_silence(play->format, play->buf + play->buf_pos * play->channels, diff)) < 0)
+                       err =  snd_pcm_format_set_silence(play->format, play->buf + play->buf_pos * play->frame_size,
+                                                         diff * play->channels);
+                       if (err < 0)
                                return err;
                        play->buf_count += diff;
                }
                if ((err = snd_pcm_prepare(play->handle)) < 0) {
                        logit(LOG_CRIT, "%s prepare failed: %s\n", play->id, snd_strerror(err));
-
                        return err;
                }
                delay1 = writeit(play);
@@ -956,7 +995,7 @@ static int xrun_sync(struct loopback *loop)
                        logit(LOG_CRIT, "%s start failed: %s\n", play->id, snd_strerror(err));
                        return err;
                }
-       } else if (delay1 < fill) {
+       } else if (delay1 < (snd_pcm_sframes_t)fill) {
                diff = (fill - delay1) / play->pitch;
                while (diff > 0) {
                        delay1 = play->buf_size - play->buf_pos;
@@ -965,7 +1004,9 @@ static int xrun_sync(struct loopback *loop)
                                        "sync: playback short, silence filling %li / buf_count=%li\n", (long)delay1, play->buf_count);
                        if (delay1 > diff)
                                delay1 = diff;
-                       if ((err = snd_pcm_format_set_silence(play->format, play->buf + play->buf_pos * play->channels, delay1)) < 0)
+                       err = snd_pcm_format_set_silence(play->format, play->buf + play->buf_pos * play->frame_size,
+                                                        delay1 * play->channels);
+                       if (err < 0)
                                return err;
                        play->buf_pos += delay1;
                        play->buf_pos %= play->buf_size;
@@ -1021,10 +1062,16 @@ static int set_rate_shift(struct loopback_handle *lhandle, double pitch)
 {
        int err;
 
-       if (lhandle->ctl_rate_shift == NULL)
+       if (lhandle->ctl_rate_shift) {
+               snd_ctl_elem_value_set_integer(lhandle->ctl_rate_shift, 0, pitch * 100000);
+               err = snd_ctl_elem_write(lhandle->ctl, lhandle->ctl_rate_shift);
+       } else if (lhandle->ctl_pitch) {
+               // 'Playback/Capture Pitch 1000000' requires reciprocal to pitch
+               snd_ctl_elem_value_set_integer(lhandle->ctl_pitch, 0, (1 / pitch) * 1000000);
+               err = snd_ctl_elem_write(lhandle->ctl, lhandle->ctl_pitch);
+       } else {
                return 0;
-       snd_ctl_elem_value_set_integer(lhandle->ctl_rate_shift, 0, pitch * 100000);
-       err = snd_ctl_elem_write(lhandle->ctl, lhandle->ctl_rate_shift);
+       }
        if (err < 0) {
                logit(LOG_CRIT, "Cannot set PCM Rate Shift element for %s: %s\n", lhandle->id, snd_strerror(err));
                return err;
@@ -1057,7 +1104,8 @@ void update_pitch(struct loopback *loop)
 #endif
        }
        else if (loop->sync == SYNC_TYPE_PLAYRATESHIFT) {
-               set_rate_shift(loop->play, pitch);
+               // pitch is capture-based, playback side requires reciprocal
+               set_rate_shift(loop->play, 1 / pitch);
 #ifdef USE_SAMPLERATE
                if (loop->use_samplerate) {
                        loop->src_data.src_ratio = 
@@ -1128,27 +1176,57 @@ static int get_channels(struct loopback_handle *lhandle)
        return snd_ctl_elem_value_get_integer(lhandle->ctl_channels, 0);
 }
 
-static void openctl_elem(struct loopback_handle *lhandle,
-                        int device, int subdevice,
-                        const char *name,
-                        snd_ctl_elem_value_t **elem)
+static int openctl_elem_id(struct loopback_handle *lhandle, snd_ctl_elem_id_t *id,
+               snd_ctl_elem_value_t **elem)
 {
        int err;
 
        if (snd_ctl_elem_value_malloc(elem) < 0) {
                *elem = NULL;
+               return -ENOMEM;
+       }
+       snd_ctl_elem_value_set_id(*elem, id);
+       snd_ctl_elem_value_set_interface(*elem, SND_CTL_ELEM_IFACE_PCM);
+       err = snd_ctl_elem_read(lhandle->ctl, *elem);
+       if (err < 0) {
+               snd_ctl_elem_value_free(*elem);
+               *elem = NULL;
+               return err;
        } else {
-               snd_ctl_elem_value_set_interface(*elem,
-                                                SND_CTL_ELEM_IFACE_PCM);
-               snd_ctl_elem_value_set_device(*elem, device);
-               snd_ctl_elem_value_set_subdevice(*elem, subdevice);
-               snd_ctl_elem_value_set_name(*elem, name);
-               err = snd_ctl_elem_read(lhandle->ctl, *elem);
-               if (err < 0) {
-                       snd_ctl_elem_value_free(*elem);
-                       *elem = NULL;
-               }
+               snd_output_printf(lhandle->loopback->output,
+                               "Opened PCM element %s of %s, device %d, subdevice %d\n",
+                               snd_ctl_elem_id_get_name(id), snd_ctl_name(lhandle->ctl),
+                               snd_ctl_elem_id_get_device(id),
+                               snd_ctl_elem_id_get_subdevice(id));
+               return 0;
+       }
+}
+
+static int openctl_elem(struct loopback_handle *lhandle,
+                        int device, int subdevice,
+                        const char *name,
+                        snd_ctl_elem_value_t **elem)
+{
+       snd_ctl_elem_id_t *id;
+
+       snd_ctl_elem_id_alloca(&id);
+       snd_ctl_elem_id_set_device(id, device);
+       snd_ctl_elem_id_set_subdevice(id, subdevice);
+       snd_ctl_elem_id_set_name(id, name);
+       return openctl_elem_id(lhandle, id, elem);
+}
+
+static int openctl_elem_ascii(struct loopback_handle *lhandle, char *ascii_name,
+               snd_ctl_elem_value_t **elem)
+{
+       snd_ctl_elem_id_t *id;
+
+       snd_ctl_elem_id_alloca(&id);
+       if (snd_ctl_ascii_elem_id_parse(id, ascii_name)) {
+               fprintf(stderr, "Wrong control identifier: %s\n", ascii_name);
+               return -EINVAL;
        }
+       return openctl_elem_id(lhandle, id, elem);
 }
 
 static int openctl(struct loopback_handle *lhandle, int device, int subdevice)
@@ -1157,14 +1235,30 @@ static int openctl(struct loopback_handle *lhandle, int device, int subdevice)
 
        lhandle->ctl_rate_shift = NULL;
        if (lhandle->loopback->play == lhandle) {
+               // play only
+               if (lhandle->prateshift_name) {
+                       err = openctl_elem_ascii(lhandle, lhandle->prateshift_name,
+                                       &lhandle->ctl_rate_shift);
+                       if (err < 0) {
+                               logit(LOG_CRIT, "Unable to open playback PCM Rate Shift elem '%s'.\n",
+                                               lhandle->prateshift_name);
+                               exit(EXIT_FAILURE);
+                       }
+               } else
+                       openctl_elem(lhandle, device, subdevice, "Playback Pitch 1000000",
+                                       &lhandle->ctl_pitch);
+               set_rate_shift(lhandle, 1);
                if (lhandle->loopback->controls)
                        goto __events;
                return 0;
        }
+       // capture only
        openctl_elem(lhandle, device, subdevice, "PCM Notify",
                        &lhandle->ctl_notify);
        openctl_elem(lhandle, device, subdevice, "PCM Rate Shift 100000",
                        &lhandle->ctl_rate_shift);
+       openctl_elem(lhandle, device, subdevice, "Capture Pitch 1000000",
+                       &lhandle->ctl_pitch);
        set_rate_shift(lhandle, 1);
        openctl_elem(lhandle, device, subdevice, "PCM Slave Active",
                        &lhandle->ctl_active);
@@ -1250,6 +1344,9 @@ static int closeit(struct loopback_handle *lhandle)
        if (lhandle->ctl_rate_shift)
                snd_ctl_elem_value_free(lhandle->ctl_rate_shift);
        lhandle->ctl_rate_shift = NULL;
+       if (lhandle->ctl_pitch)
+               snd_ctl_elem_value_free(lhandle->ctl_pitch);
+       lhandle->ctl_pitch = NULL;
        if (lhandle->ctl)
                err = snd_ctl_close(lhandle->ctl);
        lhandle->ctl = NULL;
@@ -1295,9 +1392,9 @@ int pcmjob_init(struct loopback *loop)
        snprintf(id, sizeof(id), "%s/%s", loop->play->id, loop->capt->id);
        id[sizeof(id)-1] = '\0';
        loop->id = strdup(id);
-       if (loop->sync == SYNC_TYPE_AUTO && loop->capt->ctl_rate_shift)
+       if (loop->sync == SYNC_TYPE_AUTO && (loop->capt->ctl_rate_shift || loop->capt->ctl_pitch))
                loop->sync = SYNC_TYPE_CAPTRATESHIFT;
-       if (loop->sync == SYNC_TYPE_AUTO && loop->play->ctl_rate_shift)
+       if (loop->sync == SYNC_TYPE_AUTO && (loop->play->ctl_rate_shift || loop->play->ctl_pitch))
                loop->sync = SYNC_TYPE_PLAYRATESHIFT;
 #ifdef USE_SAMPLERATE
        if (loop->sync == SYNC_TYPE_AUTO && loop->src_enable)
@@ -1339,7 +1436,7 @@ static void freeloop(struct loopback *loop)
                if (loop->src_state)
                        src_delete(loop->src_state);
                loop->src_state = NULL;
-               free(loop->src_data.data_in);
+               free((void *)loop->src_data.data_in);
                loop->src_data.data_in = NULL;
                free(loop->src_data.data_out);
                loop->src_data.data_out = NULL;
@@ -1450,7 +1547,7 @@ __again:
        if (loop->play->access == loop->capt->access &&
            loop->play->format == loop->capt->format &&
            loop->play->rate == loop->capt->rate &&
-           loop->play->channels == loop->play->channels &&
+           loop->play->channels == loop->capt->channels &&
            loop->sync != SYNC_TYPE_SAMPLERATE) {
                if (verbose > 1)
                        snd_output_printf(loop->output, "shared buffer!!!\n");
@@ -1576,8 +1673,8 @@ __again:
                snd_output_printf(loop->output, "%s: silence queued %i samples\n", loop->id, err);
        if (count > loop->play->buffer_size)
                count = loop->play->buffer_size;
-       if (err != count) {
-               logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%i)\n", loop->id, err, (int)count, loop->play->buffer_size);
+       if (err != (int)count) {
+               logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%u)\n", loop->id, err, (int)count, loop->play->buffer_size);
                err = -EIO;
                goto __error;
        }
@@ -1659,9 +1756,8 @@ int pcmjob_pollfds_init(struct loopback *loop, struct pollfd *fds)
 static snd_pcm_sframes_t get_queued_playback_samples(struct loopback *loop)
 {
        snd_pcm_sframes_t delay;
-       int err;
 
-       if ((err = snd_pcm_delay(loop->play->handle, &delay)) < 0)
+       if (snd_pcm_delay(loop->play->handle, &delay) < 0)
                return 0;
        loop->play->last_delay = delay;
        delay += loop->play->buf_count;
@@ -1698,7 +1794,7 @@ static int ctl_event_check(snd_ctl_elem_value_t *val, snd_ctl_event_t *ev)
 }
 
 static int handle_ctl_events(struct loopback_handle *lhandle,
-                            unsigned short events)
+                            unsigned short events ATTRIBUTE_UNUSED)
 {
        struct loopback *loop = lhandle->loopback;
        snd_ctl_event_t *ev;
@@ -1723,12 +1819,12 @@ static int handle_ctl_events(struct loopback_handle *lhandle,
                        continue;
                } else if (ctl_event_check(lhandle->ctl_rate, ev)) {
                        err = get_rate(lhandle);
-                       if (lhandle->rate != err)
+                       if ((int)lhandle->rate != err)
                                restart = 1;
                        continue;
                } else if (ctl_event_check(lhandle->ctl_channels, ev)) {
                        err = get_channels(lhandle);
-                       if (lhandle->channels != err)
+                       if ((int)lhandle->channels != err)
                                restart = 1;
                        continue;
                }
@@ -1763,7 +1859,7 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
        struct loopback_handle *capt = loop->capt;
        unsigned short prevents, crevents, events;
        snd_pcm_uframes_t ccount, pcount;
-       int err, loopcount = 10, idx;
+       int err, loopcount = 0, idx;
 
        if (verbose > 11)
                snd_output_printf(loop->output, "%s: pollfds handle\n", loop->id);
@@ -1843,6 +1939,18 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
                goto __pcm_end;
        do {
                ccount = readit(capt);
+               if (prevents != 0 && crevents == 0 &&
+                   ccount == 0 && loopcount == 0) {
+                       if (play->stall > 20) {
+                               play->stall = 0;
+                               increase_playback_avail_min(play);
+                               break;
+                       }
+                       play->stall++;
+                       break;
+               }
+               if (ccount > 0)
+                       play->stall = 0;
                buf_add(loop, ccount);
                if (capt->xrun_pending || loop->reinit)
                        break;
@@ -1850,10 +1958,12 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
                   buffer, feed them there */
                pcount = writeit(play);
                buf_remove(loop, pcount);
+               if (pcount > 0)
+                       play->stall = 0;
                if (play->xrun_pending || loop->reinit)
                        break;
-               loopcount--;
-       } while ((ccount > 0 || pcount > 0) && loopcount 0);
+               loopcount++;
+       } while ((ccount > 0 || pcount > 0) && loopcount < 10);
        if (play->xrun_pending || capt->xrun_pending) {
                if ((err = xrun_sync(loop)) < 0)
                        return err;
@@ -1901,8 +2011,16 @@ int pcmjob_pollfds_handle(struct loopback *loop, struct pollfd *fds)
        }
        if (loop->sync != SYNC_TYPE_NONE) {
                snd_pcm_sframes_t pqueued, cqueued;
-               pqueued = get_queued_playback_samples(loop);
-               cqueued = get_queued_capture_samples(loop);
+
+               /* Reduce cumulative error by interleaving playback vs capture reading order */
+               if (loop->total_queued_count & 1) {
+                       pqueued = get_queued_playback_samples(loop);
+                       cqueued = get_queued_capture_samples(loop);
+               } else {
+                       cqueued = get_queued_capture_samples(loop);
+                       pqueued = get_queued_playback_samples(loop);
+               }
+
                if (verbose > 4)
                        snd_output_printf(loop->output, "%s: queued %li/%li samples\n", loop->id, pqueued, cqueued);
                if (pqueued > 0)
index 259b29e..dbf58f9 100644 (file)
@@ -1,14 +1,19 @@
-AM_CFLAGS = @CURSES_CFLAGS@ -DCURSESINC="@CURSESINC@"
+AM_CFLAGS = -D_GNU_SOURCE @CURSES_CFLAGS@ -DCURSESINC="@CURSESINC@"
 LDADD = @CURSESLIB@
 
 bin_PROGRAMS = alsamixer
 alsamixer_SOURCES = card_select.c card_select.h \
+               bindings.c bindings.h \
                cli.c \
                colors.c colors.h \
+               curskey.c curskey.h \
+               configparser.c configparser.h \
                device_name.c device_name.h \
                die.c die.h \
                mainloop.c mainloop.h \
                mem.c mem.h \
+               menu_widget.c menu_widget.h \
+               mixer_clickable.c mixer_clickable.h \
                mixer_controls.c mixer_controls.h \
                mixer_display.c mixer_display.h \
                mixer_widget.c mixer_widget.h \
@@ -18,7 +23,7 @@ alsamixer_SOURCES = card_select.c card_select.h \
                volume_mapping.c volume_mapping.h \
                widget.c widget.h
 man_MANS = alsamixer.1
-EXTRA_DIST = alsamixer.1
+EXTRA_DIST = alsamixer.1 alsamixer.rc.example
 alsamixer_CPPFLAGS = -I$(top_srcdir)/include
 
 #LDFLAGS = -static
index 74be5a3..fbff08f 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,17 +90,19 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = alsamixer$(EXEEXT)
 subdir = alsamixer
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -70,9 +110,13 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
 am_alsamixer_OBJECTS = alsamixer-card_select.$(OBJEXT) \
-       alsamixer-cli.$(OBJEXT) alsamixer-colors.$(OBJEXT) \
+       alsamixer-bindings.$(OBJEXT) alsamixer-cli.$(OBJEXT) \
+       alsamixer-colors.$(OBJEXT) alsamixer-curskey.$(OBJEXT) \
+       alsamixer-configparser.$(OBJEXT) \
        alsamixer-device_name.$(OBJEXT) alsamixer-die.$(OBJEXT) \
        alsamixer-mainloop.$(OBJEXT) alsamixer-mem.$(OBJEXT) \
+       alsamixer-menu_widget.$(OBJEXT) \
+       alsamixer-mixer_clickable.$(OBJEXT) \
        alsamixer-mixer_controls.$(OBJEXT) \
        alsamixer-mixer_display.$(OBJEXT) \
        alsamixer-mixer_widget.$(OBJEXT) \
@@ -82,14 +126,62 @@ am_alsamixer_OBJECTS = alsamixer-card_select.$(OBJEXT) \
 alsamixer_OBJECTS = $(am_alsamixer_OBJECTS)
 alsamixer_LDADD = $(LDADD)
 alsamixer_DEPENDENCIES =
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/alsamixer-bindings.Po \
+       ./$(DEPDIR)/alsamixer-card_select.Po \
+       ./$(DEPDIR)/alsamixer-cli.Po ./$(DEPDIR)/alsamixer-colors.Po \
+       ./$(DEPDIR)/alsamixer-configparser.Po \
+       ./$(DEPDIR)/alsamixer-curskey.Po \
+       ./$(DEPDIR)/alsamixer-device_name.Po \
+       ./$(DEPDIR)/alsamixer-die.Po ./$(DEPDIR)/alsamixer-mainloop.Po \
+       ./$(DEPDIR)/alsamixer-mem.Po \
+       ./$(DEPDIR)/alsamixer-menu_widget.Po \
+       ./$(DEPDIR)/alsamixer-mixer_clickable.Po \
+       ./$(DEPDIR)/alsamixer-mixer_controls.Po \
+       ./$(DEPDIR)/alsamixer-mixer_display.Po \
+       ./$(DEPDIR)/alsamixer-mixer_widget.Po \
+       ./$(DEPDIR)/alsamixer-proc_files.Po \
+       ./$(DEPDIR)/alsamixer-textbox.Po \
+       ./$(DEPDIR)/alsamixer-utils.Po \
+       ./$(DEPDIR)/alsamixer-volume_mapping.Po \
+       ./$(DEPDIR)/alsamixer-widget.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(alsamixer_SOURCES)
 DIST_SOURCES = $(alsamixer_SOURCES)
 am__can_run_installinfo = \
@@ -127,15 +219,37 @@ am__uninstall_files_from_dir = { \
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -153,11 +267,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -169,27 +290,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -202,6 +333,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -210,6 +342,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -220,7 +354,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -261,6 +397,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -271,16 +409,21 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
-AM_CFLAGS = @CURSES_CFLAGS@ -DCURSESINC="@CURSESINC@"
+xmlto_available = @xmlto_available@
+AM_CFLAGS = -D_GNU_SOURCE @CURSES_CFLAGS@ -DCURSESINC="@CURSESINC@"
 LDADD = @CURSESLIB@
 alsamixer_SOURCES = card_select.c card_select.h \
+               bindings.c bindings.h \
                cli.c \
                colors.c colors.h \
+               curskey.c curskey.h \
+               configparser.c configparser.h \
                device_name.c device_name.h \
                die.c die.h \
                mainloop.c mainloop.h \
                mem.c mem.h \
+               menu_widget.c menu_widget.h \
+               mixer_clickable.c mixer_clickable.h \
                mixer_controls.c mixer_controls.h \
                mixer_display.c mixer_display.h \
                mixer_widget.c mixer_widget.h \
@@ -291,12 +434,12 @@ alsamixer_SOURCES = card_select.c card_select.h \
                widget.c widget.h
 
 man_MANS = alsamixer.1
-EXTRA_DIST = alsamixer.1
+EXTRA_DIST = alsamixer.1 alsamixer.rc.example
 alsamixer_CPPFLAGS = -I$(top_srcdir)/include
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -309,14 +452,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign alsamixer/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign alsamixer/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -336,10 +478,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -350,8 +494,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -360,16 +504,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 alsamixer$(EXEEXT): $(alsamixer_OBJECTS) $(alsamixer_DEPENDENCIES) $(EXTRA_alsamixer_DEPENDENCIES) 
        @rm -f alsamixer$(EXEEXT)
-       $(LINK) $(alsamixer_OBJECTS) $(alsamixer_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(alsamixer_OBJECTS) $(alsamixer_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -377,245 +529,342 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-card_select.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-cli.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-colors.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-device_name.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-die.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mainloop.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mem.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mixer_controls.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mixer_display.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mixer_widget.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-proc_files.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-textbox.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-volume_mapping.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-widget.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-bindings.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-card_select.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-cli.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-colors.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-configparser.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-curskey.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-device_name.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-die.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mainloop.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mem.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-menu_widget.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mixer_clickable.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mixer_controls.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mixer_display.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-mixer_widget.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-proc_files.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-textbox.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-utils.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-volume_mapping.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsamixer-widget.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 alsamixer-card_select.o: card_select.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-card_select.o -MD -MP -MF $(DEPDIR)/alsamixer-card_select.Tpo -c -o alsamixer-card_select.o `test -f 'card_select.c' || echo '$(srcdir)/'`card_select.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-card_select.Tpo $(DEPDIR)/alsamixer-card_select.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='card_select.c' object='alsamixer-card_select.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-card_select.o -MD -MP -MF $(DEPDIR)/alsamixer-card_select.Tpo -c -o alsamixer-card_select.o `test -f 'card_select.c' || echo '$(srcdir)/'`card_select.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-card_select.Tpo $(DEPDIR)/alsamixer-card_select.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='card_select.c' object='alsamixer-card_select.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-card_select.o `test -f 'card_select.c' || echo '$(srcdir)/'`card_select.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-card_select.o `test -f 'card_select.c' || echo '$(srcdir)/'`card_select.c
 
 alsamixer-card_select.obj: card_select.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-card_select.obj -MD -MP -MF $(DEPDIR)/alsamixer-card_select.Tpo -c -o alsamixer-card_select.obj `if test -f 'card_select.c'; then $(CYGPATH_W) 'card_select.c'; else $(CYGPATH_W) '$(srcdir)/card_select.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-card_select.Tpo $(DEPDIR)/alsamixer-card_select.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='card_select.c' object='alsamixer-card_select.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-card_select.obj -MD -MP -MF $(DEPDIR)/alsamixer-card_select.Tpo -c -o alsamixer-card_select.obj `if test -f 'card_select.c'; then $(CYGPATH_W) 'card_select.c'; else $(CYGPATH_W) '$(srcdir)/card_select.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-card_select.Tpo $(DEPDIR)/alsamixer-card_select.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='card_select.c' object='alsamixer-card_select.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-card_select.obj `if test -f 'card_select.c'; then $(CYGPATH_W) 'card_select.c'; else $(CYGPATH_W) '$(srcdir)/card_select.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-card_select.obj `if test -f 'card_select.c'; then $(CYGPATH_W) 'card_select.c'; else $(CYGPATH_W) '$(srcdir)/card_select.c'; fi`
+
+alsamixer-bindings.o: bindings.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-bindings.o -MD -MP -MF $(DEPDIR)/alsamixer-bindings.Tpo -c -o alsamixer-bindings.o `test -f 'bindings.c' || echo '$(srcdir)/'`bindings.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-bindings.Tpo $(DEPDIR)/alsamixer-bindings.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='bindings.c' object='alsamixer-bindings.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-bindings.o `test -f 'bindings.c' || echo '$(srcdir)/'`bindings.c
+
+alsamixer-bindings.obj: bindings.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-bindings.obj -MD -MP -MF $(DEPDIR)/alsamixer-bindings.Tpo -c -o alsamixer-bindings.obj `if test -f 'bindings.c'; then $(CYGPATH_W) 'bindings.c'; else $(CYGPATH_W) '$(srcdir)/bindings.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-bindings.Tpo $(DEPDIR)/alsamixer-bindings.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='bindings.c' object='alsamixer-bindings.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-bindings.obj `if test -f 'bindings.c'; then $(CYGPATH_W) 'bindings.c'; else $(CYGPATH_W) '$(srcdir)/bindings.c'; fi`
 
 alsamixer-cli.o: cli.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-cli.o -MD -MP -MF $(DEPDIR)/alsamixer-cli.Tpo -c -o alsamixer-cli.o `test -f 'cli.c' || echo '$(srcdir)/'`cli.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-cli.Tpo $(DEPDIR)/alsamixer-cli.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='cli.c' object='alsamixer-cli.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-cli.o -MD -MP -MF $(DEPDIR)/alsamixer-cli.Tpo -c -o alsamixer-cli.o `test -f 'cli.c' || echo '$(srcdir)/'`cli.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-cli.Tpo $(DEPDIR)/alsamixer-cli.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='cli.c' object='alsamixer-cli.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-cli.o `test -f 'cli.c' || echo '$(srcdir)/'`cli.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-cli.o `test -f 'cli.c' || echo '$(srcdir)/'`cli.c
 
 alsamixer-cli.obj: cli.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-cli.obj -MD -MP -MF $(DEPDIR)/alsamixer-cli.Tpo -c -o alsamixer-cli.obj `if test -f 'cli.c'; then $(CYGPATH_W) 'cli.c'; else $(CYGPATH_W) '$(srcdir)/cli.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-cli.Tpo $(DEPDIR)/alsamixer-cli.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='cli.c' object='alsamixer-cli.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-cli.obj -MD -MP -MF $(DEPDIR)/alsamixer-cli.Tpo -c -o alsamixer-cli.obj `if test -f 'cli.c'; then $(CYGPATH_W) 'cli.c'; else $(CYGPATH_W) '$(srcdir)/cli.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-cli.Tpo $(DEPDIR)/alsamixer-cli.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='cli.c' object='alsamixer-cli.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-cli.obj `if test -f 'cli.c'; then $(CYGPATH_W) 'cli.c'; else $(CYGPATH_W) '$(srcdir)/cli.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-cli.obj `if test -f 'cli.c'; then $(CYGPATH_W) 'cli.c'; else $(CYGPATH_W) '$(srcdir)/cli.c'; fi`
 
 alsamixer-colors.o: colors.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-colors.o -MD -MP -MF $(DEPDIR)/alsamixer-colors.Tpo -c -o alsamixer-colors.o `test -f 'colors.c' || echo '$(srcdir)/'`colors.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-colors.Tpo $(DEPDIR)/alsamixer-colors.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='colors.c' object='alsamixer-colors.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-colors.o -MD -MP -MF $(DEPDIR)/alsamixer-colors.Tpo -c -o alsamixer-colors.o `test -f 'colors.c' || echo '$(srcdir)/'`colors.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-colors.Tpo $(DEPDIR)/alsamixer-colors.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='colors.c' object='alsamixer-colors.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-colors.o `test -f 'colors.c' || echo '$(srcdir)/'`colors.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-colors.o `test -f 'colors.c' || echo '$(srcdir)/'`colors.c
 
 alsamixer-colors.obj: colors.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-colors.obj -MD -MP -MF $(DEPDIR)/alsamixer-colors.Tpo -c -o alsamixer-colors.obj `if test -f 'colors.c'; then $(CYGPATH_W) 'colors.c'; else $(CYGPATH_W) '$(srcdir)/colors.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-colors.Tpo $(DEPDIR)/alsamixer-colors.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='colors.c' object='alsamixer-colors.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-colors.obj -MD -MP -MF $(DEPDIR)/alsamixer-colors.Tpo -c -o alsamixer-colors.obj `if test -f 'colors.c'; then $(CYGPATH_W) 'colors.c'; else $(CYGPATH_W) '$(srcdir)/colors.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-colors.Tpo $(DEPDIR)/alsamixer-colors.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='colors.c' object='alsamixer-colors.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-colors.obj `if test -f 'colors.c'; then $(CYGPATH_W) 'colors.c'; else $(CYGPATH_W) '$(srcdir)/colors.c'; fi`
+
+alsamixer-curskey.o: curskey.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-curskey.o -MD -MP -MF $(DEPDIR)/alsamixer-curskey.Tpo -c -o alsamixer-curskey.o `test -f 'curskey.c' || echo '$(srcdir)/'`curskey.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-curskey.Tpo $(DEPDIR)/alsamixer-curskey.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='curskey.c' object='alsamixer-curskey.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-curskey.o `test -f 'curskey.c' || echo '$(srcdir)/'`curskey.c
+
+alsamixer-curskey.obj: curskey.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-curskey.obj -MD -MP -MF $(DEPDIR)/alsamixer-curskey.Tpo -c -o alsamixer-curskey.obj `if test -f 'curskey.c'; then $(CYGPATH_W) 'curskey.c'; else $(CYGPATH_W) '$(srcdir)/curskey.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-curskey.Tpo $(DEPDIR)/alsamixer-curskey.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='curskey.c' object='alsamixer-curskey.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-curskey.obj `if test -f 'curskey.c'; then $(CYGPATH_W) 'curskey.c'; else $(CYGPATH_W) '$(srcdir)/curskey.c'; fi`
+
+alsamixer-configparser.o: configparser.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-configparser.o -MD -MP -MF $(DEPDIR)/alsamixer-configparser.Tpo -c -o alsamixer-configparser.o `test -f 'configparser.c' || echo '$(srcdir)/'`configparser.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-configparser.Tpo $(DEPDIR)/alsamixer-configparser.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='configparser.c' object='alsamixer-configparser.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-configparser.o `test -f 'configparser.c' || echo '$(srcdir)/'`configparser.c
+
+alsamixer-configparser.obj: configparser.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-configparser.obj -MD -MP -MF $(DEPDIR)/alsamixer-configparser.Tpo -c -o alsamixer-configparser.obj `if test -f 'configparser.c'; then $(CYGPATH_W) 'configparser.c'; else $(CYGPATH_W) '$(srcdir)/configparser.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-configparser.Tpo $(DEPDIR)/alsamixer-configparser.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='configparser.c' object='alsamixer-configparser.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-colors.obj `if test -f 'colors.c'; then $(CYGPATH_W) 'colors.c'; else $(CYGPATH_W) '$(srcdir)/colors.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-configparser.obj `if test -f 'configparser.c'; then $(CYGPATH_W) 'configparser.c'; else $(CYGPATH_W) '$(srcdir)/configparser.c'; fi`
 
 alsamixer-device_name.o: device_name.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-device_name.o -MD -MP -MF $(DEPDIR)/alsamixer-device_name.Tpo -c -o alsamixer-device_name.o `test -f 'device_name.c' || echo '$(srcdir)/'`device_name.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-device_name.Tpo $(DEPDIR)/alsamixer-device_name.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='device_name.c' object='alsamixer-device_name.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-device_name.o -MD -MP -MF $(DEPDIR)/alsamixer-device_name.Tpo -c -o alsamixer-device_name.o `test -f 'device_name.c' || echo '$(srcdir)/'`device_name.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-device_name.Tpo $(DEPDIR)/alsamixer-device_name.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='device_name.c' object='alsamixer-device_name.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-device_name.o `test -f 'device_name.c' || echo '$(srcdir)/'`device_name.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-device_name.o `test -f 'device_name.c' || echo '$(srcdir)/'`device_name.c
 
 alsamixer-device_name.obj: device_name.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-device_name.obj -MD -MP -MF $(DEPDIR)/alsamixer-device_name.Tpo -c -o alsamixer-device_name.obj `if test -f 'device_name.c'; then $(CYGPATH_W) 'device_name.c'; else $(CYGPATH_W) '$(srcdir)/device_name.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-device_name.Tpo $(DEPDIR)/alsamixer-device_name.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='device_name.c' object='alsamixer-device_name.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-device_name.obj -MD -MP -MF $(DEPDIR)/alsamixer-device_name.Tpo -c -o alsamixer-device_name.obj `if test -f 'device_name.c'; then $(CYGPATH_W) 'device_name.c'; else $(CYGPATH_W) '$(srcdir)/device_name.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-device_name.Tpo $(DEPDIR)/alsamixer-device_name.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='device_name.c' object='alsamixer-device_name.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-device_name.obj `if test -f 'device_name.c'; then $(CYGPATH_W) 'device_name.c'; else $(CYGPATH_W) '$(srcdir)/device_name.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-device_name.obj `if test -f 'device_name.c'; then $(CYGPATH_W) 'device_name.c'; else $(CYGPATH_W) '$(srcdir)/device_name.c'; fi`
 
 alsamixer-die.o: die.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-die.o -MD -MP -MF $(DEPDIR)/alsamixer-die.Tpo -c -o alsamixer-die.o `test -f 'die.c' || echo '$(srcdir)/'`die.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-die.Tpo $(DEPDIR)/alsamixer-die.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='die.c' object='alsamixer-die.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-die.o -MD -MP -MF $(DEPDIR)/alsamixer-die.Tpo -c -o alsamixer-die.o `test -f 'die.c' || echo '$(srcdir)/'`die.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-die.Tpo $(DEPDIR)/alsamixer-die.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='die.c' object='alsamixer-die.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-die.o `test -f 'die.c' || echo '$(srcdir)/'`die.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-die.o `test -f 'die.c' || echo '$(srcdir)/'`die.c
 
 alsamixer-die.obj: die.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-die.obj -MD -MP -MF $(DEPDIR)/alsamixer-die.Tpo -c -o alsamixer-die.obj `if test -f 'die.c'; then $(CYGPATH_W) 'die.c'; else $(CYGPATH_W) '$(srcdir)/die.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-die.Tpo $(DEPDIR)/alsamixer-die.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='die.c' object='alsamixer-die.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-die.obj -MD -MP -MF $(DEPDIR)/alsamixer-die.Tpo -c -o alsamixer-die.obj `if test -f 'die.c'; then $(CYGPATH_W) 'die.c'; else $(CYGPATH_W) '$(srcdir)/die.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-die.Tpo $(DEPDIR)/alsamixer-die.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='die.c' object='alsamixer-die.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-die.obj `if test -f 'die.c'; then $(CYGPATH_W) 'die.c'; else $(CYGPATH_W) '$(srcdir)/die.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-die.obj `if test -f 'die.c'; then $(CYGPATH_W) 'die.c'; else $(CYGPATH_W) '$(srcdir)/die.c'; fi`
 
 alsamixer-mainloop.o: mainloop.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mainloop.o -MD -MP -MF $(DEPDIR)/alsamixer-mainloop.Tpo -c -o alsamixer-mainloop.o `test -f 'mainloop.c' || echo '$(srcdir)/'`mainloop.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mainloop.Tpo $(DEPDIR)/alsamixer-mainloop.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mainloop.c' object='alsamixer-mainloop.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mainloop.o -MD -MP -MF $(DEPDIR)/alsamixer-mainloop.Tpo -c -o alsamixer-mainloop.o `test -f 'mainloop.c' || echo '$(srcdir)/'`mainloop.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mainloop.Tpo $(DEPDIR)/alsamixer-mainloop.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mainloop.c' object='alsamixer-mainloop.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mainloop.o `test -f 'mainloop.c' || echo '$(srcdir)/'`mainloop.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mainloop.o `test -f 'mainloop.c' || echo '$(srcdir)/'`mainloop.c
 
 alsamixer-mainloop.obj: mainloop.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mainloop.obj -MD -MP -MF $(DEPDIR)/alsamixer-mainloop.Tpo -c -o alsamixer-mainloop.obj `if test -f 'mainloop.c'; then $(CYGPATH_W) 'mainloop.c'; else $(CYGPATH_W) '$(srcdir)/mainloop.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mainloop.Tpo $(DEPDIR)/alsamixer-mainloop.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mainloop.c' object='alsamixer-mainloop.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mainloop.obj -MD -MP -MF $(DEPDIR)/alsamixer-mainloop.Tpo -c -o alsamixer-mainloop.obj `if test -f 'mainloop.c'; then $(CYGPATH_W) 'mainloop.c'; else $(CYGPATH_W) '$(srcdir)/mainloop.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mainloop.Tpo $(DEPDIR)/alsamixer-mainloop.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mainloop.c' object='alsamixer-mainloop.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mainloop.obj `if test -f 'mainloop.c'; then $(CYGPATH_W) 'mainloop.c'; else $(CYGPATH_W) '$(srcdir)/mainloop.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mainloop.obj `if test -f 'mainloop.c'; then $(CYGPATH_W) 'mainloop.c'; else $(CYGPATH_W) '$(srcdir)/mainloop.c'; fi`
 
 alsamixer-mem.o: mem.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mem.o -MD -MP -MF $(DEPDIR)/alsamixer-mem.Tpo -c -o alsamixer-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mem.Tpo $(DEPDIR)/alsamixer-mem.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mem.c' object='alsamixer-mem.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mem.o -MD -MP -MF $(DEPDIR)/alsamixer-mem.Tpo -c -o alsamixer-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mem.Tpo $(DEPDIR)/alsamixer-mem.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mem.c' object='alsamixer-mem.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mem.o `test -f 'mem.c' || echo '$(srcdir)/'`mem.c
 
 alsamixer-mem.obj: mem.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mem.obj -MD -MP -MF $(DEPDIR)/alsamixer-mem.Tpo -c -o alsamixer-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mem.Tpo $(DEPDIR)/alsamixer-mem.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mem.c' object='alsamixer-mem.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mem.obj -MD -MP -MF $(DEPDIR)/alsamixer-mem.Tpo -c -o alsamixer-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mem.Tpo $(DEPDIR)/alsamixer-mem.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mem.c' object='alsamixer-mem.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi`
+
+alsamixer-menu_widget.o: menu_widget.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-menu_widget.o -MD -MP -MF $(DEPDIR)/alsamixer-menu_widget.Tpo -c -o alsamixer-menu_widget.o `test -f 'menu_widget.c' || echo '$(srcdir)/'`menu_widget.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-menu_widget.Tpo $(DEPDIR)/alsamixer-menu_widget.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='menu_widget.c' object='alsamixer-menu_widget.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-menu_widget.o `test -f 'menu_widget.c' || echo '$(srcdir)/'`menu_widget.c
+
+alsamixer-menu_widget.obj: menu_widget.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-menu_widget.obj -MD -MP -MF $(DEPDIR)/alsamixer-menu_widget.Tpo -c -o alsamixer-menu_widget.obj `if test -f 'menu_widget.c'; then $(CYGPATH_W) 'menu_widget.c'; else $(CYGPATH_W) '$(srcdir)/menu_widget.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-menu_widget.Tpo $(DEPDIR)/alsamixer-menu_widget.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='menu_widget.c' object='alsamixer-menu_widget.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-menu_widget.obj `if test -f 'menu_widget.c'; then $(CYGPATH_W) 'menu_widget.c'; else $(CYGPATH_W) '$(srcdir)/menu_widget.c'; fi`
+
+alsamixer-mixer_clickable.o: mixer_clickable.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_clickable.o -MD -MP -MF $(DEPDIR)/alsamixer-mixer_clickable.Tpo -c -o alsamixer-mixer_clickable.o `test -f 'mixer_clickable.c' || echo '$(srcdir)/'`mixer_clickable.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mixer_clickable.Tpo $(DEPDIR)/alsamixer-mixer_clickable.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mixer_clickable.c' object='alsamixer-mixer_clickable.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mem.obj `if test -f 'mem.c'; then $(CYGPATH_W) 'mem.c'; else $(CYGPATH_W) '$(srcdir)/mem.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_clickable.o `test -f 'mixer_clickable.c' || echo '$(srcdir)/'`mixer_clickable.c
+
+alsamixer-mixer_clickable.obj: mixer_clickable.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_clickable.obj -MD -MP -MF $(DEPDIR)/alsamixer-mixer_clickable.Tpo -c -o alsamixer-mixer_clickable.obj `if test -f 'mixer_clickable.c'; then $(CYGPATH_W) 'mixer_clickable.c'; else $(CYGPATH_W) '$(srcdir)/mixer_clickable.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mixer_clickable.Tpo $(DEPDIR)/alsamixer-mixer_clickable.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mixer_clickable.c' object='alsamixer-mixer_clickable.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_clickable.obj `if test -f 'mixer_clickable.c'; then $(CYGPATH_W) 'mixer_clickable.c'; else $(CYGPATH_W) '$(srcdir)/mixer_clickable.c'; fi`
 
 alsamixer-mixer_controls.o: mixer_controls.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_controls.o -MD -MP -MF $(DEPDIR)/alsamixer-mixer_controls.Tpo -c -o alsamixer-mixer_controls.o `test -f 'mixer_controls.c' || echo '$(srcdir)/'`mixer_controls.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mixer_controls.Tpo $(DEPDIR)/alsamixer-mixer_controls.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mixer_controls.c' object='alsamixer-mixer_controls.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_controls.o -MD -MP -MF $(DEPDIR)/alsamixer-mixer_controls.Tpo -c -o alsamixer-mixer_controls.o `test -f 'mixer_controls.c' || echo '$(srcdir)/'`mixer_controls.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mixer_controls.Tpo $(DEPDIR)/alsamixer-mixer_controls.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mixer_controls.c' object='alsamixer-mixer_controls.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_controls.o `test -f 'mixer_controls.c' || echo '$(srcdir)/'`mixer_controls.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_controls.o `test -f 'mixer_controls.c' || echo '$(srcdir)/'`mixer_controls.c
 
 alsamixer-mixer_controls.obj: mixer_controls.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_controls.obj -MD -MP -MF $(DEPDIR)/alsamixer-mixer_controls.Tpo -c -o alsamixer-mixer_controls.obj `if test -f 'mixer_controls.c'; then $(CYGPATH_W) 'mixer_controls.c'; else $(CYGPATH_W) '$(srcdir)/mixer_controls.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mixer_controls.Tpo $(DEPDIR)/alsamixer-mixer_controls.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mixer_controls.c' object='alsamixer-mixer_controls.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_controls.obj -MD -MP -MF $(DEPDIR)/alsamixer-mixer_controls.Tpo -c -o alsamixer-mixer_controls.obj `if test -f 'mixer_controls.c'; then $(CYGPATH_W) 'mixer_controls.c'; else $(CYGPATH_W) '$(srcdir)/mixer_controls.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mixer_controls.Tpo $(DEPDIR)/alsamixer-mixer_controls.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mixer_controls.c' object='alsamixer-mixer_controls.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_controls.obj `if test -f 'mixer_controls.c'; then $(CYGPATH_W) 'mixer_controls.c'; else $(CYGPATH_W) '$(srcdir)/mixer_controls.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_controls.obj `if test -f 'mixer_controls.c'; then $(CYGPATH_W) 'mixer_controls.c'; else $(CYGPATH_W) '$(srcdir)/mixer_controls.c'; fi`
 
 alsamixer-mixer_display.o: mixer_display.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_display.o -MD -MP -MF $(DEPDIR)/alsamixer-mixer_display.Tpo -c -o alsamixer-mixer_display.o `test -f 'mixer_display.c' || echo '$(srcdir)/'`mixer_display.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mixer_display.Tpo $(DEPDIR)/alsamixer-mixer_display.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mixer_display.c' object='alsamixer-mixer_display.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_display.o -MD -MP -MF $(DEPDIR)/alsamixer-mixer_display.Tpo -c -o alsamixer-mixer_display.o `test -f 'mixer_display.c' || echo '$(srcdir)/'`mixer_display.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mixer_display.Tpo $(DEPDIR)/alsamixer-mixer_display.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mixer_display.c' object='alsamixer-mixer_display.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_display.o `test -f 'mixer_display.c' || echo '$(srcdir)/'`mixer_display.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_display.o `test -f 'mixer_display.c' || echo '$(srcdir)/'`mixer_display.c
 
 alsamixer-mixer_display.obj: mixer_display.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_display.obj -MD -MP -MF $(DEPDIR)/alsamixer-mixer_display.Tpo -c -o alsamixer-mixer_display.obj `if test -f 'mixer_display.c'; then $(CYGPATH_W) 'mixer_display.c'; else $(CYGPATH_W) '$(srcdir)/mixer_display.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mixer_display.Tpo $(DEPDIR)/alsamixer-mixer_display.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mixer_display.c' object='alsamixer-mixer_display.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_display.obj -MD -MP -MF $(DEPDIR)/alsamixer-mixer_display.Tpo -c -o alsamixer-mixer_display.obj `if test -f 'mixer_display.c'; then $(CYGPATH_W) 'mixer_display.c'; else $(CYGPATH_W) '$(srcdir)/mixer_display.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mixer_display.Tpo $(DEPDIR)/alsamixer-mixer_display.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mixer_display.c' object='alsamixer-mixer_display.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_display.obj `if test -f 'mixer_display.c'; then $(CYGPATH_W) 'mixer_display.c'; else $(CYGPATH_W) '$(srcdir)/mixer_display.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_display.obj `if test -f 'mixer_display.c'; then $(CYGPATH_W) 'mixer_display.c'; else $(CYGPATH_W) '$(srcdir)/mixer_display.c'; fi`
 
 alsamixer-mixer_widget.o: mixer_widget.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_widget.o -MD -MP -MF $(DEPDIR)/alsamixer-mixer_widget.Tpo -c -o alsamixer-mixer_widget.o `test -f 'mixer_widget.c' || echo '$(srcdir)/'`mixer_widget.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mixer_widget.Tpo $(DEPDIR)/alsamixer-mixer_widget.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mixer_widget.c' object='alsamixer-mixer_widget.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_widget.o -MD -MP -MF $(DEPDIR)/alsamixer-mixer_widget.Tpo -c -o alsamixer-mixer_widget.o `test -f 'mixer_widget.c' || echo '$(srcdir)/'`mixer_widget.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mixer_widget.Tpo $(DEPDIR)/alsamixer-mixer_widget.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mixer_widget.c' object='alsamixer-mixer_widget.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_widget.o `test -f 'mixer_widget.c' || echo '$(srcdir)/'`mixer_widget.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_widget.o `test -f 'mixer_widget.c' || echo '$(srcdir)/'`mixer_widget.c
 
 alsamixer-mixer_widget.obj: mixer_widget.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_widget.obj -MD -MP -MF $(DEPDIR)/alsamixer-mixer_widget.Tpo -c -o alsamixer-mixer_widget.obj `if test -f 'mixer_widget.c'; then $(CYGPATH_W) 'mixer_widget.c'; else $(CYGPATH_W) '$(srcdir)/mixer_widget.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-mixer_widget.Tpo $(DEPDIR)/alsamixer-mixer_widget.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='mixer_widget.c' object='alsamixer-mixer_widget.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-mixer_widget.obj -MD -MP -MF $(DEPDIR)/alsamixer-mixer_widget.Tpo -c -o alsamixer-mixer_widget.obj `if test -f 'mixer_widget.c'; then $(CYGPATH_W) 'mixer_widget.c'; else $(CYGPATH_W) '$(srcdir)/mixer_widget.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-mixer_widget.Tpo $(DEPDIR)/alsamixer-mixer_widget.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mixer_widget.c' object='alsamixer-mixer_widget.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_widget.obj `if test -f 'mixer_widget.c'; then $(CYGPATH_W) 'mixer_widget.c'; else $(CYGPATH_W) '$(srcdir)/mixer_widget.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-mixer_widget.obj `if test -f 'mixer_widget.c'; then $(CYGPATH_W) 'mixer_widget.c'; else $(CYGPATH_W) '$(srcdir)/mixer_widget.c'; fi`
 
 alsamixer-proc_files.o: proc_files.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-proc_files.o -MD -MP -MF $(DEPDIR)/alsamixer-proc_files.Tpo -c -o alsamixer-proc_files.o `test -f 'proc_files.c' || echo '$(srcdir)/'`proc_files.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-proc_files.Tpo $(DEPDIR)/alsamixer-proc_files.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='proc_files.c' object='alsamixer-proc_files.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-proc_files.o -MD -MP -MF $(DEPDIR)/alsamixer-proc_files.Tpo -c -o alsamixer-proc_files.o `test -f 'proc_files.c' || echo '$(srcdir)/'`proc_files.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-proc_files.Tpo $(DEPDIR)/alsamixer-proc_files.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='proc_files.c' object='alsamixer-proc_files.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-proc_files.o `test -f 'proc_files.c' || echo '$(srcdir)/'`proc_files.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-proc_files.o `test -f 'proc_files.c' || echo '$(srcdir)/'`proc_files.c
 
 alsamixer-proc_files.obj: proc_files.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-proc_files.obj -MD -MP -MF $(DEPDIR)/alsamixer-proc_files.Tpo -c -o alsamixer-proc_files.obj `if test -f 'proc_files.c'; then $(CYGPATH_W) 'proc_files.c'; else $(CYGPATH_W) '$(srcdir)/proc_files.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-proc_files.Tpo $(DEPDIR)/alsamixer-proc_files.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='proc_files.c' object='alsamixer-proc_files.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-proc_files.obj -MD -MP -MF $(DEPDIR)/alsamixer-proc_files.Tpo -c -o alsamixer-proc_files.obj `if test -f 'proc_files.c'; then $(CYGPATH_W) 'proc_files.c'; else $(CYGPATH_W) '$(srcdir)/proc_files.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-proc_files.Tpo $(DEPDIR)/alsamixer-proc_files.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='proc_files.c' object='alsamixer-proc_files.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-proc_files.obj `if test -f 'proc_files.c'; then $(CYGPATH_W) 'proc_files.c'; else $(CYGPATH_W) '$(srcdir)/proc_files.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-proc_files.obj `if test -f 'proc_files.c'; then $(CYGPATH_W) 'proc_files.c'; else $(CYGPATH_W) '$(srcdir)/proc_files.c'; fi`
 
 alsamixer-textbox.o: textbox.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-textbox.o -MD -MP -MF $(DEPDIR)/alsamixer-textbox.Tpo -c -o alsamixer-textbox.o `test -f 'textbox.c' || echo '$(srcdir)/'`textbox.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-textbox.Tpo $(DEPDIR)/alsamixer-textbox.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='textbox.c' object='alsamixer-textbox.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-textbox.o -MD -MP -MF $(DEPDIR)/alsamixer-textbox.Tpo -c -o alsamixer-textbox.o `test -f 'textbox.c' || echo '$(srcdir)/'`textbox.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-textbox.Tpo $(DEPDIR)/alsamixer-textbox.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='textbox.c' object='alsamixer-textbox.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-textbox.o `test -f 'textbox.c' || echo '$(srcdir)/'`textbox.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-textbox.o `test -f 'textbox.c' || echo '$(srcdir)/'`textbox.c
 
 alsamixer-textbox.obj: textbox.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-textbox.obj -MD -MP -MF $(DEPDIR)/alsamixer-textbox.Tpo -c -o alsamixer-textbox.obj `if test -f 'textbox.c'; then $(CYGPATH_W) 'textbox.c'; else $(CYGPATH_W) '$(srcdir)/textbox.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-textbox.Tpo $(DEPDIR)/alsamixer-textbox.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='textbox.c' object='alsamixer-textbox.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-textbox.obj -MD -MP -MF $(DEPDIR)/alsamixer-textbox.Tpo -c -o alsamixer-textbox.obj `if test -f 'textbox.c'; then $(CYGPATH_W) 'textbox.c'; else $(CYGPATH_W) '$(srcdir)/textbox.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-textbox.Tpo $(DEPDIR)/alsamixer-textbox.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='textbox.c' object='alsamixer-textbox.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-textbox.obj `if test -f 'textbox.c'; then $(CYGPATH_W) 'textbox.c'; else $(CYGPATH_W) '$(srcdir)/textbox.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-textbox.obj `if test -f 'textbox.c'; then $(CYGPATH_W) 'textbox.c'; else $(CYGPATH_W) '$(srcdir)/textbox.c'; fi`
 
 alsamixer-utils.o: utils.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-utils.o -MD -MP -MF $(DEPDIR)/alsamixer-utils.Tpo -c -o alsamixer-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-utils.Tpo $(DEPDIR)/alsamixer-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='utils.c' object='alsamixer-utils.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-utils.o -MD -MP -MF $(DEPDIR)/alsamixer-utils.Tpo -c -o alsamixer-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-utils.Tpo $(DEPDIR)/alsamixer-utils.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='utils.c' object='alsamixer-utils.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
 
 alsamixer-utils.obj: utils.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-utils.obj -MD -MP -MF $(DEPDIR)/alsamixer-utils.Tpo -c -o alsamixer-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-utils.Tpo $(DEPDIR)/alsamixer-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='utils.c' object='alsamixer-utils.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-utils.obj -MD -MP -MF $(DEPDIR)/alsamixer-utils.Tpo -c -o alsamixer-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-utils.Tpo $(DEPDIR)/alsamixer-utils.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='utils.c' object='alsamixer-utils.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
 
 alsamixer-volume_mapping.o: volume_mapping.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-volume_mapping.o -MD -MP -MF $(DEPDIR)/alsamixer-volume_mapping.Tpo -c -o alsamixer-volume_mapping.o `test -f 'volume_mapping.c' || echo '$(srcdir)/'`volume_mapping.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-volume_mapping.Tpo $(DEPDIR)/alsamixer-volume_mapping.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='volume_mapping.c' object='alsamixer-volume_mapping.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-volume_mapping.o -MD -MP -MF $(DEPDIR)/alsamixer-volume_mapping.Tpo -c -o alsamixer-volume_mapping.o `test -f 'volume_mapping.c' || echo '$(srcdir)/'`volume_mapping.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-volume_mapping.Tpo $(DEPDIR)/alsamixer-volume_mapping.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='volume_mapping.c' object='alsamixer-volume_mapping.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-volume_mapping.o `test -f 'volume_mapping.c' || echo '$(srcdir)/'`volume_mapping.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-volume_mapping.o `test -f 'volume_mapping.c' || echo '$(srcdir)/'`volume_mapping.c
 
 alsamixer-volume_mapping.obj: volume_mapping.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-volume_mapping.obj -MD -MP -MF $(DEPDIR)/alsamixer-volume_mapping.Tpo -c -o alsamixer-volume_mapping.obj `if test -f 'volume_mapping.c'; then $(CYGPATH_W) 'volume_mapping.c'; else $(CYGPATH_W) '$(srcdir)/volume_mapping.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-volume_mapping.Tpo $(DEPDIR)/alsamixer-volume_mapping.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='volume_mapping.c' object='alsamixer-volume_mapping.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-volume_mapping.obj -MD -MP -MF $(DEPDIR)/alsamixer-volume_mapping.Tpo -c -o alsamixer-volume_mapping.obj `if test -f 'volume_mapping.c'; then $(CYGPATH_W) 'volume_mapping.c'; else $(CYGPATH_W) '$(srcdir)/volume_mapping.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-volume_mapping.Tpo $(DEPDIR)/alsamixer-volume_mapping.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='volume_mapping.c' object='alsamixer-volume_mapping.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-volume_mapping.obj `if test -f 'volume_mapping.c'; then $(CYGPATH_W) 'volume_mapping.c'; else $(CYGPATH_W) '$(srcdir)/volume_mapping.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-volume_mapping.obj `if test -f 'volume_mapping.c'; then $(CYGPATH_W) 'volume_mapping.c'; else $(CYGPATH_W) '$(srcdir)/volume_mapping.c'; fi`
 
 alsamixer-widget.o: widget.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-widget.o -MD -MP -MF $(DEPDIR)/alsamixer-widget.Tpo -c -o alsamixer-widget.o `test -f 'widget.c' || echo '$(srcdir)/'`widget.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-widget.Tpo $(DEPDIR)/alsamixer-widget.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='widget.c' object='alsamixer-widget.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-widget.o -MD -MP -MF $(DEPDIR)/alsamixer-widget.Tpo -c -o alsamixer-widget.o `test -f 'widget.c' || echo '$(srcdir)/'`widget.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-widget.Tpo $(DEPDIR)/alsamixer-widget.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='widget.c' object='alsamixer-widget.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-widget.o `test -f 'widget.c' || echo '$(srcdir)/'`widget.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-widget.o `test -f 'widget.c' || echo '$(srcdir)/'`widget.c
 
 alsamixer-widget.obj: widget.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-widget.obj -MD -MP -MF $(DEPDIR)/alsamixer-widget.Tpo -c -o alsamixer-widget.obj `if test -f 'widget.c'; then $(CYGPATH_W) 'widget.c'; else $(CYGPATH_W) '$(srcdir)/widget.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/alsamixer-widget.Tpo $(DEPDIR)/alsamixer-widget.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='widget.c' object='alsamixer-widget.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT alsamixer-widget.obj -MD -MP -MF $(DEPDIR)/alsamixer-widget.Tpo -c -o alsamixer-widget.obj `if test -f 'widget.c'; then $(CYGPATH_W) 'widget.c'; else $(CYGPATH_W) '$(srcdir)/widget.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/alsamixer-widget.Tpo $(DEPDIR)/alsamixer-widget.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='widget.c' object='alsamixer-widget.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-widget.obj `if test -f 'widget.c'; then $(CYGPATH_W) 'widget.c'; else $(CYGPATH_W) '$(srcdir)/widget.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(alsamixer_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o alsamixer-widget.obj `if test -f 'widget.c'; then $(CYGPATH_W) 'widget.c'; else $(CYGPATH_W) '$(srcdir)/widget.c'; fi`
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -660,26 +909,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -691,15 +929,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -708,9 +942,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -726,20 +961,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -808,10 +1033,29 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/alsamixer-bindings.Po
+       -rm -f ./$(DEPDIR)/alsamixer-card_select.Po
+       -rm -f ./$(DEPDIR)/alsamixer-cli.Po
+       -rm -f ./$(DEPDIR)/alsamixer-colors.Po
+       -rm -f ./$(DEPDIR)/alsamixer-configparser.Po
+       -rm -f ./$(DEPDIR)/alsamixer-curskey.Po
+       -rm -f ./$(DEPDIR)/alsamixer-device_name.Po
+       -rm -f ./$(DEPDIR)/alsamixer-die.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mainloop.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mem.Po
+       -rm -f ./$(DEPDIR)/alsamixer-menu_widget.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mixer_clickable.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mixer_controls.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mixer_display.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mixer_widget.Po
+       -rm -f ./$(DEPDIR)/alsamixer-proc_files.Po
+       -rm -f ./$(DEPDIR)/alsamixer-textbox.Po
+       -rm -f ./$(DEPDIR)/alsamixer-utils.Po
+       -rm -f ./$(DEPDIR)/alsamixer-volume_mapping.Po
+       -rm -f ./$(DEPDIR)/alsamixer-widget.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -857,13 +1101,33 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/alsamixer-bindings.Po
+       -rm -f ./$(DEPDIR)/alsamixer-card_select.Po
+       -rm -f ./$(DEPDIR)/alsamixer-cli.Po
+       -rm -f ./$(DEPDIR)/alsamixer-colors.Po
+       -rm -f ./$(DEPDIR)/alsamixer-configparser.Po
+       -rm -f ./$(DEPDIR)/alsamixer-curskey.Po
+       -rm -f ./$(DEPDIR)/alsamixer-device_name.Po
+       -rm -f ./$(DEPDIR)/alsamixer-die.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mainloop.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mem.Po
+       -rm -f ./$(DEPDIR)/alsamixer-menu_widget.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mixer_clickable.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mixer_controls.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mixer_display.Po
+       -rm -f ./$(DEPDIR)/alsamixer-mixer_widget.Po
+       -rm -f ./$(DEPDIR)/alsamixer-proc_files.Po
+       -rm -f ./$(DEPDIR)/alsamixer-textbox.Po
+       -rm -f ./$(DEPDIR)/alsamixer-utils.Po
+       -rm -f ./$(DEPDIR)/alsamixer-volume_mapping.Po
+       -rm -f ./$(DEPDIR)/alsamixer-widget.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -879,9 +1143,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -889,9 +1154,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 #LDFLAGS = -static
index 8d34680..d7340a2 100644 (file)
@@ -29,12 +29,16 @@ Select the mixer device to control.
 Select the starting view mode, either \fIplayback\fP, \fIcapture\fP or \fIall\fP.
 
 .TP
+\fI\-B, \-\-black-background\fP
+Use the black background color.
+
+.TP
 \fI\-g, \-\-no\-color\fP
 Toggle the using of colors.
 
 .SH MIXER VIEWS
 
-The top-left corner of \fBalsamixer\fP is the are to show some basic
+The top-left corner of \fBalsamixer\fP shows some basic
 information: the card name, the mixer chip name, the current view
 mode and the currently selected mixer item.
 When the mixer item is switched off, \fI[Off]\fP is displayed in its
@@ -43,7 +47,7 @@ name.
 Volume bars are located below the basic information area.  You can
 scroll left/right when all controls can't be put in a single screen.
 The name of each control is shown in the bottom below the volume bars.
-The currently selected item is drawn in red and/of emphasized.
+The currently selected item is drawn in red and/or emphasized.
 
 Each mixer control with volume capability shows a box and the current
 volume filled in that box.  The volume percentages are displayed below
@@ -170,6 +174,216 @@ Only for controls without dB information, a linear mapping of the
 hardware volume register values is used (this is the same algorithm as
 used in the old \fBalsamixer\fP).
 
+.SH FILES
+
+Configuration is read from the following files:
+
+\fI$XDG_CONFIG_HOME\fP/alsamixer.rc
+
+\fI$HOME\fP/.config/alsamixer.rc
+
+.SH CONFIGURATION
+
+Comments start with '#'.
+
+.TP
+\fBcolor\fP \fIelement\fP \fIforeground\fP \fIbackground\fP [\fIattribute...\fP]
+
+Valid values for \fIforeground\fP and \fIbackground\fP are: red, green, yellow, blue, magenta, cyan, white, black, none / default.
+
+Valid values for \fIattribute\fP are: bold, normal, reverse, underline, dim, italic, blink.
+
+See section \fBTHEME ELEMENTS\fP for a list of \fIelements\fP.
+
+.TP
+\fBset\fP \fIoption\fP \fIvalue\fP
+
+\fBmouse_wheel_step\fP \fI<N>\fP
+
+Set the mouse wheel step to \fI<N>\fP
+
+\fBmouse_wheel_focuses_control\fP \fI0|1\fP
+
+If enabled (\fI1\fP), mixer controls can be changed by hovering over them and scrolling the mouse wheel.
+
+\fBbackground\fP \fIcolor\fP
+
+Set the default background color
+
+.TP
+\fBbind\fP \fIkey_definition\fP \fIcommand\fP
+
+A \fIkey_definition\fP may be:
+   - a single character
+   - a combination with control: C-a
+   - a combination with alt: M-a
+   - a special keyname: Enter, Escape, PageUp, PageDown, Left, Down, Right, Up, Home, End, Backspace, F1 .. F12
+
+See section \fBCOMMANDS\fP for a list of \fIcommands\fP.
+
+.SS COMMANDS
+
+.TP
+\fItextbox_close\fP
+Close textbox
+
+.TP
+\fItextbox_up\fP / \fItextbox_down\fP
+Scroll text up/down by one line
+
+.TP
+\fItextbox_left\fP / \fItextbox_right\fP
+Scroll text left/right by one column
+
+.TP
+\fItextbox_page_up\fP / \fItextbox_page_down\fP
+Scroll text up/down one page
+
+.TP
+\fItextbox_page_left\fP / \fItextbox_page_right\fP
+Scroll text left/right one page
+
+.TP
+\fItextbox_top\fP / \fItextbox_bottom\fP
+Go to top/bottom position of text
+
+.TP
+\fImixer_balance_volumes\fP
+Balance both channels
+
+.TP
+\fImixer_close\fP
+Close alsamixer application
+
+.TP
+\fImixer_help\fP
+Show help
+
+.TP
+\fImixer_mode_playback\fP
+Show playback controls
+
+.TP
+\fImixer_mode_capture\fP
+Show capture controls
+
+.TP
+\fImixer_mode_all\fP
+Show playback and capture controls
+
+.TP
+\fImixer_mode_toggle\fP
+Toggle between playback/capture/all controls
+
+.TP
+\fImixer_refresh\fP
+Refresh screen
+
+.TP
+\fImixer_previous\fP / \fImixer_next\fP
+Select previous/next mixer control
+
+.TP
+\fImixer_control_focus_<N>\fP
+Focus control number \fI<N>\fP.
+
+.TP
+\fImixer_control_set_<N>\fP[\fI_left\fP|\fI_right\fP]
+Change volume of current control to \fI<N>\fP percent.
+
+.TP
+\fImixer_control_up_<N>\fP[\fI_left\fP|\fI_right\fP]
+Increase volume of current control by \fI<N>\fP percent. 
+
+.TP
+\fImixer_control_down_<N>\fP[\fI_left\fP|\fI_right\fP]
+Decrease volume of current control by \fI<N>\fP percent.
+
+.TP
+\fImixer_toggle_mute\fP[\fI_left\fP|\fI_right\fP]
+Toggle mute state of both/left/right channels
+
+.TP
+\fImixer_toggle_capture\fP[\fI_left\fP|\fI_right\fP]
+Toggle capture state of both/left/right channels
+
+.TP
+\fImixer_select_card\fP
+Show window for selecting sound card
+
+.TP
+\fImixer_system_information\fP
+Show system information
+
+
+.SS THEME ELEMENTS
+
+.TP
+\fImixer_frame\fP Color of the box around the mixer
+
+.TP
+\fImixer_text\fP Color of text at the top of the mixer
+
+.TP
+\fImixer_active\fP Color of \fIAlsaMixer\fP heading
+
+.TP
+\fIctl_frame\fP Color of the frame around the mixer controls
+
+.TP
+\fIctl_mute\fP Color indicating the mute state (\fIMM\fP)
+
+.TP
+\fIctl_nomute\fP Color indicating the unmute state (\fI00\fP)
+
+.TP
+\fIctl_capture\fP Color of \fICAPTURE\fP text
+
+.TP
+\fIctl_nocapture\fP Colof of disabled capture label
+
+.TP
+\fIctl_label\fP Color of label underneath mixer controls
+
+.TP
+\fIctl_label_focus\fP Color of label underneath focused mixer control
+
+.TP
+\fIctl_mark_focus\fP Color of \fI<>\fP marks beside focused mixer label
+
+.TP
+\fIctl_bar_lo\fP Color of lower volume bar
+
+.TP
+\fIctl_bar_mi\fP Color of middle volume bar
+
+.TP
+\fIctl_bar_hi\fP Color of top volume bar
+
+.TP
+\fIctl_inactive\fP Color for inactive control
+
+.TP
+\fIctl_label_inactive\fP Color for inactive label
+
+.TP
+\fIerrormsg\fP Color used for error message
+
+.TP
+\fIinfomsg\fP Color used for information message
+
+.TP
+\fItextbox\fP Color used for textbox (user input)
+
+.TP
+\fItextfield\fP Color used for textbox
+
+.TP
+\fImenu\fP Color used for menu
+
+.TP
+\fImenu_selected\fP Color used for selected entry in menu
+
 .SH SEE ALSO
 \fB
 amixer(1),
@@ -177,11 +391,6 @@ aplay(1),
 arecord(1)
 \fP
 
-.SH BUGS 
-Some terminal emulators (e.g. \fBnxterm\fP) may not
-work quite right with ncurses, but that's their own damn
-fault. Plain old \fBxterm\fP seems to be fine.
-
 .SH AUTHOR
 .B alsamixer
 has been written by Tim Janik and
diff --git a/alsamixer/alsamixer.rc.example b/alsamixer/alsamixer.rc.example
new file mode 100644 (file)
index 0000000..f8594b9
--- /dev/null
@@ -0,0 +1,192 @@
+### alsamixer configuration file
+#
+# location: ~/alsamixer.rc  or  ~/.config/alsamixer.rc  or  ~/.alsamixer.rc
+
+
+### color configuration
+# color <element> <fg-color> <bg-color> [<attr> ...]
+#
+# color:
+#   default, black, red, green, yellow, blue, magenta, cyan, white
+#
+# attr:
+#   bold, reverse, standout, dim, underline, italic, normal, blink
+#
+# element:
+#   mixer_frame, mixer_text, mixer_active, ctl_frame, ctl_mute, ctl_nomute,
+#   ctl_capture, ctl_nocapture, ctl_label, ctl_label_focus, ctl_mark_focus,
+#   ctl_bar_lo, ctl_bar_mi, ctl_bar_hi, ctl_inactive, ctl_label_inactive,
+#   errormsg, infomsg, textbox, textfield, menu, menu_selected
+
+#color mixer_frame               cyan    default
+#color mixer_text                cyan    default
+#color mixer_active              yellow  default bold
+#color ctl_frame                 cyan    default bold
+#color ctl_mute                  cyan    default
+#color ctl_nomute                white   green   bold
+#color ctl_capture               red     default bold
+#color ctl_nocapture             white   default
+#color ctl_label                 white   blue    bold
+#color ctl_label_focus           red     blue    bold
+#color ctl_mark_focus            red     default bold
+#color ctl_bar_lo                green   green   bold
+#color ctl_bar_mi                white   white   bold
+#color ctl_bar_hi                red     red     bold
+#color ctl_inactive              white   default
+#color ctl_label_inactive        white   default reverse
+#color errormsg                  white   red     bold
+#color infomsg                   white   blue    bold
+#color textbox                   white   blue    bold
+#color textfield                 white   default reverse
+#color menu                      white   blue    bold
+#color menu_selected             white   blue    reverse
+
+
+### key bindings
+# bind <key> [mixer] <mixer-cmd>
+# bind <key> textbox <textbox-cmd>
+#
+# mixer-cmd:
+#   help, close, refresh, select_card, system_information, mode_all,
+#   mode_capture, mode_playback, mode_toggle, balance_control, next[_<N>],
+#   previous[_<N>], control_focus_<[_left|_right]N>,
+#   control_up[_<N>][_left|_right], control_down[_<N>][_left|_right],
+#   control_set_<N>[_left|_right], toggle_mute[_left|_right],
+#   toggle_capture[_left|_right]
+#
+# textbox-cmd:
+#   close, down, up, left, right, page_down, page_up, page_left, page_right,
+#   top, bottom
+#
+# key: a key definition may be:
+#   - a single character (A, a, Z, z, ...)
+#   - a character with control-modifier (^x, C-x, c-x, ...)
+#   - a character with meta/alt-modifier (M-x, m-x, A-x, a-x, ...)
+#   - a character with both modifiers (C-M-x, M-C-x, M-^x, ...)
+#   - a curses keyname, no modifiers allowed (KEY_HOME, Home, F1, F(1), ...)
+
+#bind Escape    mixer close
+#bind Cancel    mixer close
+#bind F10       mixer close
+#bind F1        mixer help
+#bind Help      mixer help
+#bind H         mixer help
+#bind h         mixer help
+#bind ?         mixer help
+#bind F2        mixer system_information
+#bind /         mixer system_information
+#bind F3        mixer mode_playback
+#bind F4        mixer mode_capture
+#bind F5        mixer mode_all
+#bind Tab       mixer mode_toggle
+#bind F6        mixer select_card
+#bind S         mixer select_card
+#bind s         mixer select_card
+#bind Refresh   mixer refresh
+#bind ^L        mixer refresh
+#bind L         mixer refresh
+#bind l         mixer refresh
+#bind Left      mixer previous
+#bind P         mixer previous
+#bind p         mixer previous
+#bind Right     mixer next
+#bind N         mixer next
+#bind n         mixer next
+#bind PPage     mixer control_up_5
+#bind NPage     mixer control_down_5
+#bind LL        mixer control_set_0
+#bind END       mixer control_set_0
+#bind 0         mixer control_set_0
+#bind 1         mixer control_set_10
+#bind 2         mixer control_set_20
+#bind 3         mixer control_set_30
+#bind 4         mixer control_set_40
+#bind 5         mixer control_set_50
+#bind 6         mixer control_set_60
+#bind 7         mixer control_set_70
+#bind 8         mixer control_set_80
+#bind 9         mixer control_set_90
+#bind Up        mixer control_up
+#bind +         mixer control_up
+#bind K         mixer control_up
+#bind k         mixer control_up
+#bind W         mixer control_up
+#bind w         mixer control_up
+#bind Down      mixer control_down
+#bind -         mixer control_down
+#bind J         mixer control_down
+#bind j         mixer control_down
+#bind X         mixer control_down
+#bind x         mixer control_down
+#bind Q         mixer control_up_left
+#bind q         mixer control_up_left
+#bind Y         mixer control_down_left
+#bind y         mixer control_down_left
+#bind Z         mixer control_down_left
+#bind z         mixer control_down_left
+#bind E         mixer control_up_right
+#bind e         mixer control_up_right
+#bind C         mixer control_down_right
+#bind c         mixer control_down_right
+#bind M         mixer toggle_mute
+#bind m         mixer toggle_mute
+#bind <         mixer toggle_mute_left
+#bind ,         mixer toggle_mute_left
+#bind >         mixer toggle_mute_right
+#bind .         mixer toggle_mute_right
+#bind Space     mixer toggle_capture
+#bind IC        mixer toggle_capture_left
+#bind ;         mixer toggle_capture_left
+#bind DC        mixer toggle_capture_right
+#bind '         mixer toggle_capture_right
+#bind B         mixer balance_control
+#bind b         mixer balance_control
+#bind =         mixer balance_control
+
+#bind Escape    textbox close
+#bind Cancel    textbox close
+#bind Enter     textbox close
+#bind Close     textbox close
+#bind Exit      textbox close
+#bind Down      textbox down
+#bind SF        textbox down
+#bind J         textbox down
+#bind j         textbox down
+#bind X         textbox down
+#bind x         textbox down
+#bind Up        textbox up
+#bind SR        textbox up
+#bind K         textbox up
+#bind k         textbox up
+#bind W         textbox up
+#bind w         textbox up
+#bind Left      textbox left
+#bind H         textbox left
+#bind h         textbox left
+#bind P         textbox left
+#bind p         textbox left
+#bind Right     textbox right
+#bind L         textbox right
+#bind l         textbox right
+#bind N         textbox right
+#bind n         textbox right
+#bind NPage     textbox page_down
+#bind SPace     textbox page_down
+#bind PPage     textbox page_up
+#bind Backspace textbox page_up
+#bind B         textbox page_up
+#bind b         textbox page_up
+#bind Home      textbox top
+#bind Beg       textbox top
+#bind LL        textbox bottom
+#bind End       textbox bottom
+#bind Tab       textbox page_right
+#bind BTab      textbox page_left
+
+
+### misc configuration
+# set mouse_wheel_step [0..100]
+# set mouse_wheel_focuses_control [0|1]
+
+#set mouse_wheel_step            1
+#set mouse_wheel_focuses_control 1
diff --git a/alsamixer/bindings.c b/alsamixer/bindings.c
new file mode 100644 (file)
index 0000000..4c8db18
--- /dev/null
@@ -0,0 +1,132 @@
+#include "bindings.h"
+#include "mixer_widget.h"
+
+#define CNTRL(C) (C%32)
+
+uint8_t textbox_bindings[KEY_MAX] = {
+       ['\n'] =          CMD_TEXTBOX_CLOSE,
+       ['\r'] =          CMD_TEXTBOX_CLOSE,
+       [27] =            CMD_TEXTBOX_CLOSE,
+       [KEY_CANCEL] =    CMD_TEXTBOX_CLOSE,
+       [KEY_ENTER] =     CMD_TEXTBOX_CLOSE,
+       [KEY_CLOSE] =     CMD_TEXTBOX_CLOSE,
+       [KEY_EXIT] =      CMD_TEXTBOX_CLOSE,
+       [KEY_DOWN] =      CMD_TEXTBOX_DOWN,
+       [KEY_SF] =        CMD_TEXTBOX_DOWN,
+       ['J'] =           CMD_TEXTBOX_DOWN,
+       ['j'] =           CMD_TEXTBOX_DOWN,
+       ['X'] =           CMD_TEXTBOX_DOWN,
+       ['x'] =           CMD_TEXTBOX_DOWN,
+       [KEY_UP] =        CMD_TEXTBOX_UP,
+       [KEY_SR] =        CMD_TEXTBOX_UP,
+       ['K'] =           CMD_TEXTBOX_UP,
+       ['k'] =           CMD_TEXTBOX_UP,
+       ['W'] =           CMD_TEXTBOX_UP,
+       ['w'] =           CMD_TEXTBOX_UP,
+       [KEY_LEFT] =      CMD_TEXTBOX_LEFT,
+       ['H'] =           CMD_TEXTBOX_LEFT,
+       ['h'] =           CMD_TEXTBOX_LEFT,
+       ['P'] =           CMD_TEXTBOX_LEFT,
+       ['p'] =           CMD_TEXTBOX_LEFT,
+       [KEY_RIGHT] =     CMD_TEXTBOX_RIGHT,
+       ['L'] =           CMD_TEXTBOX_RIGHT,
+       ['l'] =           CMD_TEXTBOX_RIGHT,
+       ['N'] =           CMD_TEXTBOX_RIGHT,
+       ['n'] =           CMD_TEXTBOX_RIGHT,
+       [KEY_NPAGE] =     CMD_TEXTBOX_PAGE_DOWN,
+       [' '] =           CMD_TEXTBOX_PAGE_DOWN,
+       [KEY_PPAGE] =     CMD_TEXTBOX_PAGE_UP,
+       [KEY_BACKSPACE] = CMD_TEXTBOX_PAGE_UP,
+       ['B'] =           CMD_TEXTBOX_PAGE_UP,
+       ['b'] =           CMD_TEXTBOX_PAGE_UP,
+       [KEY_HOME] =      CMD_TEXTBOX_TOP,
+       [KEY_BEG] =       CMD_TEXTBOX_TOP,
+       [KEY_LL] =        CMD_TEXTBOX_BOTTOM,
+       [KEY_END] =       CMD_TEXTBOX_BOTTOM,
+       ['\t'] =          CMD_TEXTBOX_PAGE_RIGHT,
+       [KEY_BTAB] =      CMD_TEXTBOX_PAGE_LEFT,
+};
+
+command_enum mixer_bindings[] = {
+       [27] =            CMD_MIXER_CLOSE,
+       [KEY_CANCEL] =    CMD_MIXER_CLOSE,
+       [KEY_F(10)] =     CMD_MIXER_CLOSE,
+       [KEY_F(1)] =      CMD_MIXER_HELP,
+       [KEY_HELP] =      CMD_MIXER_HELP,
+       ['H'] =           CMD_MIXER_HELP,
+       ['h'] =           CMD_MIXER_HELP,
+       ['?'] =           CMD_MIXER_HELP,
+       [KEY_F(2)] =      CMD_MIXER_SYSTEM_INFORMATION,
+       ['/'] =           CMD_MIXER_SYSTEM_INFORMATION,
+       [KEY_F(3)] =      CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_PLAYBACK),
+       [KEY_F(4)] =      CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_CAPTURE),
+       [KEY_F(5)] =      CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_ALL),
+       ['\t'] =          CMD_MIXER_TOGGLE_VIEW_MODE,
+       [KEY_F(6)] =      CMD_MIXER_SELECT_CARD,
+       ['S'] =           CMD_MIXER_SELECT_CARD,
+       ['s'] =           CMD_MIXER_SELECT_CARD,
+       [KEY_REFRESH] =   CMD_MIXER_REFRESH,
+       [CNTRL('L')] =    CMD_MIXER_REFRESH,
+       ['L'] =           CMD_MIXER_REFRESH,
+       ['l'] =           CMD_MIXER_REFRESH,
+       [KEY_LEFT] =      CMD_WITH_ARG(CMD_MIXER_PREVIOUS, 1),
+       ['p'] =           CMD_WITH_ARG(CMD_MIXER_PREVIOUS, 1),
+       ['P'] =           CMD_WITH_ARG(CMD_MIXER_PREVIOUS, 1),
+       [KEY_RIGHT] =     CMD_WITH_ARG(CMD_MIXER_NEXT, 1),
+       ['N'] =           CMD_WITH_ARG(CMD_MIXER_NEXT, 1),
+       ['n'] =           CMD_WITH_ARG(CMD_MIXER_NEXT, 1),
+       [KEY_PPAGE] =     CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 5),
+       [KEY_NPAGE] =     CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 5),
+       [KEY_LL] =        CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 0),
+       [KEY_END] =       CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 0),
+       ['0'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 0),
+       ['1'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 10),
+       ['2'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 20),
+       ['3'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 30),
+       ['4'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 40),
+       ['5'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 50),
+       ['6'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 60),
+       ['7'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 70),
+       ['8'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 80),
+       ['9'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 90),
+#if 0
+       [KEY_BEG] =       CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 100),
+       [KEY_HELP] =      CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT, 100),
+#endif
+       [KEY_UP] =        CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1),
+       ['+'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1),
+       ['K'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1),
+       ['k'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1),
+       ['W'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1),
+       ['w'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 1),
+       [KEY_DOWN] =      CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1),
+       ['-'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1),
+       ['J'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1),
+       ['j'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1),
+       ['X'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1),
+       ['x'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1),
+       ['Q'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP_LEFT, 1),
+       ['q'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP_LEFT, 1),
+       ['Y'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_LEFT, 1),
+       ['y'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_LEFT, 1),
+       ['Z'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_LEFT, 1),
+       ['z'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_LEFT, 1),
+       ['E'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP_RIGHT, 1),
+       ['e'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_UP_RIGHT, 1),
+       ['C'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_RIGHT, 1),
+       ['c'] =           CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN_RIGHT, 1),
+       ['M'] =           CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, LEFT|RIGHT),
+       ['m'] =           CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, LEFT|RIGHT),
+       ['<'] =           CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, LEFT),
+       [','] =           CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, LEFT),
+       ['>'] =           CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, RIGHT),
+       ['.'] =           CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, RIGHT),
+       [' '] =           CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, LEFT|RIGHT),
+       [KEY_IC] =        CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, LEFT),
+       [';'] =           CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, LEFT),
+       [KEY_DC] =        CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, RIGHT),
+       ['\''] =          CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, RIGHT),
+       ['B'] =           CMD_MIXER_BALANCE_CONTROL,
+       ['b'] =           CMD_MIXER_BALANCE_CONTROL,
+       ['='] =           CMD_MIXER_BALANCE_CONTROL,
+};
diff --git a/alsamixer/bindings.h b/alsamixer/bindings.h
new file mode 100644 (file)
index 0000000..fa2e8d3
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef BINDINGS_H_INCLUDED
+#define BINDINGS_H_INCLUDED
+
+#include CURSESINC
+#include <menu.h>
+#include <stdint.h>
+
+/* Commands are stored in an uint16_t and may take an unsigned numeric argument.
+ * The command itself is stored in the lower 7 bits, the argument is stored
+ * in the higher 9 bits.
+ *
+ * The value `0` is used for no (unbound) command. */
+
+typedef uint16_t command_enum;
+extern command_enum mixer_bindings[KEY_MAX];
+/* No need for a 16bit type, since textbox commands don't take arguments */
+extern uint8_t textbox_bindings[KEY_MAX];
+
+#define CMD_WITH_ARG(CMD, ARG) \
+       ((CMD) + ((ARG) << 9))
+
+#define CMD_GET_COMMAND(CMD) \
+       ((CMD) & 0x1FF)
+
+#define CMD_GET_ARGUMENT(CMD) \
+       ((CMD) >> 9)
+
+enum mixer_command {
+       // `CMD % 4` should produce the channel mask
+       CMD_MIXER_CONTROL_DOWN_LEFT = 1,
+       CMD_MIXER_CONTROL_DOWN_RIGHT,
+       CMD_MIXER_CONTROL_DOWN,
+       CMD_MIXER_CONTROL_UP_LEFT = 5,
+       CMD_MIXER_CONTROL_UP_RIGHT,
+       CMD_MIXER_CONTROL_UP,
+       CMD_MIXER_CONTROL_SET_PERCENT_LEFT = 9,
+       CMD_MIXER_CONTROL_SET_PERCENT_RIGHT,
+       CMD_MIXER_CONTROL_SET_PERCENT,
+
+       // Keep those in the same order as displayed on screen
+       CMD_MIXER_HELP,
+       CMD_MIXER_SYSTEM_INFORMATION,
+       CMD_MIXER_SELECT_CARD,
+       CMD_MIXER_CLOSE,
+
+       CMD_MIXER_TOGGLE_VIEW_MODE,
+       CMD_MIXER_SET_VIEW_MODE,
+       CMD_MIXER_PREVIOUS,
+       CMD_MIXER_NEXT,
+       CMD_MIXER_FOCUS_CONTROL,
+       CMD_MIXER_TOGGLE_MUTE,
+       CMD_MIXER_TOGGLE_CAPTURE,
+       CMD_MIXER_BALANCE_CONTROL,
+       CMD_MIXER_REFRESH,
+
+       // Mouse
+       CMD_MIXER_MOUSE_CLICK_MUTE,
+       CMD_MIXER_MOUSE_CLICK_VOLUME_BAR,
+       CMD_MIXER_MOUSE_CLICK_CONTROL_ENUM,
+};
+
+enum textbox_command {
+       /* Since these commands are also used by the menu widget we make use of
+        * the menu_driver() request constants.
+        * KEY_MAX is substracted so the value fits in 8 bits. */
+       CMD_TEXTBOX___MIN_MENU_COMMAND = MIN_MENU_COMMAND - KEY_MAX,
+       CMD_TEXTBOX_TOP = REQ_FIRST_ITEM - KEY_MAX,
+       CMD_TEXTBOX_BOTTOM = REQ_LAST_ITEM - KEY_MAX,
+       CMD_TEXTBOX_LEFT = REQ_LEFT_ITEM - KEY_MAX,
+       CMD_TEXTBOX_RIGHT = REQ_RIGHT_ITEM - KEY_MAX,
+       CMD_TEXTBOX_UP = REQ_UP_ITEM - KEY_MAX,
+       CMD_TEXTBOX_DOWN = REQ_DOWN_ITEM - KEY_MAX,
+       CMD_TEXTBOX_PAGE_DOWN = REQ_SCR_DPAGE - KEY_MAX,
+       CMD_TEXTBOX_PAGE_UP = REQ_SCR_UPAGE - KEY_MAX,
+       CMD_TEXTBOX___MAX_MENU_COMMAND = MAX_MENU_COMMAND - KEY_MAX,
+       CMD_TEXTBOX_PAGE_LEFT,
+       CMD_TEXTBOX_PAGE_RIGHT,
+       CMD_TEXTBOX_CLOSE,
+};
+
+#endif
index b473dcf..aac7b45 100644 (file)
@@ -28,6 +28,7 @@
 #include "utils.h"
 #include "colors.h"
 #include "widget.h"
+#include "menu_widget.h"
 #include "mixer_widget.h"
 #include "device_name.h"
 #include "card_select.h"
@@ -59,86 +60,24 @@ static void on_key_enter(void)
        }
 }
 
-static void on_menu_key(int key)
-{
-       static const struct {
-               int key;
-               int request;
-       } key_map[] = {
-               { KEY_DOWN, REQ_DOWN_ITEM },
-               { KEY_UP, REQ_UP_ITEM },
-               { KEY_HOME, REQ_FIRST_ITEM },
-               { KEY_NPAGE, REQ_SCR_DPAGE },
-               { KEY_PPAGE, REQ_SCR_UPAGE },
-               { KEY_BEG, REQ_FIRST_ITEM },
-               { KEY_END, REQ_LAST_ITEM },
-       };
-       unsigned int i;
-
-       for (i = 0; i < ARRAY_SIZE(key_map); ++i)
-               if (key_map[i].key == key) {
-                       menu_driver(menu, key_map[i].request);
-                       break;
-               }
-}
-
 static void on_handle_key(int key)
 {
-       switch (key) {
-       case 27:
-       case KEY_CANCEL:
-       case 'q':
-       case 'Q':
-               list_widget.close();
-               break;
-       case 10:
-       case 13:
-       case KEY_ENTER:
-               on_key_enter();
-               break;
-       default:
-               on_menu_key(key);
-               break;
-       }
-}
-
-static bool create(void)
-{
-       int rows, columns;
-       const char *title;
-
-       if (screen_lines < 3 || screen_cols < 10) {
-               beep();
-               list_widget.close();
-               return FALSE;
+       switch (menu_widget_handle_key(menu, key)) {
+               case KEY_ENTER:
+                       on_key_enter();
+                       break;
+               case KEY_CANCEL:
+                       list_widget.close();
+                       break;
        }
-       scale_menu(menu, &rows, &columns);
-       rows += 2;
-       columns += 2;
-       if (rows > screen_lines)
-               rows = screen_lines;
-       if (columns > screen_cols)
-               columns = screen_cols;
-
-       widget_init(&list_widget, rows, columns, SCREEN_CENTER, SCREEN_CENTER,
-                   attr_menu, WIDGET_BORDER | WIDGET_SUBWINDOW);
-
-       title = _("Sound Card");
-       mvwprintw(list_widget.window, 0, (columns - 2 - get_mbs_width(title)) / 2, " %s ", title);
-       set_menu_win(menu, list_widget.window);
-       set_menu_sub(menu, list_widget.subwindow);
-       return TRUE;
 }
 
-static void on_window_size_changed(void)
+static void create(void)
 {
-       unpost_menu(menu);
-       if (!create())
-               return;
-       post_menu(menu);
+       menu_widget_create(&list_widget, menu, _("Sound Card"));
 }
 
-static void on_close(void)
+void close_card_select_list(void)
 {
        unsigned int i;
        struct card *card, *next_card;
@@ -158,15 +97,10 @@ static void on_close(void)
        widget_free(&list_widget);
 }
 
-void close_card_select_list(void)
-{
-       on_close();
-}
-
 static struct widget list_widget = {
        .handle_key = on_handle_key,
-       .window_size_changed = on_window_size_changed,
-       .close = on_close,
+       .window_size_changed = create,
+       .close = close_card_select_list,
 };
 
 static int get_cards(void)
@@ -174,7 +108,7 @@ static int get_cards(void)
        int count, number, err;
        snd_ctl_t *ctl;
        snd_ctl_card_info_t *info;
-       char buf[16];
+       char buf[32];
        struct card *card, *prev_card;
 
        first_card.indexstr = "-";
@@ -191,7 +125,11 @@ static int get_cards(void)
                        fatal_alsa_error(_("cannot enumerate sound cards"), err);
                if (number < 0)
                        break;
+#if defined(SND_LIB_VER) && SND_LIB_VER(1, 2, 5) <= SND_LIB_VERSION
+               sprintf(buf, "sysdefault:%d", number);
+#else
                sprintf(buf, "hw:%d", number);
+#endif
                err = snd_ctl_open(&ctl, buf, 0);
                if (err < 0)
                        continue;
@@ -200,11 +138,9 @@ static int get_cards(void)
                if (err < 0)
                        continue;
                card = ccalloc(1, sizeof *card);
-               sprintf(buf, "%d", number);
-               card->indexstr = cstrdup(buf);
-               card->name = cstrdup(snd_ctl_card_info_get_name(info));
-               sprintf(buf, "hw:%d", number);
                card->device_name = cstrdup(buf);
+               card->indexstr = cstrdup(buf + 3);
+               card->name = cstrdup(snd_ctl_card_info_get_name(info));
                prev_card->next = card;
                prev_card = card;
                ++count;
@@ -253,16 +189,13 @@ void create_card_select_list(void)
        menu = new_menu(items);
        if (!menu)
                fatal_error("cannot create menu");
-       set_menu_fore(menu, attr_menu_selected);
-       set_menu_back(menu, attr_menu);
+       set_menu_fore(menu, attrs.menu_selected);
+       set_menu_back(menu, attrs.menu);
        set_menu_mark(menu, NULL);
        if (initial_item)
                set_current_item(menu, initial_item);
        set_menu_spacing(menu, 2, 1, 1);
        menu_opts_on(menu, O_SHOWDESC);
 
-       if (!create())
-               return;
-
-       post_menu(menu);
+       create();
 }
index 3f8f52f..a39a4f5 100644 (file)
 #include "gettext_curses.h"
 #include "mixer_widget.h"
 #include "mainloop.h"
+#include "configparser.h"
+#include "colors.h"
 
+static int black_background = 0;
 static int use_color = 1;
+static int use_mouse = 1;
+static const char* config_file = CONFIG_DEFAULT;
 static struct snd_mixer_selem_regopt selem_regopt = {
        .ver = 1,
        .abstract = SND_MIXER_SABSTRACT_NONE,
@@ -42,7 +47,12 @@ static void show_help(void)
               "  -h, --help              this help\n"
               "  -c, --card=NUMBER       sound card number or id\n"
               "  -D, --device=NAME       mixer device name\n"
-              "  -V, --view=MODE         starting view mode: playback/capture/all"));
+              "  -m, --mouse             enable mouse\n"
+              "  -M, --no-mouse          disable mouse\n"
+              "  -f, --config=FILE       configuration file\n"
+              "  -F, --no-config         do not load configuration file\n"
+              "  -V, --view=MODE         starting view mode: playback/capture/all\n"
+              "  -B, --black-background  use black background color"));
        puts(_("Debugging options:\n"
               "  -g, --no-color          toggle using of colors\n"
               "  -a, --abstraction=NAME  mixer abstraction level: none/basic"));
@@ -50,19 +60,24 @@ static void show_help(void)
 
 static void parse_options(int argc, char *argv[])
 {
-       static const char short_options[] = "hc:D:V:gsa:";
+       static const char short_options[] = "hc:f:FD:mMV:Bga:";
        static const struct option long_options[] = {
                { .name = "help", .val = 'h' },
                { .name = "card", .has_arg = 1, .val = 'c' },
+               { .name = "config", .has_arg = 1, .val = 'f' },
+               { .name = "no-config", .val = 'F' },
                { .name = "device", .has_arg = 1, .val = 'D' },
+               { .name = "mouse", .val = 'm' },
+               { .name = "no-mouse", .val = 'M' },
                { .name = "view", .has_arg = 1, .val = 'V' },
+               { .name = "black-background", .val = 'B' },
                { .name = "no-color", .val = 'g' },
                { .name = "abstraction", .has_arg = 1, .val = 'a' },
-               { }
+               { }
        };
        int option;
        int card_index;
-       static char name_buf[16];
+       static char name_buf[24];
 
        while ((option = getopt_long(argc, argv, short_options,
                                     long_options, NULL)) != -1) {
@@ -77,12 +92,28 @@ static void parse_options(int argc, char *argv[])
                                fprintf(stderr, _("invalid card index: %s\n"), optarg);
                                goto fail;
                        }
+#if defined(SND_LIB_VER) && SND_LIB_VER(1, 2, 5) <= SND_LIB_VERSION
+                       sprintf(name_buf, "sysdefault:%d", card_index);
+#else
                        sprintf(name_buf, "hw:%d", card_index);
+#endif
                        selem_regopt.device = name_buf;
                        break;
                case 'D':
                        selem_regopt.device = optarg;
                        break;
+               case 'f':
+                       config_file = optarg;
+                       break;
+               case 'F':
+                       config_file = NULL;
+                       break;
+               case 'm':
+                       use_mouse = 1;
+                       break;
+               case 'M':
+                       use_mouse = 0;
+                       break;
                case 'V':
                        if (*optarg == 'p' || *optarg == 'P')
                                view_mode = VIEW_MODE_PLAYBACK;
@@ -91,6 +122,9 @@ static void parse_options(int argc, char *argv[])
                        else
                                view_mode = VIEW_MODE_ALL;
                        break;
+               case 'B':
+                       black_background = 1;
+                       break;
                case 'g':
                        use_color = !use_color;
                        break;
@@ -127,7 +161,15 @@ int main(int argc, char *argv[])
 
        create_mixer_object(&selem_regopt);
 
-       initialize_curses(use_color);
+       initialize_curses(use_color, use_mouse);
+
+       if (config_file == CONFIG_DEFAULT)
+               parse_default_config_file();
+       else if (config_file)
+               parse_config_file(config_file);
+
+       if (black_background)
+               reinit_colors(COLOR_BLACK);
 
        create_mixer_widget();
 
index b4b98e5..cca5233 100644 (file)
 #include CURSESINC
 #include "colors.h"
 
-int attr_mixer_frame;
-int attr_mixer_text;
-int attr_mixer_active;
-int attr_ctl_frame;
-int attr_ctl_mute;
-int attr_ctl_nomute;
-int attr_ctl_capture;
-int attr_ctl_nocapture;
-int attr_ctl_label;
-int attr_ctl_label_focus;
-int attr_ctl_mark_focus;
-int attr_ctl_bar_lo;
-#ifdef TRICOLOR_VOLUME_BAR
-int attr_ctl_bar_mi;
-int attr_ctl_bar_hi;
-#endif
-int attr_ctl_inactive;
-int attr_ctl_label_inactive;
-int attr_errormsg;
-int attr_infomsg;
-int attr_textbox;
-int attr_textfield;
-int attr_menu;
-int attr_menu_selected;
+struct attributes attrs;
+static short background_color = -1;
+
+int get_color_pair(short fg, short bg)
+{
+       static int color_pairs_defined = 0;
+       short i, pair_fg, pair_bg;
+
+       for (i = 1; i <= color_pairs_defined; ++i) {
+               if (OK == pair_content(i, &pair_fg, &pair_bg))
+                       if (pair_fg == fg && pair_bg == bg)
+                               return COLOR_PAIR(i);
+       }
+
+       if (color_pairs_defined + 1 < COLOR_PAIRS) {
+               ++color_pairs_defined;
+               init_pair(color_pairs_defined, fg, bg);
+               return COLOR_PAIR(color_pairs_defined);
+       }
+
+       return 0;
+}
+
+void reinit_colors(short bg)
+{
+       if (bg == background_color)
+               return;
+       init_pair(1, COLOR_CYAN, bg);
+       init_pair(2, COLOR_YELLOW, bg);
+       init_pair(4, COLOR_RED, bg);
+       init_pair(5, COLOR_WHITE, bg);
+       background_color = bg;
+}
 
 void init_colors(int use_color)
 {
        if (!!has_colors() == !!use_color) {
                start_color();
+               use_default_colors();
 
-               init_pair(1, COLOR_CYAN, COLOR_BLACK);
-               init_pair(2, COLOR_YELLOW, COLOR_BLACK);
-               init_pair(3, COLOR_WHITE, COLOR_GREEN);
-               init_pair(4, COLOR_RED, COLOR_BLACK);
-               init_pair(5, COLOR_WHITE, COLOR_BLACK);
-               init_pair(6, COLOR_WHITE, COLOR_BLUE);
-               init_pair(7, COLOR_RED, COLOR_BLUE);
-               init_pair(8, COLOR_GREEN, COLOR_GREEN);
-               init_pair(9, COLOR_WHITE, COLOR_RED);
+               get_color_pair(COLOR_CYAN, background_color); // COLOR_PAIR(1)
+               get_color_pair(COLOR_YELLOW, background_color);
+               get_color_pair(COLOR_WHITE, COLOR_GREEN);
+               get_color_pair(COLOR_RED, background_color);
+               get_color_pair(COLOR_WHITE, background_color);
+               get_color_pair(COLOR_WHITE, COLOR_BLUE);
+               get_color_pair(COLOR_RED, COLOR_BLUE);
+               get_color_pair(COLOR_GREEN, COLOR_GREEN);
+               get_color_pair(COLOR_WHITE, COLOR_RED); // COLOR_PAIR(9)
 #ifdef TRICOLOR_VOLUME_BAR
-               init_pair(10, COLOR_WHITE, COLOR_WHITE);
-               init_pair(11, COLOR_RED, COLOR_RED);
+               get_color_pair(COLOR_WHITE, COLOR_WHITE);
+               get_color_pair(COLOR_RED, COLOR_RED);
 #endif
 
-               attr_mixer_frame = COLOR_PAIR(1);
-               attr_mixer_text = COLOR_PAIR(1);
-               attr_mixer_active = A_BOLD | COLOR_PAIR(2);
-               attr_ctl_frame = A_BOLD | COLOR_PAIR(1);
-               attr_ctl_mute = COLOR_PAIR(1);
-               attr_ctl_nomute = A_BOLD | COLOR_PAIR(3);
-               attr_ctl_capture = A_BOLD | COLOR_PAIR(4);
-               attr_ctl_nocapture = COLOR_PAIR(5);
-               attr_ctl_label = A_BOLD | COLOR_PAIR(6);
-               attr_ctl_label_focus = A_BOLD | COLOR_PAIR(7);
-               attr_ctl_mark_focus = A_BOLD | COLOR_PAIR(4);
-               attr_ctl_bar_lo = A_BOLD | COLOR_PAIR(8);
+               attrs = (struct attributes) {
+                       .mixer_frame = COLOR_PAIR(1),
+                       .mixer_text = COLOR_PAIR(1),
+                       .mixer_active = A_BOLD | COLOR_PAIR(2),
+                       .ctl_frame = A_BOLD | COLOR_PAIR(1),
+                       .ctl_mute = COLOR_PAIR(1),
+                       .ctl_nomute = A_BOLD | COLOR_PAIR(3),
+                       .ctl_capture = A_BOLD | COLOR_PAIR(4),
+                       .ctl_nocapture = COLOR_PAIR(5),
+                       .ctl_label = A_BOLD | COLOR_PAIR(6),
+                       .ctl_label_focus = A_BOLD | COLOR_PAIR(7),
+                       .ctl_mark_focus = A_BOLD | COLOR_PAIR(4),
+                       .ctl_bar_lo = A_BOLD | COLOR_PAIR(8),
 #ifdef TRICOLOR_VOLUME_BAR
-               attr_ctl_bar_mi = A_BOLD | COLOR_PAIR(10);
-               attr_ctl_bar_hi = A_BOLD | COLOR_PAIR(11);
+                       .ctl_bar_mi = A_BOLD | COLOR_PAIR(10),
+                       .ctl_bar_hi = A_BOLD | COLOR_PAIR(11),
 #endif
-               attr_ctl_inactive = COLOR_PAIR(5);
-               attr_ctl_label_inactive = A_REVERSE | COLOR_PAIR(5);
-               attr_errormsg = A_BOLD | COLOR_PAIR(9);
-               attr_infomsg = A_BOLD | COLOR_PAIR(6);
-               attr_textbox = A_BOLD | COLOR_PAIR(6);
-               attr_textfield = A_REVERSE | COLOR_PAIR(5);
-               attr_menu = A_BOLD | COLOR_PAIR(6);
-               attr_menu_selected = A_REVERSE | COLOR_PAIR(6);
+                       .ctl_inactive = COLOR_PAIR(5),
+                       .ctl_label_inactive = A_REVERSE | COLOR_PAIR(5),
+                       .errormsg = A_BOLD | COLOR_PAIR(9),
+                       .infomsg = A_BOLD | COLOR_PAIR(6),
+                       .textbox = A_BOLD | COLOR_PAIR(6),
+                       .textfield = A_REVERSE | COLOR_PAIR(5),
+                       .menu = A_BOLD | COLOR_PAIR(6),
+                       .menu_selected = A_REVERSE | COLOR_PAIR(6)
+               };
        } else {
-               attr_mixer_frame = A_NORMAL;
-               attr_mixer_text = A_NORMAL;
-               attr_mixer_active = A_BOLD;
-               attr_ctl_frame = A_BOLD;
-               attr_ctl_mute = A_NORMAL;
-               attr_ctl_nomute = A_BOLD;
-               attr_ctl_capture = A_BOLD;
-               attr_ctl_nocapture = A_NORMAL;
-               attr_ctl_label = A_REVERSE;
-               attr_ctl_label_focus = A_REVERSE | A_BOLD;
-               attr_ctl_mark_focus = A_BOLD;
-               attr_ctl_bar_lo = A_BOLD;
+               attrs = (struct attributes) {
+                       .mixer_frame = A_NORMAL,
+                       .mixer_text = A_NORMAL,
+                       .mixer_active = A_BOLD,
+                       .ctl_frame = A_BOLD,
+                       .ctl_mute = A_NORMAL,
+                       .ctl_nomute = A_BOLD,
+                       .ctl_capture = A_BOLD,
+                       .ctl_nocapture = A_NORMAL,
+                       .ctl_label = A_REVERSE,
+                       .ctl_label_focus = A_REVERSE | A_BOLD,
+                       .ctl_mark_focus = A_BOLD,
+                       .ctl_bar_lo = A_BOLD,
 #ifdef TRICOLOR_VOLUME_BAR
-               attr_ctl_bar_mi = A_BOLD;
-               attr_ctl_bar_hi = A_BOLD;
+                       .ctl_bar_mi = A_BOLD,
+                       .ctl_bar_hi = A_BOLD,
 #endif
-               attr_ctl_inactive = A_NORMAL;
-               attr_ctl_label_inactive = A_REVERSE;
-               attr_errormsg = A_STANDOUT;
-               attr_infomsg = A_NORMAL;
-               attr_textbox = A_NORMAL;
-               attr_textfield = A_REVERSE;
-               attr_menu = A_NORMAL;
-               attr_menu_selected = A_REVERSE;
+                       .ctl_inactive = A_NORMAL,
+                       .ctl_label_inactive = A_REVERSE,
+                       .errormsg = A_STANDOUT,
+                       .infomsg = A_NORMAL,
+                       .textbox = A_NORMAL,
+                       .textfield = A_REVERSE,
+                       .menu = A_NORMAL,
+                       .menu_selected = A_REVERSE,
+               };
        }
 }
index 9396004..ac404e9 100644 (file)
@@ -3,31 +3,40 @@
 
 #define TRICOLOR_VOLUME_BAR
 
-extern int attr_mixer_frame;
-extern int attr_mixer_text;
-extern int attr_mixer_active;
-extern int attr_ctl_frame;
-extern int attr_ctl_mute;
-extern int attr_ctl_nomute;
-extern int attr_ctl_capture;
-extern int attr_ctl_nocapture;
-extern int attr_ctl_label;
-extern int attr_ctl_label_focus;
-extern int attr_ctl_mark_focus;
-extern int attr_ctl_bar_lo;
+struct attributes {
+       // Alphabetically sorted
 #ifdef TRICOLOR_VOLUME_BAR
-extern int attr_ctl_bar_mi;
-extern int attr_ctl_bar_hi;
+       int ctl_bar_hi;
 #endif
-extern int attr_ctl_inactive;
-extern int attr_ctl_label_inactive;
-extern int attr_errormsg;
-extern int attr_infomsg;
-extern int attr_textbox;
-extern int attr_textfield;
-extern int attr_menu;
-extern int attr_menu_selected;
+       int ctl_bar_lo;
+#ifdef TRICOLOR_VOLUME_BAR
+       int ctl_bar_mi;
+#endif
+       int ctl_capture;
+       int ctl_frame;
+       int ctl_inactive;
+       int ctl_label;
+       int ctl_label_focus;
+       int ctl_label_inactive;
+       int ctl_mark_focus;
+       int ctl_mute;
+       int ctl_nocapture;
+       int ctl_nomute;
+       int errormsg;
+       int infomsg;
+       int menu;
+       int menu_selected;
+       int mixer_active;
+       int mixer_frame;
+       int mixer_text;
+       int textbox;
+       int textfield;
+};
+
+extern struct attributes attrs;
 
 void init_colors(int use_color);
+void reinit_colors(short bg);
+int get_color_pair(short fg, short bg);
 
 #endif
diff --git a/alsamixer/configparser.c b/alsamixer/configparser.c
new file mode 100644 (file)
index 0000000..68ac673
--- /dev/null
@@ -0,0 +1,601 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <inttypes.h>
+#include <ctype.h>
+#include <errno.h>
+#include <pwd.h>
+#include CURSESINC
+#include "colors.h"
+#include "gettext_curses.h"
+#include "utils.h"
+#include "curskey.h"
+#include "bindings.h"
+#include "mixer_widget.h"
+
+#define ERROR_CONFIG (-1)
+#define ERROR_MISSING_ARGUMENTS (-2)
+#define ERROR_TOO_MUCH_ARGUMENTS (-3)
+
+static const char *error_message;
+static const char *error_cause;
+
+static int strlist_index(const char *haystack, unsigned int itemlen, const char *needle) {
+       unsigned int needle_len;
+       unsigned int pos;
+       const char *found;
+
+       needle_len = strlen(needle);
+       if (needle_len <= itemlen && needle[needle_len - 1] != ' ') {
+               found = strstr(haystack, needle);
+               if (found) {
+                       pos = (found - haystack);
+                       if (pos % itemlen == 0 && (needle_len == itemlen || haystack[pos+needle_len] == ' '))
+                               return pos / itemlen;
+               }
+       }
+
+       return -1;
+}
+
+static int color_by_name(const char *name) {
+       return strlist_index(
+               "default"
+               "black  "
+               "red    "
+               "green  "
+               "yellow "
+               "blue   "
+               "magenta"
+               "cyan   "
+               "white  ", 7, name) - 1;
+};
+
+static int attr_by_name(const char *name) {
+       return (int[]) {
+               -1,
+               A_BOLD,
+               A_REVERSE,
+               A_STANDOUT,
+               A_DIM,
+               A_UNDERLINE,
+#ifdef A_ITALIC
+               A_ITALIC,
+#endif
+               A_NORMAL,
+               A_BLINK,
+       }[strlist_index(
+               "bold     "
+               "reverse  "
+               "standout "
+               "dim      "
+               "underline"
+#ifdef A_ITALIC
+               "italic   "
+#endif
+               "normal   "
+               "blink    ", 9, name) + 1];
+};
+
+#define W_NUMBER (1U << 0)
+
+enum textbox_word {
+       TW_BOTTOM = (1U << 1),
+       TW_CLOSE = (1U << 2),
+       TW_DOWN = (1U << 3),
+       TW_LEFT = (1U << 4),
+       TW_PAGE = (1U << 5),
+       TW_RIGHT = (1U << 6),
+       TW_TOP = (1U << 7),
+       TW_UP = (1U << 8),
+};
+
+const char *textbox_words =
+       "bottom"
+       "close "
+       "down  "
+       "left  "
+       "page  "
+       "right "
+       "top   "
+       "up    ";
+
+enum mixer_word {
+       MW_ALL = (1U << 1),
+       MW_BALANCE = (1U << 2),
+       MW_CAPTURE = (1U << 3),
+       MW_CARD = (1U << 4),
+       MW_CLOSE = (1U << 5),
+       MW_CONTROL = (1U << 6),
+       MW_DOWN = (1U << 7),
+       MW_FOCUS = (1U << 8),
+       MW_HELP = (1U << 9),
+       MW_INFORMATION = (1U << 10),
+       MW_LEFT = (1U << 11),
+       MW_MODE = (1U << 12),
+       MW_MUTE = (1U << 13),
+       MW_NEXT = (1U << 14),
+       MW_PLAYBACK = (1U << 15),
+       MW_PREVIOUS = (1U << 16),
+       MW_REFRESH = (1U << 17),
+       MW_RIGHT = (1U << 18),
+       MW_SELECT = (1U << 19),
+       MW_SET = (1U << 20),
+       MW_SYSTEM = (1U << 21),
+       MW_TOGGLE = (1U << 22),
+       MW_UP = (1U << 23),
+};
+
+const char *mixer_words =
+       "all        "
+       "balance    "
+       "capture    "
+       "card       "
+       "close      "
+       "control    "
+       "down       "
+       "focus      "
+       "help       "
+       "information"
+       "left       "
+       "mode       "
+       "mute       "
+       "next       "
+       "playback   "
+       "previous   "
+       "refresh    "
+       "right      "
+       "select     "
+       "set        "
+       "system     "
+       "toggle     "
+       "up         ";
+
+static unsigned int parse_words(const char *name, const char* wordlist, unsigned int itemlen, unsigned int *number) {
+       unsigned int words = 0;
+       unsigned int word;
+       int i;
+       char buf[16];
+       char *endptr;
+
+       while (*name) {
+               for (i = 0; i < (int)sizeof(buf) - 1; ++i) {
+                       if (*name == '\0')
+                               break;
+                       if (*name == '_') {
+                               ++name;
+                               break;
+                       }
+                       buf[i] = *name;
+                       ++name;
+               }
+               buf[i] = '\0';
+
+               if (buf[0] >= '0' && buf[0] <= '9') {
+                       if (number) {
+                               *number = strtoumax(buf, &endptr, 10);
+                               if (*endptr != '\0')
+                                       return 0;
+                       }
+                       word = W_NUMBER;
+               }
+               else if ((i = strlist_index(wordlist, itemlen, buf)) >= 0)
+                       word = i <= 30 ? (2U << i) : 0;
+               else
+                       return 0;
+
+               if (words & word) // no duplicate words
+                       return 0;
+               words |= word;
+       }
+
+       return words;
+}
+
+static int textbox_command_by_name(const char *name) {
+       switch (parse_words(name, textbox_words, 6, NULL)) {
+               case TW_TOP: return CMD_TEXTBOX_TOP;
+               case TW_BOTTOM: return CMD_TEXTBOX_BOTTOM;
+               case TW_CLOSE: return CMD_TEXTBOX_CLOSE;
+               case TW_UP: return CMD_TEXTBOX_UP;
+               case TW_DOWN: return CMD_TEXTBOX_DOWN;
+               case TW_LEFT: return CMD_TEXTBOX_LEFT;
+               case TW_RIGHT: return CMD_TEXTBOX_RIGHT;
+               case TW_PAGE|TW_UP: return CMD_TEXTBOX_PAGE_UP;
+               case TW_PAGE|TW_DOWN: return CMD_TEXTBOX_PAGE_DOWN;
+               case TW_PAGE|TW_LEFT: return CMD_TEXTBOX_PAGE_LEFT;
+               case TW_PAGE|TW_RIGHT: return CMD_TEXTBOX_PAGE_RIGHT;
+               default: return 0;
+       }
+}
+
+static int mixer_command_by_name(const char *name) {
+       unsigned int channel = 0;
+       unsigned int number = 1; // default numeric arg
+       unsigned int words = parse_words(name, mixer_words, 11, &number);
+
+       switch (words) {
+               case MW_HELP: return CMD_MIXER_HELP;
+               case MW_CLOSE: return CMD_MIXER_CLOSE;
+               case MW_REFRESH: return CMD_MIXER_REFRESH;
+               case MW_SELECT|MW_CARD: return CMD_MIXER_SELECT_CARD;
+               case MW_SYSTEM|MW_INFORMATION: return CMD_MIXER_SYSTEM_INFORMATION;
+               case MW_MODE|MW_ALL: return CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_ALL);
+               case MW_MODE|MW_CAPTURE: return CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_CAPTURE);
+               case MW_MODE|MW_PLAYBACK: return CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, VIEW_MODE_PLAYBACK);
+               case MW_MODE|MW_TOGGLE: return CMD_MIXER_TOGGLE_VIEW_MODE;
+               case MW_CONTROL|MW_BALANCE: return CMD_MIXER_BALANCE_CONTROL;
+               case MW_NEXT:
+               case MW_NEXT|W_NUMBER:
+               case MW_PREVIOUS:
+               case MW_PREVIOUS|W_NUMBER:
+                       return ((number < 1 || number > 511) ? 0 :
+                                       CMD_WITH_ARG((words & MW_NEXT
+                                                       ? CMD_MIXER_NEXT
+                                                       : CMD_MIXER_PREVIOUS), number));
+               case MW_CONTROL|MW_FOCUS|W_NUMBER:
+                       return ((number < 1 || number > 512) ? 0 :
+                                       CMD_WITH_ARG(CMD_MIXER_FOCUS_CONTROL, number - 1));
+       }
+
+       if (words & MW_LEFT)
+               channel |= LEFT;
+       if (words & MW_RIGHT)
+               channel |= RIGHT;
+       if (!channel)
+               channel = LEFT|RIGHT;
+
+       switch (words & ~(MW_LEFT|MW_RIGHT)) {
+               case MW_CONTROL|MW_UP:
+               case MW_CONTROL|MW_UP|W_NUMBER:
+               case MW_CONTROL|MW_DOWN:
+               case MW_CONTROL|MW_DOWN|W_NUMBER:
+                       return ((number < 1 || number > 100) ? 0 :
+                                       CMD_WITH_ARG((words & MW_UP
+                                                ? CMD_MIXER_CONTROL_UP_LEFT
+                                                : CMD_MIXER_CONTROL_DOWN_LEFT) + channel - 1, number));
+               case MW_CONTROL|MW_SET|W_NUMBER:
+                       return (number > 100 ? 0 :
+                                       CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT_LEFT + channel - 1, number));
+               case MW_TOGGLE|MW_MUTE:
+                       return CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, channel);
+               case MW_TOGGLE|MW_CAPTURE:
+                       return CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, channel);
+       }
+
+       return 0;
+}
+
+static int* element_by_name(const char *name) {
+       int idx = strlist_index(
+#ifdef TRICOLOR_VOLUME_BAR
+               "ctl_bar_hi        "
+#endif
+               "ctl_bar_lo        "
+#ifdef TRICOLOR_VOLUME_BAR
+               "ctl_bar_mi        "
+#endif
+               "ctl_capture       "
+               "ctl_frame         "
+               "ctl_inactive      "
+               "ctl_label         "
+               "ctl_label_focus   "
+               "ctl_label_inactive"
+               "ctl_mark_focus    "
+               "ctl_mute          "
+               "ctl_nocapture     "
+               "ctl_nomute        "
+               "errormsg          "
+               "infomsg           "
+               "menu              "
+               "menu_selected     "
+               "mixer_active      "
+               "mixer_frame       "
+               "mixer_text        "
+               "textbox           "
+               "textfield         ", 18, name);
+
+       if (idx < 0) {
+#ifndef TRICOLOR_VOLUME_BAR
+               if (strlist_index(
+                       "ctl_bar_hi"
+                       "ctl_bar_mi", 10, name) >= 0)
+                       return &errno; // dummy element
+#endif
+               return NULL;
+       }
+
+       return &( ((int*) &attrs)[idx] );
+}
+
+static int cfg_bind(char **argv, unsigned int argc) {
+       const char *command_name;
+       command_enum command = 0;
+       unsigned int i;
+       int keys[3] = { -1, -1, -1 };
+       union {
+               command_enum *mixer_bindings;
+               uint8_t *textbox_bindings;
+       } bind_to = {
+               .mixer_bindings = mixer_bindings
+       };
+
+       if (argc == 2)
+               command_name = argv[1];
+       else if (argc == 3) {
+               command_name = argv[2];
+
+               if (! strcmp(argv[1], "textbox")) {
+                       bind_to.textbox_bindings = textbox_bindings;
+               }
+               else if (! strcmp(argv[1], "mixer"))
+                       ; // bind_to.mixer_bindings = mixer_bindings
+               else {
+                       error_message = _("invalid widget");
+                       error_cause = argv[1];
+                       return ERROR_CONFIG;
+               }
+       }
+       else {
+               return (argc < 2 ? ERROR_MISSING_ARGUMENTS : ERROR_TOO_MUCH_ARGUMENTS);
+       }
+
+       keys[0] = curskey_parse(argv[0]);
+       if (keys[0] < 0 || keys[0] >= (int)ARRAY_SIZE(mixer_bindings)) {
+               error_message = _("invalid key");
+               error_cause = argv[0];
+               return ERROR_CONFIG;
+       }
+
+       if (keys[0] == KEY_ENTER || keys[0] == '\n' || keys[0] == '\r') {
+               keys[0] = KEY_ENTER;
+               keys[1] = '\n';
+               keys[2] = '\r';
+       }
+
+       if (bind_to.textbox_bindings == textbox_bindings)
+               command = textbox_command_by_name(command_name);
+       else
+               command = mixer_command_by_name(command_name);
+
+       if (!command) {
+               if (!strcmp(command_name, "none"))
+                       ; // command = 0
+               else {
+                       error_message = _("invalid command");
+                       error_cause = command_name;
+                       return ERROR_CONFIG;
+               }
+       }
+
+       for (i = 0; i < ARRAY_SIZE(keys) && keys[i] != -1; ++i) {
+               if (bind_to.textbox_bindings == textbox_bindings)
+                       bind_to.textbox_bindings[keys[i]] = command;
+               else
+                       bind_to.mixer_bindings[keys[i]] = command;
+       }
+
+       return 0;
+}
+
+static int cfg_color(char **argv, unsigned int argc)
+{
+       short fg_color, bg_color;
+       unsigned int i;
+       int *element;
+       int attr;
+
+       if (argc < 3)
+               return ERROR_MISSING_ARGUMENTS;
+
+       if (NULL == (element = element_by_name(argv[0]))) {
+               error_message = _("unknown theme element");
+               error_cause = argv[0];
+               return ERROR_CONFIG;
+       }
+
+       if (-2 == (fg_color = color_by_name(argv[1]))) {
+               error_message = _("unknown color");
+               error_cause = argv[1];
+               return ERROR_CONFIG;
+       }
+
+       if (-2 == (bg_color = color_by_name(argv[2]))) {
+               error_message = _("unknown color");
+               error_cause = argv[2];
+               return ERROR_CONFIG;
+       }
+
+       *element = get_color_pair(fg_color, bg_color);
+
+       for (i = 3; i < argc; ++i) {
+               if (-1 == (attr = attr_by_name(argv[i]))) {
+                       error_message = _("unknown color attribute");
+                       error_cause = argv[i];
+                       return ERROR_CONFIG;
+               }
+               else
+                       *element |= attr;
+       }
+       return 0;
+}
+
+static int cfg_set(char **argv, unsigned int argc)
+{
+       char *endptr;
+
+       if (argc == 2) {
+               if (! strcmp(argv[0], "mouse_wheel_step")) {
+                       mouse_wheel_step = strtoumax(argv[1], &endptr, 10);
+                       if (mouse_wheel_step > 100 || *endptr != '\0') {
+                               mouse_wheel_step = 1;
+                               error_message = _("invalid value");
+                               error_cause = argv[1];
+                               return ERROR_CONFIG;
+                       }
+               }
+               else if (! strcmp(argv[0], "mouse_wheel_focuses_control")) {
+                       if ((argv[1][0] == '0' || argv[1][0] == '1') && argv[1][1] == '\0')
+                               mouse_wheel_focuses_control = argv[1][0] - '0';
+                       else {
+                               error_message = _("invalid value");
+                               error_cause = argv[1];
+                               return ERROR_CONFIG;
+                       }
+               }
+               else if (!strcmp(argv[0], "background")) {
+                       int bg_color = color_by_name(argv[1]);
+                       if (bg_color == -2) {
+                               error_message = _("unknown color");
+                               error_cause = argv[1];
+                               return ERROR_CONFIG;
+                       }
+                       reinit_colors(bg_color);
+               }
+               else {
+                       error_message = _("unknown option");
+                       error_cause = argv[0];
+                       return ERROR_CONFIG;
+               }
+       }
+       else {
+               return (argc < 2 ? ERROR_MISSING_ARGUMENTS : ERROR_TOO_MUCH_ARGUMENTS);
+       }
+
+       return 0;
+}
+
+/* Split $line on whitespace, store it in $args, return the argument count.
+ * Return 0 for commented lines ('\s*#').
+ *
+ * This will modify contents of $line.
+ */
+static unsigned int parse_line(char *line, char **args, unsigned int args_size)
+{
+       unsigned int count;
+
+       for (count = 0; count < args_size; ++count) {
+               while (*line && isspace(*line))
+                       ++line;
+
+               if (*line == '\0')
+                       break;
+
+               if (*line == '#' && count == 0)
+                       break;
+
+               args[count] = line;
+
+               while (*line && !isspace(*line))
+                       ++line;
+
+               if (*line != '\0') {
+                       *line = '\0';
+                       ++line;
+               }
+       }
+
+       return count;
+}
+
+static int process_line(char *line) {
+       char *args[16];
+       unsigned int argc = parse_line(line, args, ARRAY_SIZE(args));
+       int ret = 0;
+
+       if (argc >= 1) {
+               error_cause = NULL;
+               //error_message = _("unknown error");
+
+               if (argc >= ARRAY_SIZE(args))
+                       ret = ERROR_TOO_MUCH_ARGUMENTS;
+               else {
+                       ret = strlist_index(
+                               "bind "
+                               "color"
+                               "set  ", 5, args[0]);
+                       switch (ret) {
+                               case 0: ret = cfg_bind(args + 1, argc - 1); break;
+                               case 1: ret = cfg_color(args + 1, argc - 1); break;
+                               case 2: ret = cfg_set(args + 1, argc - 1); break;
+                               default: error_message = _("unknown command");
+                       }
+               }
+
+               if (ret == ERROR_MISSING_ARGUMENTS)
+                       error_message = _("missing arguments");
+               else if (ret == ERROR_TOO_MUCH_ARGUMENTS)
+                       error_message = _("too much arguments");
+       }
+
+       return ret;
+}
+
+void parse_config_file(const char *file_name)
+{
+       char *buf;
+       unsigned int file_size;
+       unsigned int lineno;
+       unsigned int i;
+       char *line;
+
+       endwin(); // print warnings to stderr
+
+       buf = read_file(file_name, &file_size);
+       if (!buf) {
+               fprintf(stderr, "%s: %s\n", file_name, strerror(errno));
+               return;
+       }
+
+       curskey_init();
+       curskey_define_meta_keys(128);
+
+       lineno = 0;
+       line = buf;
+       for (i = 0; i < file_size; ++i) {
+               if (buf[i] == '\n') {
+                       buf[i] = '\0';
+                       ++lineno;
+                       if (process_line(line) < 0) {
+                               if (error_cause)
+                                       fprintf(stderr, "%s:%d: %s: %s: %s\n", file_name, lineno, line, error_message, error_cause);
+                               else
+                                       fprintf(stderr, "%s:%d: %s: %s\n", file_name, lineno, line, error_message);
+                       }
+                       line = &buf[i + 1];
+               }
+       }
+
+       free(buf);
+       curskey_destroy();
+}
+
+void parse_default_config_file() {
+       char file[4096];
+       const char *home;
+
+       home = getenv("XDG_CONFIG_HOME");
+       if (home && *home) {
+               snprintf(file, sizeof(file), "%s/alsamixer.rc", home);
+               if (! access(file, F_OK))
+                       return parse_config_file(file);
+       }
+
+       home = getenv("HOME");
+       if (!home || !*home) {
+               struct passwd *pwd = getpwuid(getuid());
+               if (pwd)
+                       home = pwd->pw_dir;
+       }
+
+       if (home && *home) {
+               snprintf(file, sizeof(file), "%s/.config/alsamixer.rc", home);
+               if (! access(file, F_OK))
+                       return parse_config_file(file);
+
+               snprintf(file, sizeof(file), "%s/.alsamixer.rc", home);
+               if (! access(file, F_OK))
+                       return parse_config_file(file);
+       }
+}
diff --git a/alsamixer/configparser.h b/alsamixer/configparser.h
new file mode 100644 (file)
index 0000000..43f5392
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef CONFIGPARSER_H_INCLUDED
+#define CONFIGPARSER_H_INCLUDED
+
+#define CONFIG_DEFAULT ((const char*) 1)
+
+void parse_config_file(const char *file);
+void parse_default_config_file();
+
+#endif
diff --git a/alsamixer/curskey.c b/alsamixer/curskey.c
new file mode 100644 (file)
index 0000000..5f39b4a
--- /dev/null
@@ -0,0 +1,274 @@
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include "curskey.h"
+#include "utils.h"
+#include "mem.h"
+
+struct curskey_key {
+       char *keyname;
+       int keycode;
+};
+
+static struct curskey_key *keynames;
+static unsigned int keynames_count;
+
+unsigned int meta_keycode_start;
+static uint64_t invalid_meta_char_mask[2];
+
+// Names for non-printable/whitespace characters and aliases for existing keys
+static const struct curskey_key keyname_aliases[] = {
+       // Sorted by `keyname`
+       { "DEL",      KEY_DEL },
+       { "DELETE",   KEY_DC },
+       { "ENTER",    '\n' },
+       { "ENTER",    '\r' },
+       { "ESCAPE",   KEY_ESCAPE },
+       { "INSERT",   KEY_IC },
+       { "PAGEDOWN", KEY_NPAGE },
+       { "PAGEUP",   KEY_PPAGE },
+       { "SPACE",    KEY_SPACE },
+       { "TAB",      KEY_TAB }
+};
+
+#define STARTSWITH_KEY(S) \
+       ((name[0] == 'K' || name[0] == 'k') && \
+       (name[1] == 'E' || name[1] == 'e') && \
+       (name[2] == 'Y' || name[2] == 'y') && \
+       (name[3] == '_'))
+
+#define IS_META(S) \
+       ((S[0] == 'M' || S[0] == 'm' || S[0] == 'A' || S[0] == 'a') && S[1] == '-')
+
+static int curskey_key_cmp(const void *a, const void *b) {
+       return strcmp(((struct curskey_key*) a)->keyname,
+                       ((struct curskey_key*) b)->keyname);
+}
+
+static int curskey_find(const struct curskey_key *table, unsigned int size, const char *name) {
+       unsigned int start = 0;
+       unsigned int end = size;
+       unsigned int i;
+       int cmp;
+
+       while (1) {
+               i = (start+end) / 2;
+               cmp = strcasecmp(name, table[i].keyname);
+
+               if (cmp == 0)
+                       return table[i].keycode;
+               else if (end == start + 1)
+                       return ERR;
+               else if (cmp > 0)
+                       start = i;
+               else
+                       end = i;
+       }
+}
+
+/* Translate the name of a ncurses KEY_ constant to its value.
+ *     "KEY_DOWN" -> 258
+ *
+ * Return ERR on failure.
+ */
+int curskey_keycode(const char *name)
+{
+       int i;
+
+       if (! name)
+               return ERR;
+
+       if (STARTSWITH_KEY(name))
+               name += 4;
+
+       if (name[0] == 'F' || name[0] == 'f') {
+               i = (name[1] == '(' ? 2 : 1);
+
+               if (name[i] >= '0' && name[i] <= '9') {
+                       i = atoi(name + i);
+                       if (i >= 1 && i <= 63)
+                               return KEY_F(i);
+               }
+       }
+
+       i = curskey_find(keyname_aliases, ARRAY_SIZE(keyname_aliases), name);
+       if (i != ERR)
+               return i;
+
+       return curskey_find(keynames, keynames_count, name);
+}
+
+static void free_ncurses_keynames() {
+       if (keynames) {
+               while (keynames_count)
+                       free(keynames[--keynames_count].keyname);
+               free(keynames);
+               keynames = NULL;
+       }
+}
+
+/* Create the list of ncurses KEY_ constants and their names.
+ * Returns OK on success, ERR on failure.
+ */
+int create_ncurses_keynames() {
+       int     key;
+       char *name;
+
+       free_ncurses_keynames();
+       keynames = ccalloc(sizeof(struct curskey_key), (KEY_MAX - KEY_MIN));
+
+       for (key = KEY_MIN; key != KEY_MAX; ++key) {
+               name = (char*) keyname(key);
+
+               if (!name || !STARTSWITH_KEY(name))
+                       continue;
+
+               name += 4;
+               if (name[0] == 'F' && name[1] == '(')
+                       continue; // ignore KEY_F(1),...
+
+               keynames[keynames_count].keycode = key;
+               keynames[keynames_count].keyname = cstrdup(name);
+               ++keynames_count;
+       }
+
+       keynames = crealloc(keynames, keynames_count * sizeof(struct curskey_key));
+       qsort(keynames, keynames_count, sizeof(struct curskey_key), curskey_key_cmp);
+
+       return OK;
+}
+
+/* Defines meta escape sequences in ncurses.
+ *
+ * Some combinations with meta/alt may not be available since they collide
+ * with the prefix of a pre-defined key.
+ * For example, keys F1 - F4 begin with "\eO", so ALT-O cannot be defined.
+ *
+ * Returns OK if meta keys are available, ERR otherwise.
+ */
+int curskey_define_meta_keys(unsigned int keycode_start) {
+#ifdef NCURSES_VERSION
+       int ch;
+       int keycode;
+       int new_keycode = keycode_start;
+       char key_sequence[3] = "\e ";
+
+       invalid_meta_char_mask[0] = 0;
+       invalid_meta_char_mask[1] = 0;
+
+       for (ch = 0; ch <= CURSKEY_MAX_META_CHAR; ++ch) {
+               key_sequence[1] = ch;
+               keycode = key_defined(key_sequence);
+               if (! keycode) {
+                       define_key(key_sequence, new_keycode);
+               }
+               else if (keycode == new_keycode)
+                       ;
+               else
+                       invalid_meta_char_mask[ch/65] |= (1UL << (ch % 64));
+
+               ++new_keycode;
+       }
+
+       meta_keycode_start = keycode_start;
+       return OK;
+#endif
+       return ERR;
+}
+
+/* Return the keycode for a key with modifiers applied.
+ *
+ * Available modifiers are:
+ *     - CURSKEY_MOD_META / CURSKEY_MOD_ALT
+ *     - CURSKEY_MOD_CNTRL
+ *
+ * See also the macros curskey_meta_key(), curskey_cntrl_key().
+ *
+ * Returns ERR if the modifiers cannot be applied to this key.
+ */
+int curskey_mod_key(int key, unsigned int modifiers) {
+       if (modifiers & CURSKEY_MOD_CNTRL) {
+               if ((key >= 'A' && key <= '_') || (key >= 'a' && key <= 'z') || key == ' ')
+                       key = key % 32;
+               else
+                       return ERR;
+       }
+
+       if (modifiers & CURSKEY_MOD_META) {
+               if (meta_keycode_start &&
+                               (key >= 0 && key <= CURSKEY_MAX_META_CHAR) &&
+                               ! (invalid_meta_char_mask[key/65] & (1UL << (key % 64)))) {
+                       key = meta_keycode_start + key;
+               }
+               else
+                       return ERR;
+       }
+
+       return key;
+}
+
+/* Return the ncurses keycode for a key definition.
+ *
+ * Key definition may be:
+ *     - Single character (a, z, ...)
+ *     - Character with control-modifier (^x, C-x, c-x, ...)
+ *     - Character with meta/alt-modifier (M-x, m-x, A-x, a-x, ...)
+ *     - Character with both modifiers (C-M-x, M-C-x, M-^x, ...)
+ *     - Curses keyname, no modifiers allowed (KEY_HOME, HOME, F1, F(1), ...)
+ *
+ * Returns ERR if either
+ *     - The key definition is NULL or empty
+ *     - The key could not be found ("KEY_FOO")
+ *     - The key combination is invalid in general ("C-TAB", "C-RETURN")
+ *     - The key is invalid because of compile time options (the
+ *             `define_key()` function was not available.)
+ *     - The key is invalid because it could not be defined by
+ *             curskey_define_meta_keys()
+ */
+int curskey_parse(const char *def) {
+       int c;
+       unsigned int mod = 0;
+
+       if (! def)
+               return ERR;
+
+       for (;;) {
+               if (def[0] == '^' && def[1] != '\0') {
+                       ++def;
+                       mod |= CURSKEY_MOD_CNTRL;
+               }
+               else if ((def[0] == 'C' || def[0] == 'c') && def[1] == '-') {
+                       def += 2;
+                       mod |= CURSKEY_MOD_CNTRL;
+               }
+               else if (IS_META(def)) {
+                       if (! meta_keycode_start)
+                               return ERR;
+                       def += 2;
+                       mod |= CURSKEY_MOD_ALT;
+               }
+               else
+                       break;
+       }
+
+       if (*def == '\0')
+               return ERR;
+       else if (*(def+1) == '\0')
+               c = *def;
+       else
+               c = curskey_keycode(def);
+
+       return curskey_mod_key(c, mod);
+}
+
+/* Initialize curskey.
+ * Returns OK on success, ERR on failure.  */
+int curskey_init() {
+       keypad(stdscr, TRUE);
+       return create_ncurses_keynames();
+}
+
+/* Destroy curskey.  */
+void curskey_destroy() {
+       free_ncurses_keynames();
+}
diff --git a/alsamixer/curskey.h b/alsamixer/curskey.h
new file mode 100644 (file)
index 0000000..129a652
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef CURSKEY_H_INCLUDED
+#define CURSKEY_H_INCLUDED
+
+#include CURSESINC
+
+/* Additional KEY_ constants */
+#define KEY_SPACE ' '
+#define KEY_TAB '\t'
+#define KEY_DEL 127
+#define KEY_ESCAPE 27
+#define KEY_INSERT KEY_IC
+#define KEY_DELETE KEY_DC
+#define KEY_PAGEUP KEY_PPAGE
+#define KEY_PAGEDOWN KEY_NPAGE
+
+/* Modifiers */
+#define CURSKEY_MOD_CNTRL      1U
+#define CURSKEY_MOD_META       2U
+#define CURSKEY_MOD_ALT                CURSKEY_MOD_META
+
+/* Defines the range of characters which should be "meta-able" */
+#define CURSKEY_MAX_META_CHAR 127
+
+int curskey_init();
+void curskey_destroy();
+int curskey_define_meta_keys(unsigned int keycode_start);
+
+int curskey_parse(const char *keydef);
+int curskey_mod_key(int key, unsigned int modifiers);
+
+#define curskey_meta_key(KEY) \
+       curskey_mod_key(KEY, CURSKEY_MOD_META)
+
+#define curskey_cntrl_key(KEY) \
+       curskey_mod_key(KEY, CURSKEY_MOD_CNTRL)
+
+#endif
index c58e652..26b03d5 100644 (file)
@@ -76,13 +76,14 @@ static void on_form_key(int key)
                { KEY_RIGHT, REQ_NEXT_CHAR },
                { KEY_HOME, REQ_BEG_FIELD },
                { KEY_BACKSPACE, REQ_DEL_PREV },
+               { 127, REQ_DEL_PREV },
                { KEY_DC, REQ_DEL_CHAR },
                { KEY_BEG, REQ_BEG_FIELD },
                { KEY_END, REQ_END_FIELD },
        };
        unsigned int i;
 
-       if (key >= 32 && key < 256) {
+       if (key >= 32 && key < 256 && key != 127) {
                form_driver(form, key);
                return;
        }
@@ -122,7 +123,7 @@ static bool create(void)
        }
        widget_init(&form_widget,
                    6, 36, SCREEN_CENTER, SCREEN_CENTER,
-                   attr_textbox, WIDGET_BORDER | WIDGET_SUBWINDOW | WIDGET_CURSOR_VISIBLE);
+                   attrs.textbox, WIDGET_BORDER | WIDGET_SUBWINDOW | WIDGET_CURSOR_VISIBLE);
        title = _("Sound Card");
        mvwprintw(form_widget.window, 0, (36 - 2 - get_mbs_width(title)) / 2, " %s ", title);
 
@@ -170,20 +171,17 @@ void create_device_name_form(void)
        fields[0] = new_field(1, 32, 1, 1, 0, 0);
        if (!fields[0])
                fatal_error("cannot create field");
-       field_opts_off(fields[0], O_ACTIVE);
-       field_opts_off(fields[0], O_EDIT);
-       set_field_fore(fields[0], attr_textbox);
-       set_field_back(fields[0], attr_textbox);
+       field_opts_off(fields[0], O_ACTIVE|O_EDIT);
+       set_field_fore(fields[0], attrs.textbox);
+       set_field_back(fields[0], attrs.textbox);
        set_field_buffer(fields[0], 0, _("Device name:"));
 
        fields[1] = new_field(1, 32, 2, 1, 0, 0);
        if (!fields[1])
                fatal_error("cannot create field");
-       field_opts_off(fields[1], O_AUTOSKIP);
-       field_opts_off(fields[1], O_NULLOK);
-       field_opts_off(fields[1], O_STATIC);
-       set_field_fore(fields[1], attr_textfield);
-       set_field_back(fields[1], attr_textfield);
+       field_opts_off(fields[1], O_AUTOSKIP|O_NULLOK|O_STATIC);
+       set_field_fore(fields[1], attrs.textfield);
+       set_field_back(fields[1], attrs.textfield);
        set_field_buffer(fields[1], 0, mixer_device_name);
 
        form = new_form(fields);
index 79d81a9..7ca785b 100644 (file)
 
 static WINDOW *curses_initialized;
 
-static void black_hole_error_handler(const char *file, int line,
-                                    const char *function, int err,
-                                    const char *fmt, ...)
+static void black_hole_error_handler(const char *file ATTRIBUTE_UNUSED,
+                                    int line ATTRIBUTE_UNUSED,
+                                    const char *function ATTRIBUTE_UNUSED,
+                                    int err ATTRIBUTE_UNUSED,
+                                    const char *fmt ATTRIBUTE_UNUSED, ...)
 {
 }
 
-void initialize_curses(bool use_color)
+void initialize_curses(bool use_color, bool use_mouse)
 {
        curses_initialized = initscr();
        cbreak();
@@ -50,6 +52,9 @@ void initialize_curses(bool use_color)
 #endif
        window_size_changed(); /* update screen_lines/cols */
        init_colors(use_color);
+       if (use_mouse)
+               mousemask(ALL_MOUSE_EVENTS, NULL);
+
        snd_lib_error_set_handler(black_hole_error_handler);
 }
 
@@ -68,7 +73,7 @@ void mainloop(void)
 {
        struct pollfd *pollfds = NULL;
        int nfds = 0, n;
-       struct widget *active_widget;
+       const struct widget *active_widget;
        unsigned short revents;
        int key;
        int err;
index 22317be..d777e0f 100644 (file)
@@ -3,7 +3,7 @@
 
 #include CURSESINC
 
-void initialize_curses(bool use_color);
+void initialize_curses(bool use_color, bool use_mouse);
 void mainloop(void);
 void app_shutdown(void);
 
index fa03a89..b6e1df2 100644 (file)
@@ -16,7 +16,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define _GNU_SOURCE
 #include "aconfig.h"
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/alsamixer/menu_widget.c b/alsamixer/menu_widget.c
new file mode 100644 (file)
index 0000000..86d46b1
--- /dev/null
@@ -0,0 +1,92 @@
+#include "menu_widget.h"
+#include "colors.h"
+#include "utils.h"
+#include "bindings.h"
+
+/* Returns
+ * - KEY_CANCEL: close is requested
+ * - KEY_ENTER: item is selected
+ * - -1: no action
+ */
+int menu_widget_handle_key(MENU *menu, int key)
+{
+       MEVENT m;
+
+       switch (key) {
+       case 27:
+       case KEY_CANCEL:
+       case 'q':
+       case 'Q':
+               return KEY_CANCEL;
+       case '\n':
+       case '\r':
+       case KEY_ENTER:
+               return KEY_ENTER;
+
+       case KEY_MOUSE:
+               switch (menu_driver(menu, KEY_MOUSE)) {
+                       case E_UNKNOWN_COMMAND:
+                               /* If you double-click an item a REQ_TOGGLE_ITEM is generated
+                                * and E_UNKNOWN_COMMAND is returned. (man menu_driver) */
+                               return KEY_ENTER;
+                       case E_REQUEST_DENIED:
+                               /* If menu did not handle KEY_MOUSE is has to be removed from
+                                * input queue to prevent an infinite loop. */
+                               key = wgetch(menu_win(menu));
+                               if (key == KEY_MOUSE) {
+                                       if (getmouse(&m) == ERR)
+                                               return -1;
+                                       if (m.bstate & (BUTTON4_PRESSED|BUTTON4_CLICKED))
+                                               menu_driver(menu, REQ_UP_ITEM);
+#if NCURSES_MOUSE_VERSION > 1
+                                       else if (m.bstate & (BUTTON5_PRESSED|BUTTON5_CLICKED))
+                                               menu_driver(menu, REQ_DOWN_ITEM);
+#endif
+                                       else
+                                               return KEY_CANCEL;
+                               }
+                               else if (key > 0)
+                                       ungetch(key);
+               }
+               return -1;
+
+       default:
+               if (key < (int)ARRAY_SIZE(textbox_bindings)) {
+                       key = textbox_bindings[key];
+                       if (key >= CMD_TEXTBOX___MIN_MENU_COMMAND &&
+                                       key <= CMD_TEXTBOX___MAX_MENU_COMMAND)
+                               menu_driver(menu, key + KEY_MAX);
+               }
+
+               return -1;
+       }
+}
+
+void menu_widget_create(struct widget *widget, MENU *menu, const char *title)
+{
+       int rows, columns;
+
+       if (menu)
+               unpost_menu(menu);
+
+       if (screen_lines < 3 || screen_cols < 10) {
+               widget->close();
+               beep();
+               return;
+       }
+       scale_menu(menu, &rows, &columns);
+       rows += 2;
+       columns += 2;
+       if (rows > screen_lines)
+               rows = screen_lines;
+       if (columns > screen_cols)
+               columns = screen_cols;
+
+       widget_init(widget, rows, columns, SCREEN_CENTER, SCREEN_CENTER,
+                   attrs.menu, WIDGET_BORDER | WIDGET_SUBWINDOW);
+
+       mvwprintw(widget->window, 0, (columns - 2 - get_mbs_width(title)) / 2, " %s ", title);
+       set_menu_win(menu, widget->window);
+       set_menu_sub(menu, widget->subwindow);
+       post_menu(menu);
+}
diff --git a/alsamixer/menu_widget.h b/alsamixer/menu_widget.h
new file mode 100644 (file)
index 0000000..e8e8a1e
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef MENU_WIDGET_H_INCLUDED
+#define MENU_WIDGET_H_INCLUDED
+
+#include "widget.h"
+#include <menu.h>
+
+int menu_widget_handle_key(MENU *menu, int key);
+void menu_widget_create(struct widget *widget, MENU *menu, const char *title);
+
+#endif
diff --git a/alsamixer/mixer_clickable.c b/alsamixer/mixer_clickable.c
new file mode 100644 (file)
index 0000000..c772f37
--- /dev/null
@@ -0,0 +1,136 @@
+#include <stdlib.h>
+#include <string.h>
+#include "mixer_clickable.h"
+
+extern int screen_cols;
+extern int screen_lines;
+
+static struct clickable_rect *clickable_rects = NULL;
+static unsigned int clickable_rects_count = 0;
+static unsigned int last_rect = 0;
+
+/* Using 0 instead of -1 for marking free rectangles allows us to use
+ * memset for `freeing` all rectangles at once.
+ * Zero is actually a valid coordinate in ncurses, but since we don't have
+ * any clickables in the top line this is fine. */
+#define FREE_MARKER 0
+#define RECT_IS_FREE(RECT) ((RECT).y1 == FREE_MARKER)
+#define RECT_FREE(RECT) ((RECT).y1 = FREE_MARKER)
+
+void clickable_set(int y1, int x1, int y2, int x2, command_enum command, int arg1) {
+       struct clickable_rect* tmp;
+       unsigned int i;
+
+       for (i = last_rect; i < clickable_rects_count; ++i) {
+               if (RECT_IS_FREE(clickable_rects[i])) {
+                       last_rect = i;
+                       goto SET_CLICKABLE_DATA;
+               }
+       }
+
+       for (i = 0; i < last_rect; ++i) {
+               if (RECT_IS_FREE(clickable_rects[i])) {
+                       last_rect = i;
+                       goto SET_CLICKABLE_DATA;
+               }
+       }
+
+       last_rect = clickable_rects_count;
+       tmp = realloc(clickable_rects, (clickable_rects_count + 8) * sizeof(*clickable_rects));
+       if (!tmp) {
+               free(clickable_rects);
+               clickable_rects = NULL;
+               clickable_rects_count = 0;
+               last_rect = 0;
+               return;
+       }
+       clickable_rects = tmp;
+#if FREE_MARKER == 0
+       memset(clickable_rects + clickable_rects_count, 0, 8 * sizeof(*clickable_rects));
+#else
+       for (i = clickable_rects_count; i < clickable_rects_count + 8; ++i)
+               RECT_FREE(clickable_rects[i]);
+#endif
+       clickable_rects_count += 8;
+
+SET_CLICKABLE_DATA:
+       clickable_rects[last_rect] = (struct clickable_rect) {
+               .y1 = y1,
+               .x1 = x1,
+               .x2 = x2,
+               .y2 = y2,
+               .command = command,
+               .arg1 = arg1
+       };
+}
+
+void clickable_set_relative(WINDOW *win, int y1, int x1, int y2, int x2, command_enum command, int arg1) {
+       int y, x;
+       getyx(win, y, x);
+       y1 = y + y1;
+       x1 = x + x1;
+       y2 = y + y2;
+       x2 = x + x2;
+       clickable_set(y1, x1, y2, x2, command, arg1);
+}
+
+void clickable_clear(int y1, int x1, int y2, int x2) {
+#define IS_IN_RECT(Y, X) (Y >= y1 && Y <= y2 && X >= x1 && X <= x2)
+       unsigned int i;
+
+       if (x1 == 0 && x2 == -1 && y2 == -1) {
+               if (y1 == 0) {
+                       // Optimize case: clear all
+#if FREE_MARKER == 0
+                       if (clickable_rects)
+                               memset(clickable_rects, 0,
+                                               clickable_rects_count * sizeof(*clickable_rects));
+#else
+                       for (i = 0; i < clickable_rects_count; ++i)
+                               RECT_FREE(clickable_rects[i]);
+#endif
+               }
+               else {
+                       // Optimize case: clear all lines beyond y1
+                       for (i = 0; i < clickable_rects_count; ++i) {
+                               if (clickable_rects[i].y2 >= y1)
+                                       RECT_FREE(clickable_rects[i]);
+                       }
+               }
+               return;
+       }
+
+       if (y2 < 0)
+               y2 = screen_lines + y2 + 1;
+       if (x2 < 0)
+               x2 = screen_cols + x2 + 1;
+
+       for (i = 0; i < clickable_rects_count; ++i) {
+               if (!RECT_IS_FREE(clickable_rects[i]) && (
+                               IS_IN_RECT(clickable_rects[i].y1, clickable_rects[i].x1) ||
+                               IS_IN_RECT(clickable_rects[i].y2, clickable_rects[i].x2)
+                       ))
+               {
+                       RECT_FREE(clickable_rects[i]);
+               }
+       }
+}
+
+struct clickable_rect* clickable_find(int y, int x) {
+       unsigned int i;
+
+       for (i = 0; i < clickable_rects_count; ++i) {
+               if (
+                               !RECT_IS_FREE(clickable_rects[i]) &&
+                               y >= clickable_rects[i].y1 &&
+                               x >= clickable_rects[i].x1 &&
+                               y <= clickable_rects[i].y2 &&
+                               x <= clickable_rects[i].x2
+                       )
+               {
+                       return &clickable_rects[i];
+               }
+       }
+
+       return NULL;
+}
diff --git a/alsamixer/mixer_clickable.h b/alsamixer/mixer_clickable.h
new file mode 100644 (file)
index 0000000..792c711
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef MIXER_CLICKABLE_H
+#define MIXER_CLICKABLE_H
+
+#include CURSESINC
+#include "bindings.h"
+
+struct clickable_rect {
+       short y1;
+       short x1;
+       short y2;
+       short x2;
+       command_enum command;
+       int arg1;
+};
+
+void clickable_set(int y1, int x1, int y2, int x2, command_enum command, int arg1);
+void clickable_set_relative(WINDOW *win, int y1, int x1, int y2, int x2, command_enum command, int arg1);
+void clickable_clear(int y1, int x1, int y2, int x2);
+struct clickable_rect* clickable_find(int y, int x);
+
+#endif
index cc98b64..9573517 100644 (file)
@@ -216,7 +216,6 @@ static unsigned int create_controls_for_elem(snd_mixer_elem_t *elem, struct cont
 {
        unsigned int count = 0;
        unsigned int i;
-       unsigned int multich_flag;
        unsigned int enum_index;
        struct control *front_control = NULL;
        bool has_pvol, has_psw;
@@ -286,7 +285,6 @@ static unsigned int create_controls_for_elem(snd_mixer_elem_t *elem, struct cont
                        ++control;
                        ++count;
                } else {
-                       multich_flag = 0;
                        for (i = 0; i < ARRAY_SIZE(supported_channels); ++i)
                                has_channel[supported_channels[i]] =
                                        snd_mixer_selem_has_playback_channel(elem, supported_channels[i]);
index b1f79d0..697da77 100644 (file)
@@ -34,6 +34,7 @@
 #include "mixer_widget.h"
 #include "mixer_controls.h"
 #include "mixer_display.h"
+#include "mixer_clickable.h"
 
 enum align {
        ALIGN_LEFT,
@@ -106,9 +107,10 @@ void init_mixer_layout(void)
                _("F6:  Select sound card"),
                _("Esc: Exit"),
        };
-       unsigned int label_width_left, label_width_right;
-       unsigned int right_x, i;
+       int label_width_left, label_width_right;
+       int right_x, i;
 
+       clickable_clear(0, 0, -1, -1);
        screen_too_small = screen_lines < 14 || screen_cols < 12;
        has_info_items = screen_lines >= 6;
        if (!has_info_items)
@@ -129,15 +131,18 @@ void init_mixer_layout(void)
                return;
        }
 
-       wattrset(mixer_widget.window, attr_mixer_text);
+       wattrset(mixer_widget.window, attrs.mixer_text);
        if (label_width_left)
                for (i = 0; i < 4; ++i)
                        display_string_in_field(1 + i, 2, labels_left[i],
                                                label_width_left, ALIGN_RIGHT);
        if (label_width_right)
-               for (i = 0; i < 4; ++i)
+               for (i = 0; i < 4; ++i) {
                        display_string_in_field(1 + i, right_x, labels_right[i],
                                                label_width_right, ALIGN_LEFT);
+                       clickable_set(1 + i, right_x, 1 + i, right_x + label_width_right - 1,
+                                               CMD_MIXER_HELP + i, -1);
+               }
 }
 
 void display_card_info(void)
@@ -167,9 +172,9 @@ void display_card_info(void)
        }
 
        if (card_name)
-               wattrset(mixer_widget.window, attr_mixer_active);
+               wattrset(mixer_widget.window, attrs.mixer_active);
        else {
-               wattrset(mixer_widget.window, attr_mixer_text);
+               wattrset(mixer_widget.window, attrs.mixer_text);
                if (unplugged)
                        card_name = _("(unplugged)");
                else
@@ -178,9 +183,9 @@ void display_card_info(void)
        display_string_in_field(1, info_items_left, card_name, info_items_width, ALIGN_LEFT);
 
        if (mixer_name)
-               wattrset(mixer_widget.window, attr_mixer_active);
+               wattrset(mixer_widget.window, attrs.mixer_active);
        else {
-               wattrset(mixer_widget.window, attr_mixer_text);
+               wattrset(mixer_widget.window, attrs.mixer_text);
                mixer_name = "-";
        }
        display_string_in_field(2, info_items_left, mixer_name, info_items_width, ALIGN_LEFT);
@@ -193,10 +198,11 @@ void display_view_mode(void)
                _("Capture"),
                _("All"),
        };
-       unsigned int widths[3];
+       int widths[3];
        bool has_view_mode;
        int i;
 
+       clickable_clear(3, 0, 3, 30);
        if (!has_info_items)
                return;
 
@@ -204,22 +210,22 @@ void display_view_mode(void)
        for (i = 0; i < 3; ++i)
                widths[i] = get_mbs_width(modes[i]);
        if (4 + widths[0] + 6 + widths[1] + 6 + widths[2] + 1 <= info_items_width) {
-               wmove(mixer_widget.window, 3, info_items_left);
-               wattrset(mixer_widget.window, attr_mixer_text);
+               wmove(mixer_widget.window, 3, info_items_left - 1);
+               wattrset(mixer_widget.window, attrs.mixer_text);
                for (i = 0; i < 3; ++i) {
-                       wprintw(mixer_widget.window, "F%c:", '3' + i);
+                       wprintw(mixer_widget.window, " F%c:", '3' + i);
                        if (has_view_mode && (int)view_mode == i) {
-                               wattrset(mixer_widget.window, attr_mixer_active);
+                               wattrset(mixer_widget.window, attrs.mixer_active);
                                wprintw(mixer_widget.window, "[%s]", modes[i]);
-                               wattrset(mixer_widget.window, attr_mixer_text);
+                               wattrset(mixer_widget.window, attrs.mixer_text);
                        } else {
                                wprintw(mixer_widget.window, " %s ", modes[i]);
                        }
-                       if (i < 2)
-                               waddch(mixer_widget.window, ' ');
+                       clickable_set_relative(mixer_widget.window, 0, -(widths[i] + 5), 0, -1,
+                                       CMD_WITH_ARG(CMD_MIXER_SET_VIEW_MODE, i), -1);
                }
        } else {
-               wattrset(mixer_widget.window, attr_mixer_active);
+               wattrset(mixer_widget.window, attrs.mixer_active);
                display_string_in_field(3, info_items_left,
                                        has_view_mode ? modes[view_mode] : "",
                                        info_items_width, ALIGN_LEFT);
@@ -248,7 +254,7 @@ static void display_focus_item_info(void)
 
        if (!has_info_items)
                return;
-       wattrset(mixer_widget.window, attr_mixer_active);
+       wattrset(mixer_widget.window, attrs.mixer_active);
        if (!controls_count || screen_too_small) {
                display_string_in_field(4, info_items_left, "", info_items_width, ALIGN_LEFT);
                return;
@@ -322,7 +328,8 @@ static void clear_controls_display(void)
 {
        int i;
 
-       wattrset(mixer_widget.window, attr_mixer_frame);
+       clickable_clear(5, 0, -1, -1);
+       wattrset(mixer_widget.window, attrs.mixer_frame);
        for (i = 5; i < screen_lines - 1; ++i)
                mvwprintw(mixer_widget.window, i, 1, "%*s", screen_cols - 2, "");
 }
@@ -349,17 +356,17 @@ static void display_unplugged(void)
                top = 5;
        if (boojum) {
                left = (screen_cols - 46) / 2;
-               wattrset(mixer_widget.window, attr_mixer_text);
+               wattrset(mixer_widget.window, attrs.mixer_text);
                mvwaddstr(mixer_widget.window, top + 0, left,    "In the midst of the word he was trying to say,");
                mvwaddstr(mixer_widget.window, top + 1, left + 2,  "In the midst of his laughter and glee,");
                mvwaddstr(mixer_widget.window, top + 2, left,    "He had softly and suddenly vanished away---");
                mvwaddstr(mixer_widget.window, top + 3, left + 2,  "For the Snark was a Boojum, you see.");
                mvwchgat(mixer_widget.window,  top + 3, left + 16, 3,          /* ^^^ */
-                        attr_mixer_text | A_BOLD, PAIR_NUMBER(attr_mixer_text), NULL);
+                        attrs.mixer_text | A_BOLD, PAIR_NUMBER(attrs.mixer_text), NULL);
                mvwaddstr(mixer_widget.window, top + 5, left,    "(Lewis Carroll, \"The Hunting of the Snark\")");
                top += 8;
        }
-       wattrset(mixer_widget.window, attr_errormsg);
+       wattrset(mixer_widget.window, attrs.errormsg);
        center_string(top, _("The sound device was unplugged."));
        center_string(top + 1, _("Press F6 to select another sound card."));
 }
@@ -374,7 +381,7 @@ static void display_no_controls(void)
                y = 5;
        if (y >= screen_lines - 1)
                return;
-       wattrset(mixer_widget.window, attr_infomsg);
+       wattrset(mixer_widget.window, attrs.infomsg);
        if (view_mode == VIEW_MODE_PLAYBACK && are_there_any_controls())
                msg = _("This sound device does not have any playback controls.");
        else if (view_mode == VIEW_MODE_CAPTURE && are_there_any_controls())
@@ -412,18 +419,16 @@ static void display_control(unsigned int control_index)
        left = first_control_x + col * (control_width + 1);
        frame_left = left + (control_width - 4) / 2;
        if (control->flags & IS_ACTIVE)
-               wattrset(mixer_widget.window, attr_ctl_frame);
+               wattrset(mixer_widget.window, attrs.ctl_frame);
        else
-               wattrset(mixer_widget.window, attr_ctl_inactive);
+               wattrset(mixer_widget.window, attrs.ctl_inactive);
        if (control->flags & (TYPE_PVOLUME | TYPE_CVOLUME)) {
                mvwaddch(mixer_widget.window, base_y - volume_height - 1, frame_left, ACS_ULCORNER);
                waddch(mixer_widget.window, ACS_HLINE);
                waddch(mixer_widget.window, ACS_HLINE);
                waddch(mixer_widget.window, ACS_URCORNER);
-               for (i = 0; i < volume_height; ++i) {
-                       mvwaddch(mixer_widget.window, base_y - i - 1, frame_left, ACS_VLINE);
-                       mvwaddch(mixer_widget.window, base_y - i - 1, frame_left + 3, ACS_VLINE);
-               }
+               mvwvline(mixer_widget.window, base_y - volume_height, frame_left, ACS_VLINE, volume_height);
+               mvwvline(mixer_widget.window, base_y - volume_height, frame_left + 3, ACS_VLINE, volume_height);
                mvwaddch(mixer_widget.window, base_y, frame_left,
                         control->flags & TYPE_PSWITCH ? ACS_LTEE : ACS_LLCORNER);
                waddch(mixer_widget.window, ACS_HLINE);
@@ -465,26 +470,28 @@ static void display_control(unsigned int control_index)
                                chtype ch;
                                if (i + 1 > bar_height)
                                        ch = ' ' | (control->flags & IS_ACTIVE ?
-                                                   attr_ctl_frame : 0);
+                                                   attrs.ctl_frame : 0);
                                else {
                                        ch = ACS_CKBOARD;
                                        if (!(control->flags & IS_ACTIVE))
                                                ;
 #ifdef TRICOLOR_VOLUME_BAR
                                        else if (i > volume_height * 8 / 10)
-                                               ch |= attr_ctl_bar_hi;
+                                               ch |= attrs.ctl_bar_hi;
                                        else if (i > volume_height * 4 / 10)
-                                               ch |= attr_ctl_bar_mi;
+                                               ch |= attrs.ctl_bar_mi;
 #endif
                                        else
-                                               ch |= attr_ctl_bar_lo;
+                                               ch |= attrs.ctl_bar_lo;
                                }
                                mvwaddch(mixer_widget.window, base_y - i - 1,
                                         frame_left + c + 1, ch);
                        }
                }
+               clickable_set(base_y - volume_height, frame_left + 1, base_y, frame_left + 2,
+                               CMD_MIXER_MOUSE_CLICK_VOLUME_BAR, control_index);
                if (control->flags & IS_ACTIVE)
-                       wattrset(mixer_widget.window, attr_mixer_active);
+                       wattrset(mixer_widget.window, attrs.mixer_active);
                if (!(control->flags & HAS_VOLUME_1)) {
                        sprintf(buf, "%d", (int)lrint(volumes[0] * 100));
                        display_string_in_field(values_y, frame_left - 2, buf, 8, ALIGN_CENTER);
@@ -492,10 +499,10 @@ static void display_control(unsigned int control_index)
                        mvwprintw(mixer_widget.window, values_y, frame_left - 2,
                                  "%3d", (int)lrint(volumes[0] * 100));
                        if (control->flags & IS_ACTIVE)
-                               wattrset(mixer_widget.window, attr_ctl_frame);
+                               wattrset(mixer_widget.window, attrs.ctl_frame);
                        waddstr(mixer_widget.window, "<>");
                        if (control->flags & IS_ACTIVE)
-                               wattrset(mixer_widget.window, attr_mixer_active);
+                               wattrset(mixer_widget.window, attrs.mixer_active);
                        wprintw(mixer_widget.window, "%-3d", (int)lrint(volumes[1] * 100));
                }
        }
@@ -513,13 +520,15 @@ static void display_control(unsigned int control_index)
                mvwaddch(mixer_widget.window, base_y + 1, frame_left + 1,
                         switches[0]
                         /* TRANSLATORS: playback on; one character */
-                        ? _("O")[0] | (control->flags & IS_ACTIVE ? attr_ctl_nomute : 0)
+                        ? _("O")[0] | (control->flags & IS_ACTIVE ? attrs.ctl_nomute : 0)
                         /* TRANSLATORS: playback muted; one character */
-                        : _("M")[0] | (control->flags & IS_ACTIVE ? attr_ctl_mute : 0));
+                        : _("M")[0] | (control->flags & IS_ACTIVE ? attrs.ctl_mute : 0));
                waddch(mixer_widget.window,
                       switches[1]
-                      ? _("O")[0] | (control->flags & IS_ACTIVE ? attr_ctl_nomute : 0)
-                      : _("M")[0] | (control->flags & IS_ACTIVE ? attr_ctl_mute : 0));
+                      ? _("O")[0] | (control->flags & IS_ACTIVE ? attrs.ctl_nomute : 0)
+                      : _("M")[0] | (control->flags & IS_ACTIVE ? attrs.ctl_mute : 0));
+               clickable_set(base_y + 1, frame_left + 1, base_y + 1, frame_left + 2,
+                               CMD_MIXER_MOUSE_CLICK_MUTE, control_index);
        }
 
        if (control->flags & TYPE_CSWITCH) {
@@ -531,18 +540,22 @@ static void display_control(unsigned int control_index)
                if (err < 0)
                        return;
                if (control->flags & IS_ACTIVE)
-                       wattrset(mixer_widget.window, switches[0] ? attr_ctl_capture : attr_ctl_nocapture);
+                       wattrset(mixer_widget.window, switches[0] ? attrs.ctl_capture : attrs.ctl_nocapture);
                /* TRANSLATORS: "left"; no more than two characters */
                display_string_in_field(cswitch_y - 1, frame_left - 2, switches[0] ? _("L") : "", 2, ALIGN_RIGHT);
+               clickable_set(cswitch_y - 1, frame_left - 2, cswitch_y - 1, frame_left - 1,
+                               CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, LEFT), control_index);
                if (control->flags & IS_ACTIVE)
-                       wattrset(mixer_widget.window, switches[1] ? attr_ctl_capture : attr_ctl_nocapture);
+                       wattrset(mixer_widget.window, switches[1] ? attrs.ctl_capture : attrs.ctl_nocapture);
                /* TRANSLATORS: "right"; no more than two characters */
                display_string_in_field(cswitch_y - 1, frame_left + 4, switches[1] ? _("R") : "", 2, ALIGN_LEFT);
+               clickable_set(cswitch_y - 1, frame_left + 4, cswitch_y - 1, frame_left + 5,
+                               CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, RIGHT), control_index);
                /* TRANSLATORS: no more than eight characters */
                s = _("CAPTURE");
                if (switches[0] || switches[1]) {
                        if (control->flags & IS_ACTIVE)
-                               wattrset(mixer_widget.window, attr_ctl_capture);
+                               wattrset(mixer_widget.window, attrs.ctl_capture);
                        display_string_in_field(cswitch_y, frame_left - 2, s, 8, ALIGN_CENTER);
                } else {
                        i = get_mbs_width(s);
@@ -551,9 +564,11 @@ static void display_control(unsigned int control_index)
                        memset(buf, '-', i);
                        buf[i] = '\0';
                        if (control->flags & IS_ACTIVE)
-                               wattrset(mixer_widget.window, attr_ctl_nocapture);
+                               wattrset(mixer_widget.window, attrs.ctl_nocapture);
                        display_string_in_field(cswitch_y, frame_left - 2, buf, 8, ALIGN_CENTER);
                }
+               clickable_set(cswitch_y, frame_left - 2, cswitch_y, frame_left - 2 + 8,
+                               CMD_WITH_ARG(CMD_MIXER_TOGGLE_CAPTURE, LEFT|RIGHT), control_index);
        }
 
        if (control->flags & TYPE_ENUM) {
@@ -564,26 +579,30 @@ static void display_control(unsigned int control_index)
                if (err < 0)
                        return;
                if (control->flags & IS_ACTIVE)
-                       wattrset(mixer_widget.window, attr_mixer_active);
+                       wattrset(mixer_widget.window, attrs.mixer_active);
                display_string_centered_in_control(base_y, col, buf, control_width);
+               clickable_set_relative(mixer_widget.window, 0, -control_name_width, 0, -2,
+                               CMD_MIXER_MOUSE_CLICK_CONTROL_ENUM, control_index);
        }
 
-       if (control_index == focus_control_index) {
+       if ((int)control_index == focus_control_index) {
                i = first_control_x + col * (control_width + 1) + (control_width - control_name_width) / 2;
-               wattrset(mixer_widget.window, attr_ctl_mark_focus);
+               wattrset(mixer_widget.window, attrs.ctl_mark_focus);
                mvwaddch(mixer_widget.window, name_y, i - 1, '<');
                mvwaddch(mixer_widget.window, name_y, i + control_name_width, '>');
                if (control->flags & IS_ACTIVE)
-                       wattrset(mixer_widget.window, attr_ctl_label_focus);
+                       wattrset(mixer_widget.window, attrs.ctl_label_focus);
                else
-                       wattrset(mixer_widget.window, attr_ctl_label_inactive);
+                       wattrset(mixer_widget.window, attrs.ctl_label_inactive);
        } else {
                if (control->flags & IS_ACTIVE)
-                       wattrset(mixer_widget.window, attr_ctl_label);
+                       wattrset(mixer_widget.window, attrs.ctl_label);
                else
-                       wattrset(mixer_widget.window, attr_ctl_label_inactive);
+                       wattrset(mixer_widget.window, attrs.ctl_label_inactive);
        }
        display_string_centered_in_control(name_y, col, control->name, control_name_width);
+       clickable_set_relative(mixer_widget.window, -1, -control_name_width, 0, -2,
+                       CMD_WITH_ARG(CMD_MIXER_FOCUS_CONTROL, control_index), -1);
        if (channel_name_y > name_y) {
                if (control->flags & IS_MULTICH) {
                        switch (control->flags & MULTICH_MASK) {
@@ -606,7 +625,7 @@ static void display_control(unsigned int control_index)
                        }
                } else {
                        s = "";
-                       wattrset(mixer_widget.window, attr_mixer_frame);
+                       wattrset(mixer_widget.window, attrs.mixer_frame);
                }
                display_string_centered_in_control(channel_name_y, col, s,
                                                   control_name_width);
@@ -615,7 +634,7 @@ static void display_control(unsigned int control_index)
 
 static void display_scroll_indicators(void)
 {
-       int y0, y1, y;
+       int y0, y1;
        chtype left, right;
 
        if (screen_too_small)
@@ -623,20 +642,22 @@ static void display_scroll_indicators(void)
        y0 = screen_lines * 3 / 8;
        y1 = screen_lines * 5 / 8;
        left = first_visible_control_index > 0 ? ACS_LARROW : ACS_VLINE;
-       right = first_visible_control_index + visible_controls < controls_count
+       right = first_visible_control_index + visible_controls < (int)controls_count
                ? ACS_RARROW : ACS_VLINE;
-       wattrset(mixer_widget.window, attr_mixer_frame);
-       for (y = y0; y <= y1; ++y) {
-               mvwaddch(mixer_widget.window, y, 0, left);
-               mvwaddch(mixer_widget.window, y, screen_cols - 1, right);
-       }
+       wattrset(mixer_widget.window, attrs.mixer_frame);
+       mvwvline(mixer_widget.window, y0, 0, left, y1 - y0 + 1);
+       mvwvline(mixer_widget.window, y0, screen_cols -1, right, y1 - y0 + 1);
+       clickable_set(y0, 0, y1, 0,
+                       CMD_WITH_ARG(CMD_MIXER_PREVIOUS, visible_controls), -1);
+       clickable_set(y0, screen_cols - 1, y1, screen_cols - 1,
+                       CMD_WITH_ARG(CMD_MIXER_NEXT, visible_controls), -1);
 }
 
 void display_controls(void)
 {
-       unsigned int i;
+       int i;
 
-       if (first_visible_control_index > controls_count - visible_controls)
+       if (first_visible_control_index > (int)controls_count - visible_controls)
                first_visible_control_index = controls_count - visible_controls;
        if (first_visible_control_index > focus_control_index)
                first_visible_control_index = focus_control_index;
@@ -703,7 +724,7 @@ void compute_controls_layout(void)
                control_width = screen_cols - 4;
 
        visible_controls = (screen_cols - 3) / (control_width + 1);
-       if (visible_controls > controls_count)
+       if (visible_controls > (int)controls_count)
                visible_controls = controls_count;
 
        first_control_x = 2 + (screen_cols - 3 - visible_controls * (control_width + 1)) / 2;
index 0c2b9e0..33b9bbc 100644 (file)
 #include "proc_files.h"
 #include "card_select.h"
 #include "volume_mapping.h"
+#include "mixer_clickable.h"
 #include "mixer_controls.h"
 #include "mixer_display.h"
 #include "mixer_widget.h"
+#include "bindings.h"
 
 snd_mixer_t *mixer;
 char *mixer_device_name;
@@ -53,12 +55,10 @@ unsigned int current_control_flags;
 bool control_values_changed;
 bool controls_changed;
 
-enum channel_mask {
-       LEFT = 1,
-       RIGHT = 2,
-};
+unsigned int mouse_wheel_step = 1;
+bool mouse_wheel_focuses_control = 1;
 
-static int elem_callback(snd_mixer_elem_t *elem, unsigned int mask)
+static int elem_callback(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, unsigned int mask)
 {
        if (mask == SND_CTL_EVENT_MASK_REMOVE) {
                controls_changed = TRUE;
@@ -73,7 +73,7 @@ static int elem_callback(snd_mixer_elem_t *elem, unsigned int mask)
        return 0;
 }
 
-static int mixer_callback(snd_mixer_t *mixer, unsigned int mask, snd_mixer_elem_t *elem)
+static int mixer_callback(snd_mixer_t *mixer ATTRIBUTE_UNUSED, unsigned int mask, snd_mixer_elem_t *elem)
 {
        if (mask & SND_CTL_EVENT_MASK_ADD) {
                snd_mixer_elem_set_callback(elem, elem_callback);
@@ -228,7 +228,8 @@ static void show_help(void)
 
 void refocus_control(void)
 {
-       if (focus_control_index < controls_count) {
+       if (focus_control_index >= 0 &&
+           focus_control_index < (int)controls_count) {
                snd_mixer_selem_get_id(controls[focus_control_index].elem, current_selem_id);
                current_control_flags = controls[focus_control_index].flags;
        }
@@ -239,7 +240,7 @@ void refocus_control(void)
 static struct control *get_focus_control(unsigned int type)
 {
        if (focus_control_index >= 0 &&
-           focus_control_index < controls_count &&
+           focus_control_index < (int)controls_count &&
            (controls[focus_control_index].flags & IS_ACTIVE) &&
            (controls[focus_control_index].flags & type))
                return &controls[focus_control_index];
@@ -294,7 +295,7 @@ static void change_enum_relative(struct control *control, int delta)
                new_index = 0;
        else if (new_index >= items)
                new_index = items - 1;
-       if (new_index == index)
+       if (new_index == (int)index)
                return;
        for (i = 0; i <= SND_MIXER_SCHN_LAST; ++i)
                if (control->enum_channel_bits & (1 << i))
@@ -330,7 +331,7 @@ static void change_volume_relative(struct control *control, int delta, unsigned
 {
        double (*get_func)(snd_mixer_elem_t *, snd_mixer_selem_channel_id_t);
        int (*set_func)(snd_mixer_elem_t *, snd_mixer_selem_channel_id_t, double, int);
-       double left, right;
+       double left = 0, right = 0;
        int dir;
 
        if (!(control->flags & HAS_VOLUME_1))
@@ -444,7 +445,6 @@ static void balance_volumes(void)
 {
        struct control *control;
        double left, right;
-       int err;
 
        control = get_focus_control(TYPE_PVOLUME | TYPE_CVOLUME);
        if (!control || !(control->flags & HAS_VOLUME_1))
@@ -467,147 +467,164 @@ static void balance_volumes(void)
        display_controls();
 }
 
+static int on_mouse_key() {
+       MEVENT m;
+       command_enum cmd = 0;
+       unsigned int channels = LEFT | RIGHT;
+       unsigned int index;
+       struct control *control;
+       struct clickable_rect *rect;
+
+       if (getmouse(&m) == ERR)
+               return 0;
+
+       if (m.bstate & (
+                               BUTTON1_PRESSED|BUTTON1_RELEASED|
+                               BUTTON2_PRESSED|BUTTON2_RELEASED|
+                               BUTTON3_PRESSED|BUTTON3_RELEASED))
+               return 0;
+
+       rect = clickable_find(m.y, m.x);
+       if (rect)
+               cmd = rect->command;
+
+#if NCURSES_MOUSE_VERSION > 1
+       if (m.bstate & (BUTTON4_CLICKED|BUTTON4_PRESSED|BUTTON5_CLICKED|BUTTON5_PRESSED)) {
+               switch (cmd) {
+                       case CMD_MIXER_MOUSE_CLICK_CONTROL_ENUM:
+                               focus_control_index = rect->arg1;
+                               return CMD_WITH_ARG((
+                                                       m.bstate & (BUTTON4_CLICKED|BUTTON4_PRESSED)
+                                                       ? CMD_MIXER_CONTROL_UP
+                                                       : CMD_MIXER_CONTROL_DOWN
+                                               ), 1);
+
+                       case CMD_MIXER_MOUSE_CLICK_VOLUME_BAR:
+                               if (mouse_wheel_focuses_control)
+                                       focus_control_index = rect->arg1;
+                               /* fall through */
+
+                       default:
+                               return CMD_WITH_ARG((
+                                                       m.bstate & (BUTTON4_CLICKED|BUTTON4_PRESSED)
+                                                       ? CMD_MIXER_CONTROL_UP
+                                                       : CMD_MIXER_CONTROL_DOWN
+                                               ), mouse_wheel_step);
+               }
+       }
+#endif
+
+       /* If the rectangle has got an argument (value != -1) it is used for
+        * setting `focus_control_index` */
+       if (rect && rect->arg1 >= 0)
+               focus_control_index = rect->arg1;
+
+       switch (cmd) {
+       case CMD_MIXER_MOUSE_CLICK_VOLUME_BAR:
+               if (m.bstate & (BUTTON3_CLICKED|BUTTON3_DOUBLE_CLICKED|BUTTON3_TRIPLE_CLICKED))
+                       channels = m.x - rect->x1 + 1;
+               return CMD_WITH_ARG(CMD_MIXER_CONTROL_SET_PERCENT_LEFT + channels - 1,
+                       (100 * (rect->y2 - m.y) / (rect->y2 - rect->y1)) // volume
+               );
+
+       case CMD_MIXER_MOUSE_CLICK_MUTE:
+               if (m.bstate & (BUTTON3_CLICKED|BUTTON3_DOUBLE_CLICKED|BUTTON3_TRIPLE_CLICKED))
+                       channels = m.x - rect->x1 + 1;
+               return CMD_WITH_ARG(CMD_MIXER_TOGGLE_MUTE, channels);
+
+       case CMD_MIXER_MOUSE_CLICK_CONTROL_ENUM:
+               control = get_focus_control(TYPE_ENUM);
+               if (control &&
+                       (snd_mixer_selem_get_enum_item(control->elem, 0, &index) >= 0)) {
+                               return (index == 0
+                                       ? CMD_WITH_ARG(CMD_MIXER_CONTROL_UP, 100)
+                                       : CMD_WITH_ARG(CMD_MIXER_CONTROL_DOWN, 1));
+               }
+               break;
+
+       default:
+               return cmd; // non-mouse command
+       }
+
+       return 0; // failed mouse command
+}
+
 static void on_handle_key(int key)
 {
-       switch (key) {
-       case 27:
-       case KEY_CANCEL:
-       case KEY_F(10):
+       int arg;
+       command_enum cmd;
+
+       if (key == KEY_MOUSE)
+               cmd = on_mouse_key();
+       else if (key < (int)ARRAY_SIZE(mixer_bindings))
+               cmd = mixer_bindings[key];
+       else
+               return;
+
+       arg = CMD_GET_ARGUMENT(cmd);
+       cmd = CMD_GET_COMMAND(cmd);
+
+       switch (cmd) {
+       case CMD_MIXER_CONTROL_DOWN_LEFT:
+       case CMD_MIXER_CONTROL_DOWN_RIGHT:
+       case CMD_MIXER_CONTROL_DOWN:
+               arg = (-arg);
+               /* fall through */
+       case CMD_MIXER_CONTROL_UP_LEFT:
+       case CMD_MIXER_CONTROL_UP_RIGHT:
+       case CMD_MIXER_CONTROL_UP:
+               change_control_relative(arg, cmd % 4);
+               break;
+       case CMD_MIXER_CONTROL_SET_PERCENT_LEFT:
+       case CMD_MIXER_CONTROL_SET_PERCENT_RIGHT:
+       case CMD_MIXER_CONTROL_SET_PERCENT:
+               change_control_to_percent(arg, cmd % 4);
+               break;
+       case CMD_MIXER_CLOSE:
                mixer_widget.close();
                break;
-       case KEY_F(1):
-       case KEY_HELP:
-       case 'H':
-       case 'h':
-       case '?':
+       case CMD_MIXER_HELP:
                show_help();
                break;
-       case KEY_F(2):
-       case '/':
+       case CMD_MIXER_SYSTEM_INFORMATION:
                create_proc_files_list();
                break;
-       case KEY_F(3):
-               set_view_mode(VIEW_MODE_PLAYBACK);
-               break;
-       case KEY_F(4):
-               set_view_mode(VIEW_MODE_CAPTURE);
+       case CMD_MIXER_TOGGLE_VIEW_MODE:
+               arg = (view_mode + 1) % VIEW_MODE_COUNT;
+               /* fall through */
+       case CMD_MIXER_SET_VIEW_MODE:
+               set_view_mode((enum view_mode)(arg));
                break;
-       case KEY_F(5):
-               set_view_mode(VIEW_MODE_ALL);
-               break;
-       case '\t':
-               set_view_mode((enum view_mode)((view_mode + 1) % VIEW_MODE_COUNT));
-               break;
-       case KEY_F(6):
-       case 'S':
-       case 's':
+       case CMD_MIXER_SELECT_CARD:
                create_card_select_list();
                break;
-       case KEY_REFRESH:
-       case 12:
-       case 'L':
-       case 'l':
+       case CMD_MIXER_REFRESH:
                clearok(mixer_widget.window, TRUE);
                display_controls();
                break;
-       case KEY_LEFT:
-       case 'P':
-       case 'p':
-               if (focus_control_index > 0) {
-                       --focus_control_index;
-                       refocus_control();
-               }
+       case CMD_MIXER_PREVIOUS:
+               arg = (-arg);
+               /* fall through */
+       case CMD_MIXER_NEXT:
+               arg = focus_control_index + arg;
+               /* fall through */
+       case CMD_MIXER_FOCUS_CONTROL:
+               focus_control_index = arg;
+               if (focus_control_index < 0)
+                       focus_control_index = 0;
+               else if (focus_control_index >= (int)controls_count)
+                       focus_control_index = controls_count - 1;
+               refocus_control();
                break;
-       case KEY_RIGHT:
-       case 'N':
-       case 'n':
-               if (focus_control_index < controls_count - 1) {
-                       ++focus_control_index;
-                       refocus_control();
-               }
-               break;
-       case KEY_PPAGE:
-               change_control_relative(5, LEFT | RIGHT);
-               break;
-       case KEY_NPAGE:
-               change_control_relative(-5, LEFT | RIGHT);
-               break;
-#if 0
-       case KEY_BEG:
-       case KEY_HOME:
-               change_control_to_percent(100, LEFT | RIGHT);
-               break;
-#endif
-       case KEY_LL:
-       case KEY_END:
-               change_control_to_percent(0, LEFT | RIGHT);
+       case CMD_MIXER_TOGGLE_MUTE:
+               toggle_mute(arg);
                break;
-       case KEY_UP:
-       case '+':
-       case 'K':
-       case 'k':
-       case 'W':
-       case 'w':
-               change_control_relative(1, LEFT | RIGHT);
+       case CMD_MIXER_TOGGLE_CAPTURE:
+               toggle_capture(arg);
                break;
-       case KEY_DOWN:
-       case '-':
-       case 'J':
-       case 'j':
-       case 'X':
-       case 'x':
-               change_control_relative(-1, LEFT | RIGHT);
-               break;
-       case '0': case '1': case '2': case '3': case '4':
-       case '5': case '6': case '7': case '8': case '9':
-               change_control_to_percent((key - '0') * 10, LEFT | RIGHT);
-               break;
-       case 'Q':
-       case 'q':
-               change_control_relative(1, LEFT);
-               break;
-       case 'Y':
-       case 'y':
-       case 'Z':
-       case 'z':
-               change_control_relative(-1, LEFT);
-               break;
-       case 'E':
-       case 'e':
-               change_control_relative(1, RIGHT);
-               break;
-       case 'C':
-       case 'c':
-               change_control_relative(-1, RIGHT);
-               break;
-       case 'M':
-       case 'm':
-               toggle_mute(LEFT | RIGHT);
-               break;
-       case 'B':
-       case 'b':
-       case '=':
+       case CMD_MIXER_BALANCE_CONTROL:
                balance_volumes();
                break;
-       case '<':
-       case ',':
-               toggle_mute(LEFT);
-               break;
-       case '>':
-       case '.':
-               toggle_mute(RIGHT);
-               break;
-       case ' ':
-               toggle_capture(LEFT | RIGHT);
-               break;
-       case KEY_IC:
-       case ';':
-               toggle_capture(LEFT);
-               break;
-       case KEY_DC:
-       case '\'':
-               toggle_capture(RIGHT);
-               break;
        }
 }
 
@@ -616,9 +633,9 @@ static void create(void)
        static const char title[] = " AlsaMixer v" SND_UTIL_VERSION_STR " ";
 
        widget_init(&mixer_widget, screen_lines, screen_cols, 0, 0,
-                   attr_mixer_frame, WIDGET_BORDER);
-       if (screen_cols >= (sizeof(title) - 1) + 2) {
-               wattrset(mixer_widget.window, attr_mixer_active);
+                   attrs.mixer_frame, WIDGET_BORDER);
+       if (screen_cols >= (int)(sizeof(title) - 1) + 2) {
+               wattrset(mixer_widget.window, attrs.mixer_active);
                mvwaddstr(mixer_widget.window, 0, (screen_cols - (sizeof(title) - 1)) / 2, title);
        }
        init_mixer_layout();
index 086611c..3b6f474 100644 (file)
@@ -12,6 +12,11 @@ enum view_mode {
        VIEW_MODE_COUNT,
 };
 
+enum channel_mask {
+       LEFT = 1,
+       RIGHT = 2,
+};
+
 extern snd_mixer_t *mixer;
 extern char *mixer_device_name;
 extern bool unplugged;
@@ -27,6 +32,9 @@ extern unsigned int current_control_flags;
 extern bool control_values_changed;
 extern bool controls_changed;
 
+extern unsigned int mouse_wheel_step;
+extern bool mouse_wheel_focuses_control;
+
 void create_mixer_object(struct snd_mixer_selem_regopt *selem_regopt);
 void create_mixer_widget(void);
 void mixer_shutdown(void);
index b2f5f21..0ca003b 100644 (file)
 #include "widget.h"
 #include "textbox.h"
 #include "proc_files.h"
+#include "menu_widget.h"
 
 static struct widget proc_widget;
 static ITEM *items[7];
 static unsigned int items_count;
 static MENU *menu;
 
-static void on_menu_key(int key)
-{
-       static const struct {
-               int key;
-               int request;
-       } key_map[] = {
-               { KEY_DOWN, REQ_DOWN_ITEM },
-               { KEY_UP, REQ_UP_ITEM },
-               { KEY_HOME, REQ_FIRST_ITEM },
-               { KEY_NPAGE, REQ_SCR_DPAGE },
-               { KEY_PPAGE, REQ_SCR_UPAGE },
-               { KEY_BEG, REQ_FIRST_ITEM },
-               { KEY_END, REQ_LAST_ITEM },
-       };
-       unsigned int i;
-
-       for (i = 0; i < ARRAY_SIZE(key_map); ++i)
-               if (key_map[i].key == key) {
-                       menu_driver(menu, key_map[i].request);
-                       break;
-               }
-}
-
 static void on_handle_key(int key)
 {
        ITEM *item;
 
-       switch (key) {
-       case 27:
-       case KEY_CANCEL:
-               proc_widget.close();
-               break;
-       case 10:
-       case 13:
-       case KEY_ENTER:
-               item = current_item(menu);
-               if (item)
-                       show_textfile(item_name(item));
-               break;
-       default:
-               on_menu_key(key);
-               break;
-       }
-}
-
-static bool create(void)
-{
-       int rows, columns;
-       const char *title;
-
-       if (screen_lines < 3 || screen_cols < 20) {
-               proc_widget.close();
-               beep();
-               return FALSE;
+       switch (menu_widget_handle_key(menu, key)) {
+               case KEY_ENTER:
+                       item = current_item(menu);
+                       if (item)
+                               show_textfile(item_name(item));
+                       break;
+               case KEY_CANCEL:
+                       proc_widget.close();
+                       break;
        }
-       scale_menu(menu, &rows, &columns);
-       rows += 2;
-       columns += 2;
-       if (rows > screen_lines)
-               rows = screen_lines;
-       if (columns > screen_cols)
-               columns = screen_cols;
-
-       widget_init(&proc_widget, rows, columns, SCREEN_CENTER, SCREEN_CENTER,
-                   attr_menu, WIDGET_BORDER | WIDGET_SUBWINDOW);
-
-       title = _("Select File");
-       mvwprintw(proc_widget.window, 0, (columns - 2 - get_mbs_width(title)) / 2, " %s ", title);
-       set_menu_win(menu, proc_widget.window);
-       set_menu_sub(menu, proc_widget.subwindow);
-       return TRUE;
 }
 
-static void on_window_size_changed(void)
+static void create(void)
 {
-       unpost_menu(menu);
-       if (!create())
-               return;
-       post_menu(menu);
+       menu_widget_create(&proc_widget, menu, _("Select File"));
 }
 
 static void on_close(void)
@@ -139,7 +80,7 @@ static void add_item(const char *file_name)
 
 static struct widget proc_widget = {
        .handle_key = on_handle_key,
-       .window_size_changed = on_window_size_changed,
+       .window_size_changed = create,
        .close = on_close,
 };
 
@@ -157,13 +98,10 @@ void create_proc_files_list(void)
        menu = new_menu(items);
        if (!menu)
                fatal_error("cannot create menu");
-       set_menu_fore(menu, attr_menu_selected);
-       set_menu_back(menu, attr_menu);
+       set_menu_fore(menu, attrs.menu_selected);
+       set_menu_back(menu, attrs.menu);
        set_menu_mark(menu, NULL);
        menu_opts_off(menu, O_SHOWDESC);
 
-       if (!create())
-               return;
-
-       post_menu(menu);
+       create();
 }
index a979d3c..930ce73 100644 (file)
@@ -32,8 +32,7 @@
 #include "colors.h"
 #include "widget.h"
 #include "textbox.h"
-
-#define MAX_FILE_SIZE 1048576
+#include "bindings.h"
 
 static void create_text_box(const char *const *lines, unsigned int count,
                            const char *title, int attrs);
@@ -49,7 +48,7 @@ void show_error(const char *msg, int err)
                lines[1] = strerror(err);
                count = 2;
        }
-       create_text_box(lines, count, _("Error"), attr_errormsg);
+       create_text_box(lines, count, _("Error"), attrs.errormsg);
 }
 
 void show_alsa_error(const char *msg, int err)
@@ -63,39 +62,7 @@ void show_alsa_error(const char *msg, int err)
                lines[1] = snd_strerror(err);
                count = 2;
        }
-       create_text_box(lines, count, _("Error"), attr_errormsg);
-}
-
-static char *read_file(const char *file_name, unsigned int *file_size)
-{
-       FILE *f;
-       int err;
-       char *buf;
-       unsigned int allocated = 2048;
-       unsigned int bytes_read;
-
-       f = fopen(file_name, "r");
-       if (!f) {
-               err = errno;
-               buf = casprintf(_("Cannot open file \"%s\"."), file_name);
-               show_error(buf, err);
-               free(buf);
-               return NULL;
-       }
-       *file_size = 0;
-       buf = NULL;
-       do {
-               allocated *= 2;
-               buf = crealloc(buf, allocated);
-               bytes_read = fread(buf + *file_size, 1, allocated - *file_size, f);
-               *file_size += bytes_read;
-       } while (*file_size == allocated && allocated < MAX_FILE_SIZE);
-       fclose(f);
-       if (*file_size > 0 && buf[*file_size - 1] != '\n' && *file_size < allocated) {
-               buf[*file_size] = '\n';
-               ++*file_size;
-       }
-       return buf;
+       create_text_box(lines, count, _("Error"), attrs.errormsg);
 }
 
 void show_textfile(const char *file_name)
@@ -108,8 +75,12 @@ void show_textfile(const char *file_name)
        const char *start_line;
 
        buf = read_file(file_name, &file_size);
-       if (!buf)
+       if (!buf) {
+               int err = errno;
+               buf = casprintf(_("Cannot open file \"%s\"."), file_name);
+               show_error(buf, err);
                return;
+       }
        line_count = 0;
        for (i = 0; i < file_size; ++i)
                line_count += buf[i] == '\n';
@@ -125,14 +96,14 @@ void show_textfile(const char *file_name)
                if (buf[i] == '\t')
                        buf[i] = ' ';
        }
-       create_text_box(lines, line_count, file_name, attr_textbox);
+       create_text_box(lines, line_count, file_name, attrs.textbox);
        free(lines);
        free(buf);
 }
 
 void show_text(const char *const *lines, unsigned int count, const char *title)
 {
-       create_text_box(lines, count, title, attr_textbox);
+       create_text_box(lines, count, title, attrs.textbox);
 }
 
 /**********************************************************************/
@@ -184,8 +155,7 @@ static void update_text_lines(void)
 static void update_y_scroll_bar(void)
 {
        int length;
-       int begin, end;
-       int i;
+       int begin;
 
        if (max_scroll_y <= 0 || text_lines_count == 0)
                return;
@@ -193,17 +163,14 @@ static void update_y_scroll_bar(void)
        if (length >= text_box_y)
                return;
        begin = current_top * (text_box_y - length) / max_scroll_y;
-       end = begin + length;
-       for (i = 0; i < text_box_y; ++i)
-               mvwaddch(text_widget.window, i + 1, text_box_x + 1,
-                        i >= begin && i < end ? ACS_BOARD : ' ');
+       mvwvline(text_widget.window, 1, text_box_x + 1, ' ', text_box_y);
+       mvwvline(text_widget.window, begin + 1, text_box_x + 1, ACS_BOARD, length);
 }
 
 static void update_x_scroll_bar(void)
 {
        int length;
-       int begin, end;
-       int i;
+       int begin;
 
        if (max_scroll_x <= 0 || max_line_width <= 0)
                return;
@@ -211,10 +178,8 @@ static void update_x_scroll_bar(void)
        if (length >= text_box_x)
                return;
        begin = current_left * (text_box_x - length) / max_scroll_x;
-       end = begin + length;
-       wmove(text_widget.window, text_box_y + 1, 1);
-       for (i = 0; i < text_box_x; ++i)
-               waddch(text_widget.window, i >= begin && i < end ? ACS_BOARD : ' ');
+       mvwhline(text_widget.window, text_box_y + 1, 1, ' ', text_box_x);
+       mvwhline(text_widget.window, text_box_y + 1, begin + 1, ACS_BOARD, length);
 }
 
 static void move_x(int delta)
@@ -251,68 +216,41 @@ static void move_y(int delta)
 
 static void on_handle_key(int key)
 {
-       switch (key) {
-       case 10:
-       case 13:
-       case 27:
-       case KEY_CANCEL:
-       case KEY_ENTER:
-       case KEY_CLOSE:
-       case KEY_EXIT:
+       if (key >= (int)ARRAY_SIZE(textbox_bindings))
+               return;
+
+       switch (textbox_bindings[key]) {
+       case CMD_TEXTBOX_CLOSE:
                text_widget.close();
                break;
-       case KEY_DOWN:
-       case KEY_SF:
-       case 'J':
-       case 'j':
-       case 'X':
-       case 'x':
+       case CMD_TEXTBOX_DOWN:
                move_y(1);
                break;
-       case KEY_UP:
-       case KEY_SR:
-       case 'K':
-       case 'k':
-       case 'W':
-       case 'w':
+       case CMD_TEXTBOX_UP:
                move_y(-1);
                break;
-       case KEY_LEFT:
-       case 'H':
-       case 'h':
-       case 'P':
-       case 'p':
+       case CMD_TEXTBOX_LEFT:
                move_x(-1);
                break;
-       case KEY_RIGHT:
-       case 'L':
-       case 'l':
-       case 'N':
-       case 'n':
+       case CMD_TEXTBOX_RIGHT:
                move_x(1);
                break;
-       case KEY_NPAGE:
-       case ' ':
+       case CMD_TEXTBOX_PAGE_DOWN:
                move_y(text_box_y);
                break;
-       case KEY_PPAGE:
-       case KEY_BACKSPACE:
-       case 'B':
-       case 'b':
+       case CMD_TEXTBOX_PAGE_UP:
                move_y(-text_box_y);
                break;
-       case KEY_HOME:
-       case KEY_BEG:
+       case CMD_TEXTBOX_TOP:
                move_x(-max_scroll_x);
                break;
-       case KEY_LL:
-       case KEY_END:
+       case CMD_TEXTBOX_BOTTOM:
                move_x(max_scroll_x);
                break;
-       case '\t':
+       case CMD_TEXTBOX_PAGE_RIGHT:
                move_x(8);
                break;
-       case KEY_BTAB:
+       case CMD_TEXTBOX_PAGE_LEFT:
                move_x(-8);
                break;
        }
index 3602bef..64c69f2 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef _XOPEN_SOURCE
 #define _XOPEN_SOURCE
+#endif
 #include "aconfig.h"
 #include <limits.h>
 #include <stdlib.h>
 #include <string.h>
 #include <wchar.h>
+#include <errno.h>
+#include <stdio.h>
 #include "utils.h"
+#include "mem.h"
 
 /*
  * mbs_at_width - compute screen position in a string
@@ -109,3 +114,35 @@ unsigned int get_max_mbs_width(const char *const *s, unsigned int count)
        }
        return max_width;
 }
+
+#define MAX_FILE_SIZE 1048576
+char *read_file(const char *file_name, unsigned int *file_size)
+{
+       FILE *f;
+       int err;
+       char *buf;
+       unsigned int allocated = 2048;
+       unsigned int bytes_read;
+
+       f = fopen(file_name, "r");
+       if (!f) {
+               err = errno;
+               errno = err;
+               return NULL;
+       }
+       *file_size = 0;
+       buf = NULL;
+       do {
+               allocated *= 2;
+               buf = crealloc(buf, allocated);
+               bytes_read = fread(buf + *file_size, 1, allocated - *file_size, f);
+               *file_size += bytes_read;
+       } while (*file_size == allocated && allocated < MAX_FILE_SIZE);
+       fclose(f);
+       if (*file_size > 0 && buf[*file_size - 1] != '\n' && *file_size < allocated) {
+               buf[*file_size] = '\n';
+               ++*file_size;
+       }
+       return buf;
+}
+
index 00a52dd..8301311 100644 (file)
@@ -6,5 +6,6 @@
 unsigned int get_mbs_width(const char *s);
 unsigned int get_max_mbs_width(const char *const *s, unsigned int count);
 const char *mbs_at_width(const char *s, int *width, int dir);
+char *read_file(const char *file_name, unsigned int *file_size);
 
 #endif
index 1c0d7c4..f34801c 100644 (file)
  */
 
 #define _ISOC99_SOURCE /* lrint() */
-#define _GNU_SOURCE /* exp10() */
 #include "aconfig.h"
 #include <math.h>
 #include <stdbool.h>
 #include "volume_mapping.h"
 
-#ifdef __UCLIBC__
-/* 10^x = 10^(log e^x) = (e^x)^log10 = e^(x * log 10) */
-#define exp10(x) (exp((x) * log(10)))
-#endif /* __UCLIBC__ */
-
 #define MAX_LINEAR_DB_SCALE    24
 
 static inline bool use_linear_dB_scale(long dBmin, long dBmax)
@@ -114,9 +108,9 @@ static double get_normalized_volume(snd_mixer_elem_t *elem,
        if (use_linear_dB_scale(min, max))
                return (value - min) / (double)(max - min);
 
-       normalized = exp10((value - max) / 6000.0);
+       normalized = pow(10, (value - max) / 6000.0);
        if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
-               min_norm = exp10((min - max) / 6000.0);
+               min_norm = pow(10, (min - max) / 6000.0);
                normalized = (normalized - min_norm) / (1 - min_norm);
        }
 
@@ -149,9 +143,11 @@ static int set_normalized_volume(snd_mixer_elem_t *elem,
        }
 
        if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
-               min_norm = exp10((min - max) / 6000.0);
+               min_norm = pow(10, (min - max) / 6000.0);
                volume = volume * (1 - min_norm) + min_norm;
        }
+       if (volume <= 0)
+               volume = 1e-36;
        value = lrint_dir(6000.0 * log10(volume), dir) + max;
        return set_dB[ctl_dir](elem, channel, value, dir);
 }
index 75da4c2..5fedaba 100644 (file)
@@ -19,6 +19,8 @@
 #include "aconfig.h"
 #include <stdlib.h>
 #include <term.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
 #include "die.h"
 #include "widget.h"
 
@@ -27,13 +29,9 @@ int screen_cols;
 
 static int cursor_visibility = -1;
 
-static void widget_handle_key(int key)
-{
-}
-
 static void update_cursor_visibility(void)
 {
-       struct widget *active_widget;
+       const struct widget *active_widget;
 
        active_widget = get_active_widget();
        if (active_widget &&
@@ -85,9 +83,6 @@ void widget_init(struct widget *widget, int lines_, int cols, int y, int x,
                set_panel_userptr(widget->panel, widget);
        }
 
-       if (!widget->handle_key)
-               widget->handle_key = widget_handle_key;
-
        if (old_window)
                delwin(old_window);
 
@@ -112,7 +107,7 @@ void widget_free(struct widget *widget)
        update_cursor_visibility();
 }
 
-struct widget *get_active_widget(void)
+const struct widget *get_active_widget(void)
 {
        PANEL *active_panel;
 
@@ -126,7 +121,11 @@ struct widget *get_active_widget(void)
 void window_size_changed(void)
 {
        PANEL *panel, *below;
-       struct widget *widget;
+       const struct widget *widget;
+       struct winsize size;
+
+       if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) == 0)
+               resize_term(size.ws_row, size.ws_col);
 
        getmaxyx(stdscr, screen_lines, screen_cols);
        if (tigetflag("xenl") != 1 && tigetflag("am") != 1)
index 6adb526..58a132c 100644 (file)
@@ -27,7 +27,7 @@ void widget_init(struct widget *widget,
                 int lines_, int cols, int y, int x,
                 chtype bkgd, unsigned int flags);
 void widget_free(struct widget *widget);
-struct widget *get_active_widget(void);
+const struct widget *get_active_widget(void);
 void window_size_changed(void);
 
 #endif
index c180d4a..2010fc0 100644 (file)
@@ -1,13 +1,20 @@
 bin_PROGRAMS = \
         alsaucm
 
-alsaucm_SOURCES = usecase.c
+if USE_RST2MAN
+man_MANS = alsaucm.1
+endif
+
+alsaucm_SOURCES = usecase.c dump.c
+
+noinst_HEADERS = usecase.h
 
 AM_CPPFLAGS = \
          -Wall -I$(top_srcdir)/include
 
-alsaucm_LDADD = -lasound
+%.1: %.rst
+       rst2man $< > $@
+
+EXTRA_DIST = alsaucm.rst
 
-# local build
-AM_CPPFLAGS += -I$(top_srcdir)/../alsa-lib/include
-alsaucm_LDADD += -L$(top_srcdir)/../alsa-lib/src/.libs
+CLEANFILES = alsaucm.1
index c4e10f4..62847ed 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 @SET_MAKE@
 
+
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,34 +91,68 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = alsaucm$(EXEEXT)
 subdir = alsaucm
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_alsaucm_OBJECTS = usecase.$(OBJEXT)
+am_alsaucm_OBJECTS = usecase.$(OBJEXT) dump.$(OBJEXT)
 alsaucm_OBJECTS = $(am_alsaucm_OBJECTS)
-alsaucm_DEPENDENCIES =
+alsaucm_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/dump.Po ./$(DEPDIR)/usecase.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(alsaucm_SOURCES)
 DIST_SOURCES = $(alsaucm_SOURCES)
 am__can_run_installinfo = \
@@ -87,15 +160,68 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+HEADERS = $(noinst_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -113,11 +239,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -129,27 +262,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -162,6 +305,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -170,6 +314,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -180,7 +326,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -221,6 +369,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -231,17 +381,19 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
-alsaucm_SOURCES = usecase.c
-
-# local build
-AM_CPPFLAGS = -Wall -I$(top_srcdir)/include \
-       -I$(top_srcdir)/../alsa-lib/include
-alsaucm_LDADD = -lasound -L$(top_srcdir)/../alsa-lib/src/.libs
+xmlto_available = @xmlto_available@
+@USE_RST2MAN_TRUE@man_MANS = alsaucm.1
+alsaucm_SOURCES = usecase.c dump.c
+noinst_HEADERS = usecase.h
+AM_CPPFLAGS = \
+         -Wall -I$(top_srcdir)/include
+
+EXTRA_DIST = alsaucm.rst
+CLEANFILES = alsaucm.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -254,14 +406,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign alsaucm/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign alsaucm/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -281,10 +432,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -295,8 +448,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -305,16 +458,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 alsaucm$(EXEEXT): $(alsaucm_OBJECTS) $(alsaucm_DEPENDENCIES) $(EXTRA_alsaucm_DEPENDENCIES) 
        @rm -f alsaucm$(EXEEXT)
-       $(LINK) $(alsaucm_OBJECTS) $(alsaucm_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(alsaucm_OBJECTS) $(alsaucm_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -322,42 +483,97 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usecase.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usecase.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man1: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man1dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.1[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -369,15 +585,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -386,9 +598,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -404,7 +617,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -436,9 +652,9 @@ distdir: $(DISTFILES)
        done
 check-am: all-am
 check: check-am
-all-am: Makefile $(PROGRAMS)
+all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(bindir)"; do \
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
@@ -463,6 +679,7 @@ install-strip:
 mostlyclean-generic:
 
 clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -473,10 +690,11 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/dump.Po
+       -rm -f ./$(DEPDIR)/usecase.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -493,7 +711,7 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-man
 
 install-dvi: install-dvi-am
 
@@ -509,7 +727,7 @@ install-info: install-info-am
 
 install-info-am:
 
-install-man:
+install-man: install-man1
 
 install-pdf: install-pdf-am
 
@@ -522,13 +740,15 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/dump.Po
+       -rm -f ./$(DEPDIR)/usecase.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -538,23 +758,32 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+
+uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
-       install-info install-info-am install-man install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
-       uninstall-am uninstall-binPROGRAMS
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
+
 
+%.1: %.rst
+       rst2man $< > $@
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/alsaucm/alsaucm.rst b/alsaucm/alsaucm.rst
new file mode 100644 (file)
index 0000000..c4fe88d
--- /dev/null
@@ -0,0 +1,235 @@
+=========
+ alsaucm
+=========
+
+---------------------
+ALSA Use Case Manager
+---------------------
+
+:Author: Antonio Ospite <ao2@ao2.it>
+:Date:   2016-09-22
+:Copyright: GPLv2+
+:Manual section: 1
+:Manual group: General Commands Manual
+
+SYNOPSIS
+========
+
+*alsaucm* <options> [command]
+
+DESCRIPTION
+===========
+
+alsaucm (ALSA Use Case Manager) is a program to use the ALSA `Use Case
+Interface`_ from the command line.
+
+On complex sound cards, setting up audio routes is not trivial and mixer
+settings can conflict one another preventing the audio card to work at all.
+
+The ALSA Use Case Manager is a mechanism for controlling complex audio
+hardware establishing a relationship between hardware configurations and
+meaningful use cases that the end-user can relate with.
+
+The use case manager can also be used to switch between use cases when
+necessary, in a consistent way.
+
+At a lower level, the use case manager works by configuring the sound card
+ALSA kcontrols to change the hardware digital and analog audio routing to
+match the requested device use case.
+
+The use case manager kcontrol configurations are stored in easy to modify text
+files. An audio use case can be defined by a **verb** and **device** parameter.
+
+The verb describes the use case action i.e. a phone call, listening to music,
+recording a conversation etc. The device describes the physical audio capture
+and playback hardware i.e. headphones, phone handset, bluetooth headset, etc.
+
+
+OPTIONS
+=======
+
+Available options:
+
+  **-h**, **--help**
+    this help
+
+  **-c**, **--card** `NAME`
+    open card NAME
+
+  **-i**, **--interactive**
+    interactive mode
+
+  **-b**, **--batch** `FILE`
+    batch mode (use ``'-'`` for the stdin input)
+
+  **-n**, **--no-open**
+    do not open first card found
+
+
+Available commands:
+
+  ``open`` `NAME`
+    open card NAME.
+
+    valid names are sound card names as listed in ``/usr/share/alsa/ucm``.
+
+  ``reset``
+    reset sound card to default state.
+
+  ``reload``
+    reload configuration.
+
+  ``listcards``
+    list available cards.
+
+  ``list`` `IDENTIFIER`
+    list command, for items returning two entries (value+comment).
+
+    the value of the `IDENTIFIER` argument can be:
+
+    - ``_verbs`` - get verb list (in pair verb+comment)
+    - ``_devices[/{verb}]`` - get list of supported devices (in pair device+comment)
+    - ``_modifiers[/{verb}]`` - get list of supported modifiers (in pair modifier+comment)
+
+    The forms without the trailing ``/{verb}`` are valid only after a specific
+    verb has been set.
+
+  ``list1`` `IDENTIFIER`
+    list command, for lists returning one item per entry.
+
+    the value of the `IDENTIFIER` argument can vary depending on the context,
+    it can be:
+
+    - ``TQ[/{verb}]`` - get list of Tone Quality identifiers
+    - ``_enadevs`` - get list of enabled devices
+    - ``_enamods`` - get list of enabled modifiers
+    - ``_supporteddevs/{modifier}|{device}[/{verb}]`` - list of supported devices
+    - ``_conflictingdevs/{modifier}|{device}[/{verb}]`` - list of conflicting devices
+
+  ``get`` `IDENTIFIER`
+    get string value.
+
+    the value of the `IDENTIFIER` argument can be:
+
+    - ``_verb`` - return current verb
+    - ``[=]{NAME}[/[{modifier}|{/device}][/{verb}]]`` (For valid NAMEs look at the
+      ALSA `Use Case Interface`_)
+
+
+  ``geti`` `IDENTIFIER`
+    get integer value.
+
+    the value of the `IDENTIFIER` argument can be:
+
+    - ``_devstatus/{device}``
+    - ``_modstatus/{device}``
+
+  ``set`` `IDENTIFIER` `VALUE`
+    set string value
+
+    The value of the `IDENTIFIER` argument can be:
+
+    - ``_verb`` - set the verb to `VALUE`
+    - ``_enadev`` - enable the device specified by `VALUE`
+    - ``_disdev`` - disable the device specified by `VALUE`
+    - ``_swdev/{old_device}`` - switche device:
+
+      - disable `old_device` and then enable the device specified by
+        `VALUE`
+      - if no device was enabled just return
+
+    - ``_enamod`` - enable the modifier specified by `VALUE`
+    - ``_dismod`` - disable the modifier specified by `VALUE`
+    - ``_swmod/{old_modifier}`` - switch modifier:
+
+      - disable `old_modifier` and then enable the modifier specified by
+        `VALUE`
+      - if no modifier was enabled just return
+
+    Note that the identifiers referring to devices and modifiers are valid
+    only after setting a verb.
+
+  ``h``, ``help``
+    help
+
+  ``q``, ``quit``
+    quit
+
+
+FILES
+=====
+
+The master use case files for each supported sound card are in ``/usr/share/alsa/ucm``.
+
+For example, the master use case file for the `Pandaboard` card is in
+``/usr/share/alsa/ucm/PandaBoard/PandaBoard.conf``, this file lists all the
+supported use cases, e.g.
+
+::
+
+  SectionUseCase."HiFi" {
+                  File "hifi"
+                  Comment "Play HiFi quality Music."
+  }
+  ...
+
+
+Each use case defines a _verb, which is described in the file specified in
+the ``File`` directive, like above.
+
+The ``HiFi`` verb above is described in
+``/usr/share/alsa/ucm/PandaBoard/hifi``.
+
+For more details on the syntax of UCM files, see the alsa-lib source code:
+http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/ucm/parser.c
+
+
+EXAMPLES OF USE
+===============
+
+Some commands, like for instance ``list _devices``,
+can only work after setting a ``_verb`` in the **same execution**, for
+instance this sequence doesn't work:
+
+::
+
+  # alsaucm -c bytcr-rt5640 set _verb HiFi
+  # alsaucm -c bytcr-rt5640 list _devices
+
+
+However this command does:
+
+::
+
+  # alsaucm -n -b - <<EOM
+  open bytcr-rt5640
+  set _verb HiFi
+  list _devices
+  EOM
+
+
+An example of setting the `Speaker` device for the `HiFi` verb of the
+`bytcr-rt5640` card:
+
+::
+
+  # alsaucm -n -b - <<EOM
+  open bytcr-rt5640
+  reset
+  set _verb HiFi
+  set _enadev Speaker
+  EOM
+
+
+
+SEE ALSO
+========
+
+* Use Case Interface: http://www.alsa-project.org/alsa-doc/alsa-lib/group__ucm.html
+
+.. _Use Case Interface: http://www.alsa-project.org/alsa-doc/alsa-lib/group__ucm.html
+
+BUGS
+====
+
+None known.
diff --git a/alsaucm/dump.c b/alsaucm/dump.c
new file mode 100644 (file)
index 0000000..a5c57f2
--- /dev/null
@@ -0,0 +1,650 @@
+/*
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Copyright (C) 2019 Red Hat Inc.
+ *  Authors: Jaroslav Kysela <perex@perex.cz>
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <alsa/asoundlib.h>
+#include <alsa/use-case.h>
+#include "usecase.h"
+#include "aconfig.h"
+#include "version.h"
+
+struct renderer {
+       int (*init)(struct renderer *r);
+       void (*done)(struct renderer *r);
+       int (*verb_begin)(struct renderer *r,
+                         const char *verb,
+                         const char *comment);
+       int (*verb_end)(struct renderer *r);
+       int (*device_block_begin)(struct renderer *r);
+       int (*device_block_end)(struct renderer *r);
+       int (*device_begin)(struct renderer *r,
+                           const char *device,
+                           const char *comment);
+       int (*device_end)(struct renderer *r);
+       int (*modifier_block_begin)(struct renderer *r);
+       int (*modifier_block_end)(struct renderer *r);
+       int (*modifier_begin)(struct renderer *r,
+                             const char *device,
+                             const char *comment);
+       int (*modifier_end)(struct renderer *r);
+       int (*supported_begin)(struct renderer *r);
+       int (*supported_value)(struct renderer *r, const char *value, int last);
+       int (*supported_end)(struct renderer *r);
+       int (*conflict_begin)(struct renderer *r);
+       int (*conflict_value)(struct renderer *r, const char *value, int last);
+       int (*conflict_end)(struct renderer *r);
+       int (*value_begin)(struct renderer *r);
+       int (*value_end)(struct renderer *r);
+       int (*value)(struct renderer *r, const char *ident, const char *value);
+       void *opaque;
+};
+
+/*
+ * Text renderer
+ */
+
+struct text {
+       char a[1];
+};
+
+static char *tesc(const char *s, char *buf, size_t buf_len)
+{
+       char *dst = buf;
+       char c = '\0';
+       if (strchr(s, '"') || strchr(s, ' ') || strchr(s, '.')) {
+               *dst++ = c = '"';
+               buf_len--;
+       }
+       while (*s && buf_len > 2) {
+               if (*s == '"') {
+                       if (buf_len > 3) {
+                               *dst++ = '\\';
+                               *dst++ = *s++;
+                               buf_len -= 2;
+                               continue;
+                       } else {
+                               break;
+                       }
+               }
+               *dst++ = *s++;
+       }
+       if (c)
+               *dst++ = c;
+       *dst = '\0';
+       return buf;
+}
+
+#define ESC(s, esc) tesc((s), (esc), sizeof(esc))
+
+static int text_verb_start(struct renderer *r ATTRIBUTE_UNUSED,
+                          const char *verb, const char *comment)
+{
+       char buf1[128], buf2[128];
+       printf("Verb.%s {\n", ESC(verb, buf1));
+       if (comment && comment[0])
+               printf("\tComment %s\n", ESC(comment, buf2));
+       return 0;
+}
+
+static int text_verb_end(struct renderer *r ATTRIBUTE_UNUSED)
+{
+       printf("}\n");
+       return 0;
+}
+
+static int text_2nd_level_begin(struct renderer *r ATTRIBUTE_UNUSED,
+                               const char *key,
+                               const char *val,
+                               const char *comment)
+{
+       char buf1[128], buf2[128];
+       printf("\t%s.%s {\n", key, ESC(val, buf1));
+       if (comment && comment[0])
+               printf("\t\tComment %s\n", ESC(comment, buf2));
+       return 0;
+}
+
+static int text_2nd_level_end(struct renderer *r ATTRIBUTE_UNUSED)
+{
+       printf("\t}\n");
+       return 0;
+}
+
+static int text_2nd_level(struct renderer *r ATTRIBUTE_UNUSED, const char *txt)
+{
+       printf("\t\t%s", txt);
+       return 0;
+}
+
+static int text_3rd_level(struct renderer *r ATTRIBUTE_UNUSED, const char *txt)
+{
+       printf("\t\t\t%s", txt);
+       return 0;
+}
+
+static int text_dev_start(struct renderer *r, const char *dev, const char *comment)
+{
+       return text_2nd_level_begin(r, "Device", dev, comment);
+}
+
+static int text_mod_start(struct renderer *r, const char *dev, const char *comment)
+{
+       return text_2nd_level_begin(r, "Modifier", dev, comment);
+}
+
+static int text_supcon_start(struct renderer *r, const char *key)
+{
+       if (text_2nd_level(r, key))
+               return 1;
+       printf(" [\n");
+       return 0;
+}
+
+static int text_supcon_value(struct renderer *r, const char *value, int last)
+{
+       char buf[256];
+       ESC(value, buf);
+       if (!last && strlen(buf) < sizeof(buf) - 2)
+               strcat(buf, ",");
+       if (text_3rd_level(r, buf))
+               return 1;
+       printf("\n");
+       return 0;
+}
+
+static int text_supcon_end(struct renderer *r)
+{
+       return text_2nd_level(r, "]\n");
+}
+
+static int text_sup_start(struct renderer *r)
+{
+       return text_supcon_start(r, "SupportedDevices");
+}
+
+static int text_con_start(struct renderer *r)
+{
+       return text_supcon_start(r, "ConflictingDevices");
+}
+
+static int text_value_begin(struct renderer *r)
+{
+       return text_2nd_level(r, "Values {\n");
+}
+
+static int text_value_end(struct renderer *r)
+{
+       return text_2nd_level(r, "}\n");
+}
+
+static int text_value(struct renderer *r, const char *ident, const char *value)
+{
+       char buf1[256], buf2[256];
+       int err;
+
+       ESC(ident, buf1);
+       err = text_3rd_level(r, buf1);
+       if (err < 0)
+               return err;
+       ESC(value, buf2);
+       printf(" %s\n", buf2);
+       return 0;
+}
+
+static struct renderer text_renderer = {
+       .verb_begin = text_verb_start,
+       .verb_end = text_verb_end,
+       .device_begin = text_dev_start,
+       .device_end = text_2nd_level_end,
+       .modifier_begin = text_mod_start,
+       .modifier_end = text_2nd_level_end,
+       .supported_begin = text_sup_start,
+       .supported_value = text_supcon_value,
+       .supported_end = text_supcon_end,
+       .conflict_begin = text_con_start,
+       .conflict_value = text_supcon_value,
+       .conflict_end = text_supcon_end,
+       .value_begin = text_value_begin,
+       .value_end = text_value_end,
+       .value = text_value,
+};
+
+/*
+ * JSON renderer
+ */
+
+struct json {
+       int block[5];
+};
+
+static char *jesc(const char *s, char *buf, size_t buf_len)
+{
+       char *dst = buf;
+       char c = '"';
+       *dst++ = c;
+       buf_len--;
+       while (*s && buf_len > 2) {
+               if (*s == '"') {
+                       if (buf_len > 3) {
+                               *dst++ = '\\';
+                               *dst++ = *s++;
+                               buf_len -= 2;
+                               continue;
+                       } else {
+                               break;
+                       }
+               }
+               *dst++ = *s++;
+       }
+       *dst++ = c;
+       *dst = '\0';
+       return buf;
+}
+
+#define JESC(s, esc) jesc((s), (esc), sizeof(esc))
+
+static void json_block(struct renderer *r, int level, int last)
+{
+       struct json *j = r->opaque;
+       printf((j->block[level] && !last) ? ",\n" : "\n");
+       j->block[level] = last ? 0 : 1;
+}
+
+static int json_init(struct renderer *r ATTRIBUTE_UNUSED)
+{
+       printf("{\n  \"Verbs\": {");
+       return 0;
+}
+
+static void json_done(struct renderer *r)
+{
+       json_block(r, 0, 1);
+       printf("  }\n}\n");
+}
+
+static int json_verb_start(struct renderer *r, const char *verb, const char *comment)
+{
+       char buf[256];
+       json_block(r, 0, 0);
+       printf("    %s: {", JESC(verb, buf));
+       if (comment && comment[0]) {
+               json_block(r, 1, 0);
+               printf("      \"Comment\": %s", JESC(comment, buf));
+       }
+       return 0;
+}
+
+static int json_verb_end(struct renderer *r)
+{
+       json_block(r, 1, 1);
+       printf("    }");
+       return 0;
+}
+
+static int json_2nd_level_block_end(struct renderer *r)
+{
+       json_block(r, 2, 1);
+       printf("      }");
+       return 0;
+}
+
+static int json_2nd_level_begin(struct renderer *r,
+                               const char *val,
+                               const char *comment)
+{
+       char buf[256];
+       json_block(r, 2, 0);
+       printf("        %s: {", JESC(val, buf));
+       if (comment && comment[0]) {
+               json_block(r, 3, 0);
+               printf("          \"Comment\": %s", JESC(comment, buf));
+       }
+       return 0;
+}
+
+static int json_2nd_level_end(struct renderer *r)
+{
+       json_block(r, 3, 1);
+       printf("        }");
+       return 0;
+}
+
+static int json_2nd_level(struct renderer *r ATTRIBUTE_UNUSED, const char *txt)
+{
+       printf("          %s", txt);
+       return 0;
+}
+
+static int json_3rd_level(struct renderer *r ATTRIBUTE_UNUSED, const char *txt)
+{
+       printf("            %s", txt);
+       return 0;
+}
+
+static int json_dev_block_start(struct renderer *r)
+{
+       json_block(r, 1, 0);
+       printf("      \"Devices\": {");
+       return 0;
+}
+
+static int json_mod_block_start(struct renderer *r)
+{
+       json_block(r, 1, 0);
+       printf("      \"Modifiers\": {");
+       return 0;
+}
+
+static int json_supcon_start(struct renderer *r, const char *key)
+{
+       json_block(r, 3, 0);
+       if (json_2nd_level(r, key))
+               return 1;
+       printf(": [");
+       return 0;
+}
+
+static int json_supcon_value(struct renderer *r, const char *value,
+                            int last ATTRIBUTE_UNUSED)
+{
+       char buf[256];
+       JESC(value, buf);
+       json_block(r, 4, 0);
+       return json_3rd_level(r, buf);
+}
+
+static int json_supcon_end(struct renderer *r)
+{
+       json_block(r, 4, 1);
+       return json_2nd_level(r, "]");
+}
+
+static int json_sup_start(struct renderer *r)
+{
+       return json_supcon_start(r, "\"SupportedDevices\"");
+}
+
+static int json_con_start(struct renderer *r)
+{
+       return json_supcon_start(r, "\"ConflictingDevices\"");
+}
+
+static int json_value_begin(struct renderer *r)
+{
+       json_block(r, 3, 0);
+       return json_2nd_level(r, "\"Values\": {");
+}
+
+static int json_value_end(struct renderer *r)
+{
+       json_block(r, 4, 1);
+       return json_2nd_level(r, "}");
+}
+
+static int json_value(struct renderer *r, const char *ident, const char *value)
+{
+       char buf[256];
+       int err;
+
+       json_block(r, 4, 0);
+       JESC(ident, buf);
+       err = json_3rd_level(r, buf);
+       if (err < 0)
+               return err;
+       JESC(value, buf);
+       printf(": %s", buf);
+       return 0;
+}
+
+static struct renderer json_renderer = {
+       .init = json_init,
+       .done = json_done,
+       .verb_begin = json_verb_start,
+       .verb_end = json_verb_end,
+       .device_block_begin = json_dev_block_start,
+       .device_block_end = json_2nd_level_block_end,
+       .device_begin = json_2nd_level_begin,
+       .device_end = json_2nd_level_end,
+       .modifier_block_begin = json_mod_block_start,
+       .modifier_block_end = json_2nd_level_block_end,
+       .modifier_begin = json_2nd_level_begin,
+       .modifier_end = json_2nd_level_end,
+       .supported_begin = json_sup_start,
+       .supported_value = json_supcon_value,
+       .supported_end = json_supcon_end,
+       .conflict_begin = json_con_start,
+       .conflict_value = json_supcon_value,
+       .conflict_end = json_supcon_end,
+       .value_begin = json_value_begin,
+       .value_end = json_value_end,
+       .value = json_value,
+};
+
+/*
+ * universal dump functions
+ */
+
+static int render_devlist(struct context *context,
+                         struct renderer *render,
+                         const char *verb,
+                         const char *device,
+                         const char *list,
+                         int (*begin)(struct renderer *),
+                         int (*value)(struct renderer *, const char *value, int last),
+                         int (*end)(struct renderer *))
+{
+       snd_use_case_mgr_t *uc_mgr = context->uc_mgr;
+       const char **dev_list;
+       char buf[256];
+       int err = 0, j, dev_num;
+
+       snprintf(buf, sizeof(buf), "%s/%s/%s", list, device, verb);
+       dev_num = snd_use_case_get_list(uc_mgr, buf, &dev_list);
+       if (dev_num < 0) {
+               fprintf(stderr, "%s: unable to get %s for verb '%s' for device '%s'\n",
+                       context->command, list, verb, device);
+               return dev_num;
+       }
+       if (dev_num > 0) {
+               err = begin(render);
+               if (err < 0)
+                       goto __err;
+               for (j = 0; j < dev_num; j++) {
+                       err = value(render, dev_list[j], j + 1 == dev_num);
+                       if (err < 0)
+                               goto __err;
+               }
+               err = end(render);
+       }
+__err:
+       snd_use_case_free_list(dev_list, dev_num);
+       return err;
+}
+
+static int render_values(struct context *context,
+                        struct renderer *render,
+                        const char *verb,
+                        const char *device)
+{
+       snd_use_case_mgr_t *uc_mgr = context->uc_mgr;
+       const char **list, *value;
+       char buf[256];
+       int err = 0, j, num;
+
+       snprintf(buf, sizeof(buf), "_identifiers/%s/%s", device, verb);
+       num = snd_use_case_get_list(uc_mgr, buf, &list);
+       if (num < 0) {
+               fprintf(stderr, "%s: unable to get _identifiers for verb '%s' for device '%s': %s\n",
+                       context->command, verb, device, snd_strerror(num));
+               return num;
+       }
+       if (num == 0)
+               goto __err;
+       if (render->value_begin) {
+               err = render->value_begin(render);
+               if (err < 0)
+                       goto __err;
+       }
+       for (j = 0; j < num; j++) {
+               snprintf(buf, sizeof(buf), "%s/%s/%s", list[j], device, verb);
+               err = snd_use_case_get(uc_mgr, buf, &value);
+               if (err < 0) {
+                       fprintf(stderr, "%s: unable to get value '%s' for verb '%s' for device '%s': %s\n",
+                               context->command, list[j], verb, device, snd_strerror(err));
+                       goto __err;
+               }
+               err = render->value(render, list[j], value);
+               free((char *)value);
+               if (err < 0)
+                       goto __err;
+       }
+       if (render->value_end)
+               err = render->value_end(render);
+__err:
+       snd_use_case_free_list(list, num);
+       return err;
+}
+
+static int render_device(struct context *context,
+                        struct renderer *render,
+                        const char *verb,
+                        const char *device)
+{
+       int err;
+
+       err = render_devlist(context, render, verb, device,
+                            "_supporteddevs",
+                            render->supported_begin,
+                            render->supported_value,
+                            render->supported_end);
+       if (err < 0)
+               return err;
+       err = render_devlist(context, render, verb, device,
+                            "_conflictingdevs",
+                            render->conflict_begin,
+                            render->conflict_value,
+                            render->conflict_end);
+       if (err < 0)
+               return err;
+       return render_values(context, render, verb, device);
+}
+
+static void render(struct context *context, struct renderer *render)
+{
+       snd_use_case_mgr_t *uc_mgr = context->uc_mgr;
+       int i, j, num, dev_num;
+       const char **list, **dev_list, *verb, *comment;
+       char buf[256];
+
+       num = snd_use_case_verb_list(uc_mgr, &list);
+       if (num < 0) {
+               fprintf(stderr, "%s: no verbs found\n", context->command);
+               return;
+       }
+       if (render->init && render->init(render))
+               goto __end;
+       for (i = 0; i < num; i += 2) {
+               /* verb */
+               verb = list[i + 0];
+               comment = list[i + 1];
+               if (render->verb_begin(render, verb, comment))
+                       break;
+               /* devices */
+               snprintf(buf, sizeof(buf), "_devices/%s", verb);
+               dev_num = snd_use_case_get_list(uc_mgr, buf, &dev_list);
+               if (dev_num < 0) {
+                       fprintf(stderr, "%s: unable to get devices for verb '%s'\n",
+                                                       context->command, verb);
+                       continue;
+               }
+               if (dev_num == 0)
+                       goto __mods;
+               if (render->device_block_begin && render->device_block_begin(render)) {
+                       snd_use_case_free_list(dev_list, dev_num);
+                       goto __end;
+               }
+               for (j = 0; j < dev_num; j += 2) {
+                       render->device_begin(render, dev_list[j + 0], dev_list[j + 1]);
+                       if (render_device(context, render, verb, dev_list[j + 0])) {
+                               snd_use_case_free_list(dev_list, dev_num);
+                               goto __end;
+                       }
+                       render->device_end(render);
+               }
+               snd_use_case_free_list(dev_list, dev_num);
+               if (render->device_block_end && render->device_block_end(render))
+                       goto __end;
+__mods:
+               /* modifiers */
+               snprintf(buf, sizeof(buf), "_modifiers/%s", verb);
+               dev_num = snd_use_case_get_list(uc_mgr, buf, &dev_list);
+               if (dev_num < 0) {
+                       fprintf(stderr, "%s: unable to get modifiers for verb '%s'\n",
+                                                       context->command, verb);
+                       continue;
+               }
+               if (dev_num == 0)
+                       goto __verb_end;
+               if (render->modifier_block_begin && render->modifier_block_begin(render)) {
+                       snd_use_case_free_list(dev_list, dev_num);
+                       goto __end;
+               }
+               for (j = 0; j < dev_num; j += 2) {
+                       render->modifier_begin(render, dev_list[j + 0], dev_list[j + 1]);
+                       render->modifier_end(render);
+               }
+               snd_use_case_free_list(dev_list, dev_num);
+               if (render->modifier_block_end && render->modifier_block_end(render))
+                       goto __end;
+__verb_end:
+               /* end */
+               if (render->verb_end(render))
+                       break;
+       }
+       if (render->done)
+               render->done(render);
+__end:
+       snd_use_case_free_list(list, num);
+}
+
+void dump(struct context *context, const char *format)
+{
+       struct renderer r;
+       struct text t;
+       struct json j;
+
+       r.opaque = NULL;
+       if (strcasecmp(format, "text") == 0 ||
+           strcasecmp(format, "txt") == 0) {
+               memset(&t, 0, sizeof(t));
+               r = text_renderer;
+               r.opaque = &t;
+       } else if (strcasecmp(format, "json") == 0) {
+               memset(&j, 0, sizeof(j));
+               r = json_renderer;
+               r.opaque = &j;
+       }
+       if (r.opaque != NULL) {
+               render(context, &r);
+               return;
+       }
+       fprintf(stderr, "%s: unknown dump format '%s'\n",
+                                       context->command, format);
+}
index 1c94680..0aea84c 100644 (file)
 #include <getopt.h>
 #include <alsa/asoundlib.h>
 #include <alsa/use-case.h>
+#include "usecase.h"
 #include "aconfig.h"
 #include "version.h"
 
 #define MAX_BUF 256
 
-struct context {
-       snd_use_case_mgr_t *uc_mgr;
-       const char *command;
-       char *card;
-       char **argv;
-       int argc;
-       int arga;
-       char *batch;
-       unsigned int interactive:1;
-       unsigned int no_open:1;
-       unsigned int do_exit:1;
-};
-
 enum uc_cmd {
        /* management */
        OM_UNKNOWN = 0,
@@ -63,13 +51,16 @@ enum uc_cmd {
        OM_RESET,
        OM_RELOAD,
        OM_LISTCARDS,
+       OM_DUMP,
        OM_LIST2,
        OM_LIST1,
 
        /* set/get */
        OM_SET,
        OM_GET,
+       OM_GET_VAL,
        OM_GETI,
+       OM_GETI_VAL,
 
        /* misc */
        OM_HELP,
@@ -88,11 +79,15 @@ static struct cmd cmds[] = {
        { OM_RESET, 0, 1, "reset" },
        { OM_RELOAD, 0, 1, "reload" },
        { OM_LISTCARDS, 0, 0, "listcards" },
+       { OM_DUMP, 1, 1, "dump" },
        { OM_LIST1, 1, 1, "list1" },
        { OM_LIST2, 1, 1, "list" },
        { OM_SET, 2, 1, "set" },
        { OM_GET, 1, 1, "get" },
+       { OM_GET_VAL, 1, 1, "getval" },
        { OM_GETI, 1, 1, "geti" },
+       { OM_GETI_VAL, 1, 1, "getival" },
+       { OM_DUMP, 1, 1, "dump" },
        { OM_HELP, 0, 0, "help" },
        { OM_QUIT, 0, 0, "quit" },
        { OM_HELP, 0, 0, "h" },
@@ -117,7 +112,9 @@ static void dump_help(struct context *context)
 "  reset                      reset sound card to default state\n"
 "  reload                     reload configuration\n"
 "  listcards                  list available cards\n"
-"  list IDENTIFIER            list command\n"
+"  dump FORMAT                dump all config information (format: text,json)\n"
+"  list IDENTIFIER            list command, for items with value + comment\n"
+"  list1 IDENTIFIER           list command, for items without comments\n"
 "  get IDENTIFIER             get string value\n"
 "  geti IDENTIFIER            get integer value\n"
 "  set IDENTIFIER VALUE       set string value\n"
@@ -126,6 +123,20 @@ static void dump_help(struct context *context)
 );
 }
 
+int is_long(const char *str)
+{
+       char *end;
+       if (!*str)
+               return 0;
+       errno = 0;
+       strtol(str, &end, 10);
+       if (errno)
+               return 0;
+       if (*end)
+               return 0;
+       return 1;
+}
+
 static int parse_line(struct context *context, char *line)
 {
        char *start, **nargv;
@@ -137,6 +148,8 @@ static int parse_line(struct context *context, char *line)
                                                        *line == '\n'))
                        line++;
                c = *line;
+               if (c == '\0')
+                       return 0;
                if (c == '\"' || c == '\'') {
                        start = ++line;
                        while (*line && *line != c)
@@ -170,6 +183,59 @@ static int parse_line(struct context *context, char *line)
        return 0;
 }
 
+static void my_exit(struct context *context, int exitcode)
+{
+       if (context->uc_mgr)
+               snd_use_case_mgr_close(context->uc_mgr);
+       if (context->arga > 0)
+               free(context->argv);
+       if (context->card)
+               free(context->card);
+       if (context->batch)
+               free(context->batch);
+       free(context);
+       snd_config_update_free_global();
+       exit(exitcode);
+}
+static void do_initial_open(struct context *context)
+{
+       int card, err;
+       char name[16];
+
+       if (!context->no_open && context->card == NULL) {
+               card = -1;
+               err = snd_card_next(&card);
+               if (err < 0) {
+                       fprintf(stderr, "%s: no sound card found: %s\n",
+                                       context->command, snd_strerror(err));
+                       my_exit(context, EXIT_FAILURE);
+               }
+               snprintf(name, sizeof(name), "hw:%d", card);
+               context->card = strdup(name);
+       }
+
+       /* open library */
+       if (!context->no_open) {
+               if (is_long(context->card)) {
+                       snprintf(name, sizeof(name), "hw:%s", context->card);
+                       free(context->card);
+                       context->card = strdup(name);
+               }
+               if (context->card == NULL) {
+                       fprintf(stderr, "%s: empty card name\n", context->command);
+                       my_exit(context, EXIT_FAILURE);
+               }
+               err = snd_use_case_mgr_open(&context->uc_mgr,
+                                           context->card);
+               if (err < 0) {
+                       fprintf(stderr,
+                               "%s: error failed to open sound card %s: %s\n",
+                               context->command, context->card, snd_strerror(err));
+                       my_exit(context, EXIT_FAILURE);
+               }
+       }
+}
+
 static int do_one(struct context *context, struct cmd *cmd, char **argv)
 {
        const char **list, *str;
@@ -177,9 +243,14 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
        int err, i, j, entries;
 
        if (cmd->opencard && context->uc_mgr == NULL) {
-               fprintf(stderr, "%s: command '%s' requires an open card\n",
-                               context->command, cmd->id);
-               return 0;
+               if (!context->no_open) {
+                       do_initial_open(context);
+                       context->no_open = 1;
+               } else {
+                       fprintf(stderr, "%s: command '%s' requires an open card\n",
+                                       context->command, cmd->id);
+                       return 0;
+               }
        }
        switch (cmd->code) {
        case OM_OPEN:
@@ -237,6 +308,9 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
                }
                snd_use_case_free_list(list, err);
                break;
+       case OM_DUMP:
+               dump(context, argv[0]);
+               break;
        case OM_LIST1:
        case OM_LIST2:
                switch (cmd->code) {
@@ -281,6 +355,7 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
                }
                break;
        case OM_GET:
+       case OM_GET_VAL:
                err = snd_use_case_get(context->uc_mgr, argv[0], &str);
                if (err < 0) {
                        fprintf(stderr,
@@ -289,10 +364,14 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
                                snd_strerror(err));
                        return err;
                }
-               printf("  %s=%s\n", argv[0], str);
+               if (cmd->code == OM_GET)
+                       printf("  %s=%s\n", argv[0], str);
+               else
+                       printf("%s\n", str);
                free((void *)str);
                break;
        case OM_GETI:
+       case OM_GETI_VAL:
                err = snd_use_case_geti(context->uc_mgr, argv[0], &lval);
                if (err < 0) {
                        fprintf(stderr,
@@ -301,7 +380,10 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
                                snd_strerror(err));
                        return lval;
                }
-               printf("  %s=%li\n", argv[0], lval);
+               if (cmd->code == OM_GETI)
+                       printf("  %s=%li\n", argv[0], lval);
+               else
+                       printf("%li\n", lval);
                break;
        case OM_QUIT:
                context->do_exit = 1;
@@ -349,20 +431,6 @@ static int do_commands(struct context *context)
        return 0;
 }
 
-static void my_exit(struct context *context, int exitcode)
-{
-       if (context->uc_mgr)
-               snd_use_case_mgr_close(context->uc_mgr);
-       if (context->arga > 0)
-               free(context->argv);
-       if (context->card)
-               free(context->card);
-       if (context->batch)
-               free(context->batch);
-       free(context);
-       exit(exitcode);
-}
-
 enum {
        OPT_VERSION = 1,
 };
@@ -381,7 +449,6 @@ int main(int argc, char *argv[])
        };
        struct context *context;
        const char *command = argv[0];
-       const char **list;
        int c, err, option_index;
        char cmd[MAX_BUF];
        FILE *in;
@@ -421,32 +488,6 @@ int main(int argc, char *argv[])
                }
        }
 
-       if (!context->no_open && context->card == NULL) {
-               err = snd_use_case_card_list(&list);
-               if (err < 0) {
-                       fprintf(stderr, "%s: unable to obtain card list: %s\n", command, snd_strerror(err));
-                       my_exit(context, EXIT_FAILURE);
-               }
-               if (err == 0) {
-                       printf("No card found\n");
-                       my_exit(context, EXIT_SUCCESS);
-               }
-               context->card = strdup(list[0]);
-               snd_use_case_free_list(list, err);
-       }
-
-       /* open library */
-       if (!context->no_open) {
-               err = snd_use_case_mgr_open(&context->uc_mgr,
-                                           context->card);
-               if (err < 0) {
-                       fprintf(stderr,
-                               "%s: error failed to open sound card %s: %s\n",
-                               command, context->card, snd_strerror(err));
-                       my_exit(context, EXIT_FAILURE);
-               }
-       }
-
        /* parse and execute any command line commands */
        if (argc > optind) {
                context->argv = argv + optind;
@@ -469,7 +510,7 @@ int main(int argc, char *argv[])
                        in = fopen(context->batch, "r");
                        if (in == NULL) {
                                fprintf(stderr, "%s: error failed to open file '%s': %s\n",
-                                       command, context->batch, strerror(-errno));
+                                       command, context->batch, strerror(errno));
                                my_exit(context, EXIT_FAILURE);
                        }
                }
diff --git a/alsaucm/usecase.h b/alsaucm/usecase.h
new file mode 100644 (file)
index 0000000..a85716a
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __USECASE_H
+#define __USECASE_H
+
+struct context {
+       snd_use_case_mgr_t *uc_mgr;
+       const char *command;
+       char *card;
+       char **argv;
+       int argc;
+       int arga;
+       char *batch;
+       unsigned int interactive:1;
+       unsigned int no_open:1;
+       unsigned int do_exit:1;
+};
+
+void dump(struct context *context, const char *format);
+
+#endif
index 9b056d3..cee027f 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,17 +90,19 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = amidi$(EXEEXT)
 subdir = amidi
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -72,14 +112,45 @@ PROGRAMS = $(bin_PROGRAMS)
 amidi_SOURCES = amidi.c
 amidi_OBJECTS = amidi.$(OBJEXT)
 amidi_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/amidi.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = amidi.c
 DIST_SOURCES = amidi.c
 am__can_run_installinfo = \
@@ -117,15 +188,37 @@ am__uninstall_files_from_dir = { \
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -143,11 +236,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -159,27 +259,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -192,6 +302,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -200,6 +311,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -210,7 +323,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -251,6 +366,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -261,14 +378,14 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 EXTRA_DIST = amidi.1
 man_MANS = amidi.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -281,14 +398,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign amidi/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign amidi/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -308,10 +424,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -322,8 +440,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -332,16 +450,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 amidi$(EXEEXT): $(amidi_OBJECTS) $(amidi_DEPENDENCIES) $(EXTRA_amidi_DEPENDENCIES) 
        @rm -f amidi$(EXEEXT)
-       $(LINK) $(amidi_OBJECTS) $(amidi_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(amidi_OBJECTS) $(amidi_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -349,21 +475,43 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amidi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amidi.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -408,26 +556,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -439,15 +576,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -456,9 +589,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -474,20 +608,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -556,10 +680,10 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/amidi.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -605,13 +729,14 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/amidi.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -627,9 +752,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -637,9 +763,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 1b4cfb1..5bc24ba 100644 (file)
@@ -1,4 +1,4 @@
-.TH AMIDI 1 "26 Jun 2006"
+.TH AMIDI 1 "30 Aug 2016"
 
 .SH NAME
 amidi \- read from and write to ALSA RawMIDI ports
@@ -80,9 +80,11 @@ to record a Standard MIDI (.mid) file, use
 .B arecordmidi(1).
 
 .B amidi
-will filter out any Active Sensing bytes (FEh), unless the
+will filter out any Active Sensing and Clock bytes (FEh, F8h), unless the
 .I \-a
-option has been given.
+or
+.I \-c
+options have been given.
 
 .TP
 .I \-S, \-\-send\-hex="..."
@@ -91,9 +93,11 @@ Sends the bytes specified as hexadecimal numbers to the MIDI port.
 .TP
 .I \-d, \-\-dump
 Prints data received from the MIDI port as hexadecimal bytes.
-Active Sensing bytes (FEh) will not be shown, unless the
+Active Sensing and Clock bytes (FEh, F8h) will not be shown, unless the
 .I \-a
-option has been given.
+or
+.I \-c
+options have been given.
 
 This option is useful for debugging.
 
@@ -111,6 +115,17 @@ to stop receiving data.
 Does not ignore Active Sensing bytes (FEh) when saving or printing
 received MIDI commands.
 
+.TP
+.I \-c, \-\-clock
+Does not ignore Clock bytes (F8h) when saving or printing received
+MIDI commands.
+
+.TP
+.I \-i, \-\-sysex-interval=mseconds
+Adds a delay in between each SysEx message sent to a device. It is
+useful when sending firmware updates via SysEx messages to a remote
+device.
+
 .SH EXAMPLES
 
 .TP
@@ -121,6 +136,14 @@ to port
 .I hw:0.
 
 .TP
+.B amidi \-p hw:1,0,0 -s firmware.syx \-i 100
+will send the MIDI commands in
+.I firmware.syx
+to port
+.I hw:1,0,0
+with 100 milliseconds delay in between each SysEx message.
+
+.TP
 .B amidi \-S 'F0 43 10 4C 00 00 7E 00 F7'
 sends an XG Reset to the default port.
 
index cedf18c..75fb8c0 100644 (file)
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #define _GNU_SOURCE
+#include "aconfig.h"
+#include "version.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <ctype.h>
+#include <math.h>
 #include <getopt.h>
 #include <errno.h>
 #include <signal.h>
+#include <sys/timerfd.h>
 #include <sys/types.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <alsa/asoundlib.h>
-#include "aconfig.h"
-#include "version.h"
+#include <time.h>
 
+#define NSEC_PER_SEC 1000000000L
+
+static int do_print_timestamp = 0;
 static int do_device_list, do_rawmidi_list;
 static char *port_name = "default";
 static char *send_file_name;
@@ -46,8 +52,9 @@ static char *send_data;
 static int send_data_length;
 static int receive_file;
 static int dump;
-static int timeout;
+static float timeout;
 static int stop;
+static int sysex_interval;
 static snd_rawmidi_t *input, **inputp;
 static snd_rawmidi_t *output, **outputp;
 
@@ -66,18 +73,26 @@ static void usage(void)
        printf(
                "Usage: amidi options\n"
                "\n"
-               "-h, --help             this help\n"
-               "-V, --version          print current version\n"
-               "-l, --list-devices     list all hardware ports\n"
-               "-L, --list-rawmidis    list all RawMIDI definitions\n"
-               "-p, --port=name        select port by name\n"
-               "-s, --send=file        send the contents of a (.syx) file\n"
-               "-r, --receive=file     write received data into a file\n"
-               "-S, --send-hex=\"...\"   send hexadecimal bytes\n"
-               "-d, --dump             print received data as hexadecimal bytes\n"
-               "-t, --timeout=seconds  exits when no data has been received\n"
-               "                       for the specified duration\n"
-               "-a, --active-sensing   don't ignore active sensing bytes\n");
+               "-h, --help                      this help\n"
+               "-V, --version                   print current version\n"
+               "-l, --list-devices              list all hardware ports\n"
+               "-L, --list-rawmidis             list all RawMIDI definitions\n"
+               "-p, --port=name                 select port by name\n"
+               "-s, --send=file                 send the contents of a (.syx) file\n"
+               "-r, --receive=file              write received data into a file\n"
+               "-S, --send-hex=\"...\"            send hexadecimal bytes\n"
+               "-d, --dump                      print received data as hexadecimal bytes\n"
+               "-T, --timestamp=...             adds a timestamp in front of each dumped message\n"
+               "                realtime\n"
+               "                monotonic\n"
+#ifdef CLOCK_MONOTONIC_RAW
+               "                raw\n"
+#endif
+               "-t, --timeout=seconds           exits when no data has been received\n"
+               "                                for the specified duration\n"
+               "-a, --active-sensing            include active sensing bytes\n"
+               "-c, --clock                     include clock bytes\n"
+               "-i, --sysex-interval=mseconds   delay in between each SysEx message\n");
 }
 
 static void version(void)
@@ -225,6 +240,47 @@ static void rawmidi_list(void)
        snd_output_close(output);
 }
 
+static int send_midi_interleaved(void)
+{
+       int err;
+       char *data = send_data;
+       size_t buffer_size;
+       snd_rawmidi_params_t *param;
+       snd_rawmidi_status_t *st;
+
+       snd_rawmidi_status_alloca(&st);
+
+       snd_rawmidi_params_alloca(&param);
+       snd_rawmidi_params_current(output, param);
+       buffer_size = snd_rawmidi_params_get_buffer_size(param);
+
+       while (data < (send_data + send_data_length)) {
+               int len = send_data + send_data_length - data;
+               char *temp;
+
+               if (data > send_data) {
+                       snd_rawmidi_status(output, st);
+                       do {
+                               /* 320 µs per byte as noted in Page 1 of MIDI spec */
+                               usleep((buffer_size - snd_rawmidi_status_get_avail(st)) * 320);
+                               snd_rawmidi_status(output, st);
+                       } while(snd_rawmidi_status_get_avail(st) < buffer_size);
+                       usleep(sysex_interval * 1000);
+               }
+
+               /* find end of SysEx */
+               if ((temp = memchr(data, 0xf7, len)) != NULL)
+                       len = temp - data + 1;
+
+               if ((err = snd_rawmidi_write(output, data, len)) < 0)
+                       return err;
+
+               data += len;
+       }
+
+       return 0;
+}
+
 static void load_file(void)
 {
        int fd;
@@ -308,7 +364,7 @@ static void parse_data(void)
 /*
  * prints MIDI commands, formatting them nicely
  */
-static void print_byte(unsigned char byte)
+static void print_byte(unsigned char byte, struct timespec *ts)
 {
        static enum {
                STATE_UNKNOWN,
@@ -378,10 +434,19 @@ static void print_byte(unsigned char byte)
                if (running_status)
                        fputs("\n  ", stdout);
        }
-       printf("%c%02X", newline ? '\n' : ' ', byte);
+
+       putchar(newline ? '\n' : ' ');
+       if (newline && do_print_timestamp) {
+               /* Nanoseconds does not make a lot of sense for serial MIDI (the
+                * 31250 bps one) but I'm not sure about MIDI over USB.
+                */
+               printf("%lld.%.9ld) ", (long long)ts->tv_sec, ts->tv_nsec);
+       }
+
+       printf("%02X", byte);
 }
 
-static void sig_handler(int dummy)
+static void sig_handler(int sig ATTRIBUTE_UNUSED)
 {
        stop = 1;
 }
@@ -406,7 +471,7 @@ static void add_send_hex_data(const char *str)
 
 int main(int argc, char *argv[])
 {
-       static const char short_options[] = "hVlLp:s:r:S::dt:a";
+       static const char short_options[] = "hVlLp:s:r:S::dt:aci:T:";
        static const struct option long_options[] = {
                {"help", 0, NULL, 'h'},
                {"version", 0, NULL, 'V'},
@@ -417,13 +482,19 @@ int main(int argc, char *argv[])
                {"receive", 1, NULL, 'r'},
                {"send-hex", 2, NULL, 'S'},
                {"dump", 0, NULL, 'd'},
+               {"timestamp", 1, NULL, 'T'},
                {"timeout", 1, NULL, 't'},
                {"active-sensing", 0, NULL, 'a'},
-               { }
+               {"clock", 0, NULL, 'c'},
+               {"sysex-interval", 1, NULL, 'i'},
+               {0}
        };
        int c, err, ok = 0;
        int ignore_active_sensing = 1;
+       int ignore_clock = 1;
        int do_send_hex = 0;
+       clockid_t cid = CLOCK_REALTIME;
+       struct itimerspec itimerspec = { .it_interval = { 0, 0 } };
 
        while ((c = getopt_long(argc, argv, short_options,
                                long_options, NULL)) != -1) {
@@ -457,12 +528,34 @@ int main(int argc, char *argv[])
                case 'd':
                        dump = 1;
                        break;
+               case 'T':
+                       do_print_timestamp = 1;
+                       if (optarg == NULL)
+                               error("Clock type missing");
+                       else if (strcasecmp(optarg, "realtime") == 0)
+                               cid = CLOCK_REALTIME;
+                       else if (strcasecmp(optarg, "monotonic") == 0)
+                               cid = CLOCK_MONOTONIC;
+#ifdef CLOCK_MONOTONIC_RAW
+                       else if (strcasecmp(optarg, "raw") == 0)
+                               cid = CLOCK_MONOTONIC_RAW;
+#endif
+                       else
+                               error("Clock type not known");
+                       break;
                case 't':
-                       timeout = atoi(optarg);
+                       if (optarg)
+                               timeout = atof(optarg);
                        break;
                case 'a':
                        ignore_active_sensing = 0;
                        break;
+               case 'c':
+                       ignore_clock = 0;
+                       break;
+               case 'i':
+                       sysex_interval = atoi(optarg);
+                       break;
                default:
                        error("Try `amidi --help' for more information.");
                        return 1;
@@ -538,48 +631,86 @@ int main(int argc, char *argv[])
                        error("cannot set blocking mode: %s", snd_strerror(err));
                        goto _exit;
                }
-               if ((err = snd_rawmidi_write(output, send_data, send_data_length)) < 0) {
-                       error("cannot send data: %s", snd_strerror(err));
-                       goto _exit;
+               if (!sysex_interval) {
+                       if ((err = snd_rawmidi_write(output, send_data, send_data_length)) < 0) {
+                               error("cannot send data: %s", snd_strerror(err));
+                               return err;
+                       }
+               } else {
+                       if ((err = send_midi_interleaved()) < 0) {
+                               error("cannot send data: %s", snd_strerror(err));
+                               return err;
+                       }
                }
        }
 
        if (inputp) {
                int read = 0;
-               int npfds, time = 0;
+               int npfds;
                struct pollfd *pfds;
 
-               timeout *= 1000;
-               npfds = snd_rawmidi_poll_descriptors_count(input);
+               npfds = 1 + snd_rawmidi_poll_descriptors_count(input);
                pfds = alloca(npfds * sizeof(struct pollfd));
-               snd_rawmidi_poll_descriptors(input, pfds, npfds);
+
+               if (timeout > 0) {
+                       pfds[0].fd = timerfd_create(CLOCK_MONOTONIC, 0);
+                       if (pfds[0].fd == -1) {
+                               error("cannot create timer: %s", strerror(errno));
+                               goto _exit;
+                       }
+                       pfds[0].events = POLLIN;
+               } else {
+                       pfds[0].fd = -1;
+               }
+
+               snd_rawmidi_poll_descriptors(input, &pfds[1], npfds - 1);
+
                signal(SIGINT, sig_handler);
+
+               if (timeout > 0) {
+                       float timeout_int;
+
+                       itimerspec.it_value.tv_nsec = modff(timeout, &timeout_int) * NSEC_PER_SEC;
+                       itimerspec.it_value.tv_sec = timeout_int;
+                       err = timerfd_settime(pfds[0].fd, 0, &itimerspec, NULL);
+                       if (err < 0) {
+                               error("cannot set timer: %s", strerror(errno));
+                               goto _exit;
+                       }
+               }
+
                for (;;) {
                        unsigned char buf[256];
                        int i, length;
                        unsigned short revents;
+                       struct timespec ts;
 
-                       err = poll(pfds, npfds, 200);
+                       err = poll(pfds, npfds, -1);
                        if (stop || (err < 0 && errno == EINTR))
                                break;
                        if (err < 0) {
                                error("poll failed: %s", strerror(errno));
                                break;
                        }
-                       if (err == 0) {
-                               time += 200;
-                               if (timeout && time >= timeout)
-                                       break;
-                               continue;
+
+                       if (clock_gettime(cid, &ts) < 0) {
+                               error("clock_getres (%d) failed: %s", cid, strerror(errno));
+                               break;
                        }
-                       if ((err = snd_rawmidi_poll_descriptors_revents(input, pfds, npfds, &revents)) < 0) {
+
+                       err = snd_rawmidi_poll_descriptors_revents(input, &pfds[1], npfds - 1, &revents);
+                       if (err < 0) {
                                error("cannot get poll events: %s", snd_strerror(errno));
                                break;
                        }
                        if (revents & (POLLERR | POLLHUP))
                                break;
-                       if (!(revents & POLLIN))
+                       if (!(revents & POLLIN)) {
+                               if (pfds[0].revents & POLLIN)
+                                       break;
                                continue;
+                       }
+
                        err = snd_rawmidi_read(input, buf, sizeof(buf));
                        if (err == -EAGAIN)
                                continue;
@@ -589,19 +720,31 @@ int main(int argc, char *argv[])
                        }
                        length = 0;
                        for (i = 0; i < err; ++i)
-                               if (!ignore_active_sensing || buf[i] != 0xfe)
+                               if ((buf[i] != MIDI_CMD_COMMON_CLOCK &&
+                                    buf[i] != MIDI_CMD_COMMON_SENSING) ||
+                                   (buf[i] == MIDI_CMD_COMMON_CLOCK   && !ignore_clock) ||
+                                   (buf[i] == MIDI_CMD_COMMON_SENSING && !ignore_active_sensing))
                                        buf[length++] = buf[i];
                        if (length == 0)
                                continue;
                        read += length;
-                       time = 0;
+
                        if (receive_file != -1)
                                write(receive_file, buf, length);
                        if (dump) {
                                for (i = 0; i < length; ++i)
-                                       print_byte(buf[i]);
+                                       print_byte(buf[i], &ts);
+
                                fflush(stdout);
                        }
+
+                       if (timeout > 0) {
+                               err = timerfd_settime(pfds[0].fd, 0, &itimerspec, NULL);
+                               if (err < 0) {
+                                       error("cannot set timer: %s", strerror(errno));
+                                       break;
+                               }
+                       }
                }
                if (isatty(fileno(stdout)))
                        printf("\n%d bytes read\n", read);
index 0343c8e..46ec736 100644 (file)
@@ -1,10 +1,11 @@
+AM_CFLAGS = -D_GNU_SOURCE
 AM_CPPFLAGS = -I$(top_srcdir)/include
 LDADD = -lm
 # LDFLAGS = -static
 # CFLAGS += -g -Wall
 
 bin_PROGRAMS = amixer
-amixer_SOURCES = amixer.c ../alsamixer/volume_mapping.c
-noinst_HEADERS = amixer.h
+amixer_SOURCES = amixer.c volume_mapping.c
+noinst_HEADERS = amixer.h volume_mapping.h
 man_MANS = amixer.1
 EXTRA_DIST = amixer.1
index 2474264..e852611 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -53,17 +91,20 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = amixer$(EXEEXT)
 subdir = amixer
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -74,14 +115,46 @@ am_amixer_OBJECTS = amixer.$(OBJEXT) volume_mapping.$(OBJEXT)
 amixer_OBJECTS = $(am_amixer_OBJECTS)
 amixer_LDADD = $(LDADD)
 amixer_DEPENDENCIES =
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/amixer.Po \
+       ./$(DEPDIR)/volume_mapping.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(amixer_SOURCES)
 DIST_SOURCES = $(amixer_SOURCES)
 am__can_run_installinfo = \
@@ -120,15 +193,37 @@ man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
 HEADERS = $(noinst_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -146,11 +241,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -162,27 +264,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -195,6 +307,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -203,6 +316,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -213,7 +328,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -254,6 +371,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -264,17 +383,18 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
+AM_CFLAGS = -D_GNU_SOURCE
 AM_CPPFLAGS = -I$(top_srcdir)/include
 LDADD = -lm
-amixer_SOURCES = amixer.c ../alsamixer/volume_mapping.c
-noinst_HEADERS = amixer.h
+amixer_SOURCES = amixer.c volume_mapping.c
+noinst_HEADERS = amixer.h volume_mapping.h
 man_MANS = amixer.1
 EXTRA_DIST = amixer.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -287,14 +407,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign amixer/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign amixer/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -314,10 +433,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -328,8 +449,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -338,16 +459,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 amixer$(EXEEXT): $(amixer_OBJECTS) $(amixer_DEPENDENCIES) $(EXTRA_amixer_DEPENDENCIES) 
        @rm -f amixer$(EXEEXT)
-       $(LINK) $(amixer_OBJECTS) $(amixer_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(amixer_OBJECTS) $(amixer_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -355,36 +484,44 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amixer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/volume_mapping.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amixer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/volume_mapping.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
-volume_mapping.o: ../alsamixer/volume_mapping.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT volume_mapping.o -MD -MP -MF $(DEPDIR)/volume_mapping.Tpo -c -o volume_mapping.o `test -f '../alsamixer/volume_mapping.c' || echo '$(srcdir)/'`../alsamixer/volume_mapping.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/volume_mapping.Tpo $(DEPDIR)/volume_mapping.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='../alsamixer/volume_mapping.c' object='volume_mapping.o' libtool=no @AMDEPBACKSLASH@
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o volume_mapping.o `test -f '../alsamixer/volume_mapping.c' || echo '$(srcdir)/'`../alsamixer/volume_mapping.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
-volume_mapping.obj: ../alsamixer/volume_mapping.c
-@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT volume_mapping.obj -MD -MP -MF $(DEPDIR)/volume_mapping.Tpo -c -o volume_mapping.obj `if test -f '../alsamixer/volume_mapping.c'; then $(CYGPATH_W) '../alsamixer/volume_mapping.c'; else $(CYGPATH_W) '$(srcdir)/../alsamixer/volume_mapping.c'; fi`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/volume_mapping.Tpo $(DEPDIR)/volume_mapping.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='../alsamixer/volume_mapping.c' object='volume_mapping.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o volume_mapping.obj `if test -f '../alsamixer/volume_mapping.c'; then $(CYGPATH_W) '../alsamixer/volume_mapping.c'; else $(CYGPATH_W) '$(srcdir)/../alsamixer/volume_mapping.c'; fi`
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -429,26 +566,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -460,15 +586,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -477,9 +599,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -495,20 +618,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -577,10 +690,11 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/amixer.Po
+       -rm -f ./$(DEPDIR)/volume_mapping.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -626,13 +740,15 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/amixer.Po
+       -rm -f ./$(DEPDIR)/volume_mapping.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -648,9 +764,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -658,9 +775,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 76007d2..8860ae1 100644 (file)
@@ -44,11 +44,12 @@ value, respectively.
 The parameters \fIcap, nocap, mute, unmute, toggle\fP are used to
 change capture (recording) and muting for the group specified.
 
-The optional modifiers can be put as extra parameters to specify
-the stream direction or channels to apply.
+The optional modifiers can be put as extra parameters before the value to
+specify the stream direction or channels to apply.
 The modifiers \fIplayback\fP and \fIcapture\fP specify the stream,
-and the modifiers \fIfront, rear, center, woofer\fP are used to specify
-channels to be changed. 
+and the modifiers \fIfront, frontleft, frontright, frontcenter, center,
+rear, rearright, rearleft, woofer\fP are used to specify channels to be
+changed.
 
 A simple mixer control must be specified. Only one device can be controlled
 at a time.
@@ -79,6 +80,16 @@ of control.
 Shows the card control contents. The identifier has same syntax as for
 the \fIcset\fP command.
 
+.SH ADVANCED COMMANDS
+
+.TP
+\fIsevents\fP
+Shows the events for the simple mixer controls.
+
+.TP
+\fIevents\fP
+Shows the events for the mixer controls.
+
 .SH OPTIONS
 
 .TP
index ed60e7c..8b8000b 100644 (file)
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -28,7 +29,7 @@
 #include <errno.h>
 #include <assert.h>
 #include <alsa/asoundlib.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <stdint.h>
 #include "amixer.h"
 #include "../alsamixer/volume_mapping.h"
@@ -81,6 +82,9 @@ static int help(void)
        printf("  contents        show contents of all controls for given card\n");
        printf("  cset cID P      set control contents for one control\n");
        printf("  cget cID        get control contents for one control\n");
+       printf("\nAvailable advanced commands:\n");
+       printf("  sevents         show the mixer events for simple controls\n");
+       printf("  events          show the mixer events for controls\n");
        return 0;
 }
 
@@ -192,16 +196,22 @@ static int convert_prange(long val, long min, long max)
        int tmp;
 
        if (range == 0)
-               return 0;
+               return min;
        val -= min;
        tmp = rint((double)val/(double)range * 100);
        return tmp;
 }
 
-/* Function to convert from percentage to volume. val = percentage */
+/* Function to convert from percentage to volume. perc = percentage */
+static long convert_prange1(long perc, long min, long max)
+{
+       long tmp;
 
-#define convert_prange1(val, min, max) \
-       ceil((val) * ((max) - (min)) * 0.01 + (min))
+       tmp = rint((double)perc * (double)(max - min) * 0.01);
+       if (tmp == 0 && perc > 0)
+               tmp++;
+       return tmp + min;
+}
 
 struct volume_ops {
        int (*get_range)(snd_mixer_elem_t *elem, long *min, long *max);
@@ -232,14 +242,14 @@ static int set_capture_dB(snd_mixer_elem_t *elem,
 
 static int set_playback_raw_volume(snd_mixer_elem_t *elem,
                                   snd_mixer_selem_channel_id_t c,
-                                  long value, int dir)
+                                  long value, int dir ATTRIBUTE_UNUSED)
 {
        return snd_mixer_selem_set_playback_volume(elem, c, value);
 }
 
 static int set_capture_raw_volume(snd_mixer_elem_t *elem,
                                  snd_mixer_selem_channel_id_t c,
-                                 long value, int dir)
+                                 long value, int dir ATTRIBUTE_UNUSED)
 {
        return snd_mixer_selem_set_capture_volume(elem, c, value);
 }
@@ -247,7 +257,7 @@ static int set_capture_raw_volume(snd_mixer_elem_t *elem,
 /* FIXME: normalize to int32 space to be compatible with other types */
 #define MAP_VOL_RES    (INT32_MAX / 100)
 
-static int get_mapped_volume_range(snd_mixer_elem_t *elem,
+static int get_mapped_volume_range(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED,
                                   long *pmin, long *pmax)
 {
        *pmin = 0;
@@ -453,6 +463,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
        unsigned int size;
        unsigned int idx = 0;
        const char *chmap_type = NULL;
+       int lf = 1;
 
        if (tlv_size < 2 * sizeof(unsigned int)) {
                printf("TLV size error!\n");
@@ -464,7 +475,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
        size = tlv[idx++];
        tlv_size -= 2 * sizeof(unsigned int);
        if (size > tlv_size) {
-               printf("TLV size error (%i, %i, %i)!\n", type, size, tlv_size);
+               printf("TLV size error (%u, %u, %u)!\n", type, size, tlv_size);
                return;
        }
        switch (type) {
@@ -480,6 +491,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
                        decode_tlv(spaces + 2, tlv + idx, tlv[idx+1] + 8);
                        idx += 2 + (tlv[idx+1] + sizeof(unsigned int) - 1) / sizeof(unsigned int);
                }
+               lf = 0;
                break;
        case SND_CTL_TLVT_DB_SCALE:
                printf("dBscale-");
@@ -574,14 +586,15 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
                break;
 #endif
        default:
-               printf("unk-%i-", type);
+               printf("unk-%u-", type);
                while (size > 0) {
                        printf("0x%08x,", tlv[idx++]);
                        size -= sizeof(unsigned int);
                }
                break;
        }
-       putc('\n', stdout);
+       if (lf)
+               putc('\n', stdout);
 }
 
 static int show_control(const char *space, snd_hctl_elem_t *elem,
@@ -608,7 +621,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
        }
        count = snd_ctl_elem_info_get_count(info);
        type = snd_ctl_elem_info_get_type(info);
-       printf("%s; type=%s,access=%s,values=%i", space, control_type(info), control_access(info), count);
+       printf("%s; type=%s,access=%s,values=%u", space, control_type(info), control_access(info), count);
        switch (type) {
        case SND_CTL_ELEM_TYPE_INTEGER:
                printf(",min=%li,max=%li,step=%li\n", 
@@ -617,7 +630,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
                       snd_ctl_elem_info_get_step(info));
                break;
        case SND_CTL_ELEM_TYPE_INTEGER64:
-               printf(",min=%Li,max=%Li,step=%Li\n", 
+               printf(",min=%lli,max=%lli,step=%lli\n",
                       snd_ctl_elem_info_get_min64(info),
                       snd_ctl_elem_info_get_max64(info),
                       snd_ctl_elem_info_get_step64(info));
@@ -659,7 +672,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
                                printf("%li", snd_ctl_elem_value_get_integer(control, idx));
                                break;
                        case SND_CTL_ELEM_TYPE_INTEGER64:
-                               printf("%Li", snd_ctl_elem_value_get_integer64(control, idx));
+                               printf("%lli", snd_ctl_elem_value_get_integer64(control, idx));
                                break;
                        case SND_CTL_ELEM_TYPE_ENUMERATED:
                                printf("%u", snd_ctl_elem_value_get_enumerated(control, idx));
@@ -682,6 +695,14 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
              __skip_read:
                if (!snd_ctl_elem_info_is_tlv_readable(info))
                        goto __skip_tlv;
+               /* skip ASoC ext bytes controls that may have huge binary TLV data */
+               if (type == SND_CTL_ELEM_TYPE_BYTES &&
+                               !snd_ctl_elem_info_is_readable(info) &&
+                               !snd_ctl_elem_info_is_writable(info)) {
+                       printf("%s; ASoC TLV Byte control, skipping bytes dump\n", space);
+                       goto __skip_tlv;
+               }
+
                tlv = malloc(4096);
                if ((err = snd_hctl_elem_tlv_read(elem, tlv, 4096)) < 0) {
                        error("Control %s element TLV read error: %s\n", card, snd_strerror(err));
@@ -812,7 +833,11 @@ static int show_selem(snd_mixer_t *handle, snd_mixer_selem_id_t *id, const char
                if (snd_mixer_selem_is_enumerated(elem)) {
                        int i, items;
                        unsigned int idx;
-                       char itemname[40];
+                       /*
+                        * See snd_ctl_elem_init_enum_names() in
+                        * sound/core/control.c.
+                        */
+                       char itemname[64];
                        items = snd_mixer_selem_get_enum_items(elem);
                        printf("  Items:");
                        for (i = 0; i < items; i++) {
@@ -1255,7 +1280,9 @@ static int get_enum_item_index(snd_mixer_elem_t *elem, char **ptrp)
 {
        char *ptr = *ptrp;
        int items, i, len;
-       char name[40];
+
+       /* See snd_ctl_elem_init_enum_names() in sound/core/control.c. */
+       char name[64];
        
        items = snd_mixer_selem_get_enum_items(elem);
        if (items <= 0)
@@ -1264,6 +1291,7 @@ static int get_enum_item_index(snd_mixer_elem_t *elem, char **ptrp)
        for (i = 0; i < items; i++) {
                if (snd_mixer_selem_get_enum_item_name(elem, i, sizeof(name)-1, name) < 0)
                        continue;
+
                len = strlen(name);
                if (! strncmp(name, ptr, len)) {
                        if (! ptr[len] || ptr[len] == ',' || ptr[len] == '\n') {
@@ -1278,7 +1306,7 @@ static int get_enum_item_index(snd_mixer_elem_t *elem, char **ptrp)
 
 static int sset_enum(snd_mixer_elem_t *elem, unsigned int argc, char **argv)
 {
-       unsigned int idx, chn = 0;
+       unsigned int idx, item = 0;
        int check_flag = ignore_error ? 0 : -1;
 
        for (idx = 1; idx < argc; idx++) {
@@ -1287,7 +1315,7 @@ static int sset_enum(snd_mixer_elem_t *elem, unsigned int argc, char **argv)
                        int ival = get_enum_item_index(elem, &ptr);
                        if (ival < 0)
                                return check_flag;
-                       if (snd_mixer_selem_set_enum_item(elem, chn, ival) >= 0)
+                       if (snd_mixer_selem_set_enum_item(elem, item++, ival) >= 0)
                                check_flag = 1;
                        /* skip separators */
                        while (*ptr == ',' || isspace(*ptr))
@@ -1546,8 +1574,8 @@ static void events_add(snd_hctl_elem_t *helem)
        snd_hctl_elem_set_callback(helem, element_callback);
 }
 
-static int ctl_callback(snd_hctl_t *ctl, unsigned int mask,
-                snd_hctl_elem_t *elem)
+static int ctl_callback(snd_hctl_t *ctl ATTRIBUTE_UNUSED, unsigned int mask,
+                       snd_hctl_elem_t *elem)
 {
        if (mask & SND_CTL_EVENT_MASK_ADD)
                events_add(elem);
@@ -1578,7 +1606,8 @@ static int events(int argc ATTRIBUTE_UNUSED, char *argv[] ATTRIBUTE_UNUSED)
                if (res >= 0) {
                        printf("Poll ok: %i\n", res);
                        res = snd_hctl_handle_events(handle);
-                       assert(res > 0);
+                       if (res < 0)
+                               printf("ERR: %s (%d)\n", snd_strerror(res), res);
                }
        }
        snd_hctl_close(handle);
@@ -1625,8 +1654,8 @@ static void sevents_add(snd_mixer_elem_t *elem)
        snd_mixer_elem_set_callback(elem, melem_event);
 }
 
-static int mixer_event(snd_mixer_t *mixer, unsigned int mask,
-               snd_mixer_elem_t *elem)
+static int mixer_event(snd_mixer_t *mixer ATTRIBUTE_UNUSED, unsigned int mask,
+                      snd_mixer_elem_t *elem)
 {
        if (mask & SND_CTL_EVENT_MASK_ADD)
                sevents_add(elem);
@@ -1747,7 +1776,7 @@ static int exec_stdin(void)
 
 int main(int argc, char *argv[])
 {
-       int morehelp, level = 0;
+       int badopt, retval, level = 0;
        int read_stdin = 0;
        static const struct option long_option[] =
        {
@@ -1766,7 +1795,7 @@ int main(int argc, char *argv[])
                {NULL, 0, NULL, 0},
        };
 
-       morehelp = 0;
+       badopt = 0;
        while (1) {
                int c;
 
@@ -1781,10 +1810,14 @@ int main(int argc, char *argv[])
                                int i;
                                i = snd_card_get_index(optarg);
                                if (i >= 0 && i < 32)
+#if defined(SND_LIB_VER) && SND_LIB_VER(1, 2, 5) <= SND_LIB_VERSION
+                                       sprintf(card, "sysdefault:%i", i);
+#else
                                        sprintf(card, "hw:%i", i);
+#endif
                                else {
-                                       fprintf(stderr, "Invalid card number.\n");
-                                       morehelp++;
+                                       fprintf(stderr, "Invalid card number '%s'.\n", optarg);
+                                       badopt++;
                                }
                        }
                        break;
@@ -1806,7 +1839,7 @@ int main(int argc, char *argv[])
                        break;
                case 'v':
                        printf("amixer version " SND_UTIL_VERSION_STR "\n");
-                       return 1;
+                       return 0;
                case 'a':
                        smixer_level = 1;
                        memset(&smixer_options, 0, sizeof(smixer_options));
@@ -1817,7 +1850,7 @@ int main(int argc, char *argv[])
                                smixer_options.abstract = SND_MIXER_SABSTRACT_BASIC;
                        else {
                                fprintf(stderr, "Select correct abstraction level (none or basic)...\n");
-                               morehelp++;
+                               badopt++;
                        }
                        break;
                case 's':
@@ -1830,49 +1863,55 @@ int main(int argc, char *argv[])
                        std_vol_type = VOL_MAP;
                        break;
                default:
-                       fprintf(stderr, "Invalid switch or option needs an argument.\n");
-                       morehelp++;
+                       fprintf(stderr, "Invalid switch or option -%c needs an argument.\n", c);
+                       badopt++;
                }
        }
-       if (morehelp) {
-               help();
+       if (badopt)
                return 1;
-       }
+
        smixer_options.device = card;
 
-       if (read_stdin)
-               return exec_stdin();
+       if (read_stdin) {
+               retval = exec_stdin();
+               goto finish;
+       }
 
        if (argc - optind <= 0) {
-               return selems(LEVEL_BASIC | level) ? 1 : 0;
+               retval = selems(LEVEL_BASIC | level) ? 1 : 0;
+               goto finish;
        }
        if (!strcmp(argv[optind], "help")) {
-               return help() ? 1 : 0;
+               retval = help() ? 1 : 0;
        } else if (!strcmp(argv[optind], "info")) {
-               return info() ? 1 : 0;
+               retval = info() ? 1 : 0;
        } else if (!strcmp(argv[optind], "controls")) {
-               return controls(level) ? 1 : 0;
+               retval = controls(level) ? 1 : 0;
        } else if (!strcmp(argv[optind], "contents")) {
-               return controls(LEVEL_BASIC | level) ? 1 : 0;
+               retval = controls(LEVEL_BASIC | level) ? 1 : 0;
        } else if (!strcmp(argv[optind], "scontrols") || !strcmp(argv[optind], "simple")) {
-               return selems(level) ? 1 : 0;
+               retval = selems(level) ? 1 : 0;
        } else if (!strcmp(argv[optind], "scontents")) {
-               return selems(LEVEL_BASIC | level) ? 1 : 0;
+               retval = selems(LEVEL_BASIC | level) ? 1 : 0;
        } else if (!strcmp(argv[optind], "sset") || !strcmp(argv[optind], "set")) {
-               return sset(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL, 0, 0) ? 1 : 0;
+               retval = sset(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL, 0, 0) ? 1 : 0;
        } else if (!strcmp(argv[optind], "sget") || !strcmp(argv[optind], "get")) {
-               return sset(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL, 1, 0) ? 1 : 0;
+               retval = sset(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL, 1, 0) ? 1 : 0;
        } else if (!strcmp(argv[optind], "cset")) {
-               return cset(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL, 0, 0) ? 1 : 0;
+               retval = cset(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL, 0, 0) ? 1 : 0;
        } else if (!strcmp(argv[optind], "cget")) {
-               return cset(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL, 1, 0) ? 1 : 0;
+               retval = cset(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL, 1, 0) ? 1 : 0;
        } else if (!strcmp(argv[optind], "events")) {
-               return events(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL);
+               retval = events(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL);
        } else if (!strcmp(argv[optind], "sevents")) {
-               return sevents(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL);
+               retval = sevents(argc - optind - 1, argc - optind > 1 ? argv + optind + 1 : NULL);
        } else {
                fprintf(stderr, "amixer: Unknown command '%s'...\n", argv[optind]);
+               retval = 0;
        }
 
-       return 0;
+finish:
+       snd_config_update_free_global();
+
+       return retval;
 }
index 3588f04..af97628 100644 (file)
@@ -14,7 +14,7 @@
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
diff --git a/amixer/volume_mapping.c b/amixer/volume_mapping.c
new file mode 100644 (file)
index 0000000..f34801c
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2010 Clemens Ladisch <clemens@ladisch.de>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * The functions in this file map the value ranges of ALSA mixer controls onto
+ * the interval 0..1.
+ *
+ * The mapping is designed so that the position in the interval is proportional
+ * to the volume as a human ear would perceive it (i.e., the position is the
+ * cubic root of the linear sample multiplication factor).  For controls with
+ * a small range (24 dB or less), the mapping is linear in the dB values so
+ * that each step has the same size visually.  Only for controls without dB
+ * information, a linear mapping of the hardware volume register values is used
+ * (this is the same algorithm as used in the old alsamixer).
+ *
+ * When setting the volume, 'dir' is the rounding direction:
+ * -1/0/1 = down/nearest/up.
+ */
+
+#define _ISOC99_SOURCE /* lrint() */
+#include "aconfig.h"
+#include <math.h>
+#include <stdbool.h>
+#include "volume_mapping.h"
+
+#define MAX_LINEAR_DB_SCALE    24
+
+static inline bool use_linear_dB_scale(long dBmin, long dBmax)
+{
+       return dBmax - dBmin <= MAX_LINEAR_DB_SCALE * 100;
+}
+
+static long lrint_dir(double x, int dir)
+{
+       if (dir > 0)
+               return lrint(ceil(x));
+       else if (dir < 0)
+               return lrint(floor(x));
+       else
+               return lrint(x);
+}
+
+enum ctl_dir { PLAYBACK, CAPTURE };
+
+static int (* const get_dB_range[2])(snd_mixer_elem_t *, long *, long *) = {
+       snd_mixer_selem_get_playback_dB_range,
+       snd_mixer_selem_get_capture_dB_range,
+};
+static int (* const get_raw_range[2])(snd_mixer_elem_t *, long *, long *) = {
+       snd_mixer_selem_get_playback_volume_range,
+       snd_mixer_selem_get_capture_volume_range,
+};
+static int (* const get_dB[2])(snd_mixer_elem_t *, snd_mixer_selem_channel_id_t, long *) = {
+       snd_mixer_selem_get_playback_dB,
+       snd_mixer_selem_get_capture_dB,
+};
+static int (* const get_raw[2])(snd_mixer_elem_t *, snd_mixer_selem_channel_id_t, long *) = {
+       snd_mixer_selem_get_playback_volume,
+       snd_mixer_selem_get_capture_volume,
+};
+static int (* const set_dB[2])(snd_mixer_elem_t *, snd_mixer_selem_channel_id_t, long, int) = {
+       snd_mixer_selem_set_playback_dB,
+       snd_mixer_selem_set_capture_dB,
+};
+static int (* const set_raw[2])(snd_mixer_elem_t *, snd_mixer_selem_channel_id_t, long) = {
+       snd_mixer_selem_set_playback_volume,
+       snd_mixer_selem_set_capture_volume,
+};
+
+static double get_normalized_volume(snd_mixer_elem_t *elem,
+                                   snd_mixer_selem_channel_id_t channel,
+                                   enum ctl_dir ctl_dir)
+{
+       long min, max, value;
+       double normalized, min_norm;
+       int err;
+
+       err = get_dB_range[ctl_dir](elem, &min, &max);
+       if (err < 0 || min >= max) {
+               err = get_raw_range[ctl_dir](elem, &min, &max);
+               if (err < 0 || min == max)
+                       return 0;
+
+               err = get_raw[ctl_dir](elem, channel, &value);
+               if (err < 0)
+                       return 0;
+
+               return (value - min) / (double)(max - min);
+       }
+
+       err = get_dB[ctl_dir](elem, channel, &value);
+       if (err < 0)
+               return 0;
+
+       if (use_linear_dB_scale(min, max))
+               return (value - min) / (double)(max - min);
+
+       normalized = pow(10, (value - max) / 6000.0);
+       if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
+               min_norm = pow(10, (min - max) / 6000.0);
+               normalized = (normalized - min_norm) / (1 - min_norm);
+       }
+
+       return normalized;
+}
+
+static int set_normalized_volume(snd_mixer_elem_t *elem,
+                                snd_mixer_selem_channel_id_t channel,
+                                double volume,
+                                int dir,
+                                enum ctl_dir ctl_dir)
+{
+       long min, max, value;
+       double min_norm;
+       int err;
+
+       err = get_dB_range[ctl_dir](elem, &min, &max);
+       if (err < 0 || min >= max) {
+               err = get_raw_range[ctl_dir](elem, &min, &max);
+               if (err < 0)
+                       return err;
+
+               value = lrint_dir(volume * (max - min), dir) + min;
+               return set_raw[ctl_dir](elem, channel, value);
+       }
+
+       if (use_linear_dB_scale(min, max)) {
+               value = lrint_dir(volume * (max - min), dir) + min;
+               return set_dB[ctl_dir](elem, channel, value, dir);
+       }
+
+       if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
+               min_norm = pow(10, (min - max) / 6000.0);
+               volume = volume * (1 - min_norm) + min_norm;
+       }
+       if (volume <= 0)
+               volume = 1e-36;
+       value = lrint_dir(6000.0 * log10(volume), dir) + max;
+       return set_dB[ctl_dir](elem, channel, value, dir);
+}
+
+double get_normalized_playback_volume(snd_mixer_elem_t *elem,
+                                     snd_mixer_selem_channel_id_t channel)
+{
+       return get_normalized_volume(elem, channel, PLAYBACK);
+}
+
+double get_normalized_capture_volume(snd_mixer_elem_t *elem,
+                                    snd_mixer_selem_channel_id_t channel)
+{
+       return get_normalized_volume(elem, channel, CAPTURE);
+}
+
+int set_normalized_playback_volume(snd_mixer_elem_t *elem,
+                                  snd_mixer_selem_channel_id_t channel,
+                                  double volume,
+                                  int dir)
+{
+       return set_normalized_volume(elem, channel, volume, dir, PLAYBACK);
+}
+
+int set_normalized_capture_volume(snd_mixer_elem_t *elem,
+                                 snd_mixer_selem_channel_id_t channel,
+                                 double volume,
+                                 int dir)
+{
+       return set_normalized_volume(elem, channel, volume, dir, CAPTURE);
+}
diff --git a/amixer/volume_mapping.h b/amixer/volume_mapping.h
new file mode 100644 (file)
index 0000000..d4251d6
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef VOLUME_MAPPING_H_INCLUDED
+#define VOLUME_MAPPING_H_INCLUDED
+
+#include <alsa/asoundlib.h>
+
+double get_normalized_playback_volume(snd_mixer_elem_t *elem,
+                                     snd_mixer_selem_channel_id_t channel);
+double get_normalized_capture_volume(snd_mixer_elem_t *elem,
+                                    snd_mixer_selem_channel_id_t channel);
+int set_normalized_playback_volume(snd_mixer_elem_t *elem,
+                                  snd_mixer_selem_channel_id_t channel,
+                                  double volume,
+                                  int dir);
+int set_normalized_capture_volume(snd_mixer_elem_t *elem,
+                                 snd_mixer_selem_channel_id_t channel,
+                                 double volume,
+                                 int dir);
+
+#endif
index b11b473..928e829 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -53,17 +91,20 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = aplay$(EXEEXT)
 subdir = aplay
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -75,14 +116,45 @@ aplay_OBJECTS = aplay.$(OBJEXT)
 aplay_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 aplay_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/aplay.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = aplay.c
 DIST_SOURCES = aplay.c
 am__can_run_installinfo = \
@@ -121,15 +193,37 @@ man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
 HEADERS = $(noinst_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -147,11 +241,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -163,27 +264,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -196,6 +307,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -204,6 +316,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -214,7 +328,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -255,6 +371,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -265,7 +383,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 LDADD = $(LIBINTL) $(LIBRT)
 man_MANS = aplay.1 arecord.1
@@ -275,7 +393,7 @@ EXTRA_CLEAN = arecord
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -288,14 +406,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign aplay/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign aplay/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -315,10 +432,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -329,8 +448,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -339,16 +458,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 aplay$(EXEEXT): $(aplay_OBJECTS) $(aplay_DEPENDENCIES) $(EXTRA_aplay_DEPENDENCIES) 
        @rm -f aplay$(EXEEXT)
-       $(LINK) $(aplay_OBJECTS) $(aplay_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(aplay_OBJECTS) $(aplay_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -356,21 +483,43 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aplay.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aplay.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -415,26 +564,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -446,15 +584,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -463,9 +597,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -481,20 +616,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -563,10 +688,10 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aplay.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -614,13 +739,14 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aplay.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -636,9 +762,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-data-am install-exec-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-data-hook install-dvi \
        install-dvi-am install-exec install-exec-am install-exec-hook \
@@ -646,9 +773,12 @@ uninstall-man: uninstall-man1
        install-man install-man1 install-pdf install-pdf-am install-ps \
        install-ps-am install-strip installcheck installcheck-am \
        installdirs maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
-       ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am uninstall-binPROGRAMS uninstall-man \
+       uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 arecord: aplay
index 2945dad..3bba59d 100644 (file)
@@ -62,7 +62,7 @@ Some of these may not be available on selected hardware
 The available format shortcuts are:
 .nf
 \-f cd (16 bit little endian, 44100, stereo) [\-f S16_LE \-c2 \-r44100]
-\-f cdr (16 bit big endian, 44100, stereo) [\-f S16_BE \-c2 \-f44100]
+\-f cdr (16 bit big endian, 44100, stereo) [\-f S16_BE \-c2 \-r44100]
 \-f dat (16 bit little endian, 48000, stereo) [\-f S16_LE \-c2 \-r48000]
 .fi
 If no format is given U8 is used.
@@ -75,10 +75,14 @@ Valid values are 2000 through 192000 Hertz.
 \fI\-d, \-\-duration=#\fP
 Interrupt after # seconds.
 A value of zero means infinity.
-The default is zero, so if this option is omitted then the arecord process will run until it is killed.
+The default is zero, so if this option is omitted then the record/playback process will run until it is killed.
+Either '-d' or '-s' option is available exclusively.
 .TP
-\fI\-s, \-\-sleep\-min=#\fP
-Min ticks to sleep. The default is not to sleep.
+\fI\-s, \-\-samples=#\fP
+Interrupt after transmission of # PCM frames.
+A value of zero means infinity.
+The default is zero, so if this options is omitted then the record/playback process will run until it is killed.
+Either '-d' or '-s' option is available exclusively.
 .TP
 \fI\-M, \-\-mmap\fP            
 Use memory\-mapped (mmap) I/O mode for the audio stream.
index e58e1bc..5bead5b 100644 (file)
  *
  *   You should have received a copy of the GNU General Public License
  *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
 #define _GNU_SOURCE
+#include "aconfig.h"
 #include <stdio.h>
+#include <stdint.h>
+#if HAVE_MALLOC_H
 #include <malloc.h>
+#endif
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 #include <termios.h>
 #include <signal.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/uio.h>
 #include <sys/time.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <endian.h>
-#include "aconfig.h"
 #include "gettext.h"
 #include "formats.h"
 #include "version.h"
+#include "os_compat.h"
+
+#define ABS(a)  (a) < 0 ? -(a) : (a)
 
 #ifdef SND_CHMAP_API_VERSION
 #define CONFIG_SUPPORT_CHMAP   1
@@ -96,10 +101,12 @@ static char *command;
 static snd_pcm_t *handle;
 static struct {
        snd_pcm_format_t format;
+       snd_pcm_subformat_t subformat;
        unsigned int channels;
        unsigned int rate;
 } hwparams, rhwparams;
 static int timelimit = 0;
+static int sampleslimit = 0;
 static int quiet_mode = 0;
 static int file_type = FORMAT_DEFAULT;
 static int open_mode = 0;
@@ -107,8 +114,8 @@ static snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;
 static int mmap_flag = 0;
 static int interleaved = 1;
 static int nonblock = 0;
-static int in_aborting = 0;
-static u_char *audiobuf = NULL;
+static volatile sig_atomic_t in_aborting = 0;
+static uint8_t *audiobuf = NULL;
 static snd_pcm_uframes_t chunk_size = 0;
 static unsigned period_time = 0;
 static unsigned buffer_time = 0;
@@ -124,7 +131,7 @@ static int fatal_errors = 0;
 static int verbose = 0;
 static int vumeter = VUMETER_NONE;
 static int buffer_pos = 0;
-static size_t bits_per_sample, bits_per_frame;
+static size_t significant_bits_per_sample, bits_per_sample, bits_per_frame;
 static size_t chunk_bytes;
 static int test_position = 0;
 static int test_coef = 8;
@@ -133,12 +140,12 @@ static snd_output_t *log;
 static long long max_file_size = 0;
 static int max_file_time = 0;
 static int use_strftime = 0;
-volatile static int recycle_capture_file = 0;
+static volatile int recycle_capture_file = 0;
 static long term_c_lflag = -1;
 static int dump_hw_params = 0;
 
 static int fd = -1;
-static off64_t pbrec_count = LLONG_MAX, fdcount;
+static off_t pbrec_count = LLONG_MAX, fdcount;
 static int vocmajor, vocminor;
 
 static char *pidfile_name = NULL;
@@ -166,6 +173,8 @@ static void end_wave(int fd);
 static void begin_au(int fd, size_t count);
 static void end_au(int fd);
 
+static void suspend(void);
+
 static const struct fmt_capture {
        void (*start) (int fd, size_t count);
        void (*end) (int fd);
@@ -181,13 +190,13 @@ static const struct fmt_capture {
 
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
 #define error(...) do {\
-       fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
+       fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \
        fprintf(stderr, __VA_ARGS__); \
        putc('\n', stderr); \
 } while (0)
 #else
 #define error(args...) do {\
-       fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
+       fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \
        fprintf(stderr, ##args); \
        putc('\n', stderr); \
 } while (0)
@@ -208,8 +217,10 @@ _("Usage: %s [OPTION]... [FILE]...\n"
 "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
 "-c, --channels=#        channels\n"
 "-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
 "-r, --rate=#            sample rate\n"
 "-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
 "-M, --mmap              mmap stream\n"
 "-N, --nonblock          nonblocking mode\n"
 "-F, --period-time=#     distance between interrupts is # microseconds\n"
@@ -399,11 +410,11 @@ static void signal_handler(int sig)
                handle = NULL;
                prg_exit(EXIT_FAILURE);
        }
-       signal(sig, signal_handler);
+       signal(sig, SIG_DFL);
 }
 
 /* call on SIGUSR1 signal. */
-static void signal_handler_recycle (int sig)
+static void signal_handler_recycle(int sig ATTRIBUTE_UNUSED)
 {
        /* flag the capture loop to start a new output file */
        recycle_capture_file = 1;
@@ -425,12 +436,49 @@ enum {
        OPT_USE_STRFTIME,
        OPT_DUMP_HWPARAMS,
        OPT_FATAL_ERRORS,
+       OPT_SUBFORMAT,
 };
 
+/*
+ * make sure we write all bytes or return an error
+ */
+static ssize_t xwrite(int fd, const void *buf, size_t count)
+{
+       ssize_t written;
+       size_t offset = 0;
+
+       while (offset < count) {
+               written = write(fd, (char *)buf + offset, count - offset);
+               if (written <= 0)
+                       return written;
+
+               offset += written;
+       };
+
+       return offset;
+}
+
+static long parse_long(const char *str, int *err)
+{
+       long val;
+       char *endptr;
+
+       errno = 0;
+       val = strtol(str, &endptr, 0);
+
+       if (errno != 0 || *endptr != '\0')
+               *err = -1;
+       else
+               *err = 0;
+
+       return val;
+}
+
 int main(int argc, char *argv[])
 {
+       int duration_or_sample = 0;
        int option_index;
-       static const char short_options[] = "hnlLD:qt:c:f:r:d:MNF:A:R:T:B:vV:IPCi"
+       static const char short_options[] = "hnlLD:qt:c:f:r:d:s:MNF:A:R:T:B:vV:IPCi"
 #ifdef CONFIG_SUPPORT_CHMAP
                "m:"
 #endif
@@ -446,8 +494,10 @@ int main(int argc, char *argv[])
                {"file-type", 1, 0, 't'},
                {"channels", 1, 0, 'c'},
                {"format", 1, 0, 'f'},
+               {"subformat", 1, 0, OPT_SUBFORMAT},
                {"rate", 1, 0, 'r'},
                {"duration", 1, 0 ,'d'},
+               {"samples", 1, 0, 's'},
                {"mmap", 0, 0, 'M'},
                {"nonblock", 0, 0, 'N'},
                {"period-time", 1, 0, 'F'},
@@ -482,7 +532,7 @@ int main(int argc, char *argv[])
        };
        char *pcm_name = "default";
        int tmp, err, c;
-       int do_device_list = 0, do_pcm_list = 0;
+       int do_device_list = 0, do_pcm_list = 0, force_sample_format = 0;
        snd_pcm_info_t *info;
        FILE *direction;
 
@@ -520,6 +570,7 @@ int main(int argc, char *argv[])
 
        chunk_size = -1;
        rhwparams.format = DEFAULT_FORMAT;
+       rhwparams.subformat = SND_PCM_SUBFORMAT_STD;
        rhwparams.rate = DEFAULT_SPEED;
        rhwparams.channels = 1;
 
@@ -558,13 +609,18 @@ int main(int argc, char *argv[])
                        }
                        break;
                case 'c':
-                       rhwparams.channels = strtol(optarg, NULL, 0);
+                       rhwparams.channels = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid channels argument '%s'"), optarg);
+                               return 1;
+                       }
                        if (rhwparams.channels < 1 || rhwparams.channels > 256) {
                                error(_("value %i for channels is invalid"), rhwparams.channels);
                                return 1;
                        }
                        break;
                case 'f':
+                       force_sample_format = 1;
                        if (strcasecmp(optarg, "cd") == 0 || strcasecmp(optarg, "cdr") == 0) {
                                if (strcasecmp(optarg, "cdr") == 0)
                                        rhwparams.format = SND_PCM_FORMAT_S16_BE;
@@ -584,43 +640,107 @@ int main(int argc, char *argv[])
                                }
                        }
                        break;
+               case OPT_SUBFORMAT:
+#if SND_LIB_VER(1, 2, 10) < SND_LIB_VERSION
+                       rhwparams.subformat = snd_pcm_subformat_value(optarg);
+                       if (rhwparams.subformat == SND_PCM_SUBFORMAT_UNKNOWN) {
+#else
+                       if (strcasecmp(optarg, "std") != 0 && strcasecmp(optarg, "standard") != 0) {
+#endif
+                               error(_("wrong extended subformat '%s'"), optarg);
+                               prg_exit(EXIT_FAILURE);
+                       }
+                       break;
                case 'r':
-                       tmp = strtol(optarg, NULL, 0);
-                       if (tmp < 300)
+                       tmp = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid rate argument '%s'"), optarg);
+                               return 1;
+                       }
+                       if (tmp < 1000)
                                tmp *= 1000;
                        rhwparams.rate = tmp;
-                       if (tmp < 2000 || tmp > 192000) {
+                       if (tmp < 2000 || tmp > 768000) {
                                error(_("bad speed value %i"), tmp);
                                return 1;
                        }
                        break;
                case 'd':
-                       timelimit = strtol(optarg, NULL, 0);
+                       if (duration_or_sample) {
+                               error(_("duration and samples arguments cannot be used together"));
+                               return 1;
+                       }
+                       timelimit = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid duration argument '%s'"), optarg);
+                               return 1;
+                       }
+                       duration_or_sample = 1;
+                       break;
+               case 's':
+                       if (duration_or_sample) {
+                               error(_("samples and duration arguments cannot be used together"));
+                               return 1;
+                       }
+                       sampleslimit = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid samples argument '%s'"), optarg);
+                               return 1;
+                       }
+                       duration_or_sample = 1;
                        break;
                case 'N':
                        nonblock = 1;
                        open_mode |= SND_PCM_NONBLOCK;
                        break;
                case 'F':
-                       period_time = strtol(optarg, NULL, 0);
+                       period_time = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid period time argument '%s'"), optarg);
+                               return 1;
+                       }
                        break;
                case 'B':
-                       buffer_time = strtol(optarg, NULL, 0);
+                       buffer_time = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid buffer time argument '%s'"), optarg);
+                               return 1;
+                       }
                        break;
                case OPT_PERIOD_SIZE:
-                       period_frames = strtol(optarg, NULL, 0);
+                       period_frames = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid period size argument '%s'"), optarg);
+                               return 1;
+                       }
                        break;
                case OPT_BUFFER_SIZE:
-                       buffer_frames = strtol(optarg, NULL, 0);
+                       buffer_frames = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid buffer size argument '%s'"), optarg);
+                               return 1;
+                       }
                        break;
                case 'A':
-                       avail_min = strtol(optarg, NULL, 0);
+                       avail_min = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid min available space argument '%s'"), optarg);
+                               return 1;
+                       }
                        break;
                case 'R':
-                       start_delay = strtol(optarg, NULL, 0);
+                       start_delay = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid start delay argument '%s'"), optarg);
+                               return 1;
+                       }
                        break;
                case 'T':
-                       stop_delay = strtol(optarg, NULL, 0);
+                       stop_delay = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid stop delay argument '%s'"), optarg);
+                               return 1;
+                       }
                        break;
                case 'v':
                        verbose++;
@@ -671,7 +791,11 @@ int main(int argc, char *argv[])
                        test_position = 1;
                        break;
                case OPT_TEST_COEF:
-                       test_coef = strtol(optarg, NULL, 0);
+                       test_coef = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid test coef argument '%s'"), optarg);
+                               return 1;
+                       }
                        if (test_coef < 1)
                                test_coef = 1;
                        break;
@@ -679,7 +803,11 @@ int main(int argc, char *argv[])
                        test_nowait = 1;
                        break;
                case OPT_MAX_FILE_TIME:
-                       max_file_time = strtol(optarg, NULL, 0);
+                       max_file_time = parse_long(optarg, &err);
+                       if (err < 0) {
+                               error(_("invalid max file time argument '%s'"), optarg);
+                               return 1;
+                       }
                        break;
                case OPT_PROCESS_ID_FILE:
                        pidfile_name = optarg;
@@ -736,10 +864,18 @@ int main(int argc, char *argv[])
                }
        }
 
+       if (!force_sample_format &&
+           isatty(fileno(stdin)) &&
+           stream == SND_PCM_STREAM_CAPTURE &&
+           snd_pcm_format_width(rhwparams.format) <= 8)
+               fprintf(stderr, "Warning: Some sources (like microphones) may produce inaudible results\n"
+                               "         with 8-bit sampling. Use '-f' argument to increase resolution\n"
+                               "         e.g. '-f S16_LE'.\n");
+
        chunk_size = 1024;
        hwparams = rhwparams;
 
-       audiobuf = (u_char *)malloc(1024);
+       audiobuf = (uint8_t *)malloc(1024);
        if (audiobuf == NULL) {
                error(_("not enough memory"));
                return 1;
@@ -850,7 +986,7 @@ static int test_vocfile(void *buffer)
  * helper for test_wavefile
  */
 
-static size_t test_wavefile_read(int fd, u_char *buffer, size_t *size, size_t reqsize, int line)
+static size_t test_wavefile_read(int fd, uint8_t *buffer, size_t *size, size_t reqsize, int line)
 {
        if (*size >= reqsize)
                return *size;
@@ -875,16 +1011,17 @@ static size_t test_wavefile_read(int fd, u_char *buffer, size_t *size, size_t re
  *                            == 0 if not
  * Value returned is bytes to be discarded.
  */
-static ssize_t test_wavefile(int fd, u_char *_buffer, size_t size)
+static ssize_t test_wavefile(int fd, uint8_t *_buffer, size_t size)
 {
        WaveHeader *h = (WaveHeader *)_buffer;
-       u_char *buffer = NULL;
+       uint8_t *buffer = NULL;
        size_t blimit = 0;
        WaveFmtBody *f;
        WaveChunkHeader *c;
-       u_int type, len;
+       uint32_t type, len;
        unsigned short format, channels;
        int big_endian, native_format;
+       uint8_t vbps = 0;
 
        if (size < sizeof(WaveHeader))
                return -1;
@@ -923,7 +1060,7 @@ static ssize_t test_wavefile(int fd, u_char *_buffer, size_t size)
 
        if (len < sizeof(WaveFmtBody)) {
                error(_("unknown length of 'fmt ' chunk (read %u, should be %u at least)"),
-                     len, (u_int)sizeof(WaveFmtBody));
+                     len, (uint32_t)sizeof(WaveFmtBody));
                prg_exit(EXIT_FAILURE);
        }
        check_wavefile_space(buffer, len, blimit);
@@ -934,13 +1071,14 @@ static ssize_t test_wavefile(int fd, u_char *_buffer, size_t size)
                WaveFmtExtensibleBody *fe = (WaveFmtExtensibleBody*)buffer;
                if (len < sizeof(WaveFmtExtensibleBody)) {
                        error(_("unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"),
-                                       len, (u_int)sizeof(WaveFmtExtensibleBody));
+                                       len, (unsigned int)sizeof(WaveFmtExtensibleBody));
                        prg_exit(EXIT_FAILURE);
                }
                if (memcmp(fe->guid_tag, WAV_GUID_TAG, 14) != 0) {
                        error(_("wrong format tag in extensible 'fmt ' chunk"));
                        prg_exit(EXIT_FAILURE);
                }
+               vbps = TO_CPU_SHORT(fe->bit_p_spl, big_endian);
                format = TO_CPU_SHORT(fe->guid_format, big_endian);
        }
        if (format != WAV_FMT_PCM &&
@@ -954,6 +1092,10 @@ static ssize_t test_wavefile(int fd, u_char *_buffer, size_t size)
                prg_exit(EXIT_FAILURE);
        }
        hwparams.channels = channels;
+       if (vbps > TO_CPU_SHORT(f->bit_p_spl, big_endian)) {
+               error(_("valid bps greater than bps: %d > %d"), vbps, TO_CPU_SHORT(f->bit_p_spl, big_endian));
+               prg_exit(EXIT_FAILURE);
+       }
        switch (TO_CPU_SHORT(f->bit_p_spl, big_endian)) {
        case 8:
                if (hwparams.format != DEFAULT_FORMAT &&
@@ -1006,10 +1148,20 @@ static ssize_t test_wavefile(int fd, u_char *_buffer, size_t size)
                break;
        case 32:
                if (format == WAV_FMT_PCM) {
-                       if (big_endian)
-                               native_format = SND_PCM_FORMAT_S32_BE;
-                       else
-                               native_format = SND_PCM_FORMAT_S32_LE;
+                       switch (vbps) {
+                       case 24:
+                               if (big_endian)
+                                       native_format = SND_PCM_FORMAT_S24_BE;
+                               else
+                                       native_format = SND_PCM_FORMAT_S24_LE;
+                               break;
+                       default:
+                               if (big_endian)
+                                       native_format = SND_PCM_FORMAT_S32_BE;
+                               else
+                                       native_format = SND_PCM_FORMAT_S32_LE;
+                               break;
+                       }
                         hwparams.format = native_format;
                } else if (format == WAV_FMT_IEEE_FLOAT) {
                        if (big_endian)
@@ -1031,7 +1183,7 @@ static ssize_t test_wavefile(int fd, u_char *_buffer, size_t size)
        size -= len;
        
        while (1) {
-               u_int type, len;
+               uint32_t type, len;
 
                check_wavefile_space(buffer, sizeof(WaveChunkHeader), blimit);
                test_wavefile_read(fd, buffer, &size, sizeof(WaveChunkHeader), __LINE__);
@@ -1102,7 +1254,7 @@ static int test_au(int fd, void *buffer)
        hwparams.channels = BE_INT(ap->channels);
        if (hwparams.channels < 1 || hwparams.channels > 256)
                return -1;
-       if ((size_t)safe_read(fd, buffer + sizeof(AuHeader), BE_INT(ap->hdr_size) - sizeof(AuHeader)) != BE_INT(ap->hdr_size) - sizeof(AuHeader)) {
+       if ((size_t)safe_read(fd, (char *)buffer + sizeof(AuHeader), BE_INT(ap->hdr_size) - sizeof(AuHeader)) != BE_INT(ap->hdr_size) - sizeof(AuHeader)) {
                error(_("read error"));
                prg_exit(EXIT_FAILURE);
        }
@@ -1156,6 +1308,7 @@ static int setup_chmap(void)
        hw_map = calloc(hwparams.channels, sizeof(int));
        if (!hw_map) {
                error(_("not enough memory"));
+               free(hw_chmap);
                return -1;
        }
 
@@ -1175,9 +1328,10 @@ static int setup_chmap(void)
                }
                if (i >= hw_chmap->channels) {
                        char buf[256];
-                       error(_("Channel %d doesn't match with hw_parmas"), ch);
+                       error(_("Channel %d doesn't match with hw_params"), ch);
                        snd_pcm_chmap_print(hw_chmap, sizeof(buf), buf);
                        fprintf(stderr, "hardware chmap = %s\n", buf);
+                       free(hw_chmap);
                        return -1;
                }
        }
@@ -1234,6 +1388,11 @@ static void set_params(void)
                show_available_sample_formats(params);
                prg_exit(EXIT_FAILURE);
        }
+       err = snd_pcm_hw_params_set_subformat(handle, params, hwparams.subformat);
+       if (err < 0) {
+               error(_("Sample subformat not available"));
+               prg_exit(EXIT_FAILURE);
+       }
        err = snd_pcm_hw_params_set_channels(handle, params, hwparams.channels);
        if (err < 0) {
                error(_("Channels count non available"));
@@ -1305,7 +1464,11 @@ static void set_params(void)
                      chunk_size, buffer_size);
                prg_exit(EXIT_FAILURE);
        }
-       snd_pcm_sw_params_current(handle, swparams);
+       err = snd_pcm_sw_params_current(handle, swparams);
+       if (err < 0) {
+               error(_("Unable to get current sw params."));
+               prg_exit(EXIT_FAILURE);
+       }
        if (avail_min < 0)
                n = chunk_size;
        else
@@ -1331,6 +1494,17 @@ static void set_params(void)
        err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold);
        assert(err >= 0);
 
+       if (verbose) {
+               err = snd_pcm_sw_params_set_tstamp_mode(handle, swparams, SND_PCM_TSTAMP_ENABLE);
+               assert(err >= 0);
+
+               if (monotonic)
+                       err = snd_pcm_sw_params_set_tstamp_type(handle, swparams, SND_PCM_TSTAMP_TYPE_MONOTONIC);
+               else
+                       err = snd_pcm_sw_params_set_tstamp_type(handle, swparams, SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY);
+               assert(err >= 0);
+       }
+
        if (snd_pcm_sw_params(handle, swparams) < 0) {
                error(_("unable to install sw params:"));
                snd_pcm_sw_params_dump(swparams, log);
@@ -1344,6 +1518,7 @@ static void set_params(void)
                snd_pcm_dump(handle, log);
 
        bits_per_sample = snd_pcm_format_physical_width(hwparams.format);
+       significant_bits_per_sample = snd_pcm_format_width(hwparams.format);
        bits_per_frame = bits_per_sample * hwparams.channels;
        chunk_bytes = chunk_size * bits_per_frame / 8;
        audiobuf = realloc(audiobuf, chunk_bytes);
@@ -1369,7 +1544,7 @@ static void set_params(void)
                        error(_("snd_pcm_mmap_begin problem: %s"), snd_strerror(err));
                        prg_exit(EXIT_FAILURE);
                }
-               for (i = 0; i < hwparams.channels; i++)
+               for (i = 0; i < (int)hwparams.channels; i++)
                        fprintf(stderr, "mmap_area[%i] = %p,%u,%u (%u)\n", i, areas[i].addr, areas[i].first, areas[i].step, snd_pcm_format_physical_width(hwparams.format));
                /* not required, but for sure */
                snd_pcm_mmap_commit(handle, offset, 0);
@@ -1413,6 +1588,19 @@ static void done_stdin(void)
        tcsetattr(fileno(stdin), TCSANOW, &term);
 }
 
+static char wait_for_input(void)
+{
+       struct pollfd pfd;
+       unsigned char b;
+
+       do {
+               pfd.fd = fileno(stdin);
+               pfd.events = POLLIN;
+               poll(&pfd, 1, -1);
+       } while (read(fileno(stdin), &b, 1) != 1);
+       return b;
+}
+
 static void do_pause(void)
 {
        int err;
@@ -1422,15 +1610,20 @@ static void do_pause(void)
                fprintf(stderr, _("\rPAUSE command ignored (no hw support)\n"));
                return;
        }
+       if (snd_pcm_state(handle) == SND_PCM_STATE_SUSPENDED)
+               suspend();
+
        err = snd_pcm_pause(handle, 1);
        if (err < 0) {
                error(_("pause push error: %s"), snd_strerror(err));
                return;
        }
        while (1) {
-               while (read(fileno(stdin), &b, 1) != 1);
+               b = wait_for_input();
                if (b == ' ' || b == '\r') {
                        while (read(fileno(stdin), &b, 1) == 1);
+                       if (snd_pcm_state(handle) == SND_PCM_STATE_SUSPENDED)
+                               suspend();
                        err = snd_pcm_pause(handle, 0);
                        if (err < 0)
                                error(_("pause release error: %s"), snd_strerror(err));
@@ -1451,7 +1644,7 @@ static void check_stdin(void)
                                while (read(fileno(stdin), &b, 1) == 1);
                                fprintf(stderr, _("\r=== PAUSE ===                                                            "));
                                fflush(stderr);
-                       do_pause();
+                               do_pause();
                                fprintf(stderr, "                                                                          \r");
                                fflush(stderr);
                        }
@@ -1495,12 +1688,6 @@ static void xrun(void)
                prg_exit(EXIT_FAILURE);
        }
        if (snd_pcm_status_get_state(status) == SND_PCM_STATE_XRUN) {
-               if (fatal_errors) {
-                       error(_("fatal %s: %s"),
-                                       stream == SND_PCM_STREAM_PLAYBACK ? _("underrun") : _("overrun"),
-                                       snd_strerror(res));
-                       prg_exit(EXIT_FAILURE);
-               }
                if (monotonic) {
 #ifdef HAVE_CLOCK_GETTIME
                        struct timespec now, diff, tstamp;
@@ -1526,12 +1713,19 @@ static void xrun(void)
                        fprintf(stderr, _("Status:\n"));
                        snd_pcm_status_dump(status, log);
                }
+               if (fatal_errors) {
+                       error(_("fatal %s: %s"),
+                                       stream == SND_PCM_STREAM_PLAYBACK ? _("underrun") : _("overrun"),
+                                       snd_strerror(res));
+                       prg_exit(EXIT_FAILURE);
+               }
                if ((res = snd_pcm_prepare(handle))<0) {
                        error(_("xrun: prepare error: %s"), snd_strerror(res));
                        prg_exit(EXIT_FAILURE);
                }
                return;         /* ok, data should be accepted again */
-       } if (snd_pcm_status_get_state(status) == SND_PCM_STATE_DRAINING) {
+       }
+       if (snd_pcm_status_get_state(status) == SND_PCM_STATE_DRAINING) {
                if (verbose) {
                        fprintf(stderr, _("Status(DRAINING):\n"));
                        snd_pcm_status_dump(status, log);
@@ -1558,13 +1752,15 @@ static void suspend(void)
 {
        int res;
 
-       if (!quiet_mode)
+       if (!quiet_mode) {
                fprintf(stderr, _("Suspended. Trying resume. ")); fflush(stderr);
+       }
        while ((res = snd_pcm_resume(handle)) == -EAGAIN)
                sleep(1);       /* wait until suspend flag is released */
        if (res < 0) {
-               if (!quiet_mode)
+               if (!quiet_mode) {
                        fprintf(stderr, _("Failed. Restarting stream. ")); fflush(stderr);
+               }
                if ((res = snd_pcm_prepare(handle)) < 0) {
                        error(_("suspend: prepare error: %s"), snd_strerror(res));
                        prg_exit(EXIT_FAILURE);
@@ -1613,15 +1809,17 @@ static void print_vu_meter_stereo(int *perc, int *maxperc)
                if (c)
                        memset(line + bar_length + 6 + 1, '#', p);
                else
-                       memset(line + bar_length - p - 1, '#', p);
-               p = maxperc[c] * bar_length / 100;
-               if (p > bar_length)
-                       p = bar_length;
+                       memset(line + bar_length - p, '#', p);
+               p = maxperc[c] * bar_length / 100 - 1;
+               if (p < 0)
+                       p = 0;
+               else if (p >= bar_length)
+                       p = bar_length - 1;
                if (c)
                        line[bar_length + 6 + 1 + p] = '+';
                else
                        line[bar_length - p - 1] = '+';
-               if (maxperc[c] > 99)
+               if (ABS(maxperc[c]) > 99)
                        sprintf(tmp, "MAX");
                else
                        sprintf(tmp, "%02d%%", maxperc[c]);
@@ -1643,12 +1841,12 @@ static void print_vu_meter(signed int *perc, signed int *maxperc)
 }
 
 /* peak handler */
-static void compute_max_peak(u_char *data, size_t count)
+static void compute_max_peak(uint8_t *data, size_t samples)
 {
        signed int val, max, perc[2], max_peak[2];
-       static  int     run = 0;
-       size_t ocount = count;
-       int     format_little_endian = snd_pcm_format_little_endian(hwparams.format);   
+       static int run = 0;
+       size_t osamples = samples;
+       int format_little_endian = snd_pcm_format_little_endian(hwparams.format);
        int ichans, c;
 
        if (vumeter == VUMETER_STEREO)
@@ -1662,7 +1860,7 @@ static void compute_max_peak(u_char *data, size_t count)
                signed char *valp = (signed char *)data;
                signed char mask = snd_pcm_format_silence(hwparams.format);
                c = 0;
-               while (count-- > 0) {
+               while (samples-- > 0) {
                        val = *valp++ ^ mask;
                        val = abs(val);
                        if (max_peak[c] < val)
@@ -1677,16 +1875,16 @@ static void compute_max_peak(u_char *data, size_t count)
                signed short mask = snd_pcm_format_silence_16(hwparams.format);
                signed short sval;
 
-               count /= 2;
                c = 0;
-               while (count-- > 0) {
+               while (samples-- > 0) {
                        if (format_little_endian)
                                sval = le16toh(*valp);
                        else
                                sval = be16toh(*valp);
-                       sval = abs(sval) ^ mask;
-                       if (max_peak[c] < sval)
-                               max_peak[c] = sval;
+                       sval ^= mask;
+                       val = abs(sval);
+                       if (max_peak[c] < val)
+                               max_peak[c] = val;
                        valp++;
                        if (vumeter == VUMETER_STEREO)
                                c = !c;
@@ -1697,19 +1895,19 @@ static void compute_max_peak(u_char *data, size_t count)
                unsigned char *valp = data;
                signed int mask = snd_pcm_format_silence_32(hwparams.format);
 
-               count /= 3;
                c = 0;
-               while (count-- > 0) {
+               while (samples-- > 0) {
                        if (format_little_endian) {
                                val = valp[0] | (valp[1]<<8) | (valp[2]<<16);
                        } else {
                                val = (valp[0]<<16) | (valp[1]<<8) | valp[2];
                        }
+                       val ^= mask;
                        /* Correct signed bit in 32-bit value */
                        if (val & (1<<(bits_per_sample-1))) {
                                val |= 0xff<<24;        /* Negate upper bits too */
                        }
-                       val = abs(val) ^ mask;
+                       val = abs(val);
                        if (max_peak[c] < val)
                                max_peak[c] = val;
                        valp += 3;
@@ -1722,14 +1920,17 @@ static void compute_max_peak(u_char *data, size_t count)
                signed int *valp = (signed int *)data;
                signed int mask = snd_pcm_format_silence_32(hwparams.format);
 
-               count /= 4;
                c = 0;
-               while (count-- > 0) {
+               while (samples-- > 0) {
                        if (format_little_endian)
                                val = le32toh(*valp);
                        else
                                val = be32toh(*valp);
-                       val = abs(val) ^ mask;
+                       val ^= mask;
+                       if ((unsigned int)val == 0x80000000U)
+                               val = 0x7fffffff;
+                       else
+                               val = abs(val);
                        if (max_peak[c] < val)
                                max_peak[c] = val;
                        valp++;
@@ -1745,11 +1946,13 @@ static void compute_max_peak(u_char *data, size_t count)
                }
                return;
        }
-       max = 1 << (bits_per_sample-1);
+       max = 1 << (significant_bits_per_sample-1);
        if (max <= 0)
                max = 0x7fffffff;
 
        for (c = 0; c < ichans; c++) {
+               if (max_peak[c] > max)
+                       max_peak[c] = max;
                if (bits_per_sample > 16)
                        perc[c] = max_peak[c] / (max / 100);
                else
@@ -1773,8 +1976,8 @@ static void compute_max_peak(u_char *data, size_t count)
                print_vu_meter(perc, maxperc);
                fflush(stderr);
        }
-       else if(verbose==3) {
-               fprintf(stderr, _("Max peak (%li samples): 0x%08x "), (long)ocount, max_peak[0]);
+       else if (verbose==3) {
+               fprintf(stderr, _("Max peak (%li samples): 0x%08x "), (long)osamples, max_peak[0]);
                for (val = 0; val < 20; val++)
                        if (val <= perc[0] / 5)
                                putc('#', stderr);
@@ -1795,22 +1998,46 @@ static void do_test_position(void)
        static snd_pcm_sframes_t minavail, mindelay;
        static snd_pcm_sframes_t badavail = 0, baddelay = 0;
        snd_pcm_sframes_t outofrange;
-       snd_pcm_sframes_t avail, delay;
+       snd_pcm_sframes_t avail, delay, savail, sdelay;
+       snd_pcm_status_t *status;
        int err;
 
+       snd_pcm_status_alloca(&status);
        err = snd_pcm_avail_delay(handle, &avail, &delay);
        if (err < 0)
                return;
+       err = snd_pcm_status(handle, status);
+       if (err < 0)
+               return;
+       savail = snd_pcm_status_get_avail(status);
+       sdelay = snd_pcm_status_get_delay(status);
        outofrange = (test_coef * (snd_pcm_sframes_t)buffer_frames) / 2;
        if (avail > outofrange || avail < -outofrange ||
            delay > outofrange || delay < -outofrange) {
-         badavail = avail; baddelay = delay;
-         availsum = delaysum = samples = 0;
-         maxavail = maxdelay = 0;
-         minavail = mindelay = buffer_frames * 16;
-         fprintf(stderr, _("Suspicious buffer position (%li total): "
-               "avail = %li, delay = %li, buffer = %li\n"),
-               ++counter, (long)avail, (long)delay, (long)buffer_frames);
+               badavail = avail; baddelay = delay;
+               availsum = delaysum = samples = 0;
+               maxavail = maxdelay = 0;
+               minavail = mindelay = buffer_frames * 16;
+               fprintf(stderr, _("Suspicious buffer position (%li total): "
+                       "avail = %li, delay = %li, buffer = %li\n"),
+                       ++counter, (long)avail, (long)delay, (long)buffer_frames);
+       } else if (savail > outofrange || savail < -outofrange ||
+                  sdelay > outofrange || sdelay < -outofrange) {
+               badavail = savail; baddelay = sdelay;
+               availsum = delaysum = samples = 0;
+               maxavail = maxdelay = 0;
+               minavail = mindelay = buffer_frames * 16;
+               fprintf(stderr, _("Suspicious status buffer position (%li total): "
+                       "avail = %li, delay = %li, buffer = %li\n"),
+                       ++counter, (long)savail, (long)sdelay, (long)buffer_frames);
+       } else if (stream == SND_PCM_STREAM_CAPTURE && avail > delay) {
+               fprintf(stderr, _("Suspicious buffer position avail > delay (%li total): "
+                       "avail = %li, delay = %li\n"),
+                       ++counter, (long)avail, (long)delay);
+       } else if (stream == SND_PCM_STREAM_CAPTURE && savail > sdelay) {
+               fprintf(stderr, _("Suspicious status buffer position avail > delay (%li total): "
+                       "avail = %li, delay = %li\n"),
+                       ++counter, (long)savail, (long)sdelay);
        } else if (verbose) {
                time(&now);
                if (tmr == (time_t) -1) {
@@ -1821,19 +2048,27 @@ static void do_test_position(void)
                }
                if (avail > maxavail)
                        maxavail = avail;
+               if (savail > maxavail)
+                       maxavail = savail;
                if (delay > maxdelay)
                        maxdelay = delay;
+               if (sdelay > maxdelay)
+                       maxdelay = sdelay;
                if (avail < minavail)
                        minavail = avail;
+               if (savail < minavail)
+                       minavail = savail;
                if (delay < mindelay)
                        mindelay = delay;
+               if (sdelay < mindelay)
+                       mindelay = sdelay;
                availsum += avail;
                delaysum += delay;
                samples++;
-               if (avail != 0 && now != tmr) {
+               if ((maxavail != 0 || maxdelay != 0) && now != tmr) {
                        fprintf(stderr, "BUFPOS: avg%li/%li "
                                "min%li/%li max%li/%li (%li) (%li:%li/%li)\n",
-                               (long)(availsum / samples),
+                         (long)(availsum / samples),
                                (long)(delaysum / samples),
                                (long)minavail, (long)mindelay,
                                (long)maxavail, (long)maxdelay,
@@ -1842,14 +2077,18 @@ static void do_test_position(void)
                        tmr = now;
                }
        }
+       if (verbose == 1) {
+               fprintf(stderr, _("Status(R/W) (standalone avail=%li delay=%li):\n"), (long)avail, (long)delay);
+               snd_pcm_status_dump(status, log);
+       }
 }
 
 /*
  */
 #ifdef CONFIG_SUPPORT_CHMAP
-static u_char *remap_data(u_char *data, size_t count)
+static uint8_t *remap_data(uint8_t *data, size_t count)
 {
-       static u_char *tmp, *src, *dst;
+       static uint8_t *tmp, *src, *dst;
        static size_t tmp_size;
        size_t sample_bytes = bits_per_sample / 8;
        size_t step = bits_per_frame / 8;
@@ -1883,9 +2122,9 @@ static u_char *remap_data(u_char *data, size_t count)
        return tmp;
 }
 
-static u_char **remap_datav(u_char **data, size_t count)
+static uint8_t **remap_datav(uint8_t **data, size_t count ATTRIBUTE_UNUSED)
 {
-       static u_char **tmp;
+       static uint8_t **tmp;
        unsigned int ch;
 
        if (!hw_map)
@@ -1911,7 +2150,7 @@ static u_char **remap_datav(u_char **data, size_t count)
  *  write function
  */
 
-static ssize_t pcm_write(u_char *data, size_t count)
+static ssize_t pcm_write(uint8_t *data, size_t count)
 {
        ssize_t r;
        ssize_t result = 0;
@@ -1950,7 +2189,7 @@ static ssize_t pcm_write(u_char *data, size_t count)
        return result;
 }
 
-static ssize_t pcm_writev(u_char **data, unsigned int channels, size_t count)
+static ssize_t pcm_writev(uint8_t **data, unsigned int channels, size_t count)
 {
        ssize_t r;
        size_t result = 0;
@@ -2003,7 +2242,7 @@ static ssize_t pcm_writev(u_char **data, unsigned int channels, size_t count)
  *  read function
  */
 
-static ssize_t pcm_read(u_char *data, size_t rcount)
+static ssize_t pcm_read(uint8_t *data, size_t rcount)
 {
        ssize_t r;
        size_t result = 0;
@@ -2013,7 +2252,9 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
                count = chunk_size;
        }
 
-       while (count > 0 && !in_aborting) {
+       while (count > 0) {
+               if (in_aborting)
+                       goto abort;
                if (test_position)
                        do_test_position();
                check_stdin();
@@ -2039,10 +2280,11 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
                        data += r * bits_per_frame / 8;
                }
        }
-       return rcount;
+abort:
+       return result > rcount ? rcount : result;
 }
 
-static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
+static ssize_t pcm_readv(uint8_t **data, unsigned int channels, size_t rcount)
 {
        ssize_t r;
        size_t result = 0;
@@ -2052,7 +2294,9 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
                count = chunk_size;
        }
 
-       while (count > 0 && !in_aborting) {
+       while (count > 0) {
+               if (in_aborting)
+                       goto abort;
                unsigned int channel;
                void *bufs[channels];
                size_t offset = result;
@@ -2084,6 +2328,7 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
                        count -= r;
                }
        }
+abort:
        return rcount;
 }
 
@@ -2091,12 +2336,12 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
  *  ok, let's play a .voc file
  */
 
-static ssize_t voc_pcm_write(u_char *data, size_t count)
+static ssize_t voc_pcm_write(uint8_t *data, size_t count)
 {
        ssize_t result = count, r;
        size_t size;
 
-       while (count > 0) {
+       while (count > 0 && !in_aborting) {
                size = count;
                if (size > chunk_bytes - buffer_pos)
                        size = chunk_bytes - buffer_pos;
@@ -2116,9 +2361,9 @@ static ssize_t voc_pcm_write(u_char *data, size_t count)
 static void voc_write_silence(unsigned x)
 {
        unsigned l;
-       u_char *buf;
+       uint8_t *buf;
 
-       buf = (u_char *) malloc(chunk_bytes);
+       buf = (uint8_t *) malloc(chunk_bytes);
        if (buf == NULL) {
                error(_("can't allocate buffer for silence"));
                return;         /* not fatal error */
@@ -2159,15 +2404,15 @@ static void voc_play(int fd, int ofs, char *name)
        VocVoiceData *vd;
        VocExtBlock *eb;
        size_t nextblock, in_buffer;
-       u_char *data, *buf;
+       uint8_t *data, *buf;
        char was_extended = 0, output = 0;
-       u_short *sp, repeat = 0;
-       off64_t filepos = 0;
+       uint16_t *sp, repeat = 0;
+       off_t filepos = 0;
 
 #define COUNT(x)       nextblock -= x; in_buffer -= x; data += x
 #define COUNT1(x)      in_buffer -= x; data += x
 
-       data = buf = (u_char *)malloc(64 * 1024);
+       data = buf = (uint8_t *)malloc(64 * 1024);
        buffer_pos = 0;
        if (data == NULL) {
                error(_("malloc error"));
@@ -2191,6 +2436,7 @@ static void voc_play(int fd, int ofs, char *name)
                }
        }
        hwparams.format = DEFAULT_FORMAT;
+       hwparams.subformat = SND_PCM_SUBFORMAT_STD;
        hwparams.channels = 1;
        hwparams.rate = DEFAULT_SPEED;
        set_params();
@@ -2259,8 +2505,8 @@ static void voc_play(int fd, int ofs, char *name)
 #endif
                                break;
                        case 3: /* a silence block, no data, only a count */
-                               sp = (u_short *) data;
-                               COUNT1(sizeof(u_short));
+                               sp = (uint16_t *) data;
+                               COUNT1(sizeof(uint16_t));
                                hwparams.rate = (int) (*data);
                                COUNT1(1);
                                hwparams.rate = 1000000 / (256 - hwparams.rate);
@@ -2275,8 +2521,8 @@ static void voc_play(int fd, int ofs, char *name)
                                voc_write_silence(*sp);
                                break;
                        case 4: /* a marker for syncronisation, no effect */
-                               sp = (u_short *) data;
-                               COUNT1(sizeof(u_short));
+                               sp = (uint16_t *) data;
+                               COUNT1(sizeof(uint16_t));
 #if 0
                                d_printf("Marker %d\n", *sp);
 #endif
@@ -2290,13 +2536,13 @@ static void voc_play(int fd, int ofs, char *name)
                        case 6: /* repeat marker, says repeatcount */
                                /* my specs don't say it: maybe this can be recursive, but
                                   I don't think somebody use it */
-                               repeat = *(u_short *) data;
-                               COUNT1(sizeof(u_short));
+                               repeat = *(uint16_t *) data;
+                               COUNT1(sizeof(uint16_t));
 #if 0
                                d_printf("Repeat loop %d times\n", repeat);
 #endif
                                if (filepos >= 0) {     /* if < 0, one seek fails, why test another */
-                                       if ((filepos = lseek64(fd, 0, 1)) < 0) {
+                                       if ((filepos = lseek(fd, 0, 1)) < 0) {
                                                error(_("can't play loops; %s isn't seekable\n"), name);
                                                repeat = 0;
                                        } else {
@@ -2318,7 +2564,7 @@ static void voc_play(int fd, int ofs, char *name)
                                        else
                                                d_printf("Neverending loop\n");
 #endif
-                                       lseek64(fd, filepos, 0);
+                                       lseek(fd, filepos, 0);
                                        in_buffer = 0;  /* clear the buffer */
                                        goto Fill_the_buffer;
                                }
@@ -2356,7 +2602,7 @@ static void voc_play(int fd, int ofs, char *name)
                        l = nextblock;
                if (l) {
                        if (output && !quiet_mode) {
-                               if (write(2, data, l) != l) {   /* to stderr */
+                               if (xwrite(2, data, l) != l) {  /* to stderr */
                                        error(_("write error"));
                                        prg_exit(EXIT_FAILURE);
                                }
@@ -2370,7 +2616,9 @@ static void voc_play(int fd, int ofs, char *name)
                }
        }                       /* while(1) */
       __end:
-        voc_pcm_flush();
+       if (!in_aborting) {
+               voc_pcm_flush();
+       }
         free(buf);
 }
 /* that was a big one, perhaps somebody split it :-) */
@@ -2382,15 +2630,18 @@ static void init_raw_data(void)
 }
 
 /* calculate the data count to read from/to dsp */
-static off64_t calc_count(void)
+static off_t calc_count(void)
 {
-       off64_t count;
+       off_t count;
 
-       if (timelimit == 0) {
-               count = pbrec_count;
-       } else {
+       if (timelimit == 0)
+               if (sampleslimit == 0)
+                       count = pbrec_count;
+               else
+                       count = snd_pcm_format_size(hwparams.format, sampleslimit * hwparams.channels);
+       else {
                count = snd_pcm_format_size(hwparams.format, hwparams.rate * hwparams.channels);
-               count *= (off64_t)timelimit;
+               count *= (off_t)timelimit;
        }
        return count < pbrec_count ? count : pbrec_count;
 }
@@ -2408,7 +2659,7 @@ static void begin_voc(int fd, size_t cnt)
        vh.version = LE_SHORT(VOC_ACTUAL_VERSION);
        vh.coded_ver = LE_SHORT(0x1233 - VOC_ACTUAL_VERSION);
 
-       if (write(fd, &vh, sizeof(VocHeader)) != sizeof(VocHeader)) {
+       if (xwrite(fd, &vh, sizeof(VocHeader)) != sizeof(VocHeader)) {
                error(_("write error"));
                prg_exit(EXIT_FAILURE);
        }
@@ -2417,30 +2668,30 @@ static void begin_voc(int fd, size_t cnt)
                bt.type = 8;
                bt.datalen = 4;
                bt.datalen_m = bt.datalen_h = 0;
-               if (write(fd, &bt, sizeof(VocBlockType)) != sizeof(VocBlockType)) {
+               if (xwrite(fd, &bt, sizeof(VocBlockType)) != sizeof(VocBlockType)) {
                        error(_("write error"));
                        prg_exit(EXIT_FAILURE);
                }
                eb.tc = LE_SHORT(65536 - 256000000L / (hwparams.rate << 1));
                eb.pack = 0;
                eb.mode = 1;
-               if (write(fd, &eb, sizeof(VocExtBlock)) != sizeof(VocExtBlock)) {
+               if (xwrite(fd, &eb, sizeof(VocExtBlock)) != sizeof(VocExtBlock)) {
                        error(_("write error"));
                        prg_exit(EXIT_FAILURE);
                }
        }
        bt.type = 1;
        cnt += sizeof(VocVoiceData);    /* Channel_data block follows */
-       bt.datalen = (u_char) (cnt & 0xFF);
-       bt.datalen_m = (u_char) ((cnt & 0xFF00) >> 8);
-       bt.datalen_h = (u_char) ((cnt & 0xFF0000) >> 16);
-       if (write(fd, &bt, sizeof(VocBlockType)) != sizeof(VocBlockType)) {
+       bt.datalen = (uint8_t) (cnt & 0xFF);
+       bt.datalen_m = (uint8_t) ((cnt & 0xFF00) >> 8);
+       bt.datalen_h = (uint8_t) ((cnt & 0xFF0000) >> 16);
+       if (xwrite(fd, &bt, sizeof(VocBlockType)) != sizeof(VocBlockType)) {
                error(_("write error"));
                prg_exit(EXIT_FAILURE);
        }
-       vd.tc = (u_char) (256 - (1000000 / hwparams.rate));
+       vd.tc = (uint8_t) (256 - (1000000 / hwparams.rate));
        vd.pack = 0;
-       if (write(fd, &vd, sizeof(VocVoiceData)) != sizeof(VocVoiceData)) {
+       if (xwrite(fd, &vd, sizeof(VocVoiceData)) != sizeof(VocVoiceData)) {
                error(_("write error"));
                prg_exit(EXIT_FAILURE);
        }
@@ -2453,8 +2704,8 @@ static void begin_wave(int fd, size_t cnt)
        WaveFmtBody f;
        WaveChunkHeader cf, cd;
        int bits;
-       u_int tmp;
-       u_short tmp2;
+       uint32_t tmp;
+       uint16_t tmp2;
 
        /* WAVE cannot handle greater than 32bit (signed?) int */
        if (cnt == (size_t)-2)
@@ -2468,11 +2719,11 @@ static void begin_wave(int fd, size_t cnt)
        case SND_PCM_FORMAT_S16_LE:
                bits = 16;
                break;
+       case SND_PCM_FORMAT_S24_LE: /* S24_LE is 24 bits stored in 32 bit width with 8 bit padding */
        case SND_PCM_FORMAT_S32_LE:
-        case SND_PCM_FORMAT_FLOAT_LE:
+       case SND_PCM_FORMAT_FLOAT_LE:
                bits = 32;
                break;
-       case SND_PCM_FORMAT_S24_LE:
        case SND_PCM_FORMAT_S24_3LE:
                bits = 24;
                break;
@@ -2497,11 +2748,11 @@ static void begin_wave(int fd, size_t cnt)
 #if 0
        tmp2 = (samplesize == 8) ? 1 : 2;
        f.byte_p_spl = LE_SHORT(tmp2);
-       tmp = dsp_speed * hwparams.channels * (u_int) tmp2;
+       tmp = dsp_speed * hwparams.channels * (uint32_t) tmp2;
 #else
        tmp2 = hwparams.channels * snd_pcm_format_physical_width(hwparams.format) / 8;
        f.byte_p_spl = LE_SHORT(tmp2);
-       tmp = (u_int) tmp2 * hwparams.rate;
+       tmp = (uint32_t) tmp2 * hwparams.rate;
 #endif
        f.byte_p_sec = LE_INT(tmp);
        f.bit_p_spl = LE_SHORT(bits);
@@ -2509,10 +2760,10 @@ static void begin_wave(int fd, size_t cnt)
        cd.type = WAV_DATA;
        cd.length = LE_INT(cnt);
 
-       if (write(fd, &h, sizeof(WaveHeader)) != sizeof(WaveHeader) ||
-           write(fd, &cf, sizeof(WaveChunkHeader)) != sizeof(WaveChunkHeader) ||
-           write(fd, &f, sizeof(WaveFmtBody)) != sizeof(WaveFmtBody) ||
-           write(fd, &cd, sizeof(WaveChunkHeader)) != sizeof(WaveChunkHeader)) {
+       if (xwrite(fd, &h, sizeof(WaveHeader)) != sizeof(WaveHeader) ||
+           xwrite(fd, &cf, sizeof(WaveChunkHeader)) != sizeof(WaveChunkHeader) ||
+           xwrite(fd, &f, sizeof(WaveFmtBody)) != sizeof(WaveFmtBody) ||
+           xwrite(fd, &cd, sizeof(WaveChunkHeader)) != sizeof(WaveChunkHeader)) {
                error(_("write error"));
                prg_exit(EXIT_FAILURE);
        }
@@ -2542,7 +2793,7 @@ static void begin_au(int fd, size_t cnt)
        }
        ah.sample_rate = BE_INT(hwparams.rate);
        ah.channels = BE_INT(hwparams.channels);
-       if (write(fd, &ah, sizeof(AuHeader)) != sizeof(AuHeader)) {
+       if (xwrite(fd, &ah, sizeof(AuHeader)) != sizeof(AuHeader)) {
                error(_("write error"));
                prg_exit(EXIT_FAILURE);
        }
@@ -2551,12 +2802,12 @@ static void begin_au(int fd, size_t cnt)
 /* closing .VOC */
 static void end_voc(int fd)
 {
-       off64_t length_seek;
+       off_t length_seek;
        VocBlockType bt;
        size_t cnt;
        char dummy = 0;         /* Write a Terminator */
 
-       if (write(fd, &dummy, 1) != 1) {
+       if (xwrite(fd, &dummy, 1) != 1) {
                error(_("write error"));
                prg_exit(EXIT_FAILURE);
        }
@@ -2568,21 +2819,19 @@ static void end_voc(int fd)
        cnt += sizeof(VocVoiceData);    /* Channel_data block follows */
        if (cnt > 0x00ffffff)
                cnt = 0x00ffffff;
-       bt.datalen = (u_char) (cnt & 0xFF);
-       bt.datalen_m = (u_char) ((cnt & 0xFF00) >> 8);
-       bt.datalen_h = (u_char) ((cnt & 0xFF0000) >> 16);
-       if (lseek64(fd, length_seek, SEEK_SET) == length_seek)
-               write(fd, &bt, sizeof(VocBlockType));
-       if (fd != 1)
-               close(fd);
+       bt.datalen = (uint8_t) (cnt & 0xFF);
+       bt.datalen_m = (uint8_t) ((cnt & 0xFF00) >> 8);
+       bt.datalen_h = (uint8_t) ((cnt & 0xFF0000) >> 16);
+       if (lseek(fd, length_seek, SEEK_SET) == length_seek)
+               xwrite(fd, &bt, sizeof(VocBlockType));
 }
 
 static void end_wave(int fd)
 {                              /* only close output */
        WaveChunkHeader cd;
-       off64_t length_seek;
-       off64_t filelen;
-       u_int rifflen;
+       off_t length_seek;
+       off_t filelen;
+       uint32_t rifflen;
        
        length_seek = sizeof(WaveHeader) +
                      sizeof(WaveChunkHeader) +
@@ -2591,25 +2840,21 @@ static void end_wave(int fd)
        cd.length = fdcount > 0x7fffffff ? LE_INT(0x7fffffff) : LE_INT(fdcount);
        filelen = fdcount + 2*sizeof(WaveChunkHeader) + sizeof(WaveFmtBody) + 4;
        rifflen = filelen > 0x7fffffff ? LE_INT(0x7fffffff) : LE_INT(filelen);
-       if (lseek64(fd, 4, SEEK_SET) == 4)
-               write(fd, &rifflen, 4);
-       if (lseek64(fd, length_seek, SEEK_SET) == length_seek)
-               write(fd, &cd, sizeof(WaveChunkHeader));
-       if (fd != 1)
-               close(fd);
+       if (lseek(fd, 4, SEEK_SET) == 4)
+               xwrite(fd, &rifflen, 4);
+       if (lseek(fd, length_seek, SEEK_SET) == length_seek)
+               xwrite(fd, &cd, sizeof(WaveChunkHeader));
 }
 
 static void end_au(int fd)
 {                              /* only close output */
        AuHeader ah;
-       off64_t length_seek;
+       off_t length_seek;
        
        length_seek = (char *)&ah.data_size - (char *)&ah;
        ah.data_size = fdcount > 0xffffffff ? 0xffffffff : BE_INT(fdcount);
-       if (lseek64(fd, length_seek, SEEK_SET) == length_seek)
-               write(fd, &ah.data_size, sizeof(ah.data_size));
-       if (fd != 1)
-               close(fd);
+       if (lseek(fd, length_seek, SEEK_SET) == length_seek)
+               xwrite(fd, &ah.data_size, sizeof(ah.data_size));
 }
 
 static void header(int rtype, char *name)
@@ -2635,11 +2880,11 @@ static void header(int rtype, char *name)
 
 /* playing raw data */
 
-static void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *name)
+static void playback_go(int fd, size_t loaded, off_t count, int rtype, char *name)
 {
        int l, r;
-       off64_t written = 0;
-       off64_t c;
+       off_t written = 0;
+       off_t c;
 
        header(rtype, name);
        set_params();
@@ -2657,8 +2902,15 @@ static void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *n
        while (written < count && !in_aborting) {
                do {
                        c = count - written;
-                       if (c > chunk_bytes)
+                       if (c > (off_t)chunk_bytes)
                                c = chunk_bytes;
+
+                       /* c < l, there is more data loaded
+                        * then we actually need to write
+                        */
+                       if (c < l)
+                               l = c;
+
                        c -= l;
 
                        if (c == 0)
@@ -2681,11 +2933,97 @@ static void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *n
                written += r;
                l = 0;
        }
-       snd_pcm_nonblock(handle, 0);
-       snd_pcm_drain(handle);
-       snd_pcm_nonblock(handle, nonblock);
+       if (!in_aborting) {
+               snd_pcm_nonblock(handle, 0);
+               snd_pcm_drain(handle);
+               snd_pcm_nonblock(handle, nonblock);
+       }
 }
 
+static int read_header(int *loaded, int header_size)
+{
+       int ret;
+       struct stat buf;
+
+       ret = fstat(fd, &buf);
+       if (ret < 0) {
+               perror("fstat");
+               prg_exit(EXIT_FAILURE);
+       }
+
+       /* don't be adventurous, get out if file size is smaller than
+        * requested header size */
+       if ((buf.st_mode & S_IFMT) == S_IFREG &&
+           buf.st_size < header_size)
+               return -1;
+
+       if (*loaded < header_size) {
+               header_size -= *loaded;
+               ret = safe_read(fd, audiobuf + *loaded, header_size);
+               if (ret != header_size) {
+                       error(_("read error"));
+                       prg_exit(EXIT_FAILURE);
+               }
+               *loaded += header_size;
+       }
+       return 0;
+}
+
+static int playback_au(char *name, int *loaded)
+{
+       if (read_header(loaded, sizeof(AuHeader)) < 0)
+               return -1;
+
+       if (test_au(fd, audiobuf) < 0)
+               return -1;
+
+       rhwparams.format = hwparams.format;
+       pbrec_count = calc_count();
+       playback_go(fd, *loaded - sizeof(AuHeader), pbrec_count, FORMAT_AU, name);
+
+       return 0;
+}
+
+static int playback_voc(char *name, int *loaded)
+{
+       int ofs;
+
+       if (read_header(loaded, sizeof(VocHeader)) < 0)
+               return -1;
+
+       if ((ofs = test_vocfile(audiobuf)) < 0)
+               return -1;
+
+       pbrec_count = calc_count();
+       voc_play(fd, ofs, name);
+
+       return 0;
+}
+
+static int playback_wave(char *name, int *loaded)
+{
+       ssize_t dtawave;
+
+       if (read_header(loaded, sizeof(WaveHeader)) < 0)
+               return -1;
+
+       if ((dtawave = test_wavefile(fd, audiobuf, *loaded)) < 0)
+               return -1;
+
+       pbrec_count = calc_count();
+       playback_go(fd, dtawave, pbrec_count, FORMAT_WAVE, name);
+
+       return 0;
+}
+
+static int playback_raw(char *name, int *loaded)
+{
+       init_raw_data();
+       pbrec_count = calc_count();
+       playback_go(fd, *loaded, pbrec_count, FORMAT_RAW, name);
+
+       return 0;
+}
 
 /*
  *  let's play or capture it (capture_type says VOC/WAVE/raw)
@@ -2693,9 +3031,7 @@ static void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *n
 
 static void playback(char *name)
 {
-       int ofs;
-       size_t dta;
-       ssize_t dtawave;
+       int loaded = 0;
 
        pbrec_count = LLONG_MAX;
        fdcount = 0;
@@ -2709,41 +3045,30 @@ static void playback(char *name)
                        prg_exit(EXIT_FAILURE);
                }
        }
-       /* read the file header */
-       dta = sizeof(AuHeader);
-       if ((size_t)safe_read(fd, audiobuf, dta) != dta) {
-               error(_("read error"));
-               prg_exit(EXIT_FAILURE);
-       }
-       if (test_au(fd, audiobuf) >= 0) {
-               rhwparams.format = hwparams.format;
-               pbrec_count = calc_count();
-               playback_go(fd, 0, pbrec_count, FORMAT_AU, name);
-               goto __end;
-       }
-       dta = sizeof(VocHeader);
-       if ((size_t)safe_read(fd, audiobuf + sizeof(AuHeader),
-                dta - sizeof(AuHeader)) != dta - sizeof(AuHeader)) {
-               error(_("read error"));
-               prg_exit(EXIT_FAILURE);;
-       }
-       if ((ofs = test_vocfile(audiobuf)) >= 0) {
-               pbrec_count = calc_count();
-               voc_play(fd, ofs, name);
-               goto __end;
-       }
-       /* read bytes for WAVE-header */
-       if ((dtawave = test_wavefile(fd, audiobuf, dta)) >= 0) {
-               pbrec_count = calc_count();
-               playback_go(fd, dtawave, pbrec_count, FORMAT_WAVE, name);
-       } else {
-               /* should be raw data */
-               init_raw_data();
-               pbrec_count = calc_count();
-               playback_go(fd, dta, pbrec_count, FORMAT_RAW, name);
-       }
-      __end:
-       if (fd != 0)
+
+       switch(file_type) {
+       case FORMAT_AU:
+               playback_au(name, &loaded);
+               break;
+       case FORMAT_VOC:
+               playback_voc(name, &loaded);
+               break;
+       case FORMAT_WAVE:
+               playback_wave(name, &loaded);
+               break;
+       case FORMAT_RAW:
+               playback_raw(name, &loaded);
+               break;
+       default:
+               /* parse the file header */
+               if (playback_au(name, &loaded) < 0 &&
+                   playback_voc(name, &loaded) < 0 &&
+                   playback_wave(name, &loaded) < 0)
+                       playback_raw(name, &loaded); /* should be raw data */
+               break;
+        }
+
+       if (fd != fileno(stdin))
                close(fd);
 }
 
@@ -2820,7 +3145,7 @@ static int new_capture_file(char *name, char *namebuf, size_t namelen,
                            int filecount)
 {
        char *s;
-       char buf[PATH_MAX+1];
+       char buf[PATH_MAX-10];
        time_t t;
        struct tm *tmp;
 
@@ -2840,6 +3165,7 @@ static int new_capture_file(char *name, char *namebuf, size_t namelen,
 
        /* get a copy of the original filename */
        strncpy(buf, name, sizeof(buf));
+       buf[sizeof(buf)-1] = '\0';
 
        /* separate extension from filename */
        s = buf + strlen(buf);
@@ -2927,15 +3253,19 @@ static void capture(char *orig_name)
        int tostdout=0;         /* boolean which describes output stream */
        int filecount=0;        /* number of files written */
        char *name = orig_name; /* current filename */
-       char namebuf[PATH_MAX+1];
-       off64_t count, rest;            /* number of bytes to capture */
+       char namebuf[PATH_MAX+2];
+       off_t count, rest;              /* number of bytes to capture */
+       struct stat statbuf;
+
+       /* setup sound hardware */
+       set_params();
 
        /* get number of bytes to capture */
        count = calc_count();
        if (count == 0)
                count = LLONG_MAX;
        /* compute the number of bytes per file */
-       max_file_size = max_file_time *
+       max_file_size = (long long) max_file_time *
                snd_pcm_format_size(hwparams.format,
                                    hwparams.rate * hwparams.channels);
        /* WAVE-file should be even (I'm not sure), but wasting one byte
@@ -2948,14 +3278,11 @@ static void capture(char *orig_name)
        /* display verbose output to console */
        header(file_type, name);
 
-       /* setup sound hardware */
-       set_params();
-
        /* write to stdout? */
        if (!name || !strcmp(name, "-")) {
                fd = fileno(stdout);
                name = "stdout";
-               tostdout=1;
+               tostdout = 1;
                if (count > fmt_rec_table[file_type].max_filesize)
                        count = fmt_rec_table[file_type].max_filesize;
        }
@@ -2963,7 +3290,7 @@ static void capture(char *orig_name)
 
        do {
                /* open a file to write */
-               if(!tostdout) {
+               if (!tostdout) {
                        /* upon the second file we start the numbering scheme */
                        if (filecount || use_strftime) {
                                filecount = new_capture_file(orig_name, namebuf,
@@ -2973,7 +3300,10 @@ static void capture(char *orig_name)
                        }
                        
                        /* open a new file */
-                       remove(name);
+                       if (!lstat(name, &statbuf)) {
+                               if (S_ISREG(statbuf.st_mode))
+                                       remove(name);
+                       }
                        fd = safe_open(name);
                        if (fd < 0) {
                                perror(name);
@@ -2995,18 +3325,22 @@ static void capture(char *orig_name)
                /* capture */
                fdcount = 0;
                while (rest > 0 && recycle_capture_file == 0 && !in_aborting) {
-                       size_t c = (rest <= (off64_t)chunk_bytes) ?
+                       size_t c = (rest <= (off_t)chunk_bytes) ?
                                (size_t)rest : chunk_bytes;
                        size_t f = c * 8 / bits_per_frame;
-                       if (pcm_read(audiobuf, f) != f)
-                               break;
-                       if (write(fd, audiobuf, c) != c) {
+                       size_t read = pcm_read(audiobuf, f);
+                       size_t save;
+                       if (read != f)
+                               in_aborting = 1;
+                       save = read * bits_per_frame / 8;
+                       if (xwrite(fd, audiobuf, save) != (ssize_t)save) {
                                perror(name);
-                               prg_exit(EXIT_FAILURE);
+                               in_aborting = 1;
+                               break;
                        }
                        count -= c;
                        rest -= c;
-                       fdcount += c;
+                       fdcount += save;
                }
 
                /* re-enable SIGUSR1 signal */
@@ -3016,27 +3350,29 @@ static void capture(char *orig_name)
                }
 
                /* finish sample container */
-               if (fmt_rec_table[file_type].end && !tostdout) {
-                       fmt_rec_table[file_type].end(fd);
+               if (!tostdout) {
+                       if (fmt_rec_table[file_type].end)
+                               fmt_rec_table[file_type].end(fd);
+                       close(fd);
                        fd = -1;
                }
 
                if (in_aborting)
-                       break;
+                       prg_exit(EXIT_FAILURE);
 
                /* repeat the loop when format is raw without timelimit or
                 * requested counts of data are recorded
                 */
-       } while ((file_type == FORMAT_RAW && !timelimit) || count > 0);
+       } while ((file_type == FORMAT_RAW && !timelimit && !sampleslimit) || count > 0);
 }
 
-static void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t count, int rtype, char **names)
+static void playbackv_go(int* fds, unsigned int channels, size_t loaded, off_t count, int rtype, char **names)
 {
        int r;
        size_t vsize;
 
        unsigned int channel;
-       u_char *bufs[channels];
+       uint8_t *bufs[channels];
 
        header(rtype, names[0]);
        set_params();
@@ -3057,7 +3393,7 @@ static void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t
                do {
                        r = safe_read(fds[0], bufs[0], expected);
                        if (r < 0) {
-                               perror(names[channel]);
+                               perror(names[0]);
                                prg_exit(EXIT_FAILURE);
                        }
                        for (channel = 1; channel < channels; ++channel) {
@@ -3077,18 +3413,20 @@ static void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t
                r = r * bits_per_frame / 8;
                count -= r;
        }
-       snd_pcm_nonblock(handle, 0);
-       snd_pcm_drain(handle);
-       snd_pcm_nonblock(handle, nonblock);
+       if (!in_aborting) {
+               snd_pcm_nonblock(handle, 0);
+               snd_pcm_drain(handle);
+               snd_pcm_nonblock(handle, nonblock);
+       }
 }
 
-static void capturev_go(int* fds, unsigned int channels, off64_t count, int rtype, char **names)
+static void capturev_go(int* fds, unsigned int channels, off_t count, int rtype, char **names)
 {
        size_t c;
        ssize_t r;
        unsigned int channel;
        size_t vsize;
-       u_char *bufs[channels];
+       uint8_t *bufs[channels];
 
        header(rtype, names[0]);
        set_params();
@@ -3108,7 +3446,7 @@ static void capturev_go(int* fds, unsigned int channels, off64_t count, int rtyp
                        break;
                rv = r * bits_per_sample / 8;
                for (channel = 0; channel < channels; ++channel) {
-                       if ((size_t)write(fds[channel], bufs[channel], rv) != rv) {
+                       if ((size_t)xwrite(fds[channel], bufs[channel], rv) != rv) {
                                perror(names[channel]);
                                prg_exit(EXIT_FAILURE);
                        }
@@ -3131,18 +3469,18 @@ static void playbackv(char **names, unsigned int count)
 
        if (count == 1 && channels > 1) {
                size_t len = strlen(names[0]);
-               char format[1024];
-               memcpy(format, names[0], len);
-               strcpy(format + len, ".%d");
-               len += 4;
+               char buf[len + 1];
+               strcpy(buf, names[0]);
+               /* 1 for "." + 3 for channel (<= 256) + 1 for null terminator */
+               len += 5;
                names = malloc(sizeof(*names) * channels);
                for (channel = 0; channel < channels; ++channel) {
                        names[channel] = malloc(len);
-                       sprintf(names[channel], format, channel);
+                       snprintf(names[channel], len, "%s.%d", buf, channel);
                }
                alloced = 1;
        } else if (count != channels) {
-               error(_("You need to specify %d files"), channels);
+               error(_("You need to specify %u files"), channels);
                prg_exit(EXIT_FAILURE);
        }
 
@@ -3184,14 +3522,14 @@ static void capturev(char **names, unsigned int count)
 
        if (count == 1) {
                size_t len = strlen(names[0]);
-               char format[1024];
-               memcpy(format, names[0], len);
-               strcpy(format + len, ".%d");
-               len += 4;
+               char buf[len + 1];
+               strcpy(buf, names[0]);
+               /* 1 for "." + 3 for channel (<= 256) + 1 for null terminator */
+               len += 5;
                names = malloc(sizeof(*names) * channels);
                for (channel = 0; channel < channels; ++channel) {
                        names[channel] = malloc(len);
-                       sprintf(names[channel], format, channel);
+                       snprintf(names[channel], len, "%s.%d", buf, channel);
                }
                alloced = 1;
        } else if (count != channels) {
index 2945dad..3bba59d 100644 (file)
@@ -62,7 +62,7 @@ Some of these may not be available on selected hardware
 The available format shortcuts are:
 .nf
 \-f cd (16 bit little endian, 44100, stereo) [\-f S16_LE \-c2 \-r44100]
-\-f cdr (16 bit big endian, 44100, stereo) [\-f S16_BE \-c2 \-f44100]
+\-f cdr (16 bit big endian, 44100, stereo) [\-f S16_BE \-c2 \-r44100]
 \-f dat (16 bit little endian, 48000, stereo) [\-f S16_LE \-c2 \-r48000]
 .fi
 If no format is given U8 is used.
@@ -75,10 +75,14 @@ Valid values are 2000 through 192000 Hertz.
 \fI\-d, \-\-duration=#\fP
 Interrupt after # seconds.
 A value of zero means infinity.
-The default is zero, so if this option is omitted then the arecord process will run until it is killed.
+The default is zero, so if this option is omitted then the record/playback process will run until it is killed.
+Either '-d' or '-s' option is available exclusively.
 .TP
-\fI\-s, \-\-sleep\-min=#\fP
-Min ticks to sleep. The default is not to sleep.
+\fI\-s, \-\-samples=#\fP
+Interrupt after transmission of # PCM frames.
+A value of zero means infinity.
+The default is zero, so if this options is omitted then the record/playback process will run until it is killed.
+Either '-d' or '-s' option is available exclusively.
 .TP
 \fI\-M, \-\-mmap\fP            
 Use memory\-mapped (mmap) I/O mode for the audio stream.
index ac0a2b0..d82505e 100644 (file)
@@ -1,8 +1,7 @@
 #ifndef FORMATS_H
 #define FORMATS_H              1
 
-#include <endian.h>
-#include <byteswap.h>
+#include "bswap.h"
 
 /* Definitions for .VOC files */
 
                                ((u_long)(bp->datalen_h) << 16) )
 
 typedef struct voc_header {
-       u_char magic[20];       /* must be MAGIC_STRING */
-       u_short headerlen;      /* Headerlength, should be 0x1A */
-       u_short version;        /* VOC-file version */
-       u_short coded_ver;      /* 0x1233-version */
+       uint8_t magic[20];      /* must be MAGIC_STRING */
+       uint16_t headerlen;     /* Headerlength, should be 0x1A */
+       uint16_t version;       /* VOC-file version */
+       uint16_t coded_ver;     /* 0x1233-version */
 } VocHeader;
 
 typedef struct voc_blocktype {
-       u_char type;
-       u_char datalen;         /* low-byte    */
-       u_char datalen_m;       /* medium-byte */
-       u_char datalen_h;       /* high-byte   */
+       uint8_t type;
+       uint8_t datalen;                /* low-byte    */
+       uint8_t datalen_m;      /* medium-byte */
+       uint8_t datalen_h;      /* high-byte   */
 } VocBlockType;
 
 typedef struct voc_voice_data {
-       u_char tc;
-       u_char pack;
+       uint8_t tc;
+       uint8_t pack;
 } VocVoiceData;
 
 typedef struct voc_ext_block {
-       u_short tc;
-       u_char pack;
-       u_char mode;
+       uint16_t tc;
+       uint8_t pack;
+       uint8_t mode;
 } VocExtBlock;
 
 /* Definitions for Microsoft WAVE format */
@@ -86,32 +85,32 @@ typedef struct voc_ext_block {
    it works on all WAVE-file I have
  */
 typedef struct {
-       u_int magic;            /* 'RIFF' */
-       u_int length;           /* filelen */
-       u_int type;             /* 'WAVE' */
+       uint32_t magic;         /* 'RIFF' */
+       uint32_t length;        /* filelen */
+       uint32_t type;          /* 'WAVE' */
 } WaveHeader;
 
 typedef struct {
-       u_short format;         /* see WAV_FMT_* */
-       u_short channels;
-       u_int sample_fq;        /* frequence of sample */
-       u_int byte_p_sec;
-       u_short byte_p_spl;     /* samplesize; 1 or 2 bytes */
-       u_short bit_p_spl;      /* 8, 12 or 16 bit */
+       uint16_t format;        /* see WAV_FMT_* */
+       uint16_t channels;
+       uint32_t sample_fq;     /* frequence of sample */
+       uint32_t byte_p_sec;
+       uint16_t byte_p_spl;    /* samplesize; 1 or 2 bytes */
+       uint16_t bit_p_spl;     /* 8, 12 or 16 bit */
 } WaveFmtBody;
 
 typedef struct {
        WaveFmtBody format;
-       u_short ext_size;
-       u_short bit_p_spl;
-       u_int channel_mask;
-       u_short guid_format;    /* WAV_FMT_* */
-       u_char guid_tag[14];    /* WAV_GUID_TAG */
+       uint16_t ext_size;
+       uint16_t bit_p_spl;
+       uint32_t channel_mask;
+       uint16_t guid_format;   /* WAV_FMT_* */
+       uint8_t guid_tag[14];   /* WAV_GUID_TAG */
 } WaveFmtExtensibleBody;
 
 typedef struct {
-       u_int type;             /* 'data' */
-       u_int length;           /* samplecount */
+       uint32_t type;          /* 'data' */
+       uint32_t length;        /* samplecount */
 } WaveChunkHeader;
 
 /* Definitions for Sparc .au header */
@@ -123,12 +122,12 @@ typedef struct {
 #define AU_FMT_LIN16           3
 
 typedef struct au_header {
-       u_int magic;            /* '.snd' */
-       u_int hdr_size;         /* size of header (min 24) */
-       u_int data_size;        /* size of data */
-       u_int encoding;         /* see to AU_FMT_XXXX */
-       u_int sample_rate;      /* sample rate */
-       u_int channels;         /* number of channels (voices) */
+       uint32_t magic;         /* '.snd' */
+       uint32_t hdr_size;      /* size of header (min 24) */
+       uint32_t data_size;     /* size of data */
+       uint32_t encoding;      /* see to AU_FMT_XXXX */
+       uint32_t sample_rate;   /* sample rate */
+       uint32_t channels;      /* number of channels (voices) */
 } AuHeader;
 
 #endif                         /* FORMATS */
diff --git a/axfer/Makefile.am b/axfer/Makefile.am
new file mode 100644 (file)
index 0000000..a00176c
--- /dev/null
@@ -0,0 +1,72 @@
+bin_PROGRAMS = \
+       axfer
+
+man_MANS = \
+       axfer.1 \
+       axfer-list.1 \
+       axfer-transfer.1
+
+# To include headers for gettext and version.
+AM_CPPFLAGS = \
+       -I$(top_srcdir)/include
+
+# Unit tests.
+SUBDIRS = \
+       test
+
+LIBRT = @LIBRT@
+LDADD = \
+       $(LIBINTL) \
+       $(LIBRT)
+
+noinst_HEADERS = \
+       misc.h \
+       subcmd.h \
+       container.h \
+       mapper.h \
+       xfer.h \
+       xfer-libasound.h \
+       frame-cache.h
+       waiter.h
+
+axfer_SOURCES = \
+       misc.h \
+       subcmd.h \
+       main.c \
+       subcmd-list.c \
+       container.h \
+       container.c \
+       container-riff-wave.c \
+       container-au.c \
+       container-voc.c \
+       container-raw.c \
+       mapper.h \
+       mapper.c \
+       mapper-single.c \
+       mapper-multiple.c \
+       xfer.h \
+       xfer.c \
+       xfer-options.c \
+       xfer-libasound.h \
+       xfer-libasound.c \
+       frame-cache.h \
+       frame-cache.c \
+       xfer-libasound-irq-rw.c \
+       subcmd-transfer.c \
+       xfer-libasound-irq-mmap.c \
+       waiter.h \
+       waiter.c \
+       waiter-poll.c \
+       waiter-select.c \
+       waiter-epoll.c \
+       xfer-libasound-timer-mmap.c
+
+if HAVE_FFADO
+axfer_SOURCES += xfer-libffado.c
+LDADD += -lffado
+endif
+
+EXTRA_DIST = \
+       axfer.1 \
+       axfer-list.1 \
+       axfer-transfer.1
diff --git a/axfer/Makefile.in b/axfer/Makefile.in
new file mode 100644 (file)
index 0000000..febcfc9
--- /dev/null
@@ -0,0 +1,1036 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = axfer$(EXEEXT)
+@HAVE_FFADO_TRUE@am__append_1 = xfer-libffado.c
+@HAVE_FFADO_TRUE@am__append_2 = -lffado
+subdir = axfer
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__axfer_SOURCES_DIST = misc.h subcmd.h main.c subcmd-list.c \
+       container.h container.c container-riff-wave.c container-au.c \
+       container-voc.c container-raw.c mapper.h mapper.c \
+       mapper-single.c mapper-multiple.c xfer.h xfer.c xfer-options.c \
+       xfer-libasound.h xfer-libasound.c frame-cache.h frame-cache.c \
+       xfer-libasound-irq-rw.c subcmd-transfer.c \
+       xfer-libasound-irq-mmap.c waiter.h waiter.c waiter-poll.c \
+       waiter-select.c waiter-epoll.c xfer-libasound-timer-mmap.c \
+       xfer-libffado.c
+@HAVE_FFADO_TRUE@am__objects_1 = xfer-libffado.$(OBJEXT)
+am_axfer_OBJECTS = main.$(OBJEXT) subcmd-list.$(OBJEXT) \
+       container.$(OBJEXT) container-riff-wave.$(OBJEXT) \
+       container-au.$(OBJEXT) container-voc.$(OBJEXT) \
+       container-raw.$(OBJEXT) mapper.$(OBJEXT) \
+       mapper-single.$(OBJEXT) mapper-multiple.$(OBJEXT) \
+       xfer.$(OBJEXT) xfer-options.$(OBJEXT) xfer-libasound.$(OBJEXT) \
+       frame-cache.$(OBJEXT) xfer-libasound-irq-rw.$(OBJEXT) \
+       subcmd-transfer.$(OBJEXT) xfer-libasound-irq-mmap.$(OBJEXT) \
+       waiter.$(OBJEXT) waiter-poll.$(OBJEXT) waiter-select.$(OBJEXT) \
+       waiter-epoll.$(OBJEXT) xfer-libasound-timer-mmap.$(OBJEXT) \
+       $(am__objects_1)
+axfer_OBJECTS = $(am_axfer_OBJECTS)
+axfer_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+axfer_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/container-au.Po \
+       ./$(DEPDIR)/container-raw.Po \
+       ./$(DEPDIR)/container-riff-wave.Po \
+       ./$(DEPDIR)/container-voc.Po ./$(DEPDIR)/container.Po \
+       ./$(DEPDIR)/frame-cache.Po ./$(DEPDIR)/main.Po \
+       ./$(DEPDIR)/mapper-multiple.Po ./$(DEPDIR)/mapper-single.Po \
+       ./$(DEPDIR)/mapper.Po ./$(DEPDIR)/subcmd-list.Po \
+       ./$(DEPDIR)/subcmd-transfer.Po ./$(DEPDIR)/waiter-epoll.Po \
+       ./$(DEPDIR)/waiter-poll.Po ./$(DEPDIR)/waiter-select.Po \
+       ./$(DEPDIR)/waiter.Po ./$(DEPDIR)/xfer-libasound-irq-mmap.Po \
+       ./$(DEPDIR)/xfer-libasound-irq-rw.Po \
+       ./$(DEPDIR)/xfer-libasound-timer-mmap.Po \
+       ./$(DEPDIR)/xfer-libasound.Po ./$(DEPDIR)/xfer-libffado.Po \
+       ./$(DEPDIR)/xfer-options.Po ./$(DEPDIR)/xfer.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(axfer_SOURCES)
+DIST_SOURCES = $(am__axfer_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+HEADERS = $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+man_MANS = \
+       axfer.1 \
+       axfer-list.1 \
+       axfer-transfer.1
+
+
+# To include headers for gettext and version.
+AM_CPPFLAGS = \
+       -I$(top_srcdir)/include
+
+
+# Unit tests.
+SUBDIRS = \
+       test
+
+LDADD = $(LIBINTL) $(LIBRT) $(am__append_2)
+noinst_HEADERS = \
+       misc.h \
+       subcmd.h \
+       container.h \
+       mapper.h \
+       xfer.h \
+       xfer-libasound.h \
+       frame-cache.h
+
+axfer_SOURCES = misc.h subcmd.h main.c subcmd-list.c container.h \
+       container.c container-riff-wave.c container-au.c \
+       container-voc.c container-raw.c mapper.h mapper.c \
+       mapper-single.c mapper-multiple.c xfer.h xfer.c xfer-options.c \
+       xfer-libasound.h xfer-libasound.c frame-cache.h frame-cache.c \
+       xfer-libasound-irq-rw.c subcmd-transfer.c \
+       xfer-libasound-irq-mmap.c waiter.h waiter.c waiter-poll.c \
+       waiter-select.c waiter-epoll.c xfer-libasound-timer-mmap.c \
+       $(am__append_1)
+EXTRA_DIST = \
+       axfer.1 \
+       axfer-list.1 \
+       axfer-transfer.1
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign axfer/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign axfer/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
+axfer$(EXEEXT): $(axfer_OBJECTS) $(axfer_DEPENDENCIES) $(EXTRA_axfer_DEPENDENCIES) 
+       @rm -f axfer$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(axfer_OBJECTS) $(axfer_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/container-au.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/container-raw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/container-riff-wave.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/container-voc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/container.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frame-cache.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapper-multiple.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapper-single.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapper.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subcmd-list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subcmd-transfer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waiter-epoll.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waiter-poll.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waiter-select.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waiter.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-libasound-irq-mmap.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-libasound-irq-rw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-libasound-timer-mmap.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-libasound.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-libffado.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer-options.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfer.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man1: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man1dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.1[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
+           dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+           $(am__relativize); \
+           new_distdir=$$reldir; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+               -rm -f ./$(DEPDIR)/container-au.Po
+       -rm -f ./$(DEPDIR)/container-raw.Po
+       -rm -f ./$(DEPDIR)/container-riff-wave.Po
+       -rm -f ./$(DEPDIR)/container-voc.Po
+       -rm -f ./$(DEPDIR)/container.Po
+       -rm -f ./$(DEPDIR)/frame-cache.Po
+       -rm -f ./$(DEPDIR)/main.Po
+       -rm -f ./$(DEPDIR)/mapper-multiple.Po
+       -rm -f ./$(DEPDIR)/mapper-single.Po
+       -rm -f ./$(DEPDIR)/mapper.Po
+       -rm -f ./$(DEPDIR)/subcmd-list.Po
+       -rm -f ./$(DEPDIR)/subcmd-transfer.Po
+       -rm -f ./$(DEPDIR)/waiter-epoll.Po
+       -rm -f ./$(DEPDIR)/waiter-poll.Po
+       -rm -f ./$(DEPDIR)/waiter-select.Po
+       -rm -f ./$(DEPDIR)/waiter.Po
+       -rm -f ./$(DEPDIR)/xfer-libasound-irq-mmap.Po
+       -rm -f ./$(DEPDIR)/xfer-libasound-irq-rw.Po
+       -rm -f ./$(DEPDIR)/xfer-libasound-timer-mmap.Po
+       -rm -f ./$(DEPDIR)/xfer-libasound.Po
+       -rm -f ./$(DEPDIR)/xfer-libffado.Po
+       -rm -f ./$(DEPDIR)/xfer-options.Po
+       -rm -f ./$(DEPDIR)/xfer.Po
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+               -rm -f ./$(DEPDIR)/container-au.Po
+       -rm -f ./$(DEPDIR)/container-raw.Po
+       -rm -f ./$(DEPDIR)/container-riff-wave.Po
+       -rm -f ./$(DEPDIR)/container-voc.Po
+       -rm -f ./$(DEPDIR)/container.Po
+       -rm -f ./$(DEPDIR)/frame-cache.Po
+       -rm -f ./$(DEPDIR)/main.Po
+       -rm -f ./$(DEPDIR)/mapper-multiple.Po
+       -rm -f ./$(DEPDIR)/mapper-single.Po
+       -rm -f ./$(DEPDIR)/mapper.Po
+       -rm -f ./$(DEPDIR)/subcmd-list.Po
+       -rm -f ./$(DEPDIR)/subcmd-transfer.Po
+       -rm -f ./$(DEPDIR)/waiter-epoll.Po
+       -rm -f ./$(DEPDIR)/waiter-poll.Po
+       -rm -f ./$(DEPDIR)/waiter-select.Po
+       -rm -f ./$(DEPDIR)/waiter.Po
+       -rm -f ./$(DEPDIR)/xfer-libasound-irq-mmap.Po
+       -rm -f ./$(DEPDIR)/xfer-libasound-irq-rw.Po
+       -rm -f ./$(DEPDIR)/xfer-libasound-timer-mmap.Po
+       -rm -f ./$(DEPDIR)/xfer-libasound.Po
+       -rm -f ./$(DEPDIR)/xfer-libffado.Po
+       -rm -f ./$(DEPDIR)/xfer-options.Po
+       -rm -f ./$(DEPDIR)/xfer.Po
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--depfiles check check-am clean clean-binPROGRAMS \
+       clean-generic clean-libtool cscopelist-am ctags ctags-am \
+       distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am uninstall-binPROGRAMS uninstall-man \
+       uninstall-man1
+
+.PRECIOUS: Makefile
+
+       waiter.h
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/axfer/axfer-list.1 b/axfer/axfer-list.1
new file mode 100644 (file)
index 0000000..306d928
--- /dev/null
@@ -0,0 +1,86 @@
+.TH AXFER\-LIST 1 "28 November 2018" "alsa\-utils"
+
+.SH NAME
+axfer\-list \- dump lists of available sound devices and nodes to transfer audio
+data frame.
+
+.SH SYNOPSIS
+
+.B axfer list
+.I direction target
+
+direction =
+.B capture
+|
+.B playback
+
+target =
+.B device
+|
+.B pcm
+
+.SH DESCRIPTION
+The
+.B list
+subcommand of
+.B axfer
+dumps lists of available nodes to
+transfer audio data frame. At present, the subcommand is helpful just for
+libasound backend of
+.B transfer
+subcommand.
+
+.SH OPTIONS
+
+.SS Direction
+
+.TP
+.B capture
+Operates for capture transmission.
+
+.TP
+.B playback
+Operates for playback transmission.
+
+.SS Target
+
+.TP
+.B device
+Dumps a list of all soundcards and digital audio devices available in
+.I libasound
+backend for
+.I tranfer
+subcommand.
+
+.TP
+.B pcm
+Dumps a list of all PCM nodes available in alsa\-lib configuration space in
+.I libasound
+backend for
+.I transfer
+subcommand.
+
+.SH COMPATIBILITY TO APLAY
+
+Options of
+.I \-l
+,
+.I \-\-list-devices
+are handled as
+.I device
+operation. Options of
+.I \-L
+,
+.I \-\-list-pcms
+are handled as
+.I pcm
+operation.
+
+.SH SEE ALSO
+.B axfer(1),
+.B axfer\-transfer(1),
+.B alsamixer(1),
+.B amixer(1)
+
+.SH AUTHOR
+Takashi Sakamoto <o\-takashi@sakamocchi.jp>
diff --git a/axfer/axfer-transfer.1 b/axfer/axfer-transfer.1
new file mode 100644 (file)
index 0000000..2e831b2
--- /dev/null
@@ -0,0 +1,1009 @@
+.TH AXFER\-TRANSFER 1 "28 November 2018" "alsa\-utils"
+
+.SH NAME
+axfer\-transfer \- transferrer of audio data frame for sound devices and nodes.
+
+.SH SYNOPSIS
+
+.B axfer transfer
+.I direction
+[
+.I common\-options
+] [
+.I backend\-options
+] [
+.I filepath
+]
+
+.B axfer transfer
+.I direction
+[
+.I common\-options
+] [
+.I backend\-options
+]
+.I \-I
+|
+.I \-\-separate\-channels filepath ...
+
+direction =
+.B capture
+|
+.B playback
+
+common\-options = ( read
+.I OPTIONS
+section )
+
+backend\-options = ( read
+.I OPTIONS
+section )
+
+filepaths = ( read
+.I OPTIONS
+section )
+
+.SH DESCRIPTION
+The
+.B transfer
+subcommand of
+.B axfer
+performs transmission of audio data frames for devices available in supported
+backends. This program is essentially designed to use alsa\-lib APIs
+(libasound backend) to handle sound devices supported by Linux sound subsystem
+(ALSA).
+
+.SH OPTIONS
+
+.SS Direction
+
+.TP
+.B capture
+Operates for capture transmission.
+
+.TP
+.B playback
+Operates for playback transmission.
+
+.SS Filepath
+
+Filepath is handled as a path relative to current working directory of run time
+if it\(aqs not full path from root directory.
+
+The standard input or output is used if filepath is not specified or given as
+.I \(aq\-\(aq
+\&.
+
+For playback transmission, container format of given
+.I filepath
+is detected automatically and metadata is used for parameters of sample format,
+channels, rate, duration. If nothing detected, content of given file path is
+handled as raw data. In this case, the parameters should be indicated as
+options.
+
+Multiple
+.I filepaths
+are allowed with
+.I \-I
+|
+.I \-\-separate\-channels
+option. In this case, standard input and output is not available. The same
+.I filepath
+is not allowed except for paths listed below:
+ \- /dev/null
+ \- /dev/zero
+ \- /dev/full
+ \- /dev/random
+ \- /dev/urandom
+
+.SS Common options
+
+.TP
+.B \-h, \-\-help
+Print help messages and finish run time.
+
+.TP
+.B \-q, \-\-quiet
+Quiet mode. Suppress messages (not sound :))
+
+.TP
+.B \-v, \-\-verbose
+Verbose mode. Runtime dumps supplemental information according to the number of
+this option given in command line.
+
+.TP
+.B \-d, \-\-duration=#
+Interrupt after # seconds. A value of zero means infinity. The default is zero,
+so if this option is omitted then the transmission process will run until it is
+killed. Either
+.I \-d
+or
+.I \-s
+option is available exclusively.
+
+.TP
+.B \-s, \-\-samples=#
+Interrupt after transmission of # number of data frames. A value of zero means
+infinity. The default is zero, so if this options is omitted then the
+transmission process will run until it is killed. Either
+.I \-d
+or
+.I \-s
+option is available exclusively.
+
+.TP
+.B \-f, \-\-format=FORMAT
+Indicate format of audio sample. This is required for capture transmission, or
+playback transmission with files including raw audio data.
+
+Available sample format is listed below:
+ - [S8|U8|S16|U16|S32|U32][_LE|_BE]
+ - [S24|U24][_LE|_BE]
+ - FLOAT[_LE|_BE]
+ - FLOAT64[_LE|_BE]
+ - IEC958_SUBFRAME[_LE|_BE]
+ - MU_LAW
+ - A_LAW
+ - [S20|U20][_LE|_BE]
+ - [S24|U24][_3LE|_3BE]
+ - [S20|U20][_3LE|_3BE]
+ - [S18|U18][_3LE|_3BE]
+ - DSD_U8
+ - DSD_[U16|U32][_LE|_BE]
+
+If endian\-ness is omitted, host endian\-ness is used.
+
+Some special formats are available:
+ - cd (16 bit little endian, 44100, stereo) [= \-f S16_LE \-c 2 \-r 44100]
+ - cdr (16 bit big endian, 44100, stereo) [= \-f S16_BE \-c 2 \-f 44100]
+ - dat (16 bit little endian, 48000, stereo) [= \-f S16_LE \-c 2 \-r 48000]
+
+If omitted,
+.I U8
+is used as a default. Actual available formats are restricted by each
+transmission backend.
+
+Unavailable sample format is listed below. These format has size of data frame
+unaligned to byte unit.
+
+ - IMA_ADPCM
+ - MPEG
+ - GSM
+ - SPECIAL
+ - G723_24
+ - G723_24_1B
+ - G723_40
+ - G723_40_1B
+
+.TP
+.B \-c, \-\-channels=#
+Indicate the number of audio data samples per frame. This is required for
+capture transmission, or playback transmission with files including raw audio
+data. The value should be between
+.I 1 to
+.I 256
+\&. If omitted,
+.I 1
+is used as a default.
+
+.TP
+.B \-r, \-\-rate=#
+Indicate the number of audio data frame per second. This is required for
+capture transmission, or playback transmission with files including raw audio
+data. If the value is less than
+.I 1000
+, it\(aqs interpreted by
+.I kHz
+unit. The value should be between
+.I 2000
+and
+.I 192000
+\&. If omitted,
+.I 8000
+is used as a default.
+
+.TP
+.B \-t, \-\-file\-type=TYPE
+Indicate the type of file. This is required for capture transmission. Available
+types are listed below:
+ - wav: Microsoft/IBM RIFF/Wave format
+ - au, sparc: Sparc AU format
+ - voc: Creative Tech. voice format
+ - raw: raw data
+
+When nothing is indicated, for capture transmission, the type is decided
+according to suffix of
+.I filepath
+, and
+.I raw
+type is used for fallback.
+
+.TP
+.B \-I, \-\-separate\-channels
+Indicate this option when several files are going to be handled. For capture
+transmission, if one filepath is given as
+.I filepath
+, a list of
+.I filepaths
+is generated in a formula \(aq<filepath>\-<sequential number>[.suffix]\(aq.
+The suffix is omitted when raw format of container is used.
+
+.TP
+.B \-\-dump\-hw\-params
+Dump hardware parameters and finish run time if backend supports it.
+
+.TP
+.B \-\-xfer\-backend=BACKEND
+Select backend of transmission from a list below. The default is libasound.
+.br
+ - libasound
+ - libffado (optional if compiled)
+
+.SS Backend options for libasound
+
+.TP
+.B \-D, \-\-device=NODE
+
+This option is used to select PCM node in libasound configuration space.
+Available nodes are listed by
+.I pcm
+operation of
+.I list
+subcommand.
+
+.TP
+.B \-N, \-\-nonblock
+
+With this option, PCM substream is opened in non\-blocking mode. When audio
+data frame is not available in buffer of the PCM substream, I/O operation
+immediately returns without blocking process. This option implicitly uses
+.I \-\-waiter\-type
+option as well to prevent heavy consumption of CPU time.
+
+.TP
+.B \-M, \-\-mmap
+
+With this option, audio data frame is processed directly in buffer of PCM
+substream if selected node supports this operation. Without the option,
+temporary buffers are used to copy audio data frame for buffer of PCM substream.
+This option implicitly uses
+.I \-\-waiter\-type
+option as well to prevent heavy consumption of CPU time.
+
+.TP
+.B \-F, \-\-period\-size=#
+
+This option configures given value to
+.I period_size
+hardware parameter of PCM substream. The parameter indicates the number of audio
+data frame per period in buffer of the PCM substream. Actual number is decided
+as a result of interaction between each implementation of PCM plugin chained
+from the selected PCM node, and in\-kernel driver or PCM I/O plugins.
+
+Ideally, the same amount of audio data frame as the value should be handled in
+one I/O operation. Actually, it is not, depending on implementation of the PCM
+plugins, in\-kernel driver, PCM I/O plugins and scheduling model. For \(aqhw\(aq
+PCM plugin in \(aqirq\(aq scheduling model, the value is used to decide
+intervals of hardware interrupt, thus the same amount of audio data frame as
+the value is expected to be available for one I/O operation.
+
+.TP
+.B \-\-period\-time=#
+
+This option configures given value to
+.I period_time
+hardware parameter of PCM substream. This option is similar to
+.I \-\-period\-size
+option, however its unit is micro\-second.
+
+.TP
+.B \-B, \-\-buffer\-size=#
+
+This option configures given value to
+.I buffer_size
+hardware parameter of PCM substream. The parameter indicates the number of audio
+data frame in buffer of PCM substream. Actual number is decided as a result of
+interaction between each implementation of PCM plugin chained from the selected
+PCM node, and in\-kernel driver or PCM I/O plugins.
+
+Ideally, this is multiples of the number of audio data frame per period, thus
+the size of period. Actually, it is not, depending on implementation of the PCM
+plugins, in\-kernel driver and PCM I/O plugins.
+
+.TP
+.B \-\-buffer\-time=#
+
+This option configures given value to
+.I buffer_time
+hardware parameter of PCM substream. This option is similar to
+.I \-\-buffer\-size
+option, however its unit is micro\-second.
+
+.TP
+.B \-\-waiter\-type=TYPE
+
+This option indicates the type of waiter for event notification. At present,
+four types are available;
+.I default
+,
+.I select
+,
+.I poll
+and
+.I epoll
+\&. With
+.I default
+type, \(aqsnd_pcm_wait()\(aq is used. With
+.I select
+type, \(aqselect(2)\(aq system call is used. With
+.I poll
+type, \(aqpoll(2)\(aq system call is used. With
+.I epoll
+type, Linux\-specific \(aqepoll(7)\(aq system call is used.
+
+This option should correspond to one of
+.I \-\-nonblock
+or
+.I \-\-mmap
+options, or
+.I timer
+value of
+.I \-\-sched\-model
+option.
+Neither this option nor
+.I \-\-test\-nowait
+is available at the same time.
+
+.TP
+.B \-\-sched\-model=MODEL
+
+This option selects scheduling model for process of this program. One of
+.I irq
+or
+.I timer
+is available. In detail, please read \(aqSCHEDULING MODEL\(aq section.
+
+When nothing specified,
+.I irq
+model is used.
+
+.TP
+.B \-A, \-\-avail\-min=#
+
+This option configures given value to
+.I avail\-min
+software parameter of PCM substream. In blocking mode, the value is used as
+threshold of the number of available audio data frames in buffer of PCM
+substream to wake up process blocked by I/O operation. In non\-blocking mode,
+any I/O operation returns \-EAGAIN until the available number of audio data frame reaches the threshold.
+
+This option has an effect in cases neither
+.I \-\-mmap
+nor
+.I timer
+value of
+.I \-\-sched\-model
+option is used.
+
+.TP
+.B \-R, \-\-start\-delay=#
+
+This option configures given value to
+.I start_threshold
+software parameter of PCM substream. The value is used as threshold to start
+PCM substream automatically. At present, this option has an effect in cases
+neither
+.I \-\-mmap
+nor
+.I timer
+value of
+.I \-\-sched\-model
+option is used.
+
+For playback transmission, when the number of accumulated audio data frame
+in buffer of PCM substream to which this program writes out reaches the
+threshold, the PCM substream starts automatically without an explicit call of
+.I snd_pcm_start()
+to the PCM substream.
+
+For capture transmission, this option is useless. The number of
+accumulated audio data frame is not increased without an explicit call of
+.I snd_pcm_start()
+to the PCM substream.
+
+This option has an effect in cases neither
+.I \-\-mmap
+nor
+.I timer
+value of
+.I \-\-sched\-model
+option is used.
+
+.TP
+.B \-T, \-\-stop\-delay=#
+
+This option configures given value to
+.I stop_threshold
+software parameter of PCM substream. The value is used as threshold to stop PCM
+substream automatically. At present, this option has an effect in cases neither
+.I \-\-mmap
+nor
+.I timer
+value of
+.I \-\-sched\-model
+option is used.
+
+For capture transmission, when the number of accumulated audio data frame
+in buffer of PCM substream to which a driver or alsa\-lib PCM plugins write
+reaches the threshold, the PCM substream stops automatically without an explicit
+call of
+.I snd_pcm_stop()
+to the PCM substream. This is a case that this program leaves the audio data
+frames without reading for a while.
+
+For playback transmission, when the number available audio data frame in buffer
+of PCM substream from which a driver or alsa\-lib PCM plugins read reaches the
+threshold, the PCM substream stops automatically without an explicit call of
+.I snd_pcm_stop()
+to the PCM substream. This is a case that this program leaves the audio data
+frames without writing for a while.
+
+This option has an effect in cases neither
+.I \-\-mmap
+nor
+.I timer
+value of
+.I \-\-sched\-model
+option is used.
+
+.TP
+.B \-\-disable\-resample
+
+This option has an effect for \(aqplug\(aq plugin in alsa\-lib to suppress
+conversion of sampling rate for audio data frame.
+
+.TP
+.B \-\-disable\-channels
+
+This option has an effect for \(aqplug\(aq plugin in alsa\-lib to suppress
+conversion of channels for audio data frame.
+
+.TP
+.B \-\-disable\-format
+
+This option has an effect for \(aqplug\(aq plugin in alsa\-lib to suppress
+conversion of sample format for audio data frame.
+
+.TP
+.B \-\-disable\-softvol
+
+This option has an effect for \(aqsoftvol\(aq plugin in alsa\-lib to suppress
+conversion of samples for audio data frame via additional control element.
+
+.TP
+.B \-\-fatal\-errors
+
+This option suppresses recovery operation from XRUN state of running PCM
+substream, then process of this program is going to finish as usual.
+
+.TP
+.B \-\-test\-nowait
+
+This option disables any waiter for I/O event notification. I/O operations are
+iterated till any of audio data frame is available. The option brings heavy
+load in consumption of CPU time.
+
+.SS Backend options for libffado
+
+This backend is automatically available when configure script detects
+.I ffado_streaming_init()
+symbol in libffado shared object.
+
+.TP
+.B \-p, \-\-port=#
+
+This option uses given value to decide which 1394 OHCI controller is used to
+communicate. When Linux system has two 1394 OHCI controllers,
+.I 0
+or
+.I 1
+are available. Neither this option nor
+.I \-g
+is available at the same time. If nothing specified, libffado performs to
+communicate to units on IEEE 1394 bus managed by all of 1394 OHCI controller available in Linux system.
+
+.TP
+.B \-n, \-\-node=#
+
+This option uses given value to decide which unit is used to communicate. This
+option requires
+.I \-p
+option to indicate which 1394 OHCI controller is used to communicate to the
+specified unit.
+
+.TP
+.B \-g, \-\-guid=HEXADECIMAL
+
+This option uses given value to decide a target unit to communicate. The value
+should be prefixed with '0x' and consists of hexadecimal literal letters
+(0\-9, a\-f, A\-F). Neither this option nor
+.I \-p
+is available at the same time. If nothing specified, libffado performs to
+communicate to units on IEEE 1394 bus managed by all of 1394 OHCI controller
+available in Linux system.
+
+.TP
+.B \-\-frames\-per\-period=#
+
+This option uses given value to decide the number of audio data frame in one
+read/write operation. The operation is blocked till the number of available
+audio data frame exceeds the given value. As a default, 512 audio data frames
+is used.
+
+.TP
+.B \-\-periods\-per\-buffer=#
+
+This option uses given value to decide the size of intermediate buffer between
+this program and libffado. As a default, 2 periods per buffer is used.
+
+.TP
+.B \-\-slave
+
+This option allows this program to run slave mode. In this mode, libffado
+adds unit directory into configuration ROM of 1394 OHCI controller where Linux
+system runs. The unit directory can be found by the other node on the same bus.
+Linux system running on the node can transfer isochronous packet with audio
+data frame to the unit. This program can receive the packet and demultiplex the
+audio data frame.
+
+.TP
+.B \-\-snoop
+
+This option allows this program to run snoop mode. In this mode, libffado
+listens isochronous channels to which device transfers isochronous packet. When
+isochronous communication starts by any unit on the same bus, the packets can
+be handled by this program.
+
+.TP
+.B \-\-sched\-priority=#
+
+This option executes
+.I pthread_setschedparam()
+in a call of
+.I ffado_streaming_init()
+to configure
+scheduling policy and given value as its priority for threads related to
+isochronous communication.
+The given value should be within
+.I RLIMIT_RTPRIO
+parameter of process. Please read
+.I getrlimit(2)
+for details.
+
+.SH POSIX SIGNALS
+During transmission,
+.I SIGINT
+and
+.I SIGTERM
+will close handled files and PCM substream to be going to finish run time.
+
+.I SIGTSTP
+will suspend PCM substream and
+.I SIGCONT
+will resume it. No XRUNs are expected. With libffado backend, the suspend/resume
+is not supported and runtime is aborted immediately.
+
+The other signals perform default behaviours.
+
+.SH EXAMPLES
+
+.PP
+.in +4n
+.EX
+.B $ axfer transfer playback \-d 1 something
+.EE
+.in
+.PP
+
+The above will transfer audio data frame in \(aqsomething\(aq file for playback
+during 1 second.  The sample format is detected automatically as a result to
+parse \(aqsomething\(aq as long as it\(aqs compliant to one of Microsoft/IBM
+RIFF/Wave, Sparc AU, Creative Tech. voice formats. If nothing detected,
+.I \-r
+,
+.I \-c
+and
+.I \-f
+should be given,
+or
+.I \-f
+should be given with special format.
+
+.PP
+.in +4n
+.EX
+.B $ axfer transfer playback \-r 22050 \-c 1 \-f S16_LE \-t raw something
+.EE
+.in
+.PP
+
+The above will transfer audio data frame in \(aqsomething\(aq file including no
+information of sample format, as sample format of 22050 Hz, monaural, signed 16
+bit little endian PCM for playback. The transmission continues till catching
+.I SIGINT
+from keyboard or
+.I SIGTERM
+by
+.I kill(1)
+\&.
+
+.PP
+.in +4n
+.EX
+.B $ axfer transfer capture \-d 10 \-f cd something.wav
+.EE
+.in
+.PP
+
+The above will transfer audio data frame to \(aqsomething.wav\(aq file as
+sample format of 44.1 kHz, 2 channels, signed 16 bit little endian PCM, during
+10 seconds. The file format is Microsoft/IBM RIFF/Wave according to suffix of
+the given
+.I filepath
+\&.
+
+.PP
+.in +4n
+.EX
+.B $ axfer transfer capture \-s 1024 \-r 48000 \-c 2 \-f S32_BE \-I \-t au channels
+.EE
+.in
+.PP
+
+The above will transfer audio data frame as sample format of 48.0 kHz, 2
+channels, signed 32 bit big endian PCM for 1,024 number of data frames to files
+named \(aqchannels\-1.au\(aq and \(aqchannels\-2.au\(aq.
+
+.SH SCHEDULING MODEL
+
+In a design of ALSA PCM core, runtime of PCM substream supports two modes;
+.I period\-wakeup
+and
+.I no\-period\-wakeup.
+These two modes are for different scheduling models.
+
+.SS IRQ\-based scheduling model
+
+As a default,
+.I period\-wakeup
+mode is used. In this mode, in\-kernel drivers should operate hardware to
+generate periodical notification for transmission of audio data frame. The
+interval of notification is equivalent to the same amount of audio data frame
+as one period of buffer, against actual time.
+
+In a handler assigned to the notification, a helper function of ALSA PCM core
+is called to update a position to head of hardware transmission, then compare
+it with a position to head of application operation to judge overrun/underrun
+(XRUN) and to wake up blocked processes.
+
+For this purpose, hardware IRQ of controller for serial audio bus such as
+Inter\-IC sound is typically used. In this case, the controller generates the
+IRQ according to transmission on the serial audio bus. In the handler assigned
+to the IRQ, direct media access (DMA) transmission is requested between
+dedicated host memory and device memory.
+
+If target hardware doesn't support this kind of mechanism, the periodical
+notification should be emulated by any timer; e.g. hrtimer, kernel timer.
+External PCM plugins generated by PCM plugin SDK in alsa\-lib should also
+emulate the above behaviour.
+
+In this mode, PCM applications are programmed according to typical way of I/O
+operations. They execute blocking system calls to read/write audio data frame
+in buffer of PCM substream, or blocking system calls to wait until any audio
+data frame is available. In
+.I axfer
+, this is called
+.I IRQ\-based
+scheduling model and a default behaviour. Users can explicitly configure this
+mode by usage of
+.I \-\-sched\-model
+option with
+.I irq
+value.
+
+.SS Timer\-based scheduling model
+
+The
+.I no\-period\-wakeup
+mode is an optional mode of runtime of PCM substream. The mode assumes a
+specific feature of hardware and assist of in\-kernel driver and PCM
+applications. In this mode, in\-kernel drivers don't operate hardware to
+generate periodical notification for transmission of audio data frame.
+The hardware should automatically continue transmission of audio data frame
+without periodical operation of the drivers; e.g. according to auto\-triggered
+DMA transmission, a chain of registered descriptors.
+
+In this mode, nothing wakes up blocked processes, therefore PCM applications
+should be programmed without any blocking operation. For this reason, this mode
+is enabled when the PCM applications explicitly configure hardware parameter to
+runtime of PCM substream, to prevent disorder of existing applications.
+Additionally, nothing maintains timing for transmission of audio data frame,
+therefore the PCM applications should voluntarily handle any timer to queue
+audio data frame in buffer of the PCM substream for lapse of time. Furthermore,
+instead of driver, the PCM application should call a helper function of ALSA
+PCM core to update a position to head of hardware transmission and to check
+XRUN.
+
+In
+.I axfer
+, this is called
+.I timer\-based
+scheduling model and available as long as hardware/driver assists
+.I no\-period\-wakeup
+runtime. Users should explicitly set this mode by usage of
+.I \-\-sched\-model
+option with
+.I timer
+value.
+
+In the scheduling model, PCM applications need to care of available space on
+PCM buffer by lapse of time, typically by yielding CPU and wait for
+rescheduling. For the yielding, timeout is calculated for preferable amount of
+PCM frames to process. This is convenient to a kind of applications, like sound
+servers. when an I/O thread of the server wait for the timeout, the other
+threads can process audio data frames for server clients. Furthermore, with
+usage of rewinding/forwarding, applications can achieve low latency between
+transmission position and handling position even if they uses large size of
+PCM buffers.
+
+.SS Advantages and issues
+
+Ideally, timer\-based scheduling model has some advantages than IRQ\-based
+scheduling model. At first, no interrupt context runs for PCM substream. The
+PCM substream is handled in any process context only. No need to care of race
+conditions between IRQ and process contexts. This reduces some concerns for
+some developers of drivers and applications. Secondary, CPU time is not used
+for handlers on the interrupt context. The CPU time can be dedicated for the
+other tasks. This is good in a point of Time Sharing System. Thirdly, hardware
+is not configured to generate interrupts. This is good in a point of reduction
+of overall power consumption possibly.
+
+In either scheduling model, the hardware should allow drivers to read the
+number of audio data frame transferred between the dedicated memory and the
+device memory for audio serial bus. However, in timer\-based scheduling model,
+fine granularity and accuracy of the value is important. Actually hardware
+performs transmission between dedicated memory and device memory for a small
+batch of audio data frames or bytes. In a view of PCM applications, the
+granularity in current transmission is required to decide correct timeout for
+each I/O operation. As of Linux kernel v4.21, ALSA PCM interface between
+kernel/userspace has no feature to report it.
+
+.SH COMPATIBILITY TO APLAY
+
+The
+.B transfer
+subcommand of
+.B axfer
+is designed to keep compatibility to aplay(1). However some options below are
+not compatible due to several technical reasons.
+
+.TP
+.I \-I, \-\-separate\-channels
+This option is supported just for files to store audio data frames corresponding
+to each channel. In aplay(1) implementation, this option has an additional
+effect to use PCM buffer aligned to non\-interleaved order if a target device
+supports. As of 2018, PCM buffer of non\-interleaved order is hardly used by
+sound devices.
+
+.TP
+.I \-A, \-\-avail\-min=#
+This option indicates threshold to wake up blocked process in a unit of
+audio data frame. Against aplay(1) implementation, this option has no effect
+with
+.I \-\-mmap
+option as well as
+.I timer
+of
+.I \-\-sched\-model
+option.
+
+.TP
+.I \-R, \-\-start\-delay=#
+This option indicates threshold to start prepared PCM substream in a unit of
+audio data frame. Against aplay(1) implementation, this option has no effect
+with
+.I \-\-mmap
+option as well as
+.I timer
+of
+.I \-\-sched\-model
+option.
+
+.TP
+.I \-T, \-\-stop\-delay=#
+This option indicates threshold to stop running PCM substream in a unit of
+audio data frame. Against aplay(1) implementation, this option has no effect
+with
+.I \-\-mmap
+option as well as
+.I timer
+of
+.I \-\-sched\-model
+option.
+
+.TP
+.I \-\-max\-file\-time=#
+This option is unsupported. In aplay(1) implementation, the option has an
+effect for capture transmission to save files up to the same number of data
+frames as the given value by second unit, or the maximum number of data frames
+supported by used file format. When reaching to the limitation, used file is
+closed, then new file is opened and audio data frames are written. However, this
+option requires extra handling of files and shall increase complexity of main
+loop of axfer.
+
+.TP
+.I \-\-use\-strftime=FORMAT
+This option is unsupported. In aplay(1) implementation, the option has an effect
+for capture transmission to generate file paths according to given format in
+which some extra formats are available as well as formats supported by
+strftime(3). However, this option requires extra string processing for file
+paths and it\(aqs bothersome if written in C language.
+
+.TP
+.I \-\-process\-id\-file=FILEPATH
+This option is unsupported. In aplay(1) implementation, the option has an effect
+to create a file for given value and write out process ID to it. This file
+allows users to get process ID and send any POSIX signal to aplay process.
+However, this idea has some troubles for file locking when multiple aplay
+processes run with the same file.
+
+.TP
+.I \-V, \-\-vumeter=TYPE
+This option is not supported at present. In aplay(1) implementation, this option
+has an effect to occupy stdout with some terminal control characters and display
+vumeter for monaural and stereo channels. However, some problems lay; this
+feature is just for audio data frames with PCM format, this feature brings
+disorder of terminal after aborting, stdout is not available for pipeline.
+
+.TP
+.I \-i, \-\-interactive
+This option is not supported at present. In aplay(1) implementation, this option
+has an effect to occupy stdin for key input and suspend/resume PCM substream
+according to pushed enter key. However, this feature requires an additional
+input handling in main loop and leave bothersome operation to maintain PCM
+substream.
+
+.TP
+.I \-m, \-\-chmap=CH1,CH2,...
+ALSA PCM core and control core doesn't support this feature, therefore
+remapping should be done in userspace. This brings overhead to align audio
+data frames, especially for mmap operation. Furthermore, as of alsa-lib v1.1.8,
+some plugins don't support this feature expectedly, thus this option is a lack
+of transparent operation. At present, this option is not supported yet not to
+confuse users.
+
+.TP
+.I SIGTSTP, SIGCONT
+This performs suspend/resume of PCM substream. In aplay(1) implementation,
+these operations bring XRUN state to the substream, and suspend/resume is done
+in interactive mode in the above. Some developers use the signal for recovery
+test from XRUN. At present, no alternative is supported for the test.
+
+.TP
+.I SIGUSR1
+This is not supported. In aplay(1) implementation, this signal is assigned to a
+handler to close a current file to store audio data frame and open a new file
+to continue processing. However, as well as
+.I \-\-max\-file\-time
+option, this option should increase complexity of main loop of axfer.
+
+.SH DESIGN
+
+.SS Modular structure
+
+This program consists of three modules;
+.I xfer
+,
+.I mapper
+and
+.I container
+\&.
+Each module has an abstraction layer to enable actual implementation.
+
+.nf
+           --------     ----------     -------------
+device <-> | xfer | <-> | mapper | <-> | container | <-> file
+           --------     ----------     -------------
+            libasound    single         wav
+            libffado     multiple       au
+                                        voc
+                                        raw
+.fi
+
+The
+.I xfer
+module performs actual transmission to devices and nodes. The module can have
+several transmission backends. As a default backend,
+.I libasound
+backend is used to perform transmission via alsa\-lib APIs. The module allows
+each backend to parse own command line options.
+
+The
+.I container
+module performs to read/write audio data frame via descriptor for file/stream
+of multimedia container or raw data. The module automatically detect type of
+multimedia container and parse parameters in its metadata of data header. At
+present, three types of multimedia containers are supported; Microsoft/IBM
+RIFF/Wave (
+.I wav
+), Sparc AU (
+.I au
+) and Creative Technology voice (
+.I voc
+). Additionally, a special container is prepared for raw audio data (
+.I raw
+).
+
+The
+.I mapper
+module handles buffer layout and alignment for transmission of audio data frame.
+The module has two implementations;
+.I single
+and
+.I multiple
+\&.
+The
+.I single
+backend uses one container to construct the buffer. The
+.I multiple
+backend uses several containers to construct it.
+
+.SS Care of copying audio data frame
+
+Between the
+.I xfer
+module and
+.I mapper
+module, a pointer to buffer including audio data frames is passed. This buffer
+has two shapes for interleaved and non\-interleaved order. For the former, the
+pointer points to one buffer. For the latter, the pointer points to an array in
+which each element points to one buffer. Between the
+.I mapper
+module and
+.I container
+module, a pointer to one buffer is passed because supported media containers
+including raw type store audio data frames in interleaved order.
+
+In passing audio data frame between the modules, axfer is programmed to avoid
+copying between a buffer to another buffer as much as possible. For example, in
+some scenarios below, no copying occurs between modules.
+
+ - xfer(mmap/interleaved), mapper(single), container(any)
+ - xfer(mmap/non\-interleaved), mapper(multiple), containers(any)
+
+.SS Unit test
+
+For each of the
+.I mapper
+and
+.I container
+module, unit test is available. To run the tests, execute below command:
+
+.nf
+$ make test
+.fi
+
+Each test iterates writing to file and reading to the file for many times and it
+takes long time to finish. Please take care of the execution time if running on
+any CI environment.
+
+.SH SEE ALSO
+\fB
+axfer(1),
+axfer\-list(1),
+alsamixer(1),
+amixer(1)
+\fP
+
+.SH AUTHOR
+Takashi Sakamoto <o\-takashi@sakamocchi.jp>
diff --git a/axfer/axfer.1 b/axfer/axfer.1
new file mode 100644 (file)
index 0000000..3ae9c8e
--- /dev/null
@@ -0,0 +1,139 @@
+.TH AXFER 1 "28 November 2018" "alsa\-utils"
+
+.SH NAME
+axfer \- command\-line sound recorder and player for sound devices and nodes
+supported by Linux sound subsystem (Advanced Linux Sound Architecture, also
+known as ALSA).
+
+.SH SYNOPSYS
+
+.B axfer
+.I subcommand direction options
+
+subcommand =
+.B transfer
+|
+.B list
+|
+.B version
+|
+.B help
+
+direction =
+.B capture
+|
+.B playback
+
+options = ( depends on
+.I subcommand
+)
+
+.SH DESCRIPTION
+The
+.B axfer
+is a command\-line recorder and player to transfer audio data frame between
+sound devices/nodes and files/stdin/stdout.
+
+.SH OPTIONS
+
+.SS Subcommand
+
+.TP
+.B transfer
+Performs transmission of audio data frame. Its detail is described in
+.B axfer\-transfer(1)
+manual.
+
+.TP
+.B list
+Dumps lists of available sound devices and nodes. Its detail is described in
+.B axfer\-list(1)
+manual.
+
+.TP
+.B version
+Prints version of this application (as the same version as alsa\-utils package).
+
+.TP
+.B help
+Prints a short message about subcommands for users to enter this application.
+
+.SS Direction
+
+.TP
+.B capture
+Operates for capture transmission.
+
+.TP
+.B playback
+Operates for playback transmission.
+
+.SH EXIT STATUS
+
+.I EXIT_SUCCESS
+(0) if run time successfully finished, else
+.I EXIT_FAILURE
+(1).
+
+.SH UNIT TEST
+
+This program has unit tests for internal implementation. Please refer to the
+manual of
+.I axfer-transfer
+for details.
+
+.SH COMPATIBILITY TO APLAY
+
+The
+.I axfer
+is designed to be compatible to aplay(1) as much as possible. In command line,
+executions of aplay/arecord files under $PATH runs axfer with compatibility
+mode if filesystem has symbolic link from the aplay/arecord to axfer.
+
+.PP
+.in +4n
+.EX
+$ ln \-s aplay axfer
+$ ln \-s arecord axfer
+.EE
+.in
+.PP
+
+.SS A string to which arg[0] points
+When args[0] in run time points to string ended with \(aqaplay\(aq, it has the
+same meaning of
+.I playback
+direction. When it points to string ended with \(aqarecord\(aq, it has the same
+meaning of
+.I capture
+direction.
+
+.SS Options acknowledged as list subcommand
+Options of
+.I \-l
+,
+.I \-\-list\-devices
+,
+.I \-L
+,
+.I \-\-list\-pcms
+are acknowledged as
+.I list
+subcommand. Without them, the run time performs
+.I transfer
+subcommand.
+
+.SH REPORTING BUGS
+Report any bugs to mailing list of ALSA community
+<alsa\-devel@alsa\-project.org> where the development and maintenance is
+primarily done. Bug tracking service of alsa\-utils repository on github.com is
+also available.
+
+.SH SEE ALSO
+.B axfer\-transfer(1),
+.B axfer\-list(1),
+.B alsamixer(1),
+.B amixer(1)
+
+.SH AUTHOR
+Takashi Sakamoto <o\-takashi@sakamocchi.jp>
diff --git a/axfer/container-au.c b/axfer/container-au.c
new file mode 100644 (file)
index 0000000..cccbebd
--- /dev/null
@@ -0,0 +1,203 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// container-au.c - a parser/builder for a container of Sun Audio File.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "container.h"
+#include "misc.h"
+
+// Not portable to all of UNIX platforms.
+#include <endian.h>
+
+// Reference:
+//  * http://pubs.opengroup.org/external/auformat.html
+
+#define AU_MAGIC       ".snd"
+#define UNKNOWN_SIZE   UINT32_MAX
+
+enum code_id {
+       CODE_ID_CCIT_MU_LAW_BE          = 0x01,
+       CODE_ID_GENERIC_MBLA_S8         = 0x02,
+       CODE_ID_GENERIC_MBLA_S16_BE     = 0x03,
+       CODE_ID_GENERIC_MBLA_S32_BE     = 0x05,
+       CODE_ID_IEEE754_FLOAT_S32_BE    = 0x06,
+       CODE_ID_IEEE754_DOUBLE_S64_BE   = 0x07,
+       CODE_ID_CCIT_ADPCM_G721_4BIT_BE = 0x17,
+       CODE_ID_CCIT_ADPCM_G723_3BIT_BE = 0x19,
+       CODE_ID_CCIT_A_LAW_BE           = 0x1b,
+};
+
+struct format_map {
+       enum code_id code_id;
+       snd_pcm_format_t format;
+};
+
+static const struct format_map format_maps[] = {
+       {CODE_ID_GENERIC_MBLA_S8,               SND_PCM_FORMAT_S8},
+       {CODE_ID_GENERIC_MBLA_S16_BE,           SND_PCM_FORMAT_S16_BE},
+       {CODE_ID_GENERIC_MBLA_S32_BE,           SND_PCM_FORMAT_S32_BE},
+       {CODE_ID_IEEE754_FLOAT_S32_BE,          SND_PCM_FORMAT_FLOAT_BE},
+       {CODE_ID_IEEE754_DOUBLE_S64_BE,         SND_PCM_FORMAT_FLOAT64_BE},
+       // CODE_ID_CCIT_ADPCM_G721_4BIT_BE is not supported by ALSA.
+       // CODE_ID_CCIT_ADPCM_G723_3BIT_BE is not supported due to width of
+       // its sample.
+       {CODE_ID_CCIT_A_LAW_BE,                 SND_PCM_FORMAT_A_LAW},
+       {CODE_ID_CCIT_MU_LAW_BE,                SND_PCM_FORMAT_MU_LAW},
+};
+
+struct container_header {
+       uint8_t magic[4];
+       uint32_t hdr_size;
+       uint32_t data_size;
+       uint32_t code_id;
+       uint32_t frames_per_second;
+       uint32_t samples_per_frame;
+};
+
+struct container_annotation {
+       uint32_t chunks[0];
+};
+
+struct parser_state {
+       enum code_id code_id;
+       unsigned int samples_per_frame;
+       unsigned int bytes_per_sample;
+};
+
+static int au_parser_pre_process(struct container_context *cntr,
+                                snd_pcm_format_t *format,
+                                unsigned int *samples_per_frame,
+                                unsigned int *frames_per_second,
+                                uint64_t *byte_count)
+{
+       struct parser_state *state = cntr->private_data;
+       struct container_header header;
+       enum code_id code_id;
+       unsigned int i;
+       int err;
+
+       // Parse header. 4 bytes are enough to detect supported containers.
+       memcpy(&header.magic, cntr->magic, sizeof(cntr->magic));
+       err = container_recursive_read(cntr,
+                                      (char *)&header + sizeof(cntr->magic),
+                                      sizeof(header) - sizeof(cntr->magic));
+       if (err < 0)
+               return err;
+       if (cntr->eof)
+               return 0;
+
+       if (memcmp(header.magic, AU_MAGIC, sizeof(header.magic)) != 0)
+               return -EINVAL;
+       if (be32toh(header.hdr_size) != sizeof(struct container_header))
+               return -EINVAL;
+
+       code_id = be32toh(header.code_id);
+       for (i = 0; i < ARRAY_SIZE(format_maps); ++i) {
+               if (format_maps[i].code_id == code_id)
+                       break;
+       }
+       if (i == ARRAY_SIZE(format_maps))
+               return -EINVAL;
+       *format = format_maps[i].format;
+       *frames_per_second = be32toh(header.frames_per_second);
+       *samples_per_frame = be32toh(header.samples_per_frame);
+
+       state->code_id = code_id;
+       state->samples_per_frame = *samples_per_frame;
+       state->bytes_per_sample = snd_pcm_format_physical_width(*format) / 8;
+
+       *byte_count = be32toh(header.data_size);
+
+       return 0;
+}
+
+struct builder_state {
+       unsigned int bytes_per_sample;
+       unsigned int samples_per_frame;
+       unsigned int frames_per_second;
+       enum code_id code_id;
+};
+
+static void build_container_header(struct builder_state *state,
+                                  struct container_header *header,
+                                  unsigned int frames_per_second,
+                                  uint64_t byte_count)
+{
+       memcpy(header->magic, AU_MAGIC, sizeof(header->magic));
+       header->hdr_size = htobe32(sizeof(struct container_header));
+       header->data_size = htobe32(byte_count);
+       header->code_id = htobe32(state->code_id);
+       header->frames_per_second = htobe32(frames_per_second);
+       header->samples_per_frame = htobe32(state->samples_per_frame);
+}
+
+static int write_container_header(struct container_context *cntr,
+                                 uint64_t byte_count)
+{
+       struct builder_state *state = cntr->private_data;
+       struct container_header header;
+
+       build_container_header(state, &header, state->frames_per_second,
+                              byte_count);
+
+       return container_recursive_write(cntr, &header, sizeof(header));
+}
+
+static int au_builder_pre_process(struct container_context *cntr,
+                                 snd_pcm_format_t *format,
+                                 unsigned int *samples_per_frame,
+                                 unsigned int *frames_per_second,
+                                 uint64_t *byte_count)
+{
+       struct builder_state *status = cntr->private_data;
+       unsigned int i;
+
+       for (i = 0; i < ARRAY_SIZE(format_maps); ++i) {
+               if (format_maps[i].format == *format)
+                       break;
+       }
+       if (i == ARRAY_SIZE(format_maps))
+               return -EINVAL;
+
+       status->code_id = format_maps[i].code_id;
+       status->bytes_per_sample = snd_pcm_format_physical_width(*format) / 8;
+       status->frames_per_second = *frames_per_second;
+       status->samples_per_frame = *samples_per_frame;
+
+       return write_container_header(cntr, *byte_count);
+}
+
+static int au_builder_post_process(struct container_context *cntr,
+                                  uint64_t handled_byte_count)
+{
+       int err;
+
+       err = container_seek_offset(cntr, 0);
+       if (err < 0)
+               return err;
+
+       return write_container_header(cntr, handled_byte_count);
+}
+
+const struct container_parser container_parser_au = {
+       .format = CONTAINER_FORMAT_AU,
+       .magic = AU_MAGIC,
+       .max_size = UINT32_MAX,
+       .ops = {
+               .pre_process = au_parser_pre_process,
+       },
+       .private_size = sizeof(struct parser_state),
+};
+
+const struct container_builder container_builder_au = {
+       .format = CONTAINER_FORMAT_AU,
+       .max_size = UINT32_MAX,
+       .ops = {
+               .pre_process    = au_builder_pre_process,
+               .post_process   = au_builder_post_process,
+       },
+       .private_size = sizeof(struct builder_state),
+};
diff --git a/axfer/container-raw.c b/axfer/container-raw.c
new file mode 100644 (file)
index 0000000..1886045
--- /dev/null
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// container-raw.c - a parser/builder for a container with raw data frame.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "container.h"
+#include "misc.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+static int raw_builder_pre_process(struct container_context *cntr ATTRIBUTE_UNUSED,
+                                  snd_pcm_format_t *format ATTRIBUTE_UNUSED,
+                                  unsigned int *samples_per_frame ATTRIBUTE_UNUSED,
+                                  unsigned int *frames_per_second ATTRIBUTE_UNUSED,
+                                  uint64_t *byte_count)
+{
+       *byte_count = UINT64_MAX;
+
+       return 0;
+}
+
+static int raw_parser_pre_process(struct container_context *cntr,
+                                 snd_pcm_format_t *format ATTRIBUTE_UNUSED,
+                                 unsigned int *samples_per_frame ATTRIBUTE_UNUSED,
+                                 unsigned int *frames_per_second ATTRIBUTE_UNUSED,
+                                 uint64_t *byte_count)
+{
+       struct stat buf = {0};
+       int err;
+
+       if (cntr->stdio) {
+               *byte_count = UINT64_MAX;
+               return 0;
+       }
+
+       err = fstat(cntr->fd, &buf);
+       if (err < 0)
+               return err;
+
+       *byte_count = buf.st_size;
+       if (*byte_count == 0)
+               *byte_count = UINT64_MAX;
+
+       return 0;
+}
+
+const struct container_parser container_parser_raw = {
+       .format = CONTAINER_FORMAT_RAW,
+       .max_size = UINT64_MAX,
+       .ops = {
+               .pre_process = raw_parser_pre_process,
+       },
+};
+
+const struct container_builder container_builder_raw = {
+       .format = CONTAINER_FORMAT_RAW,
+       .max_size = UINT64_MAX,
+       .ops = {
+               .pre_process = raw_builder_pre_process,
+       },
+};
diff --git a/axfer/container-riff-wave.c b/axfer/container-riff-wave.c
new file mode 100644 (file)
index 0000000..f62cdbd
--- /dev/null
@@ -0,0 +1,574 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// container-riff-wave.c - a parser/builder for a container of RIFF/Wave File.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "container.h"
+#include "misc.h"
+
+// Not portable to all of UNIX platforms.
+#include <endian.h>
+
+// References:
+// - 'Resource Interchange File Format (RIFF)' at msdn.microsoft.com
+// - 'Multiple channel audio data and WAVE files' at msdn.microsoft.com
+// - RFC 2361 'WAVE and AVI Codec Registries' at ietf.org
+// - 'mmreg.h' in Wine project
+// - 'mmreg.h' in ReactOS project
+
+#define RIFF_MAGIC             "RIF"   // A common part.
+
+#define RIFF_CHUNK_ID_LE       "RIFF"
+#define RIFF_CHUNK_ID_BE       "RIFX"
+#define RIFF_FORM_WAVE         "WAVE"
+#define FMT_SUBCHUNK_ID                "fmt "
+#define DATA_SUBCHUNK_ID       "data"
+
+// See 'WAVE and AVI Codec Registries (Historic Registry)' in 'iana.org'.
+// https://www.iana.org/assignments/wave-avi-codec-registry/
+enum wave_format {
+       WAVE_FORMAT_PCM                 = 0x0001,
+       WAVE_FORMAT_ADPCM               = 0x0002,
+       WAVE_FORMAT_IEEE_FLOAT          = 0x0003,
+       WAVE_FORMAT_ALAW                = 0x0006,
+       WAVE_FORMAT_MULAW               = 0x0007,
+       WAVE_FORMAT_G723_ADPCM          = 0x0014,
+       // The others are not supported.
+};
+
+struct format_map {
+       enum wave_format wformat;
+       snd_pcm_format_t format;
+};
+
+static const struct format_map format_maps[] = {
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_U8},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S16_LE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S16_BE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S24_LE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S24_BE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S32_LE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S32_BE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S24_3LE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S24_3BE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S20_3LE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S20_3BE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S18_3LE},
+       {WAVE_FORMAT_PCM,       SND_PCM_FORMAT_S18_3BE},
+       {WAVE_FORMAT_IEEE_FLOAT, SND_PCM_FORMAT_FLOAT_LE},
+       {WAVE_FORMAT_IEEE_FLOAT, SND_PCM_FORMAT_FLOAT_BE},
+       {WAVE_FORMAT_IEEE_FLOAT, SND_PCM_FORMAT_FLOAT64_LE},
+       {WAVE_FORMAT_IEEE_FLOAT, SND_PCM_FORMAT_FLOAT64_BE},
+       {WAVE_FORMAT_ALAW,      SND_PCM_FORMAT_A_LAW},
+       {WAVE_FORMAT_MULAW,     SND_PCM_FORMAT_MU_LAW},
+       // Below sample formats are not currently supported, due to width of
+       // its sample.
+       //  - WAVE_FORMAT_ADPCM
+       //  - WAVE_FORMAT_G723_ADPCM
+       //  - WAVE_FORMAT_G723_ADPCM
+       //  - WAVE_FORMAT_G723_ADPCM
+       //  - WAVE_FORMAT_G723_ADPCM
+};
+
+struct riff_chunk {
+       uint8_t id[4];
+       uint32_t size;
+
+       uint8_t data[0];
+};
+
+struct riff_chunk_data {
+       uint8_t id[4];
+
+       uint8_t subchunks[0];
+};
+
+struct riff_subchunk {
+       uint8_t id[4];
+       uint32_t size;
+
+       uint8_t data[0];
+};
+
+struct wave_fmt_subchunk {
+       uint8_t id[4];
+       uint32_t size;
+
+       uint16_t format;
+       uint16_t samples_per_frame;
+       uint32_t frames_per_second;
+       uint32_t average_bytes_per_second;
+       uint16_t bytes_per_frame;
+       uint16_t bits_per_sample;
+       uint8_t extension[0];
+};
+
+struct wave_data_subchunk {
+       uint8_t id[4];
+       uint32_t size;
+
+       uint8_t frames[0];
+};
+
+struct parser_state {
+       bool be;
+       enum wave_format format;
+       unsigned int samples_per_frame;
+       unsigned int frames_per_second;
+       unsigned int average_bytes_per_second;
+       unsigned int bytes_per_frame;
+       unsigned int bytes_per_sample;
+       unsigned int avail_bits_in_sample;
+       unsigned int byte_count;
+};
+
+static int parse_riff_chunk_header(struct parser_state *state,
+                                  struct riff_chunk *chunk,
+                                  uint64_t *byte_count)
+{
+       if (!memcmp(chunk->id, RIFF_CHUNK_ID_BE, sizeof(chunk->id)))
+               state->be = true;
+       else if (!memcmp(chunk->id, RIFF_CHUNK_ID_LE, sizeof(chunk->id)))
+               state->be = false;
+       else
+               return -EINVAL;
+
+       if (state->be)
+               *byte_count = be32toh(chunk->size);
+       else
+               *byte_count = le32toh(chunk->size);
+
+       return 0;
+}
+
+static int parse_riff_chunk(struct container_context *cntr,
+                           uint64_t *byte_count)
+{
+       struct parser_state *state = cntr->private_data;
+       union {
+               struct riff_chunk chunk;
+               struct riff_chunk_data chunk_data;
+       } buf = {0};
+       int err;
+
+       // Chunk header. 4 bytes were alread read to detect container type.
+       memcpy(buf.chunk.id, cntr->magic, sizeof(cntr->magic));
+       err = container_recursive_read(cntr,
+                                      (char *)&buf.chunk + sizeof(cntr->magic),
+                                      sizeof(buf.chunk) - sizeof(cntr->magic));
+       if (err < 0)
+               return err;
+       if (cntr->eof)
+               return 0;
+
+       err = parse_riff_chunk_header(state, &buf.chunk, byte_count);
+       if (err < 0)
+               return err;
+
+       // Chunk data header.
+       err = container_recursive_read(cntr, &buf, sizeof(buf.chunk_data));
+       if (err < 0)
+               return err;
+       if (cntr->eof)
+               return 0;
+
+       if (memcmp(buf.chunk_data.id, RIFF_FORM_WAVE,
+                  sizeof(buf.chunk_data.id)))
+               return -EINVAL;
+
+       return 0;
+}
+
+static int parse_wave_fmt_subchunk(struct parser_state *state,
+                                  struct wave_fmt_subchunk *subchunk)
+{
+       if (state->be) {
+               state->format = be16toh(subchunk->format);
+               state->samples_per_frame = be16toh(subchunk->samples_per_frame);
+               state->frames_per_second = be32toh(subchunk->frames_per_second);
+               state->average_bytes_per_second =
+                               be32toh(subchunk->average_bytes_per_second);
+               state->bytes_per_frame = be16toh(subchunk->bytes_per_frame);
+               state->avail_bits_in_sample =
+                                       be16toh(subchunk->bits_per_sample);
+       } else {
+               state->format = le16toh(subchunk->format);
+               state->samples_per_frame = le16toh(subchunk->samples_per_frame);
+               state->frames_per_second = le32toh(subchunk->frames_per_second);
+               state->average_bytes_per_second =
+                               le32toh(subchunk->average_bytes_per_second);
+               state->bytes_per_frame = le16toh(subchunk->bytes_per_frame);
+               state->avail_bits_in_sample =
+                                       le16toh(subchunk->bits_per_sample);
+       }
+
+       if (state->average_bytes_per_second !=
+                       state->bytes_per_frame * state->frames_per_second)
+               return -EINVAL;
+
+       return 0;
+}
+
+static int parse_wave_data_subchunk(struct parser_state *state,
+                                   struct wave_data_subchunk *subchunk)
+{
+       if (state->be)
+               state->byte_count = be32toh(subchunk->size);
+       else
+               state->byte_count = le32toh(subchunk->size);
+
+       return 0;
+}
+
+static int parse_wave_subchunk(struct container_context *cntr)
+{
+       union {
+               struct riff_subchunk subchunk;
+               struct wave_fmt_subchunk fmt_subchunk;
+               struct wave_data_subchunk data_subchunk;
+       } buf = {0};
+       enum {
+               SUBCHUNK_TYPE_UNKNOWN = -1,
+               SUBCHUNK_TYPE_FMT,
+               SUBCHUNK_TYPE_DATA,
+       } subchunk_type;
+       struct parser_state *state = cntr->private_data;
+       unsigned int required_size;
+       unsigned int subchunk_data_size;
+       int err;
+
+       while (1) {
+               err = container_recursive_read(cntr, &buf,
+                                              sizeof(buf.subchunk));
+               if (err < 0)
+                       return err;
+               if (cntr->eof)
+                       return 0;
+
+               // Calculate the size of subchunk data.
+               if (state->be)
+                       subchunk_data_size = be32toh(buf.subchunk.size);
+               else
+                       subchunk_data_size = le32toh(buf.subchunk.size);
+
+               // Detect type of subchunk.
+               if (!memcmp(buf.subchunk.id, FMT_SUBCHUNK_ID,
+                           sizeof(buf.subchunk.id))) {
+                       subchunk_type = SUBCHUNK_TYPE_FMT;
+               } else if (!memcmp(buf.subchunk.id, DATA_SUBCHUNK_ID,
+                                  sizeof(buf.subchunk.id))) {
+                       subchunk_type = SUBCHUNK_TYPE_DATA;
+               } else {
+                       subchunk_type = SUBCHUNK_TYPE_UNKNOWN;
+               }
+
+               if (subchunk_type != SUBCHUNK_TYPE_UNKNOWN) {
+                       // Parse data of this subchunk.
+                       if (subchunk_type == SUBCHUNK_TYPE_FMT) {
+                               required_size =
+                                       sizeof(struct wave_fmt_subchunk) -
+                                       sizeof(struct riff_chunk);
+                       } else {
+                               required_size =
+                                       sizeof(struct wave_data_subchunk)-
+                                       sizeof(struct riff_chunk);
+                       }
+
+                       if (subchunk_data_size < required_size)
+                               return -EINVAL;
+
+                       err = container_recursive_read(cntr, &buf.subchunk.data,
+                                                      required_size);
+                       if (err < 0)
+                               return err;
+                       if (cntr->eof)
+                               return 0;
+                       subchunk_data_size -= required_size;
+
+                       if (subchunk_type == SUBCHUNK_TYPE_FMT) {
+                               err = parse_wave_fmt_subchunk(state,
+                                                       &buf.fmt_subchunk);
+                       } else if (subchunk_type == SUBCHUNK_TYPE_DATA) {
+                               err = parse_wave_data_subchunk(state,
+                                                        &buf.data_subchunk);
+                       }
+                       if (err < 0)
+                               return err;
+
+                       // Found frame data.
+                       if (subchunk_type == SUBCHUNK_TYPE_DATA)
+                               break;
+               }
+
+               // Go to next subchunk.
+               while (subchunk_data_size > 0) {
+                       unsigned int consume;
+
+                       if (subchunk_data_size > sizeof(buf))
+                               consume = sizeof(buf);
+                       else
+                               consume = subchunk_data_size;
+
+                       err = container_recursive_read(cntr, &buf, consume);
+                       if (err < 0)
+                               return err;
+                       if (cntr->eof)
+                               return 0;
+                       subchunk_data_size -= consume;
+               }
+       }
+
+       return 0;
+}
+
+static int parse_riff_wave_format(struct container_context *cntr)
+{
+       uint64_t byte_count;
+       int err;
+
+       err = parse_riff_chunk(cntr, &byte_count);
+       if (err < 0)
+               return err;
+
+       err = parse_wave_subchunk(cntr);
+       if (err < 0)
+               return err;
+
+       return 0;
+}
+
+static int wave_parser_pre_process(struct container_context *cntr,
+                                  snd_pcm_format_t *format,
+                                  unsigned int *samples_per_frame,
+                                  unsigned int *frames_per_second,
+                                  uint64_t *byte_count)
+{
+       struct parser_state *state = cntr->private_data;
+       int phys_width;
+       const struct format_map *map;
+       unsigned int i;
+       int err;
+
+       err = parse_riff_wave_format(cntr);
+       if (err < 0)
+               return err;
+
+       phys_width = 8 * state->average_bytes_per_second /
+                    state->samples_per_frame / state->frames_per_second;
+
+       for (i = 0; i < ARRAY_SIZE(format_maps); ++i) {
+               map = &format_maps[i];
+               if (state->format != map->wformat)
+                       continue;
+               if ((int)state->avail_bits_in_sample !=
+                                       snd_pcm_format_width(map->format))
+                       continue;
+               if (phys_width != snd_pcm_format_physical_width(map->format))
+                       continue;
+
+               if (state->be && snd_pcm_format_big_endian(map->format) != 1)
+                       continue;
+
+               break;
+       }
+       if (i == ARRAY_SIZE(format_maps))
+               return -EINVAL;
+
+       // Set parameters.
+       *format = format_maps[i].format;
+       *samples_per_frame = state->samples_per_frame;
+       *frames_per_second = state->frames_per_second;
+       *byte_count = state->byte_count;
+
+       return 0;
+}
+
+struct builder_state {
+       bool be;
+       enum wave_format format;
+       unsigned int avail_bits_in_sample;
+       unsigned int bytes_per_sample;
+       unsigned int samples_per_frame;
+       unsigned int frames_per_second;
+};
+
+static void build_riff_chunk_header(struct riff_chunk *chunk,
+                                   uint64_t byte_count, bool be)
+{
+       uint64_t data_size = sizeof(struct riff_chunk_data) +
+                            sizeof(struct wave_fmt_subchunk) +
+                            sizeof(struct wave_data_subchunk) + byte_count;
+
+       if (be) {
+               memcpy(chunk->id, RIFF_CHUNK_ID_BE, sizeof(chunk->id));
+               chunk->size = htobe32(data_size);
+       } else {
+               memcpy(chunk->id, RIFF_CHUNK_ID_LE, sizeof(chunk->id));
+               chunk->size = htole32(data_size);
+       }
+}
+
+static void build_subchunk_header(struct riff_subchunk *subchunk,
+                                 const char *const form, uint64_t size,
+                                 bool be)
+{
+       memcpy(subchunk->id, form, sizeof(subchunk->id));
+       if (be)
+               subchunk->size = htobe32(size);
+       else
+               subchunk->size = htole32(size);
+}
+
+static void build_wave_format_subchunk(struct wave_fmt_subchunk *subchunk,
+                                      struct builder_state *state)
+{
+       unsigned int bytes_per_frame =
+                       state->bytes_per_sample * state->samples_per_frame;
+       unsigned int average_bytes_per_second = state->bytes_per_sample *
+                       state->samples_per_frame * state->frames_per_second;
+       uint64_t size;
+
+       // No extensions.
+       size = sizeof(struct wave_fmt_subchunk) - sizeof(struct riff_subchunk);
+       build_subchunk_header((struct riff_subchunk *)subchunk, FMT_SUBCHUNK_ID,
+                             size, state->be);
+
+       if (state->be) {
+               subchunk->format = htobe16(state->format);
+               subchunk->samples_per_frame = htobe16(state->samples_per_frame);
+               subchunk->frames_per_second = htobe32(state->frames_per_second);
+               subchunk->average_bytes_per_second =
+                                       htobe32(average_bytes_per_second);
+               subchunk->bytes_per_frame = htobe16(bytes_per_frame);
+               subchunk->bits_per_sample =
+                                       htobe16(state->avail_bits_in_sample);
+       } else {
+               subchunk->format = htole16(state->format);
+               subchunk->samples_per_frame = htole16(state->samples_per_frame);
+               subchunk->frames_per_second = htole32(state->frames_per_second);
+               subchunk->average_bytes_per_second =
+                                       htole32(average_bytes_per_second);
+               subchunk->bytes_per_frame = htole16(bytes_per_frame);
+               subchunk->bits_per_sample =
+                                       htole16(state->avail_bits_in_sample);
+       }
+}
+
+static void build_wave_data_subchunk(struct wave_data_subchunk *subchunk,
+                                    uint64_t byte_count, bool be)
+{
+       build_subchunk_header((struct riff_subchunk *)subchunk,
+                             DATA_SUBCHUNK_ID, byte_count, be);
+}
+
+static int write_riff_chunk_for_wave(struct container_context *cntr,
+                                    uint64_t byte_count)
+{
+       struct builder_state *state = cntr->private_data;
+       union {
+               struct riff_chunk chunk;
+               struct riff_chunk_data chunk_data;
+               struct wave_fmt_subchunk fmt_subchunk;
+               struct wave_data_subchunk data_subchunk;
+       } buf = {0};
+       uint64_t total_byte_count;
+       int err;
+
+       // Chunk header.
+       total_byte_count = sizeof(struct riff_chunk_data) +
+                          sizeof(struct wave_fmt_subchunk) +
+                          sizeof(struct wave_data_subchunk);
+       if (byte_count > cntr->max_size - total_byte_count)
+               total_byte_count = cntr->max_size;
+       else
+               total_byte_count += byte_count;
+       build_riff_chunk_header(&buf.chunk, total_byte_count, state->be);
+       err = container_recursive_write(cntr, &buf, sizeof(buf.chunk));
+       if (err < 0)
+               return err;
+
+       // Chunk data header.
+       memcpy(buf.chunk_data.id, RIFF_FORM_WAVE, sizeof(buf.chunk_data.id));
+       err = container_recursive_write(cntr, &buf, sizeof(buf.chunk_data));
+       if (err < 0)
+               return err;
+
+       // A subchunk in the chunk data for WAVE format.
+       build_wave_format_subchunk(&buf.fmt_subchunk, state);
+       err = container_recursive_write(cntr, &buf, sizeof(buf.fmt_subchunk));
+       if (err < 0)
+               return err;
+
+       // A subchunk in the chunk data for WAVE data.
+       build_wave_data_subchunk(&buf.data_subchunk, byte_count, state->be);
+       return container_recursive_write(cntr, &buf, sizeof(buf.data_subchunk));
+}
+
+static int wave_builder_pre_process(struct container_context *cntr,
+                                   snd_pcm_format_t *format,
+                                   unsigned int *samples_per_frame,
+                                   unsigned int *frames_per_second,
+                                   uint64_t *byte_count)
+{
+       struct builder_state *state = cntr->private_data;
+       unsigned int i;
+
+       // Validate parameters.
+       for (i = 0; i < ARRAY_SIZE(format_maps); ++i) {
+               if (format_maps[i].format == *format)
+                       break;
+       }
+       if (i == ARRAY_SIZE(format_maps))
+               return -EINVAL;
+
+       state->format = format_maps[i].wformat;
+       state->avail_bits_in_sample = snd_pcm_format_width(*format);
+       state->bytes_per_sample = snd_pcm_format_physical_width(*format) / 8;
+       state->samples_per_frame = *samples_per_frame;
+       state->frames_per_second = *frames_per_second;
+
+       state->be = (snd_pcm_format_big_endian(*format) == 1);
+
+       return write_riff_chunk_for_wave(cntr, *byte_count);
+}
+
+static int wave_builder_post_process(struct container_context *cntr,
+                                    uint64_t handled_byte_count)
+{
+       int err;
+
+       err = container_seek_offset(cntr, 0);
+       if (err < 0)
+               return err;
+
+       return write_riff_chunk_for_wave(cntr, handled_byte_count);
+}
+
+const struct container_parser container_parser_riff_wave = {
+       .format = CONTAINER_FORMAT_RIFF_WAVE,
+       .magic =  RIFF_MAGIC,
+       .max_size = UINT32_MAX -
+                   sizeof(struct riff_chunk_data) -
+                   sizeof(struct wave_fmt_subchunk) -
+                   sizeof(struct wave_data_subchunk),
+       .ops = {
+               .pre_process    = wave_parser_pre_process,
+       },
+       .private_size = sizeof(struct parser_state),
+};
+
+const struct container_builder container_builder_riff_wave = {
+       .format = CONTAINER_FORMAT_RIFF_WAVE,
+       .max_size = UINT32_MAX -
+                   sizeof(struct riff_chunk_data) -
+                   sizeof(struct wave_fmt_subchunk) -
+                   sizeof(struct wave_data_subchunk),
+       .ops = {
+               .pre_process    = wave_builder_pre_process,
+               .post_process   = wave_builder_post_process,
+       },
+       .private_size = sizeof(struct builder_state),
+};
diff --git a/axfer/container-voc.c b/axfer/container-voc.c
new file mode 100644 (file)
index 0000000..f169a1a
--- /dev/null
@@ -0,0 +1,835 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// container-voc.c - a parser/builder for a container of Creative Voice File.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "container.h"
+#include "misc.h"
+
+// Not portable to all of UNIX platforms.
+#include <endian.h>
+
+// References:
+//  - http://sox.sourceforge.net/
+
+#define VOC_MAGIC              "Creative Voice File\x1a"
+#define VOC_VERSION_1_10       0x010a
+#define VOC_VERSION_1_20       0x0114
+
+enum block_type {
+       BLOCK_TYPE_TERMINATOR           = 0x00,
+       BLOCK_TYPE_V110_DATA            = 0x01,
+       BLOCK_TYPE_CONTINUOUS_DATA      = 0x02,
+       BLOCK_TYPE_SILENCE              = 0x03,
+       BLOCK_TYPE_MARKER               = 0x04,
+       BLOCK_TYPE_STRING               = 0x05,
+       BLOCK_TYPE_REPEAT_START         = 0x06,
+       BLOCK_TYPE_REPEAT_END           = 0x07,
+       BLOCK_TYPE_EXTENDED_V110_FORMAT = 0x08,
+       BLOCK_TYPE_V120_DATA            = 0x09,
+};
+
+enum code_id {
+       // Version 1.10.
+       CODE_ID_GENERIC_MBLA_U8                 = 0x00,
+       CODE_ID_CREATIVE_ADPCM_8BIT_TO_4BIT_LE  = 0x01,
+       CODE_ID_CREATIVE_ADPCM_8BIT_TO_3BIT_LE  = 0x02,
+       CODE_ID_CREATIVE_ADPCM_8BIT_TO_2BIT_LE  = 0x03,
+       // Version 1.20.
+       CODE_ID_GENERIC_MBLA_S16_LE             = 0x04,
+       CODE_ID_CCIT_A_LAW_LE                   = 0x06,
+       CODE_ID_CCIT_MU_LAW_LE                  = 0x07,
+       CODE_ID_CREATIVE_ADPCM_16BIT_TO_4BIT_LE = 0x2000,
+};
+
+struct format_map {
+       unsigned int minimal_version;
+       enum code_id code_id;
+       snd_pcm_format_t format;
+};
+
+static const struct format_map format_maps[] = {
+       {VOC_VERSION_1_10, CODE_ID_GENERIC_MBLA_U8,     SND_PCM_FORMAT_U8},
+       {VOC_VERSION_1_20, CODE_ID_GENERIC_MBLA_S16_LE, SND_PCM_FORMAT_S16_LE},
+       {VOC_VERSION_1_20, CODE_ID_CCIT_A_LAW_LE,       SND_PCM_FORMAT_A_LAW},
+       {VOC_VERSION_1_20, CODE_ID_CCIT_MU_LAW_LE,      SND_PCM_FORMAT_MU_LAW},
+       // The other formats are not supported by ALSA.
+};
+
+struct container_header {
+       uint8_t magic[20];
+       uint16_t hdr_size;
+       uint16_t version;
+       uint16_t version_compr;
+};
+
+// A format for data blocks except for terminator type.
+struct block_header {
+       uint8_t type;
+       uint8_t size[3];
+
+       uint8_t data[0];
+};
+
+// Data block for terminator type has an exceptional format.
+struct block_terminator {
+       uint8_t type;
+};
+
+struct time_const {
+       unsigned int frames_per_second;
+       uint16_t code;
+};
+
+static const struct time_const v110_time_consts[] = {
+       {5512, 74},
+       {8000, 130},
+       {11025, 165},
+       {16000, 193},
+       {22050, 210},
+       {32000, 224},
+       {44100, 233},
+       {48000, 235},
+       {64000, 240},
+       // Time constant for the upper sampling rate is not identical.
+};
+
+static const struct time_const ex_v110_time_consts[] = {
+       {5512, 19092},
+       {8000, 33536},
+       {11025, 42317},
+       {16000, 49536},
+       {22050, 53927},
+       {32000, 57536},
+       {44100, 59732},
+       {48000, 60203},
+       {64000, 61536},
+       {88200, 62634},
+       {96000, 62870},
+       {176400, 64085},
+       {192000, 64203},
+       // This support up to 192.0 kHz. The rest is for cases with 2ch.
+       {352800, 64811},
+       {384000, 64870},
+};
+
+// v1.10 format:
+// - monaural.
+// - frames_per_second = 1,000,000 / (256 - time_const)
+struct block_v110_data {
+       uint8_t type;
+       uint8_t size[3];        // Equals to (2 + the size of frames).
+
+       uint8_t time_const;
+       uint8_t code_id;
+       uint8_t frames[0];      // Aligned to little-endian.
+};
+
+struct block_continuous_data {
+       uint8_t type;
+       uint8_t size[3];        // Equals to the size of frames.
+
+       uint8_t frames[0];      // Aligned to little-endian.
+};
+
+// v1.10 format:
+// - monaural.
+// - frames_per_second = 1,000,000 / (256 - time_const).
+struct block_silence {
+       uint8_t type;
+       uint8_t size[3];        // Equals to 3.
+
+       uint16_t frame_count;
+       uint8_t time_const;
+};
+
+struct block_marker {
+       uint8_t type;
+       uint8_t size[3];        // Equals to 2.
+
+       uint16_t mark;
+};
+
+struct block_string {
+       uint8_t type;
+       uint8_t size[3];        // Equals to the length of string with 0x00.
+
+       uint8_t chars[0];
+};
+
+struct block_repeat_start {
+       uint8_t type;
+       uint8_t size[3];        // Equals to 2.
+
+       uint16_t count;
+};
+
+struct block_repeat_end {
+       uint8_t type;
+       uint8_t size[3];        // Equals to 0.
+};
+
+// Extended v1.10 format:
+// - manaural/stereo.
+// - frames_per_second =
+//             256,000,000 / (samples_per_frame * (65536 - time_const)).
+// - Appear just before v110_data block.
+struct block_extended_v110_format {
+       uint8_t type;
+       uint8_t size[3];        // Equals to 4.
+
+       uint16_t time_const;
+       uint8_t code_id;
+       uint8_t ch_mode;        // 0 is monaural, 1 is stereo.
+};
+
+// v1.20 format:
+// - monaural/stereo.
+// - 8/16 bits_per_sample.
+// - time_const is not used.
+// - code_id is extended.
+struct block_v120_format {
+       uint8_t type;
+       uint8_t size[3];        // Equals to (12 + ).
+
+       uint32_t frames_per_second;
+       uint8_t bits_per_sample;
+       uint8_t samples_per_frame;
+       uint16_t code_id;
+       uint8_t reserved[4];
+
+       uint8_t frames[0];      // Aligned to little-endian.
+};
+
+// Aligned to little endian order but 24 bits field.
+static uint32_t parse_block_data_size(uint8_t fields[3])
+{
+       return (fields[2] << 16) | (fields[1] << 8) | fields[0];
+}
+
+static void build_block_data_size(uint8_t fields[3], unsigned int size)
+{
+       fields[0] = (size & 0x0000ff);
+       fields[1] = (size & 0x00ff00) >> 8;
+       fields[2] = (size & 0xff0000) >> 16;
+}
+
+static int build_time_constant(unsigned int frames_per_second,
+                              unsigned int samples_per_frame, uint16_t *code,
+                              bool extended)
+{
+       unsigned int i;
+
+       // 16 bits are available for this purpose.
+       if (extended) {
+               if (samples_per_frame > 2)
+                       return -EINVAL;
+               frames_per_second *= samples_per_frame;
+
+               for (i = 0; i < ARRAY_SIZE(ex_v110_time_consts); ++i) {
+                       if (ex_v110_time_consts[i].frames_per_second ==
+                                       frames_per_second)
+                               break;
+               }
+               if (i < ARRAY_SIZE(ex_v110_time_consts) &&
+                   frames_per_second <= 192000) {
+                       *code = ex_v110_time_consts[i].code;
+               } else {
+                       *code = 65536 - 256000000 / frames_per_second;
+               }
+       } else {
+               if (samples_per_frame != 1)
+                       return -EINVAL;
+
+               for (i = 0; i < ARRAY_SIZE(v110_time_consts); ++i) {
+                       if (v110_time_consts[i].frames_per_second ==
+                                       frames_per_second)
+                       break;
+               }
+               // Should be within 8 bit.
+               if (i < ARRAY_SIZE(v110_time_consts))
+                       *code = (uint8_t)v110_time_consts[i].code;
+               else
+                       *code = 256 - 1000000 / frames_per_second;
+       }
+
+       return 0;
+}
+
+static unsigned int parse_time_constant(uint16_t code,
+                                       unsigned int samples_per_frame,
+                                       unsigned int *frames_per_second,
+                                       bool extended)
+{
+       unsigned int i;
+
+       if (extended) {
+               if (samples_per_frame > 2)
+                       return -EINVAL;
+
+               for (i = 0; i < ARRAY_SIZE(ex_v110_time_consts); ++i) {
+                       if (ex_v110_time_consts[i].code == code ||
+                           ex_v110_time_consts[i].code - 1 == code)
+                               break;
+               }
+               if (i < ARRAY_SIZE(ex_v110_time_consts)) {
+                       *frames_per_second =
+                               ex_v110_time_consts[i].frames_per_second /
+                               samples_per_frame;
+               } else {
+                       *frames_per_second = 256000000 / samples_per_frame /
+                                            (65536 - code);
+               }
+       } else {
+               if (samples_per_frame != 1)
+                       return -EINVAL;
+
+               for (i = 0; i < ARRAY_SIZE(v110_time_consts); ++i) {
+                       if (v110_time_consts[i].code == code ||
+                           v110_time_consts[i].code - 1 == code)
+                               break;
+               }
+               if (i < ARRAY_SIZE(v110_time_consts)) {
+                       *frames_per_second =
+                                       v110_time_consts[i].frames_per_second;
+               } else {
+                       *frames_per_second = 1000000 / (256 - code);
+               }
+       }
+
+       return 0;
+}
+
+struct parser_state {
+       unsigned int version;
+       bool extended;
+
+       unsigned int frames_per_second;
+       unsigned int samples_per_frame;
+       unsigned int bytes_per_sample;
+       enum code_id code_id;
+       uint32_t byte_count;
+};
+
+static int parse_container_header(struct parser_state *state,
+                                 struct container_header *header)
+{
+       uint16_t hdr_size;
+       uint16_t version;
+       uint16_t version_compr;
+
+       hdr_size = le16toh(header->hdr_size);
+       version = le16toh(header->version);
+       version_compr = le16toh(header->version_compr);
+
+       if (memcmp(header->magic, VOC_MAGIC, sizeof(header->magic)))
+               return -EIO;
+
+       if (hdr_size != sizeof(*header))
+               return -EIO;
+
+       if (version_compr != 0x1234 + ~version)
+               return -EIO;
+
+       if (version != VOC_VERSION_1_10 && version != VOC_VERSION_1_20)
+               return -EIO;
+
+       state->version = version;
+
+       return 0;
+}
+
+static bool check_code_id(uint8_t code_id, unsigned int version)
+{
+       unsigned int i;
+
+       for (i = 0; i < ARRAY_SIZE(format_maps); ++i) {
+               if (code_id != format_maps[i].code_id)
+                       continue;
+               if (version >= format_maps[i].minimal_version)
+                       return true;
+       }
+
+       return false;
+}
+
+static int parse_v120_format_block(struct parser_state *state,
+                                  struct block_v120_format *block)
+{
+       state->frames_per_second = le32toh(block->frames_per_second);
+       state->bytes_per_sample = block->bits_per_sample / 8;
+       state->samples_per_frame = block->samples_per_frame;
+       state->code_id = le16toh(block->code_id);
+       state->byte_count = parse_block_data_size(block->size) - 12;
+
+       if (!check_code_id(state->code_id, VOC_VERSION_1_20))
+               return -EIO;
+
+       return 0;
+}
+
+static int parse_extended_v110_format(struct parser_state *state,
+                                     struct block_extended_v110_format *block)
+{
+       unsigned int time_const;
+       unsigned int frames_per_second;
+       int err;
+
+       state->code_id = block->code_id;
+       if (!check_code_id(state->code_id, VOC_VERSION_1_10))
+               return -EIO;
+
+       if (block->ch_mode == 0)
+               state->samples_per_frame = 1;
+       else if (block->ch_mode == 1)
+               state->samples_per_frame = 2;
+       else
+               return -EIO;
+
+       time_const = le16toh(block->time_const);
+       err = parse_time_constant(time_const, state->samples_per_frame,
+                                 &frames_per_second, true);
+       if (err < 0)
+               return err;
+       state->frames_per_second = frames_per_second;
+
+       state->extended = true;
+
+       return 0;
+}
+
+static int parse_v110_data(struct parser_state *state,
+                          struct block_v110_data *block)
+{
+       unsigned int time_const;
+       unsigned int frames_per_second;
+       int err;
+
+       if (!state->extended) {
+               state->code_id = block->code_id;
+               if (!check_code_id(state->code_id, VOC_VERSION_1_10))
+                       return -EIO;
+
+               time_const = block->time_const;
+               err = parse_time_constant(time_const, 1, &frames_per_second,
+                                         false);
+               if (err < 0)
+                       return err;
+               state->frames_per_second = frames_per_second;
+               state->samples_per_frame = 1;
+       }
+
+       state->bytes_per_sample = 1;
+       state->byte_count = parse_block_data_size(block->size) - 2;
+
+       return 0;
+}
+
+static int detect_container_version(struct container_context *cntr)
+{
+       struct parser_state *state = cntr->private_data;
+       struct container_header header = {0};
+       int err;
+
+       // 4 bytes were alread read to detect container type.
+       memcpy(&header.magic, cntr->magic, sizeof(cntr->magic));
+       err = container_recursive_read(cntr,
+                                      (char *)&header + sizeof(cntr->magic),
+                                      sizeof(header) - sizeof(cntr->magic));
+       if (err < 0)
+               return err;
+       if (cntr->eof)
+               return 0;
+
+       return parse_container_header(state, &header);
+}
+
+static int allocate_for_block_cache(struct container_context *cntr,
+                                   struct block_header *header, void **buf)
+{
+       uint32_t block_size;
+       char *cache;
+       int err;
+
+       if (header->type == BLOCK_TYPE_V110_DATA)
+               block_size = sizeof(struct block_v110_data);
+       else if (header->type == BLOCK_TYPE_CONTINUOUS_DATA)
+               block_size = sizeof(struct block_continuous_data);
+       else if (header->type == BLOCK_TYPE_EXTENDED_V110_FORMAT)
+               block_size = sizeof(struct block_extended_v110_format);
+       else if (header->type == BLOCK_TYPE_V120_DATA)
+               block_size = sizeof(struct block_v120_format);
+       else
+               block_size = parse_block_data_size(header->size);
+
+       cache = malloc(block_size);
+       if (cache == NULL)
+               return -ENOMEM;
+       memset(cache, 0, block_size);
+
+       memcpy(cache, header, sizeof(*header));
+       err = container_recursive_read(cntr, cache + sizeof(*header),
+                                      block_size - sizeof(*header));
+       if (err < 0) {
+               free(cache);
+               return err;
+       }
+       if (cntr->eof) {
+               free(cache);
+               return 0;
+       }
+
+       *buf = cache;
+
+       return 0;
+}
+
+static int cache_data_block(struct container_context *cntr,
+                           struct block_header *header, void **buf)
+{
+       int err;
+
+       // Check type of this block.
+       err = container_recursive_read(cntr, &header->type,
+                                      sizeof(header->type));
+       if (err < 0)
+               return err;
+       if (cntr->eof)
+               return 0;
+
+       if (header->type > BLOCK_TYPE_V120_DATA)
+               return -EIO;
+       if (header->type == BLOCK_TYPE_TERMINATOR)
+               return 0;
+
+       // Check size of this block. If the block includes a batch of data,
+       err = container_recursive_read(cntr, &header->size,
+                                      sizeof(header->size));
+       if (err < 0)
+               return err;
+       if (cntr->eof)
+               return 0;
+
+       return allocate_for_block_cache(cntr, header, buf);
+}
+
+static int detect_format_block(struct container_context *cntr)
+{
+       struct parser_state *state = cntr->private_data;
+       struct block_header header;
+       void *buf;
+       int err;
+
+again:
+       buf = NULL;
+       err = cache_data_block(cntr, &header, &buf);
+       if (err < 0)
+               return err;
+       if (buf) {
+               if (header.type == BLOCK_TYPE_EXTENDED_V110_FORMAT) {
+                       err = parse_extended_v110_format(state, buf);
+               } else if (header.type == BLOCK_TYPE_V120_DATA) {
+                       err = parse_v120_format_block(state, buf);
+               } else if (header.type == BLOCK_TYPE_V110_DATA) {
+                       err = parse_v110_data(state, buf);
+               } else {
+                       free(buf);
+                       goto again;
+               }
+
+               free(buf);
+
+               if (err < 0)
+                       return err;
+       }
+
+       // Expect to detect block_v110_data.
+       if (header.type == BLOCK_TYPE_EXTENDED_V110_FORMAT)
+               goto again;
+
+       return 0;
+}
+
+static int voc_parser_pre_process(struct container_context *cntr,
+                                 snd_pcm_format_t *format,
+                                 unsigned int *samples_per_frame,
+                                 unsigned int *frames_per_second,
+                                 uint64_t *byte_count)
+{
+       struct parser_state *state = cntr->private_data;
+       unsigned int i;
+       int err;
+
+       err = detect_container_version(cntr);
+       if (err < 0)
+               return err;
+
+       err = detect_format_block(cntr);
+       if (err < 0)
+               return err;
+
+       for (i = 0; i < ARRAY_SIZE(format_maps); ++i) {
+               if (format_maps[i].code_id == state->code_id)
+                       break;
+       }
+       if (i == ARRAY_SIZE(format_maps))
+               return -EINVAL;
+
+       *format = format_maps[i].format;
+       *samples_per_frame = state->samples_per_frame;
+       *frames_per_second = state->frames_per_second;
+
+       // This program handles PCM frames in this data block only.
+       *byte_count = state->byte_count;
+
+       return 0;
+}
+
+struct builder_state {
+       unsigned int version;
+       bool extended;
+       enum code_id code_id;
+
+       unsigned int samples_per_frame;
+       unsigned int bytes_per_sample;
+};
+
+static int write_container_header(struct container_context *cntr,
+                                 struct container_header *header)
+{
+       struct builder_state *state = cntr->private_data;
+
+       // Process container header.
+       memcpy(header->magic, VOC_MAGIC, sizeof(header->magic));
+       header->hdr_size = htole16(sizeof(*header));
+       header->version = htole16(state->version);
+       header->version_compr = htole16(0x1234 + ~state->version);
+
+       return container_recursive_write(cntr, header, sizeof(*header));
+}
+
+static int write_v120_format_block(struct container_context *cntr,
+                                  struct block_v120_format *block,
+                                  unsigned int frames_per_second,
+                                  uint64_t byte_count)
+{
+       struct builder_state *state = cntr->private_data;
+
+       block->type = BLOCK_TYPE_V120_DATA;
+       build_block_data_size(block->size, 12 + byte_count);
+
+       block->frames_per_second = htole32(frames_per_second);
+       block->bits_per_sample = state->bytes_per_sample * 8;
+       block->samples_per_frame = state->samples_per_frame;
+       block->code_id = htole16(state->code_id);
+
+       return container_recursive_write(cntr, block, sizeof(*block));
+}
+
+static int write_extended_v110_format_block(struct container_context *cntr,
+                               unsigned int frames_per_second,
+                               struct block_extended_v110_format *block)
+{
+       struct builder_state *state = cntr->private_data;
+       uint16_t time_const;
+       int err;
+
+       block->type = BLOCK_TYPE_EXTENDED_V110_FORMAT;
+       build_block_data_size(block->size, 4);
+
+       // 16 bits are available for this purpose.
+       err = build_time_constant(frames_per_second, state->samples_per_frame,
+                                 &time_const, true);
+       if (err < 0)
+               return err;
+       block->time_const = htole16(time_const);
+       block->code_id = htole16(state->code_id);
+
+       if (state->samples_per_frame == 1)
+               block->ch_mode = 0;
+       else
+               block->ch_mode = 1;
+
+       return container_recursive_write(cntr, block, sizeof(*block));
+}
+
+static int write_v110_format_block(struct container_context *cntr,
+                                  struct block_v110_data *block,
+                                  unsigned int frames_per_second,
+                                  uint64_t byte_count)
+{
+       struct builder_state *state = cntr->private_data;
+       uint16_t time_const;
+       int err;
+
+       block->type = BLOCK_TYPE_V110_DATA;
+       build_block_data_size(block->size, 2 + byte_count);
+
+       // These fields were obsoleted by extension.
+       err = build_time_constant(frames_per_second, 1, &time_const, false);
+       if (err < 0)
+               return err;
+       block->time_const = (uint8_t)time_const;
+       block->code_id = state->code_id;
+       return container_recursive_write(cntr, block, sizeof(*block));
+}
+
+static int write_data_blocks(struct container_context *cntr,
+                            unsigned int frames_per_second,
+                            uint64_t byte_count)
+{
+       union {
+               struct container_header header;
+               struct block_v110_data v110_data;
+               struct block_extended_v110_format extended_v110_format;
+               struct block_v120_format v120_format;
+       } buf = {0};
+       struct builder_state *state = cntr->private_data;
+       int err;
+
+       err = write_container_header(cntr, &buf.header);
+       if (err < 0)
+               return err;
+
+       if (state->version == VOC_VERSION_1_20) {
+               err = write_v120_format_block(cntr, &buf.v120_format,
+                                             frames_per_second, byte_count);
+       } else {
+               if (state->extended) {
+                       err = write_extended_v110_format_block(cntr,
+                                       frames_per_second,
+                                       &buf.extended_v110_format);
+                       if (err < 0)
+                               return err;
+               }
+               err = write_v110_format_block(cntr, &buf.v110_data,
+                                             frames_per_second, byte_count);
+       }
+
+       return err;
+}
+
+static int voc_builder_pre_process(struct container_context *cntr,
+                                  snd_pcm_format_t *format,
+                                  unsigned int *samples_per_frame,
+                                  unsigned int *frames_per_second,
+                                  uint64_t *byte_count)
+{
+       struct builder_state *state = cntr->private_data;
+       unsigned int i;
+
+       // Validate parameters.
+       for (i = 0; i < ARRAY_SIZE(format_maps); ++i) {
+               if (format_maps[i].format == *format)
+                       break;
+       }
+       if (i == ARRAY_SIZE(format_maps))
+               return -EINVAL;
+       state->code_id = format_maps[i].code_id;
+
+       // Decide container version.
+       if (*samples_per_frame > 2)
+               state->version = VOC_VERSION_1_20;
+       else
+               state->version = format_maps[i].minimal_version;
+       if (state->version == VOC_VERSION_1_10) {
+               if (*samples_per_frame == 2) {
+                       for (i = 0;
+                            i < ARRAY_SIZE(ex_v110_time_consts); ++i) {
+                               if (ex_v110_time_consts[i].frames_per_second ==
+                                               *frames_per_second)
+                                       break;
+                       }
+                       if (i == ARRAY_SIZE(ex_v110_time_consts))
+                               state->version = VOC_VERSION_1_20;
+                       else
+                               state->extended = true;
+               } else {
+                       for (i = 0; i < ARRAY_SIZE(v110_time_consts); ++i) {
+                               if (v110_time_consts[i].frames_per_second ==
+                                                       *frames_per_second)
+                                       break;
+                       }
+                       if (i == ARRAY_SIZE(v110_time_consts))
+                               state->version = VOC_VERSION_1_20;
+               }
+       }
+
+       state->bytes_per_sample = snd_pcm_format_physical_width(*format) / 8;
+       state->samples_per_frame = *samples_per_frame;
+
+       return write_data_blocks(cntr, *frames_per_second, *byte_count);
+}
+
+static int write_block_terminator(struct container_context *cntr)
+{
+       struct block_terminator block = {0};
+
+       block.type = BLOCK_TYPE_TERMINATOR;
+       return container_recursive_write(cntr, &block, sizeof(block));
+}
+
+static int write_data_size(struct container_context *cntr, uint64_t byte_count)
+{
+       struct builder_state *state = cntr->private_data;
+       off_t offset;
+       uint8_t size_field[3];
+       int err;
+
+       offset = sizeof(struct container_header) + sizeof(uint8_t);
+       if (state->version == VOC_VERSION_1_10 && state->extended)
+               offset += sizeof(struct block_extended_v110_format);
+       err = container_seek_offset(cntr, offset);
+       if (err < 0)
+               return err;
+
+       if (state->version == VOC_VERSION_1_10)
+               offset = 2;
+       else
+               offset = 12;
+
+       if (byte_count > cntr->max_size - offset)
+               byte_count = cntr->max_size;
+       else
+               byte_count += offset;
+       build_block_data_size(size_field, byte_count);
+
+       return container_recursive_write(cntr, &size_field, sizeof(size_field));
+}
+
+static int voc_builder_post_process(struct container_context *cntr,
+                                   uint64_t handled_byte_count)
+{
+       int err;
+
+       err = write_block_terminator(cntr);
+       if (err < 0)
+               return err;
+
+       return write_data_size(cntr, handled_byte_count);
+}
+
+const struct container_parser container_parser_voc = {
+       .format = CONTAINER_FORMAT_VOC,
+       .magic = VOC_MAGIC,
+       .max_size = 0xffffff -  // = UINT24_MAX.
+                   sizeof(struct block_terminator),
+       .ops = {
+               .pre_process    = voc_parser_pre_process,
+       },
+       .private_size = sizeof(struct parser_state),
+};
+
+const struct container_builder container_builder_voc = {
+       .format = CONTAINER_FORMAT_VOC,
+       .max_size = 0xffffff -  // = UINT24_MAX.
+                   sizeof(struct block_terminator),
+       .ops = {
+               .pre_process    = voc_builder_pre_process,
+               .post_process   = voc_builder_post_process,
+       },
+       .private_size = sizeof(struct builder_state),
+};
diff --git a/axfer/container.c b/axfer/container.c
new file mode 100644 (file)
index 0000000..a325fef
--- /dev/null
@@ -0,0 +1,459 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// container.c - an interface of parser/builder for formatted files.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "container.h"
+#include "misc.h"
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <inttypes.h>
+
+static const char *const cntr_type_labels[] = {
+       [CONTAINER_TYPE_PARSER] = "parser",
+       [CONTAINER_TYPE_BUILDER] = "builder",
+};
+
+static const char *const cntr_format_labels[] = {
+       [CONTAINER_FORMAT_RIFF_WAVE] = "riff/wave",
+       [CONTAINER_FORMAT_AU] = "au",
+       [CONTAINER_FORMAT_VOC] = "voc",
+       [CONTAINER_FORMAT_RAW] = "raw",
+};
+
+static const char *const suffixes[] = {
+       [CONTAINER_FORMAT_RIFF_WAVE]    = ".wav",
+       [CONTAINER_FORMAT_AU]           = ".au",
+       [CONTAINER_FORMAT_VOC]          = ".voc",
+       [CONTAINER_FORMAT_RAW]          = "",
+};
+
+const char * container_suffix_from_format(enum container_format format)
+{
+       return suffixes[format];
+}
+
+int container_recursive_read(struct container_context *cntr, void *buf,
+                            unsigned int byte_count)
+{
+       char *dst = buf;
+       ssize_t result;
+       size_t consumed = 0;
+
+       while (consumed < byte_count && !cntr->interrupted) {
+               result = read(cntr->fd, dst + consumed, byte_count - consumed);
+               if (result < 0) {
+                       // This descriptor was configured with non-blocking
+                       // mode. EINTR is not cought when get any interrupts.
+                       if (cntr->interrupted)
+                               return -EINTR;
+                       if (errno == EAGAIN)
+                               continue;
+                       return -errno;
+               }
+               // Reach EOF.
+               if (result == 0) {
+                       cntr->eof = true;
+                       return 0;
+               }
+
+               consumed += result;
+       }
+
+       return 0;
+}
+
+int container_recursive_write(struct container_context *cntr, void *buf,
+                             unsigned int byte_count)
+{
+       char *src = buf;
+       ssize_t result;
+       size_t consumed = 0;
+
+       while (consumed < byte_count && !cntr->interrupted) {
+               result = write(cntr->fd, src + consumed, byte_count - consumed);
+               if (result < 0) {
+                       // This descriptor was configured with non-blocking
+                       // mode. EINTR is not cought when get any interrupts.
+                       if (cntr->interrupted)
+                               return -EINTR;
+                       if (errno == EAGAIN)
+                               continue;
+                       return -errno;
+               }
+
+               consumed += result;
+       }
+
+       return 0;
+}
+
+enum container_format container_format_from_path(const char *path)
+{
+       const char *suffix;
+       const char *pos;
+       int i;
+
+       for (i = 0; i < (int)ARRAY_SIZE(suffixes); ++i) {
+               suffix = suffixes[i];
+
+               // Check last part of the string.
+               pos = path + strlen(path) - strlen(suffix);
+               if (!strcmp(pos, suffix))
+                       return i;
+       }
+
+       // Unsupported.
+       return CONTAINER_FORMAT_RAW;
+}
+
+int container_seek_offset(struct container_context *cntr, off_t offset)
+{
+       off_t pos;
+
+       pos = lseek(cntr->fd, offset, SEEK_SET);
+       if (pos < 0)
+               return -errno;
+       if (pos != offset)
+               return -EIO;
+
+       return 0;
+}
+
+// To avoid blocking execution at system call iteration after receiving UNIX
+// signals.
+static int set_nonblock_flag(int fd)
+{
+       int flags;
+
+       flags = fcntl(fd, F_GETFL);
+       if (flags < 0)
+               return -errno;
+
+       flags |= O_NONBLOCK;
+       if (fcntl(fd, F_SETFL, flags) < 0)
+               return -errno;
+
+       return 0;
+}
+
+int container_parser_init(struct container_context *cntr, int fd,
+                         unsigned int verbose)
+{
+       const struct container_parser *parsers[] = {
+               [CONTAINER_FORMAT_RIFF_WAVE] = &container_parser_riff_wave,
+               [CONTAINER_FORMAT_AU] = &container_parser_au,
+               [CONTAINER_FORMAT_VOC] = &container_parser_voc,
+       };
+       const struct container_parser *parser;
+       unsigned int size;
+       int i;
+       int err;
+
+       assert(cntr);
+       assert(fd >= 0);
+
+       // Detect forgotten to destruct.
+       assert(cntr->fd == 0);
+       assert(cntr->private_data == NULL);
+
+       memset(cntr, 0, sizeof(*cntr));
+
+       cntr->fd = fd;
+
+       cntr->stdio = (cntr->fd == fileno(stdin));
+       if (cntr->stdio) {
+               if (isatty(cntr->fd)) {
+                       fprintf(stderr,
+                               "A terminal is referred for standard input. "
+                               "Output from any process or shell redirection "
+                               "should be referred instead.\n");
+                       return -EIO;
+               }
+       }
+
+       err = set_nonblock_flag(cntr->fd);
+       if (err < 0)
+               return err;
+
+       // 4 bytes are enough to detect supported containers.
+       err = container_recursive_read(cntr, cntr->magic, sizeof(cntr->magic));
+       if (err < 0)
+               return err;
+       for (i = 0; i < (int)ARRAY_SIZE(parsers); ++i) {
+               parser = parsers[i];
+               size = strlen(parser->magic);
+               if (size > 4)
+                       size = 4;
+               if (!strncmp(cntr->magic, parser->magic, size))
+                       break;
+       }
+
+       // Don't forget that the first 4 bytes were already read for magic
+       // bytes.
+       cntr->magic_handled = false;
+
+       // Unless detected, use raw container.
+       if (i == ARRAY_SIZE(parsers))
+               parser = &container_parser_raw;
+
+       // Allocate private data for the parser.
+       if (parser->private_size > 0) {
+               cntr->private_data = malloc(parser->private_size);
+               if (cntr->private_data == NULL)
+                       return -ENOMEM;
+               memset(cntr->private_data, 0, parser->private_size);
+       }
+
+       cntr->type = CONTAINER_TYPE_PARSER;
+       cntr->process_bytes = container_recursive_read;
+       cntr->format = parser->format;
+       cntr->ops = &parser->ops;
+       cntr->max_size = parser->max_size;
+       cntr->verbose = verbose;
+
+       return 0;
+}
+
+int container_builder_init(struct container_context *cntr, int fd,
+                          enum container_format format, unsigned int verbose)
+{
+       const struct container_builder *builders[] = {
+               [CONTAINER_FORMAT_RIFF_WAVE] = &container_builder_riff_wave,
+               [CONTAINER_FORMAT_AU] = &container_builder_au,
+               [CONTAINER_FORMAT_VOC] = &container_builder_voc,
+               [CONTAINER_FORMAT_RAW] = &container_builder_raw,
+       };
+       const struct container_builder *builder;
+       int err;
+
+       assert(cntr);
+       assert(fd >= 0);
+
+       // Detect forgotten to destruct.
+       assert(cntr->fd == 0);
+       assert(cntr->private_data == NULL);
+
+       memset(cntr, 0, sizeof(*cntr));
+
+       cntr->fd = fd;
+
+       cntr->stdio = (cntr->fd == fileno(stdout));
+       if (cntr->stdio) {
+               if (isatty(cntr->fd)) {
+                       fprintf(stderr,
+                               "A terminal is referred for standard output. "
+                               "Input to any process or shell redirection "
+                               "should be referred instead.\n");
+                       return -EIO;
+               }
+       }
+
+       err = set_nonblock_flag(cntr->fd);
+       if (err < 0)
+               return err;
+
+       builder = builders[format];
+
+       // Allocate private data for the builder.
+       if (builder->private_size > 0) {
+               cntr->private_data = malloc(builder->private_size);
+               if (cntr->private_data == NULL)
+                       return -ENOMEM;
+               memset(cntr->private_data, 0, builder->private_size);
+       }
+
+       cntr->type = CONTAINER_TYPE_BUILDER;
+       cntr->process_bytes = container_recursive_write;
+       cntr->format = builder->format;
+       cntr->ops = &builder->ops;
+       cntr->max_size = builder->max_size;
+       cntr->verbose = verbose;
+
+       return 0;
+}
+
+int container_context_pre_process(struct container_context *cntr,
+                                 snd_pcm_format_t *format,
+                                 unsigned int *samples_per_frame,
+                                 unsigned int *frames_per_second,
+                                 uint64_t *frame_count)
+{
+       uint64_t byte_count = 0;
+       unsigned int bytes_per_frame;
+       int err;
+
+       assert(cntr);
+       assert(format);
+       assert(samples_per_frame);
+       assert(frames_per_second);
+       assert(frame_count);
+
+       if (cntr->type == CONTAINER_TYPE_BUILDER)
+               byte_count = cntr->max_size;
+
+       if (cntr->ops->pre_process) {
+               err = cntr->ops->pre_process(cntr, format, samples_per_frame,
+                                            frames_per_second, &byte_count);
+               if (err < 0)
+                       return err;
+               if (cntr->eof)
+                       return 0;
+       }
+
+       if (cntr->format == CONTAINER_FORMAT_RAW) {
+               if (*format == SND_PCM_FORMAT_UNKNOWN ||
+                   *samples_per_frame == 0 || *frames_per_second == 0) {
+                       fprintf(stderr,
+                               "Any file format is not detected. Need to "
+                               "indicate all of sample format, channels and "
+                               "rate explicitly.\n");
+                       return -EINVAL;
+               }
+       }
+       assert(*format >= SND_PCM_FORMAT_S8);
+       assert(*format <= SND_PCM_FORMAT_LAST);
+       assert(*samples_per_frame > 0);
+       assert(*frames_per_second > 0);
+       assert(byte_count > 0);
+
+       cntr->bytes_per_sample = snd_pcm_format_physical_width(*format) / 8;
+       cntr->samples_per_frame = *samples_per_frame;
+       cntr->frames_per_second = *frames_per_second;
+
+       bytes_per_frame = cntr->bytes_per_sample * *samples_per_frame;
+       *frame_count = byte_count / bytes_per_frame;
+       cntr->max_size -= cntr->max_size / bytes_per_frame;
+
+       if (cntr->verbose > 0) {
+               fprintf(stderr, "Container: %s\n",
+                       cntr_type_labels[cntr->type]);
+               fprintf(stderr, "  format: %s\n",
+                       cntr_format_labels[cntr->format]);
+               fprintf(stderr, "  sample format: %s\n",
+                       snd_pcm_format_name(*format));
+               fprintf(stderr, "  bytes/sample: %u\n",
+                       cntr->bytes_per_sample);
+               fprintf(stderr, "  samples/frame: %u\n",
+                       cntr->samples_per_frame);
+               fprintf(stderr, "  frames/second: %u\n",
+                       cntr->frames_per_second);
+               if (cntr->type == CONTAINER_TYPE_PARSER) {
+                       fprintf(stderr, "  frames: %" PRIu64 "\n",
+                               *frame_count);
+               } else {
+                       fprintf(stderr, "  max frames: %" PRIu64 "\n",
+                               *frame_count);
+               }
+       }
+
+       return 0;
+}
+
+int container_context_process_frames(struct container_context *cntr,
+                                    void *frame_buffer,
+                                    unsigned int *frame_count)
+{
+       char *buf = frame_buffer;
+       unsigned int bytes_per_frame;
+       unsigned int byte_count;
+       unsigned int target_byte_count;
+       int err;
+
+       assert(cntr);
+       assert(!cntr->eof);
+       assert(frame_buffer);
+       assert(frame_count);
+
+       bytes_per_frame = cntr->bytes_per_sample * cntr->samples_per_frame;
+       target_byte_count = *frame_count * bytes_per_frame;
+
+       // A parser of cotainers already read first 4 bytes to detect format
+       // of container, however they includes PCM frames when any format was
+       // undetected. Surely to write out them.
+       byte_count = target_byte_count;
+       if (cntr->format == CONTAINER_FORMAT_RAW &&
+           cntr->type == CONTAINER_TYPE_PARSER && !cntr->magic_handled) {
+               memcpy(buf, cntr->magic, sizeof(cntr->magic));
+               buf += sizeof(cntr->magic);
+               byte_count -= sizeof(cntr->magic);
+               cntr->magic_handled = true;
+       }
+
+       // Each container has limitation for its volume for sample data.
+       if (cntr->handled_byte_count > cntr->max_size - byte_count)
+               byte_count = cntr->max_size - cntr->handled_byte_count;
+
+       // All of supported containers include interleaved PCM frames.
+       // TODO: process frames for truncate case.
+       err = cntr->process_bytes(cntr, buf, byte_count);
+       if (err < 0) {
+               *frame_count = 0;
+               return err;
+       }
+
+       cntr->handled_byte_count += target_byte_count;
+       if (cntr->handled_byte_count == cntr->max_size)
+               cntr->eof = true;
+
+       *frame_count = target_byte_count / bytes_per_frame;
+
+       return 0;
+}
+
+int container_context_post_process(struct container_context *cntr,
+                                  uint64_t *frame_count)
+{
+       int err = 0;
+
+       assert(cntr);
+       assert(frame_count);
+
+       if (cntr->verbose && cntr->handled_byte_count > 0) {
+               fprintf(stderr, "  Handled bytes: %" PRIu64 "\n",
+                       cntr->handled_byte_count);
+       }
+
+       // NOTE* we cannot seek when using standard input/output.
+       if (!cntr->stdio && cntr->ops && cntr->ops->post_process) {
+               // Usually, need to write out processed bytes in container
+               // header even it this program is interrupted.
+               cntr->interrupted = false;
+
+               err = cntr->ops->post_process(cntr, cntr->handled_byte_count);
+       }
+
+       // Ensure to perform write-back from disk cache.
+       if (cntr->type == CONTAINER_TYPE_BUILDER)
+               fsync(cntr->fd);
+
+       if (err < 0)
+               return err;
+
+       if (cntr->bytes_per_sample == 0 || cntr->samples_per_frame == 0) {
+               *frame_count = 0;
+       } else {
+               *frame_count = cntr->handled_byte_count /
+                              cntr->bytes_per_sample /
+                              cntr->samples_per_frame;
+       }
+
+       return 0;
+}
+
+void container_context_destroy(struct container_context *cntr)
+{
+       assert(cntr);
+
+       if (cntr->private_data)
+               free(cntr->private_data);
+
+       cntr->fd = 0;
+       cntr->private_data = NULL;
+}
diff --git a/axfer/container.h b/axfer/container.h
new file mode 100644 (file)
index 0000000..3dd466a
--- /dev/null
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// container.h - an interface of parser/builder for formatted files.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#ifndef __ALSA_UTILS_AXFER_CONTAINER__H_
+#define __ALSA_UTILS_AXFER_CONTAINER__H_
+
+#include "aconfig.h"
+
+#define _LARGEFILE64_SOURCE
+#include <sys/types.h>
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include <alsa/asoundlib.h>
+
+#include "os_compat.h"
+
+enum container_type {
+       CONTAINER_TYPE_PARSER = 0,
+       CONTAINER_TYPE_BUILDER,
+       CONTAINER_TYPE_COUNT,
+};
+
+enum container_format {
+       CONTAINER_FORMAT_RIFF_WAVE = 0,
+       CONTAINER_FORMAT_AU,
+       CONTAINER_FORMAT_VOC,
+       CONTAINER_FORMAT_RAW,
+       CONTAINER_FORMAT_COUNT,
+};
+
+struct container_ops;
+
+struct container_context {
+       enum container_type type;
+       int fd;
+       int (*process_bytes)(struct container_context *cntr,
+                            void *buffer, unsigned int byte_count);
+       bool magic_handled;
+       bool eof;
+       bool interrupted;
+       bool stdio;
+
+       enum container_format format;
+       uint64_t max_size;
+       char magic[4];
+       const struct container_ops *ops;
+       void *private_data;
+
+       // Available after pre-process.
+       unsigned int bytes_per_sample;
+       unsigned int samples_per_frame;
+       unsigned int frames_per_second;
+
+       unsigned int verbose;
+       uint64_t handled_byte_count;
+};
+
+const char *container_suffix_from_format(enum container_format format);
+enum container_format container_format_from_path(const char *path);
+int container_parser_init(struct container_context *cntr, int fd,
+                         unsigned int verbose);
+int container_builder_init(struct container_context *cntr, int fd,
+                          enum container_format format, unsigned int verbose);
+void container_context_destroy(struct container_context *cntr);
+int container_context_pre_process(struct container_context *cntr,
+                                 snd_pcm_format_t *format,
+                                 unsigned int *samples_per_frame,
+                                 unsigned int *frames_per_second,
+                                 uint64_t *frame_count);
+int container_context_process_frames(struct container_context *cntr,
+                                    void *frame_buffer,
+                                    unsigned int *frame_count);
+int container_context_post_process(struct container_context *cntr,
+                                  uint64_t *frame_count);
+
+// For internal use in 'container' module.
+
+struct container_ops {
+       int (*pre_process)(struct container_context *cntr,
+                          snd_pcm_format_t *format,
+                          unsigned int *samples_per_frame,
+                          unsigned int *frames_per_second,
+                          uint64_t *byte_count);
+       int (*post_process)(struct container_context *cntr,
+                           uint64_t handled_byte_count);
+};
+struct container_parser {
+       enum container_format format;
+       const char *const magic;
+       uint64_t max_size;
+       struct container_ops ops;
+       unsigned int private_size;
+};
+
+struct container_builder {
+       enum container_format format;
+       const char *const suffix;
+       uint64_t max_size;
+       struct container_ops ops;
+       unsigned int private_size;
+};
+
+int container_recursive_read(struct container_context *cntr, void *buf,
+                            unsigned int byte_count);
+int container_recursive_write(struct container_context *cntr, void *buf,
+                             unsigned int byte_count);
+int container_seek_offset(struct container_context *cntr, off_t offset);
+
+extern const struct container_parser container_parser_riff_wave;
+extern const struct container_builder container_builder_riff_wave;
+
+extern const struct container_parser container_parser_au;
+extern const struct container_builder container_builder_au;
+
+extern const struct container_parser container_parser_voc;
+extern const struct container_builder container_builder_voc;
+
+extern const struct container_parser container_parser_raw;
+extern const struct container_builder container_builder_raw;
+
+#endif
diff --git a/axfer/frame-cache.c b/axfer/frame-cache.c
new file mode 100644 (file)
index 0000000..8538f1e
--- /dev/null
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// frame-cache.c - maintainer of cache for data frame.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "frame-cache.h"
+
+static void align_frames_in_i(struct frame_cache *cache,
+                             unsigned int consumed_count)
+{
+       char *buf = cache->buf;
+       unsigned int offset;
+       unsigned int size;
+
+       cache->remained_count -= consumed_count;
+
+       offset = cache->bytes_per_sample * cache->samples_per_frame *
+                consumed_count;
+       size = cache->bytes_per_sample * cache->samples_per_frame *
+              cache->remained_count;
+       memmove(buf, buf + offset, size);
+
+       cache->buf_ptr = buf + size;
+}
+
+static void align_frames_in_n(struct frame_cache *cache,
+                             unsigned int consumed_count)
+{
+       char **bufs = cache->buf;
+       char **buf_ptrs = cache->buf_ptr;
+       unsigned int offset;
+       unsigned int size;
+       unsigned int i;
+
+       cache->remained_count -= consumed_count;
+
+       for (i = 0; i < cache->samples_per_frame; ++i) {
+               offset = cache->bytes_per_sample * consumed_count;
+               size = cache->bytes_per_sample * cache->remained_count;
+               memmove(bufs[i], bufs[i] + offset, size);
+               buf_ptrs[i] = bufs[i] + size;
+       }
+}
+
+int frame_cache_init(struct frame_cache *cache, snd_pcm_access_t access,
+                    unsigned int bytes_per_sample,
+                    unsigned int samples_per_frame,
+                    unsigned int frames_per_cache)
+{
+       cache->access = access;
+       cache->remained_count = 0;
+       cache->bytes_per_sample = bytes_per_sample;
+       cache->samples_per_frame = samples_per_frame;
+       cache->frames_per_cache = frames_per_cache;
+
+       if (access == SND_PCM_ACCESS_RW_INTERLEAVED)
+               cache->align_frames = align_frames_in_i;
+       else if (access == SND_PCM_ACCESS_RW_NONINTERLEAVED)
+               cache->align_frames = align_frames_in_n;
+       else
+               return -EINVAL;
+
+       if (access == SND_PCM_ACCESS_RW_INTERLEAVED) {
+               char *buf;
+
+               buf = calloc(frames_per_cache,
+                            bytes_per_sample * samples_per_frame);
+               if (buf == NULL)
+                       goto nomem;
+               cache->buf = buf;
+               cache->buf_ptr = buf;
+       } else {
+               char **bufs = calloc(samples_per_frame, sizeof(*bufs));
+               char **buf_ptrs = calloc(samples_per_frame, sizeof(*buf_ptrs));
+               unsigned int i;
+
+               cache->buf = bufs;
+               cache->buf_ptr = buf_ptrs;
+               if (bufs == NULL || buf_ptrs == NULL)
+                       goto nomem;
+               for (i = 0; i < samples_per_frame; ++i) {
+                       bufs[i] = calloc(frames_per_cache, bytes_per_sample);
+                       if (bufs[i] == NULL)
+                               goto nomem;
+                       buf_ptrs[i] = bufs[i];
+               }
+       }
+
+
+       return 0;
+
+nomem:
+       frame_cache_destroy(cache);
+       return -ENOMEM;
+}
+
+void frame_cache_destroy(struct frame_cache *cache)
+{
+       if (cache->access == SND_PCM_ACCESS_RW_NONINTERLEAVED) {
+               char **bufs = cache->buf;
+               if (bufs) {
+                       unsigned int i;
+                       for (i = 0; i < cache->samples_per_frame; ++i)
+                               free(bufs[i]);
+               }
+               free(cache->buf_ptr);
+       }
+       free(cache->buf);
+       memset(cache, 0, sizeof(*cache));
+}
diff --git a/axfer/frame-cache.h b/axfer/frame-cache.h
new file mode 100644 (file)
index 0000000..7191333
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// frame-cache.h - maintainer of cache for data frame.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include <alsa/asoundlib.h>
+
+struct frame_cache {
+       void *buf;
+       void *buf_ptr;
+
+       unsigned int remained_count;
+
+       snd_pcm_access_t access;
+       unsigned int bytes_per_sample;
+       unsigned int samples_per_frame;
+       unsigned int frames_per_cache;
+
+       void (*align_frames)(struct frame_cache *cache,
+                            unsigned int consumed_count);
+};
+
+int frame_cache_init(struct frame_cache *cache, snd_pcm_access_t access,
+                    unsigned int bytes_per_sample,
+                    unsigned int samples_per_frame,
+                    unsigned int frames_per_cache);
+void frame_cache_destroy(struct frame_cache *cache);
+
+static inline unsigned int frame_cache_get_count(struct frame_cache *cache)
+{
+       return cache->remained_count;
+}
+
+static inline void frame_cache_increase_count(struct frame_cache *cache,
+                                             unsigned int frame_count)
+{
+       cache->remained_count += frame_count;
+}
+
+static inline void frame_cache_reduce(struct frame_cache *cache,
+                                     unsigned int consumed_count)
+{
+       cache->align_frames(cache, consumed_count);
+}
diff --git a/axfer/main.c b/axfer/main.c
new file mode 100644 (file)
index 0000000..765d2c3
--- /dev/null
@@ -0,0 +1,287 @@
+// SPDX-License-Identifier: GPL-2.0
+// main.c - an entry point for this program.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Originally written as 'aplay', by Michael Beck and Jaroslav Kysela.
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "subcmd.h"
+#include "misc.h"
+
+#include "version.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+enum subcmds {
+       SUBCMD_TRANSFER = 0,
+       SUBCMD_LIST,
+       SUBCMD_HELP,
+       SUBCMD_VERSION,
+};
+
+char *arg_duplicate_string(const char *str, int *err)
+{
+       char *ptr;
+
+       // For safe.
+       if (strlen(str) > 1024) {
+               *err = -EINVAL;
+               return NULL;
+       }
+
+       ptr = strdup(str);
+       if (ptr == NULL)
+               *err = -ENOMEM;
+
+       return ptr;
+}
+
+long arg_parse_decimal_num(const char *str, int *err)
+{
+       long val;
+       char *endptr;
+
+       errno = 0;
+       val = strtol(str, &endptr, 0);
+       if (errno > 0) {
+               *err = -errno;
+               return 0;
+       }
+       if (*endptr != '\0') {
+               *err = -EINVAL;
+               return 0;
+       }
+
+       return val;
+}
+
+static void print_version(const char *const cmdname)
+{
+       printf("%s: version %s\n", cmdname, SND_UTIL_VERSION_STR);
+}
+
+static void print_help(void)
+{
+       printf(
+"Usage:\n"
+"  axfer transfer DIRECTION OPTIONS\n"
+"  axfer list DIRECTION OPTIONS\n"
+"  axfer version\n"
+"  axfer help\n"
+"\n"
+"  where:\n"
+"    DIRECTION = capture | playback\n"
+"    OPTIONS = -h | --help | (subcommand specific)\n"
+       );
+}
+
+// Backward compatibility to aplay(1).
+static bool decide_subcmd(int argc, char *const *argv, enum subcmds *subcmd)
+{
+       static const struct {
+               const char *const name;
+               enum subcmds subcmd;
+       } long_opts[] = {
+               {"--list-devices",      SUBCMD_LIST},
+               {"--list-pcms",         SUBCMD_LIST},
+               {"--help",              SUBCMD_HELP},
+               {"--version",           SUBCMD_VERSION},
+       };
+       static const struct {
+               unsigned char c;
+               enum subcmds subcmd;
+       } short_opts[] = {
+               {'l', SUBCMD_LIST},
+               {'L', SUBCMD_LIST},
+               {'h', SUBCMD_HELP},
+       };
+       char *pos;
+       int i, j;
+
+       if (argc == 1)
+               return false;
+
+       // Original command system. For long options.
+       for (i = 0; i < (int)ARRAY_SIZE(long_opts); ++i) {
+               for (j = 0; j < argc; ++j) {
+                       if (!strcmp(long_opts[i].name, argv[j])) {
+                               *subcmd = long_opts[i].subcmd;
+                               return true;
+                       }
+               }
+       }
+
+       // Original command system. For short options.
+       for (i = 1; i < argc; ++i) {
+               // Pick up short options only.
+               if (argv[i][0] != '-' || argv[i][0] == '\0' ||
+                   argv[i][1] == '-' || argv[i][1] == '\0')
+                       continue;
+               for (pos = argv[i]; *pos != '\0'; ++pos) {
+                       for (j = 0; j < (int)ARRAY_SIZE(short_opts); ++j) {
+                               if (*pos == short_opts[j].c) {
+                                       *subcmd = short_opts[j].subcmd;
+                                       return true;
+                               }
+                       }
+               }
+       }
+
+       return false;
+}
+
+// Backward compatibility to aplay(1).
+static bool decide_direction(int argc, char *const *argv,
+                            snd_pcm_stream_t *direction)
+{
+       static const struct {
+               const char *const name;
+               snd_pcm_stream_t direction;
+       } long_opts[] = {
+               {"--capture",   SND_PCM_STREAM_CAPTURE},
+               {"--playback",  SND_PCM_STREAM_PLAYBACK},
+       };
+       static const struct {
+               unsigned char c;
+               snd_pcm_stream_t direction;
+       } short_opts[] = {
+               {'C',           SND_PCM_STREAM_CAPTURE},
+               {'P',           SND_PCM_STREAM_PLAYBACK},
+       };
+       static const char *const aliases[] = {
+               [SND_PCM_STREAM_CAPTURE] = "arecord",
+               [SND_PCM_STREAM_PLAYBACK] = "aplay",
+       };
+       int i, j;
+       char *pos;
+
+       // Original command system. For long options.
+       for (i = 0; i < (int)ARRAY_SIZE(long_opts); ++i) {
+               for (j = 0; j < argc; ++j) {
+                       if (!strcmp(long_opts[i].name, argv[j])) {
+                               *direction = long_opts[i].direction;
+                               return true;
+                       }
+               }
+       }
+
+       // Original command system. For short options.
+       for (i = 1; i < argc; ++i) {
+               // Pick up short options only.
+               if (argv[i][0] != '-' || argv[i][0] == '\0' ||
+                   argv[i][1] == '-' || argv[i][1] == '\0')
+                       continue;
+               for (pos = argv[i]; *pos != '\0'; ++pos) {
+                       for (j = 0; j < (int)ARRAY_SIZE(short_opts); ++j) {
+                               if (*pos == short_opts[j].c) {
+                                       *direction = short_opts[j].direction;
+                                       return true;
+                               }
+                       }
+               }
+       }
+
+       // If not decided yet, judge according to command name.
+       for (i = 0; i < (int)ARRAY_SIZE(aliases); ++i) {
+               for (pos = argv[0] + strlen(argv[0]); pos != argv[0]; --pos) {
+                       if (strstr(pos, aliases[i]) != NULL) {
+                               *direction = i;
+                               return true;
+                       }
+               }
+       }
+
+       return false;
+}
+
+static bool detect_subcmd(int argc, char *const *argv, enum subcmds *subcmd)
+{
+       static const char *const subcmds[] = {
+               [SUBCMD_TRANSFER] = "transfer",
+               [SUBCMD_LIST] = "list",
+               [SUBCMD_HELP] = "help",
+               [SUBCMD_VERSION] = "version",
+       };
+       int i;
+
+       if (argc < 2)
+               return false;
+
+       for (i = 0; i < (int)ARRAY_SIZE(subcmds); ++i) {
+               if (!strcmp(argv[1], subcmds[i])) {
+                       *subcmd = i;
+                       return true;
+               }
+       }
+
+       return false;
+}
+
+static bool detect_direction(int argc, char *const *argv,
+                            snd_pcm_stream_t *direction)
+{
+       if (argc < 3)
+               return false;
+
+       if (!strcmp(argv[2], "capture")) {
+               *direction = SND_PCM_STREAM_CAPTURE;
+               return true;
+       }
+
+       if (!strcmp(argv[2], "playback")) {
+               *direction = SND_PCM_STREAM_PLAYBACK;
+               return true;
+       }
+
+       return false;
+}
+
+int main(int argc, char *const *argv)
+{
+       snd_pcm_stream_t direction;
+       enum subcmds subcmd;
+       int err = 0;
+
+       // For compatibility to aplay(1) implementation.
+       if (strstr(argv[0], "arecord") == argv[0] + strlen(argv[0]) - 7 ||
+           strstr(argv[0], "aplay") == argv[0] + strlen(argv[0]) - 5) {
+               if (!decide_direction(argc, argv, &direction))
+                       direction = SND_PCM_STREAM_PLAYBACK;
+               if (!decide_subcmd(argc, argv, &subcmd))
+                       subcmd = SUBCMD_TRANSFER;
+       } else {
+               // The first option should be one of subcommands.
+               if (!detect_subcmd(argc, argv, &subcmd))
+                       subcmd = SUBCMD_HELP;
+               // The second option should be either 'capture' or 'direction'
+               // if subcommand is neither 'version' nor 'help'.
+               if (subcmd != SUBCMD_VERSION && subcmd != SUBCMD_HELP) {
+                       if (!detect_direction(argc, argv, &direction)) {
+                               subcmd = SUBCMD_HELP;
+                       } else {
+                               // argv[0] is needed for unparsed option to use
+                               // getopt_long(3).
+                               argc -= 2;
+                               argv += 2;
+                       }
+               }
+       }
+
+       if (subcmd == SUBCMD_TRANSFER)
+               err = subcmd_transfer(argc, argv, direction);
+       else if (subcmd == SUBCMD_LIST)
+               err = subcmd_list(argc, argv, direction);
+       else if (subcmd == SUBCMD_VERSION)
+               print_version(argv[0]);
+       else
+               print_help();
+       if (err < 0)
+               return EXIT_FAILURE;
+
+       return EXIT_SUCCESS;
+}
diff --git a/axfer/mapper-multiple.c b/axfer/mapper-multiple.c
new file mode 100644 (file)
index 0000000..8e82b22
--- /dev/null
@@ -0,0 +1,259 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// mapper-multiple.c - a muxer/demuxer for multiple containers.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "mapper.h"
+#include "misc.h"
+
+struct multiple_state {
+       void (*align_frames)(void *frame_buf, unsigned int frame_count,
+                            char **buf, unsigned int bytes_per_sample,
+                            struct container_context *cntrs,
+                            unsigned int cntr_count);
+       char **bufs;
+       unsigned int cntr_count;
+};
+
+static void align_to_i(void *frame_buf, unsigned int frame_count,
+                      char **src_bufs, unsigned int bytes_per_sample,
+                      struct container_context *cntrs, unsigned int cntr_count)
+{
+       char *dst = frame_buf;
+       char *src;
+       unsigned int dst_pos;
+       unsigned int src_pos;
+       struct container_context *cntr;
+       unsigned int i, j;
+
+       // src: first channel in each of interleaved buffers in containers =>
+       // dst:interleaved.
+       for (i = 0; i < cntr_count; ++i) {
+               src = src_bufs[i];
+               cntr = cntrs + i;
+
+               for (j = 0; j < frame_count; ++j) {
+                       // Use first src channel for each of dst channel.
+                       src_pos = bytes_per_sample * cntr->samples_per_frame * j;
+                       dst_pos = bytes_per_sample * (cntr_count * j + i);
+
+                       memcpy(dst + dst_pos, src + src_pos, bytes_per_sample);
+               }
+       }
+}
+
+static void align_from_i(void *frame_buf, unsigned int frame_count,
+                        char **dst_bufs, unsigned int bytes_per_sample,
+                        struct container_context *cntrs,
+                        unsigned int cntr_count)
+{
+       char *src = frame_buf;
+       char *dst;
+       unsigned int src_pos;
+       unsigned int dst_pos;
+       struct container_context *cntr;
+       unsigned int i, j;
+
+       for (i = 0; i < cntr_count; ++i) {
+               dst = dst_bufs[i];
+               cntr = cntrs + i;
+
+               for (j = 0; j < frame_count; ++j) {
+                       // Use first src channel for each of dst channel.
+                       src_pos = bytes_per_sample * (cntr_count * j + i);
+                       dst_pos = bytes_per_sample * cntr->samples_per_frame * j;
+
+                       memcpy(dst + dst_pos, src + src_pos, bytes_per_sample);
+               }
+       }
+}
+
+static int multiple_pre_process(struct mapper_context *mapper,
+                               struct container_context *cntrs,
+                               unsigned int cntr_count)
+{
+       struct multiple_state *state = mapper->private_data;
+       struct container_context *cntr;
+       unsigned int i;
+
+       // Additionally, format of samples in the containers should be the same
+       // as the format in PCM substream.
+       for (i = 0; i < cntr_count; ++i) {
+               cntr = cntrs + i;
+               if (mapper->bytes_per_sample != cntr->bytes_per_sample)
+                       return -EINVAL;
+       }
+       state->cntr_count = cntr_count;
+
+       // Decide method to align frames.
+       if (mapper->type == MAPPER_TYPE_DEMUXER) {
+               if (mapper->access == SND_PCM_ACCESS_RW_INTERLEAVED ||
+                   mapper->access == SND_PCM_ACCESS_MMAP_INTERLEAVED)
+                       state->align_frames = align_from_i;
+               else if (mapper->access == SND_PCM_ACCESS_RW_NONINTERLEAVED ||
+                        mapper->access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED)
+                       state->align_frames = NULL;
+               else
+                       return -EINVAL;
+       } else {
+               if (mapper->access == SND_PCM_ACCESS_RW_INTERLEAVED ||
+                   mapper->access == SND_PCM_ACCESS_MMAP_INTERLEAVED)
+                       state->align_frames = align_to_i;
+               else if (mapper->access == SND_PCM_ACCESS_RW_NONINTERLEAVED ||
+                        mapper->access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED)
+                       state->align_frames = NULL;
+               else
+                       return -EINVAL;
+       }
+
+       if (state->align_frames) {
+               // Furthermore, in demuxer case, each container should be
+               // configured to store one sample per frame.
+               if (mapper->type == MAPPER_TYPE_DEMUXER) {
+                       for (i = 0; i < cntr_count; ++i) {
+                               cntr = cntrs + i;
+                               if (cntr->samples_per_frame != 1)
+                                       return -EINVAL;
+                       }
+               }
+
+               state->bufs = calloc(cntr_count, sizeof(char *));
+               if (state->bufs == NULL)
+                       return -ENOMEM;
+
+               for (i = 0; i < cntr_count; ++i) {
+                       unsigned int bytes_per_buffer;
+
+                       // Allocate intermediate buffer as the same size as a
+                       // period for each of containers.
+                       cntr = cntrs + i;
+
+                       bytes_per_buffer = mapper->bytes_per_sample *
+                                          cntr->samples_per_frame *
+                                          mapper->frames_per_buffer;
+
+                       state->bufs[i] = malloc(bytes_per_buffer);
+                       if (state->bufs[i] == NULL)
+                               return -ENOMEM;
+                       memset(state->bufs[i], 0, bytes_per_buffer);
+               }
+       }
+
+       return 0;
+}
+
+static int process_containers(char **src_bufs, unsigned int *frame_count,
+                             struct container_context *cntrs,
+                             unsigned int cntr_count)
+{
+       struct container_context *cntr;
+       char *src;
+       unsigned int i;
+       int err = 0;
+
+       // TODO: arrangement for *frame_count.
+       for (i = 0; i < cntr_count; ++i) {
+               cntr = &cntrs[i];
+               src = src_bufs[i];
+
+               err = container_context_process_frames(cntr, src, frame_count);
+               if (err < 0)
+                       break;
+       }
+
+       return err;
+}
+
+static int multiple_muxer_process_frames(struct mapper_context *mapper,
+                                        void *frame_buf,
+                                        unsigned int *frame_count,
+                                        struct container_context *cntrs,
+                                        unsigned int cntr_count)
+{
+       struct multiple_state *state = mapper->private_data;
+       char **src_bufs;
+       int err;
+
+       // If need to align PCM frames, process PCM frames to the intermediate
+       // buffer once.
+       if (!state->align_frames) {
+               // The most likely.
+               src_bufs = frame_buf;
+       } else {
+               src_bufs = state->bufs;
+       }
+       err = process_containers(src_bufs, frame_count, cntrs, cntr_count);
+       if (err < 0)
+               return err;
+
+       // Unlikely.
+       if (src_bufs != frame_buf && *frame_count > 0) {
+               state->align_frames(frame_buf, *frame_count, src_bufs,
+                                   mapper->bytes_per_sample, cntrs,
+                                   cntr_count);
+       }
+
+       return 0;
+}
+
+static int multiple_demuxer_process_frames(struct mapper_context *mapper,
+                                          void *frame_buf,
+                                          unsigned int *frame_count,
+                                          struct container_context *cntrs,
+                                          unsigned int cntr_count)
+{
+       struct multiple_state *state = mapper->private_data;
+       char **dst_bufs;
+
+       // If need to align PCM frames, process PCM frames to the intermediate
+       // buffer once.
+       if (!state->align_frames) {
+               // The most likely.
+               dst_bufs = frame_buf;
+       } else {
+               dst_bufs = state->bufs;
+               state->align_frames(frame_buf, *frame_count, dst_bufs,
+                                   mapper->bytes_per_sample, cntrs,
+                                   cntr_count);
+       }
+
+       return process_containers(dst_bufs, frame_count, cntrs, cntr_count);
+}
+
+static void multiple_post_process(struct mapper_context *mapper)
+{
+       struct multiple_state *state = mapper->private_data;
+       unsigned int i;
+
+       if (state->bufs) {
+               for (i = 0; i < state->cntr_count; ++i) {
+                       if (state->bufs[i])
+                               free(state->bufs[i]);
+               }
+               free(state->bufs);
+       }
+
+       state->bufs = NULL;
+       state->align_frames = NULL;
+}
+
+const struct mapper_data mapper_muxer_multiple = {
+       .ops = {
+               .pre_process = multiple_pre_process,
+               .process_frames = multiple_muxer_process_frames,
+               .post_process = multiple_post_process,
+       },
+       .private_size = sizeof(struct multiple_state),
+};
+
+const struct mapper_data mapper_demuxer_multiple = {
+       .ops = {
+               .pre_process = multiple_pre_process,
+               .process_frames = multiple_demuxer_process_frames,
+               .post_process = multiple_post_process,
+       },
+       .private_size = sizeof(struct multiple_state),
+};
diff --git a/axfer/mapper-single.c b/axfer/mapper-single.c
new file mode 100644 (file)
index 0000000..f669f7f
--- /dev/null
@@ -0,0 +1,191 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// mapper-single.c - a muxer/demuxer for single containers.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "mapper.h"
+#include "misc.h"
+
+struct single_state {
+       void (*align_frames)(void *frame_buf, unsigned int frame_count,
+                            char *buf, unsigned int bytes_per_sample,
+                            unsigned int samples_per_frame);
+       char *buf;
+};
+
+static void align_to_vector(void *frame_buf, unsigned int frame_count,
+                           char *src, unsigned int bytes_per_sample,
+                           unsigned samples_per_frame)
+{
+       char **dst_bufs = frame_buf;
+       char *dst;
+       unsigned int src_pos;
+       unsigned int dst_pos;
+       unsigned int i, j;
+
+       // src: interleaved => dst: a set of interleaved buffers.
+       for (i = 0; i < samples_per_frame; ++i) {
+               dst = dst_bufs[i];
+               for (j = 0; j < frame_count; ++j) {
+                       src_pos = bytes_per_sample * (samples_per_frame * j + i);
+                       dst_pos = bytes_per_sample * j;
+
+                       memcpy(dst + dst_pos, src + src_pos, bytes_per_sample);
+               }
+       }
+}
+
+static void align_from_vector(void *frame_buf, unsigned int frame_count,
+                             char *dst, unsigned int bytes_per_sample,
+                             unsigned int samples_per_frame)
+{
+       char **src_bufs = frame_buf;
+       char *src;
+       unsigned int dst_pos;
+       unsigned int src_pos;
+       unsigned int i, j;
+
+       // src: a set of interleaved buffers => dst:interleaved.
+       for (i = 0; i < samples_per_frame; ++i) {
+               src = src_bufs[i];
+               for (j = 0; j < frame_count; ++j) {
+                       src_pos = bytes_per_sample * j;
+                       dst_pos = bytes_per_sample * (samples_per_frame * j + i);
+
+                       memcpy(dst + dst_pos, src + src_pos, bytes_per_sample);
+               }
+       }
+}
+
+static int single_pre_process(struct mapper_context *mapper,
+                             struct container_context *cntrs,
+                             unsigned int cntr_count ATTRIBUTE_UNUSED)
+{
+       struct single_state *state = mapper->private_data;
+       unsigned int bytes_per_buffer;
+
+       if (cntrs->bytes_per_sample != mapper->bytes_per_sample ||
+           cntrs->samples_per_frame != mapper->samples_per_frame)
+               return -EINVAL;
+
+       // Decide method to align frames.
+       if (mapper->type == MAPPER_TYPE_DEMUXER) {
+               if (mapper->access == SND_PCM_ACCESS_RW_NONINTERLEAVED ||
+                   mapper->access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED)
+                       state->align_frames = align_from_vector;
+               else if (mapper->access == SND_PCM_ACCESS_RW_INTERLEAVED ||
+                        mapper->access == SND_PCM_ACCESS_MMAP_INTERLEAVED)
+                       state->align_frames = NULL;
+               else
+                       return -EINVAL;
+       } else {
+               if (mapper->access == SND_PCM_ACCESS_RW_NONINTERLEAVED ||
+                   mapper->access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED)
+                       state->align_frames = align_to_vector;
+               else if (mapper->access == SND_PCM_ACCESS_RW_INTERLEAVED ||
+                        mapper->access == SND_PCM_ACCESS_MMAP_INTERLEAVED)
+                       state->align_frames = NULL;
+               else
+                       return -EINVAL;
+       }
+
+       if (state->align_frames) {
+               // Allocate intermediate buffer as the same size as a period.
+               bytes_per_buffer = mapper->bytes_per_sample *
+                                  mapper->samples_per_frame *
+                                  mapper->frames_per_buffer;
+               state->buf = malloc(bytes_per_buffer);
+               if (state->buf == NULL)
+                       return -ENOMEM;
+               memset(state->buf, 0, bytes_per_buffer);
+       }
+
+       return 0;
+}
+
+static int single_muxer_process_frames(struct mapper_context *mapper,
+                                      void *frame_buf,
+                                      unsigned int *frame_count,
+                                      struct container_context *cntrs,
+                                      unsigned int cntr_count ATTRIBUTE_UNUSED)
+{
+       struct single_state *state = mapper->private_data;
+       void *src;
+       int err;
+
+       // If need to align PCM frames, process PCM frames to the intermediate
+       // buffer once.
+       if (!state->align_frames) {
+               // The most likely.
+               src = frame_buf;
+       } else {
+               src = state->buf;
+       }
+       err = container_context_process_frames(cntrs, src, frame_count);
+       if (err < 0)
+               return err;
+
+       // Unlikely.
+       if (src != frame_buf && *frame_count > 0)
+               state->align_frames(frame_buf, *frame_count, src,
+                                   mapper->bytes_per_sample,
+                                   mapper->samples_per_frame);
+
+       return 0;
+}
+
+static int single_demuxer_process_frames(struct mapper_context *mapper,
+                                        void *frame_buf,
+                                        unsigned int *frame_count,
+                                        struct container_context *cntrs,
+                                        unsigned int cntr_count ATTRIBUTE_UNUSED)
+{
+       struct single_state *state = mapper->private_data;
+       void *dst;
+
+       // If need to align PCM frames, process PCM frames to the intermediate
+       // buffer once.
+       if (!state->align_frames) {
+               // The most likely.
+               dst = frame_buf;
+       } else {
+               state->align_frames(frame_buf, *frame_count, state->buf,
+                                   mapper->bytes_per_sample,
+                                   mapper->samples_per_frame);
+               dst = state->buf;
+       }
+
+       return container_context_process_frames(cntrs, dst, frame_count);
+}
+
+static void single_post_process(struct mapper_context *mapper)
+{
+       struct single_state *state = mapper->private_data;
+
+       if (state->buf)
+               free(state->buf);
+
+       state->buf = NULL;
+       state->align_frames = NULL;
+}
+
+const struct mapper_data mapper_muxer_single = {
+       .ops = {
+               .pre_process = single_pre_process,
+               .process_frames = single_muxer_process_frames,
+               .post_process = single_post_process,
+       },
+       .private_size = sizeof(struct single_state),
+};
+
+const struct mapper_data mapper_demuxer_single = {
+       .ops = {
+               .pre_process = single_pre_process,
+               .process_frames = single_demuxer_process_frames,
+               .post_process = single_post_process,
+       },
+       .private_size = sizeof(struct single_state),
+};
diff --git a/axfer/mapper.c b/axfer/mapper.c
new file mode 100644 (file)
index 0000000..4c3f0e3
--- /dev/null
@@ -0,0 +1,150 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// mapper.c - an interface of muxer/demuxer between buffer with data frames and
+//           formatted files.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "mapper.h"
+#include "misc.h"
+
+#include <stdio.h>
+
+static const char *const mapper_type_labels[] = {
+       [MAPPER_TYPE_MUXER] = "muxer",
+       [MAPPER_TYPE_DEMUXER] = "demuxer",
+};
+
+static const char *const mapper_target_labels[] = {
+       [MAPPER_TARGET_SINGLE] = "single",
+       [MAPPER_TARGET_MULTIPLE] = "multiple",
+};
+
+int mapper_context_init(struct mapper_context *mapper,
+                       enum mapper_type type, unsigned int cntr_count,
+                       unsigned int verbose)
+{
+       const struct mapper_data *data = NULL;
+
+       assert(mapper);
+       assert(cntr_count > 0);
+
+       // Detect forgotten to destruct.
+       assert(mapper->private_data == NULL);
+
+       memset(mapper, 0, sizeof(*mapper));
+
+       if (type == MAPPER_TYPE_MUXER) {
+               if (cntr_count == 1) {
+                       data = &mapper_muxer_single;
+                       mapper->target = MAPPER_TARGET_SINGLE;
+               } else {
+                       data = &mapper_muxer_multiple;
+                       mapper->target = MAPPER_TARGET_MULTIPLE;
+               }
+       } else {
+               if (cntr_count == 1) {
+                       data = &mapper_demuxer_single;
+                       mapper->target = MAPPER_TARGET_SINGLE;
+               } else {
+                       data = &mapper_demuxer_multiple;
+                       mapper->target = MAPPER_TARGET_MULTIPLE;
+               }
+       }
+
+       mapper->ops = &data->ops;
+       mapper->type = type;
+
+       mapper->private_data = malloc(data->private_size);
+       if (mapper->private_data == NULL)
+               return -ENOMEM;
+       memset(mapper->private_data, 0, data->private_size);
+
+       mapper->cntr_count = cntr_count;
+       mapper->verbose = verbose;
+
+       return 0;
+}
+
+int mapper_context_pre_process(struct mapper_context *mapper,
+                              snd_pcm_access_t access,
+                              unsigned int bytes_per_sample,
+                              unsigned int samples_per_frame,
+                              unsigned int frames_per_buffer,
+                              struct container_context *cntrs)
+{
+       int err;
+
+       assert(mapper);
+       assert(access >= SND_PCM_ACCESS_MMAP_INTERLEAVED);
+       assert(access <= SND_PCM_ACCESS_RW_NONINTERLEAVED);
+       assert(bytes_per_sample > 0);
+       assert(samples_per_frame > 0);
+       assert(cntrs);
+
+       // The purpose of multiple target is to mux/demux each channels to/from
+       // containers.
+       if (mapper->target == MAPPER_TARGET_MULTIPLE &&
+           samples_per_frame != mapper->cntr_count)
+               return -EINVAL;
+
+       mapper->access = access;
+       mapper->bytes_per_sample = bytes_per_sample;
+       mapper->samples_per_frame = samples_per_frame;
+       mapper->frames_per_buffer = frames_per_buffer;
+
+       err = mapper->ops->pre_process(mapper, cntrs, mapper->cntr_count);
+       if (err < 0)
+               return err;
+
+       if (mapper->verbose > 0) {
+               fprintf(stderr, "Mapper: %s\n",
+                      mapper_type_labels[mapper->type]);
+               fprintf(stderr, "  target: %s\n",
+                      mapper_target_labels[mapper->target]);
+               fprintf(stderr, "  access: %s\n",
+                      snd_pcm_access_name(mapper->access));
+               fprintf(stderr, "  bytes/sample: %u\n",
+                       mapper->bytes_per_sample);
+               fprintf(stderr, "  samples/frame: %u\n",
+                       mapper->samples_per_frame);
+               fprintf(stderr, "  frames/buffer: %lu\n",
+                       mapper->frames_per_buffer);
+       }
+
+       return 0;
+}
+
+int mapper_context_process_frames(struct mapper_context *mapper,
+                                 void *frame_buffer,
+                                 unsigned int *frame_count,
+                                 struct container_context *cntrs)
+{
+       assert(mapper);
+       assert(frame_buffer);
+       assert(frame_count);
+       assert(*frame_count <= mapper->frames_per_buffer);
+       assert(cntrs);
+
+       return mapper->ops->process_frames(mapper, frame_buffer, frame_count,
+                                           cntrs, mapper->cntr_count);
+}
+
+void mapper_context_post_process(struct mapper_context *mapper)
+{
+       assert(mapper);
+
+       if (mapper->ops && mapper->ops->post_process)
+               mapper->ops->post_process(mapper);
+}
+
+void mapper_context_destroy(struct mapper_context *mapper)
+{
+       assert(mapper);
+
+       if (mapper->private_data)
+               free(mapper->private_data);
+       mapper->private_data = NULL;
+}
diff --git a/axfer/mapper.h b/axfer/mapper.h
new file mode 100644 (file)
index 0000000..58b6118
--- /dev/null
@@ -0,0 +1,87 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// mapper.h - an interface of muxer/demuxer between buffer with data frames and
+//           formatted files.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#ifndef __ALSA_UTILS_AXFER_MAPPER__H_
+#define __ALSA_UTILS_AXFER_MAPPER__H_
+
+#include "container.h"
+
+enum mapper_type {
+       MAPPER_TYPE_MUXER = 0,
+       MAPPER_TYPE_DEMUXER,
+       MAPPER_TYPE_COUNT,
+};
+
+enum mapper_target {
+       MAPPER_TARGET_SINGLE = 0,
+       MAPPER_TARGET_MULTIPLE,
+       MAPPER_TARGET_COUNT,
+};
+
+struct mapper_ops;
+
+struct mapper_context {
+       enum mapper_type type;
+       enum mapper_target target;
+       const struct mapper_ops *ops;
+       unsigned int private_size;
+
+       void *private_data;
+       unsigned int cntr_count;
+
+       // A part of parameters of PCM substream.
+       snd_pcm_access_t access;
+       unsigned int bytes_per_sample;
+       unsigned int samples_per_frame;
+       snd_pcm_uframes_t frames_per_buffer;
+
+       unsigned int verbose;
+};
+
+int mapper_context_init(struct mapper_context *mapper,
+                       enum mapper_type type, unsigned int cntr_count,
+                       unsigned int verbose);
+int mapper_context_pre_process(struct mapper_context *mapper,
+                              snd_pcm_access_t access,
+                              unsigned int bytes_per_sample,
+                              unsigned int samples_per_frame,
+                              unsigned int frames_per_buffer,
+                              struct container_context *cntrs);
+int mapper_context_process_frames(struct mapper_context *mapper,
+                                 void *frame_buffer,
+                                 unsigned int *frame_count,
+                                 struct container_context *cntrs);
+void mapper_context_post_process(struct mapper_context *mapper);
+void mapper_context_destroy(struct mapper_context *mapper);
+
+// For internal use in 'mapper' module.
+
+struct mapper_ops {
+       int (*pre_process)(struct mapper_context *mapper,
+                          struct container_context *cntrs,
+                          unsigned int cntr_count);
+       int (*process_frames)(struct mapper_context *mapper,
+                             void *frame_buffer, unsigned int *frame_count,
+                             struct container_context *cntrs,
+                             unsigned int cntr_count);
+       void (*post_process)(struct mapper_context *mapper);
+};
+
+struct mapper_data {
+       struct mapper_ops ops;
+       unsigned int private_size;
+};
+
+extern const struct mapper_data mapper_muxer_single;
+extern const struct mapper_data mapper_demuxer_single;
+
+extern const struct mapper_data mapper_muxer_multiple;
+extern const struct mapper_data mapper_demuxer_multiple;
+
+#endif
diff --git a/axfer/misc.h b/axfer/misc.h
new file mode 100644 (file)
index 0000000..5f27d28
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// misc.h - a header file for miscellaneous tools.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#ifndef __ALSA_UTILS_AXFER_MISC__H_
+#define __ALSA_UTILS_AXFER_MISC__H_
+
+#include <gettext.h>
+
+#define ARRAY_SIZE(array)      (sizeof(array)/sizeof(array[0]))
+
+char *arg_duplicate_string(const char *str, int *err);
+long arg_parse_decimal_num(const char *str, int *err);
+
+#endif
diff --git a/axfer/subcmd-list.c b/axfer/subcmd-list.c
new file mode 100644 (file)
index 0000000..187e1d7
--- /dev/null
@@ -0,0 +1,272 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// subcmd-list.c - operations for list sub command.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "subcmd.h"
+#include "misc.h"
+
+#include <getopt.h>
+#include <stdbool.h>
+
+enum list_op {
+       LIST_OP_DEVICE = 0,
+       LIST_OP_PCM,
+       LIST_OP_HELP,
+};
+
+static int dump_device(snd_ctl_t *handle, const char *id, const char *name,
+                      snd_pcm_stream_t stream ATTRIBUTE_UNUSED, snd_pcm_info_t *info)
+{
+       unsigned int i, count;
+       int err;
+
+       printf("card %i: %s [%s], device %i: %s [%s]\n",
+              snd_pcm_info_get_card(info), id, name,
+              snd_pcm_info_get_device(info), snd_pcm_info_get_id(info),
+              snd_pcm_info_get_name(info));
+
+       count = snd_pcm_info_get_subdevices_count(info);
+       printf("  Subdevices: %i/%u\n",
+              snd_pcm_info_get_subdevices_avail(info), count);
+
+       for (i = 0; i < count; ++i) {
+               snd_pcm_info_set_subdevice(info, i);
+
+               err = snd_ctl_pcm_info(handle, info);
+               if (err < 0) {
+                       printf("control digital audio playback info (%i): %s",
+                              snd_pcm_info_get_card(info), snd_strerror(err));
+                       continue;
+               }
+
+               printf("  Subdevice #%u: %s\n",
+                      i, snd_pcm_info_get_subdevice_name(info));
+       }
+
+       return 0;
+}
+
+static int dump_devices(snd_ctl_t *handle, const char *id, const char *name,
+                       snd_pcm_stream_t direction)
+{
+       snd_pcm_info_t *info;
+       int device = -1;
+       int err;
+
+       err = snd_pcm_info_malloc(&info);
+       if (err < 0)
+               return err;
+
+       while (1) {
+               err = snd_ctl_pcm_next_device(handle, &device);
+               if (err < 0)
+                       break;
+               if (device < 0)
+                       break;
+
+               snd_pcm_info_set_device(info, device);
+               snd_pcm_info_set_subdevice(info, 0);
+               snd_pcm_info_set_stream(info, direction);
+               err = snd_ctl_pcm_info(handle, info);
+               if (err < 0)
+                       continue;
+
+               err = dump_device(handle, id, name, direction, info);
+               if (err < 0)
+                       break;
+       }
+
+       free(info);
+       return err;
+}
+
+static int list_devices(snd_pcm_stream_t direction)
+{
+       int card = -1;
+       char name[32];
+       snd_ctl_t *handle;
+       snd_ctl_card_info_t *info;
+       int err;
+
+       err = snd_ctl_card_info_malloc(&info);
+       if (err < 0)
+               return err;
+
+       // Not found.
+       if (snd_card_next(&card) < 0 || card < 0)
+               goto end;
+
+       printf("**** List of %s Hardware Devices ****\n",
+              snd_pcm_stream_name(direction));
+
+       while (card >= 0) {
+               sprintf(name, "hw:%d", card);
+               err = snd_ctl_open(&handle, name, 0);
+               if (err < 0) {
+                       printf("control open (%i): %s",
+                              card, snd_strerror(err));
+               } else {
+                       err = snd_ctl_card_info(handle, info);
+                       if (err < 0) {
+                               printf("control hardware info (%i): %s",
+                                      card, snd_strerror(err));
+                       } else {
+                               err = dump_devices(handle,
+                                       snd_ctl_card_info_get_id(info),
+                                       snd_ctl_card_info_get_name(info),
+                                       direction);
+                       }
+                       snd_ctl_close(handle);
+               }
+
+               if (err < 0)
+                       break;
+
+               // Go to next.
+               if (snd_card_next(&card) < 0) {
+                       printf("snd_card_next");
+                       break;
+               }
+       }
+end:
+       free(info);
+       return err;
+}
+
+static int list_pcms(snd_pcm_stream_t direction)
+{
+       static const char *const filters[] = {
+               [SND_PCM_STREAM_CAPTURE]        = "Input",
+               [SND_PCM_STREAM_PLAYBACK]       = "Output",
+       };
+       const char *filter;
+       void **hints;
+       void **n;
+       char *io;
+       char *name;
+       char *desc;
+
+       if (snd_device_name_hint(-1, "pcm", &hints) < 0)
+               return -EINVAL;
+
+       filter = filters[direction];
+
+       for (n = hints; *n != NULL; ++n) {
+               io = snd_device_name_get_hint(*n, "IOID");
+               if (io != NULL && strcmp(io, filter) != 0) {
+                       free(io);
+                       continue;
+               }
+
+               name = snd_device_name_get_hint(*n, "NAME");
+               desc = snd_device_name_get_hint(*n, "DESC");
+
+               printf("%s\n", name);
+               if (desc == NULL) {
+                       free(name);
+                       free(desc);
+                       continue;
+               }
+
+
+               printf("    ");
+               while (*desc) {
+                       if (*desc == '\n')
+                               printf("\n    ");
+                       else
+                               putchar(*desc);
+                       desc++;
+               }
+               putchar('\n');
+       }
+
+       snd_device_name_free_hint(hints);
+
+       return 0;
+}
+
+static void print_help(void)
+{
+       printf(
+"Usage:\n"
+"  axfer list DIRECTION TARGET\n"
+"\n"
+"  where:\n"
+"    DIRECTION = capture | playback\n"
+"    TARGET = device | pcm\n"
+       );
+}
+
+// Backward compatibility to aplay(1).
+static bool decide_operation(int argc, char *const *argv, enum list_op *op)
+{
+       static const char *s_opts = "hlL";
+       static const struct option l_opts[] = {
+               {"list-devices",        0, NULL, 'l'},
+               {"list-pcms",           0, NULL, 'L'},
+               {NULL,                  0, NULL, 0}
+       };
+
+       optind = 0;
+       opterr = 0;
+       while (1) {
+               int c = getopt_long(argc, argv, s_opts, l_opts, NULL);
+               if (c < 0)
+                       break;
+               if (c == 'l') {
+                       *op = LIST_OP_DEVICE;
+                       return true;
+               }
+               if (c == 'L') {
+                       *op = LIST_OP_PCM;
+                       return true;
+               }
+       }
+
+       return false;
+}
+
+static int detect_operation(int argc, char *const *argv, enum list_op *op)
+{
+       static const char *const ops[] = {
+               [LIST_OP_DEVICE] = "device",
+               [LIST_OP_PCM] = "pcm",
+       };
+       int i;
+
+       if (argc < 2)
+               return false;
+
+       for (i = 0; i < (int)ARRAY_SIZE(ops); ++i) {
+               if (!strcmp(argv[1], ops[i])) {
+                       *op = i;
+                       return true;
+               }
+       }
+
+       return false;
+}
+
+int subcmd_list(int argc, char *const *argv, snd_pcm_stream_t direction)
+{
+       enum list_op op = LIST_OP_HELP;
+       int err = 0;
+
+       // Renewed command system.
+       if (!detect_operation(argc, argv, &op) &&
+           !decide_operation(argc, argv, &op))
+                       err = -EINVAL;
+
+       if (op == LIST_OP_DEVICE)
+               err = list_devices(direction);
+       else if (op == LIST_OP_PCM)
+               err = list_pcms(direction);
+       else
+               print_help();
+
+       return err;
+}
diff --git a/axfer/subcmd-transfer.c b/axfer/subcmd-transfer.c
new file mode 100644 (file)
index 0000000..8d63043
--- /dev/null
@@ -0,0 +1,502 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// subcmd-transfer.c - operations for transfer sub command.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "xfer.h"
+#include "subcmd.h"
+#include "misc.h"
+
+#include <signal.h>
+#include <inttypes.h>
+
+struct context {
+       struct xfer_context xfer;
+       struct mapper_context mapper;
+       struct container_context *cntrs;
+       unsigned int cntr_count;
+
+       int *cntr_fds;
+
+       // NOTE: To handling Unix signal.
+       bool interrupted;
+       int signal;
+};
+
+// NOTE: To handling Unix signal.
+static struct context *ctx_ptr;
+
+static void handle_unix_signal_for_finish(int sig)
+{
+       unsigned int i;
+
+       for (i = 0; i < ctx_ptr->cntr_count; ++i)
+               ctx_ptr->cntrs[i].interrupted = true;
+
+       ctx_ptr->signal = sig;
+       ctx_ptr->interrupted = true;
+}
+
+static void handle_unix_signal_for_suspend(int sig ATTRIBUTE_UNUSED)
+{
+       sigset_t curr, prev;
+       struct sigaction sa = {0};
+
+       // 1. suspend substream.
+       xfer_context_pause(&ctx_ptr->xfer, true);
+
+       // 2. Prepare for default handler(SIG_DFL) of SIGTSTP to stop this
+       // process.
+       if (sigaction(SIGTSTP, NULL, &sa) < 0) {
+               fprintf(stderr, "sigaction(2)\n");
+               exit(EXIT_FAILURE);
+       }
+       if (sa.sa_handler == SIG_ERR)
+               exit(EXIT_FAILURE);
+       if (sa.sa_handler == handle_unix_signal_for_suspend)
+               sa.sa_handler = SIG_DFL;
+       if (sigaction(SIGTSTP, &sa, NULL) < 0) {
+               fprintf(stderr, "sigaction(2)\n");
+               exit(EXIT_FAILURE);
+       }
+
+       // Queue SIGTSTP.
+       raise(SIGTSTP);
+
+       // Release the queued signal from being blocked. This causes an
+       // additional interrupt for the default handler.
+       sigemptyset(&curr);
+       sigaddset(&curr, SIGTSTP);
+       if (sigprocmask(SIG_UNBLOCK, &curr, &prev) < 0) {
+               fprintf(stderr, "sigprocmask(2)\n");
+               exit(EXIT_FAILURE);
+       }
+
+       // 3. SIGCONT is cought and rescheduled. Recover blocking status of
+       // UNIX signals.
+       if (sigprocmask(SIG_SETMASK, &prev, NULL) < 0) {
+               fprintf(stderr, "sigprocmask(2)\n");
+               exit(EXIT_FAILURE);
+       }
+
+       // Reconfigure this handler for SIGTSTP, instead of default one.
+       sigemptyset(&sa.sa_mask);
+       sa.sa_flags = SA_RESTART;
+       sa.sa_handler = handle_unix_signal_for_suspend;
+       if (sigaction(SIGTSTP, &sa, NULL) < 0) {
+               fprintf(stderr, "sigaction(2)\n");
+               exit(EXIT_FAILURE);
+       }
+
+       // 4. Continue the PCM substream.
+       xfer_context_pause(&ctx_ptr->xfer, false);
+}
+
+static int prepare_signal_handler(struct context *ctx)
+{
+       struct sigaction sa = {0};
+
+       sigemptyset(&sa.sa_mask);
+       sa.sa_flags = 0;
+       sa.sa_handler = handle_unix_signal_for_finish;
+
+       if (sigaction(SIGINT, &sa, NULL) < 0)
+               return -errno;
+       if (sigaction(SIGTERM, &sa, NULL) < 0)
+               return -errno;
+
+       sigemptyset(&sa.sa_mask);
+       sa.sa_flags = 0;
+       sa.sa_handler = handle_unix_signal_for_suspend;
+       if (sigaction(SIGTSTP, &sa, NULL) < 0)
+               return -errno;
+
+       ctx_ptr = ctx;
+
+       return 0;
+}
+
+static int context_init(struct context *ctx, snd_pcm_stream_t direction,
+                       int argc, char *const *argv)
+{
+       const char *xfer_type_literal;
+       enum xfer_type xfer_type;
+       int i;
+
+       // Decide transfer backend before option parser runs.
+       xfer_type_literal = NULL;
+       for (i = 0; i < argc; ++i) {
+               if (strstr(argv[i], "--xfer-type") != argv[i])
+                       continue;
+               xfer_type_literal = argv[i] + 12;
+       }
+       if (xfer_type_literal == NULL) {
+               xfer_type = XFER_TYPE_LIBASOUND;
+       } else {
+               xfer_type = xfer_type_from_label(xfer_type_literal);
+               if (xfer_type == XFER_TYPE_UNSUPPORTED) {
+                       fprintf(stderr, "The '%s' xfer type is not supported\n",
+                               xfer_type_literal);
+                       return -EINVAL;
+               }
+       }
+
+       // Initialize transfer.
+       return xfer_context_init(&ctx->xfer, xfer_type, direction, argc, argv);
+}
+
+static int allocate_containers(struct context *ctx, unsigned int count)
+{
+       ctx->cntrs = calloc(count, sizeof(*ctx->cntrs));
+       if (ctx->cntrs == NULL)
+               return -ENOMEM;
+       ctx->cntr_count = count;
+
+       ctx->cntr_fds = calloc(count, sizeof(*ctx->cntr_fds));
+       if (ctx->cntr_fds == NULL)
+               return -ENOMEM;
+
+       return 0;
+}
+
+static int capture_pre_process(struct context *ctx, snd_pcm_access_t *access,
+                              snd_pcm_uframes_t *frames_per_buffer,
+                              uint64_t *total_frame_count)
+{
+       snd_pcm_format_t sample_format = SND_PCM_FORMAT_UNKNOWN;
+       unsigned int samples_per_frame = 0;
+       unsigned int frames_per_second = 0;
+       unsigned int channels;
+       unsigned int i;
+       int err;
+
+       err = xfer_context_pre_process(&ctx->xfer, &sample_format,
+                                      &samples_per_frame, &frames_per_second,
+                                      access, frames_per_buffer);
+       if (err < 0)
+               return err;
+
+       // Prepare for containers.
+       err = allocate_containers(ctx, ctx->xfer.path_count);
+       if (err < 0)
+               return err;
+
+       if (ctx->cntr_count > 1)
+               channels = 1;
+       else
+               channels = samples_per_frame;
+
+       *total_frame_count = 0;
+       for (i = 0; i < ctx->cntr_count; ++i) {
+               const char *path = ctx->xfer.paths[i];
+               int fd;
+               uint64_t frame_count;
+
+               if (!strcmp(path, "-")) {
+                       fd = fileno(stdout);
+               } else {
+                       fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
+                       if (fd < 0)
+                               return -errno;
+               }
+               ctx->cntr_fds[i] = fd;
+
+               err = container_builder_init(ctx->cntrs + i, ctx->cntr_fds[i],
+                                            ctx->xfer.cntr_format,
+                                            ctx->xfer.verbose > 1);
+               if (err < 0)
+                       return err;
+
+               err = container_context_pre_process(ctx->cntrs + i,
+                                                   &sample_format, &channels,
+                                                   &frames_per_second,
+                                                   &frame_count);
+               if (err < 0)
+                       return err;
+
+               if (*total_frame_count == 0)
+                       *total_frame_count = frame_count;
+               if (frame_count < *total_frame_count)
+                       *total_frame_count = frame_count;
+       }
+
+       return 0;
+}
+
+static int playback_pre_process(struct context *ctx, snd_pcm_access_t *access,
+                               snd_pcm_uframes_t *frames_per_buffer,
+                               uint64_t *total_frame_count)
+{
+       snd_pcm_format_t sample_format = SND_PCM_FORMAT_UNKNOWN;
+       unsigned int samples_per_frame = 0;
+       unsigned int frames_per_second = 0;
+       unsigned int i;
+       int err;
+
+       // Prepare for containers.
+       err = allocate_containers(ctx, ctx->xfer.path_count);
+       if (err < 0)
+               return err;
+
+       for (i = 0; i < ctx->cntr_count; ++i) {
+               const char *path = ctx->xfer.paths[i];
+               int fd;
+               snd_pcm_format_t format;
+               unsigned int channels;
+               unsigned int rate;
+               uint64_t frame_count;
+
+               if (!strcmp(path, "-")) {
+                       fd = fileno(stdin);
+               } else {
+                       fd = open(path, O_RDONLY);
+                       if (fd < 0)
+                               return -errno;
+               }
+               ctx->cntr_fds[i] = fd;
+
+               err = container_parser_init(ctx->cntrs + i, ctx->cntr_fds[i],
+                                           ctx->xfer.verbose > 1);
+               if (err < 0)
+                       return err;
+
+               if (i == 0) {
+                       // For a raw container.
+                       format = ctx->xfer.sample_format;
+                       channels = ctx->xfer.samples_per_frame;
+                       rate = ctx->xfer.frames_per_second;
+               } else {
+                       format = sample_format;
+                       channels = samples_per_frame;
+                       rate = frames_per_second;
+               }
+
+               err = container_context_pre_process(ctx->cntrs + i, &format,
+                                                   &channels, &rate,
+                                                   &frame_count);
+               if (err < 0)
+                       return err;
+
+               if (format == SND_PCM_FORMAT_UNKNOWN || channels == 0 ||
+                   rate == 0) {
+                       fprintf(stderr,
+                               "Sample format, channels and rate should be "
+                               "indicated for given files.\n");
+                       return -EINVAL;
+               }
+
+               if (i == 0) {
+                       sample_format = format;
+                       samples_per_frame = channels;
+                       frames_per_second = rate;
+                       *total_frame_count = frame_count;
+               } else {
+                       if (format != sample_format) {
+                               fprintf(stderr,
+                                       "When using several files, they "
+                                       "should include the same sample "
+                                       "format.\n");
+                               return -EINVAL;
+                       }
+
+                       // No need to check channels to handle multiple
+                       // containers.
+                       if (rate != frames_per_second) {
+                               fprintf(stderr,
+                                       "When using several files, they "
+                                       "should include samples at the same "
+                                       "sampling rate.\n");
+                               return -EINVAL;
+                       }
+                       if (frame_count < *total_frame_count)
+                               *total_frame_count = frame_count;
+               }
+       }
+
+       if (ctx->cntr_count > 1)
+               samples_per_frame = ctx->cntr_count;
+
+       // Configure hardware with these parameters.
+       return xfer_context_pre_process(&ctx->xfer, &sample_format,
+                                       &samples_per_frame, &frames_per_second,
+                                       access, frames_per_buffer);
+}
+
+static int context_pre_process(struct context *ctx, snd_pcm_stream_t direction,
+                              uint64_t *total_frame_count)
+{
+       snd_pcm_access_t access;
+       snd_pcm_uframes_t frames_per_buffer = 0;
+       unsigned int bytes_per_sample = 0;
+       enum mapper_type mapper_type;
+       int err;
+
+       if (direction == SND_PCM_STREAM_CAPTURE) {
+               mapper_type = MAPPER_TYPE_DEMUXER;
+               err = capture_pre_process(ctx, &access, &frames_per_buffer,
+                                         total_frame_count);
+       } else {
+               mapper_type = MAPPER_TYPE_MUXER;
+               err = playback_pre_process(ctx, &access, &frames_per_buffer,
+                                          total_frame_count);
+       }
+       if (err < 0)
+               return err;
+
+       // Prepare for mapper.
+       err = mapper_context_init(&ctx->mapper, mapper_type, ctx->cntr_count,
+                                 ctx->xfer.verbose > 1);
+       if (err < 0)
+               return err;
+
+       bytes_per_sample =
+               snd_pcm_format_physical_width(ctx->xfer.sample_format) / 8;
+       if (bytes_per_sample <= 0)
+               return -ENXIO;
+       err = mapper_context_pre_process(&ctx->mapper, access, bytes_per_sample,
+                                        ctx->xfer.samples_per_frame,
+                                        frames_per_buffer, ctx->cntrs);
+       if (err < 0)
+               return err;
+
+       xfer_options_calculate_duration(&ctx->xfer, total_frame_count);
+
+       return 0;
+}
+
+static int context_process_frames(struct context *ctx,
+                                 snd_pcm_stream_t direction,
+                                 uint64_t expected_frame_count,
+                                 uint64_t *actual_frame_count)
+{
+       bool verbose = ctx->xfer.verbose > 2;
+       unsigned int frame_count;
+       unsigned int i;
+       int err = 0;
+
+       if (!ctx->xfer.quiet) {
+               fprintf(stderr,
+                       "%s: Format '%s', Rate %u Hz, Channels ",
+                       snd_pcm_stream_name(direction),
+                       snd_pcm_format_description(ctx->xfer.sample_format),
+                       ctx->xfer.frames_per_second);
+               if (ctx->xfer.samples_per_frame == 1)
+                       fprintf(stderr, "'monaural'");
+               else if (ctx->xfer.samples_per_frame == 2)
+                       fprintf(stderr, "'Stereo'");
+               else
+                       fprintf(stderr, "%u", ctx->xfer.samples_per_frame);
+               fprintf(stderr, "\n");
+       }
+
+       *actual_frame_count = 0;
+       while (!ctx->interrupted) {
+               struct container_context *cntr;
+
+               // Tell remains to expected frame count.
+               frame_count = expected_frame_count - *actual_frame_count;
+               err = xfer_context_process_frames(&ctx->xfer, &ctx->mapper,
+                                                 ctx->cntrs, &frame_count);
+               if (err < 0) {
+                       if (err == -EAGAIN || err == -EINTR)
+                               continue;
+                       break;
+               }
+               if (verbose) {
+                       fprintf(stderr,
+                               "  handled: %u\n", frame_count);
+               }
+               for (i = 0; i < ctx->cntr_count; ++i) {
+                       cntr = &ctx->cntrs[i];
+                       if (cntr->eof)
+                               break;
+               }
+               if (i < ctx->cntr_count)
+                       break;
+
+               *actual_frame_count += frame_count;
+               if (*actual_frame_count >= expected_frame_count)
+                       break;
+       }
+
+       if (!ctx->xfer.quiet) {
+               fprintf(stderr,
+                       "%s: Expected %" PRIu64 "frames, "
+                       "Actual %" PRIu64 "frames\n",
+                       snd_pcm_stream_name(direction), expected_frame_count,
+                       *actual_frame_count);
+               if (ctx->interrupted) {
+                       fprintf(stderr, "Aborted by signal: %s\n",
+                              strsignal(ctx->signal));
+                       return 0;
+               }
+       }
+
+       return err;
+}
+
+static void context_post_process(struct context *ctx,
+                                uint64_t accumulated_frame_count ATTRIBUTE_UNUSED)
+{
+       uint64_t total_frame_count;
+       unsigned int i;
+
+       xfer_context_post_process(&ctx->xfer);
+
+       if (ctx->cntrs) {
+               for (i = 0; i < ctx->cntr_count; ++i) {
+                       container_context_post_process(ctx->cntrs + i,
+                                                      &total_frame_count);
+                       container_context_destroy(ctx->cntrs + i);
+               }
+               free(ctx->cntrs);
+       }
+
+       if (ctx->cntr_fds) {
+               for (i = 0; i < ctx->cntr_count; ++i)
+                       close(ctx->cntr_fds[i]);
+               free(ctx->cntr_fds);
+       }
+
+       mapper_context_post_process(&ctx->mapper);
+       mapper_context_destroy(&ctx->mapper);
+}
+
+static void context_destroy(struct context *ctx)
+{
+       xfer_context_destroy(&ctx->xfer);
+}
+
+int subcmd_transfer(int argc, char *const *argv, snd_pcm_stream_t direction)
+{
+       static struct context ctx = {0};
+       uint64_t expected_frame_count = 0;
+       uint64_t actual_frame_count = 0;
+       int err = 0;
+
+       err = prepare_signal_handler(&ctx);
+       if (err < 0)
+               return err;
+
+       err = context_init(&ctx, direction, argc, argv);
+       if (err < 0)
+               goto end;
+       if (ctx.xfer.help || ctx.xfer.dump_hw_params)
+               goto end;
+
+       err = context_pre_process(&ctx, direction, &expected_frame_count);
+       if (err < 0)
+               goto end;
+
+       err = context_process_frames(&ctx, direction, expected_frame_count,
+                                    &actual_frame_count);
+end:
+       context_post_process(&ctx, actual_frame_count);
+
+       context_destroy(&ctx);
+
+       return err;
+}
diff --git a/axfer/subcmd.h b/axfer/subcmd.h
new file mode 100644 (file)
index 0000000..5ffe1e4
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// subcmd.h - a header for each sub-commands.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#ifndef __ALSA_UTILS_AXFER_SUBCMD__H_
+#define __ALSA_UTILS_AXFER_SUBCMD__H_
+
+#include <alsa/asoundlib.h>
+
+int subcmd_list(int argc, char *const *argv, snd_pcm_stream_t direction);
+
+int subcmd_transfer(int argc, char *const *argv, snd_pcm_stream_t direction);
+
+#endif
diff --git a/axfer/test/Makefile.am b/axfer/test/Makefile.am
new file mode 100644 (file)
index 0000000..6521134
--- /dev/null
@@ -0,0 +1,33 @@
+TESTS = \
+       container-test  \
+       mapper-test
+
+check_PROGRAMS = \
+       container-test \
+       mapper-test
+
+container_test_SOURCES = \
+       ../container.h \
+       ../container.c \
+       ../container-riff-wave.c \
+       ../container-au.c \
+       ../container-voc.c \
+       ../container-raw.c \
+       generator.c \
+       generator.h \
+       container-test.c
+
+mapper_test_SOURCES = \
+       ../container.h \
+       ../container.c \
+       ../container-riff-wave.c \
+       ../container-au.c \
+       ../container-voc.c \
+       ../container-raw.c \
+       ../mapper.h \
+       ../mapper.c \
+       ../mapper-single.c \
+       ../mapper-multiple.c \
+       generator.c \
+       generator.h \
+       mapper-test.c
diff --git a/axfer/test/Makefile.in b/axfer/test/Makefile.in
new file mode 100644 (file)
index 0000000..6272c24
--- /dev/null
@@ -0,0 +1,1134 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+TESTS = container-test$(EXEEXT) mapper-test$(EXEEXT)
+check_PROGRAMS = container-test$(EXEEXT) mapper-test$(EXEEXT)
+subdir = axfer/test
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__dirstamp = $(am__leading_dot)dirstamp
+am_container_test_OBJECTS = ../container.$(OBJEXT) \
+       ../container-riff-wave.$(OBJEXT) ../container-au.$(OBJEXT) \
+       ../container-voc.$(OBJEXT) ../container-raw.$(OBJEXT) \
+       generator.$(OBJEXT) container-test.$(OBJEXT)
+container_test_OBJECTS = $(am_container_test_OBJECTS)
+container_test_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+am_mapper_test_OBJECTS = ../container.$(OBJEXT) \
+       ../container-riff-wave.$(OBJEXT) ../container-au.$(OBJEXT) \
+       ../container-voc.$(OBJEXT) ../container-raw.$(OBJEXT) \
+       ../mapper.$(OBJEXT) ../mapper-single.$(OBJEXT) \
+       ../mapper-multiple.$(OBJEXT) generator.$(OBJEXT) \
+       mapper-test.$(OBJEXT)
+mapper_test_OBJECTS = $(am_mapper_test_OBJECTS)
+mapper_test_LDADD = $(LDADD)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ../$(DEPDIR)/container-au.Po \
+       ../$(DEPDIR)/container-raw.Po \
+       ../$(DEPDIR)/container-riff-wave.Po \
+       ../$(DEPDIR)/container-voc.Po ../$(DEPDIR)/container.Po \
+       ../$(DEPDIR)/mapper-multiple.Po ../$(DEPDIR)/mapper-single.Po \
+       ../$(DEPDIR)/mapper.Po ./$(DEPDIR)/container-test.Po \
+       ./$(DEPDIR)/generator.Po ./$(DEPDIR)/mapper-test.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(container_test_SOURCES) $(mapper_test_SOURCES)
+DIST_SOURCES = $(container_test_SOURCES) $(mapper_test_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[    ]*:recheck:[    ]*
+am__global_test_result_rx = ^[         ]*:global-test-result:[         ]*
+am__copy_in_global_log_rx = ^[         ]*:copy-in-global-log:[         ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+           recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[       ]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);                                     \
+$(am__vpath_adj_setup) $(am__vpath_adj)                        \
+$(am__tty_colors);                                     \
+srcdir=$(srcdir); export srcdir;                       \
+case "$@" in                                           \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;   \
+    *) am__odir=.;;                                    \
+esac;                                                  \
+test "x$$am__odir" = x"." || test -d "$$am__odir"      \
+  || $(MKDIR_P) "$$am__odir" || exit $$?;              \
+if test -f "./$$f"; then dir=./;                       \
+elif test -f "$$f"; then dir=;                         \
+else dir="$(srcdir)/"; fi;                             \
+tst=$$dir$$f; log='$@';                                \
+if test -n '$(DISABLE_HARD_ERRORS)'; then              \
+  am__enable_hard_errors=no;                           \
+else                                                   \
+  am__enable_hard_errors=yes;                          \
+fi;                                                    \
+case " $(XFAIL_TESTS) " in                             \
+  *[\ \        ]$$f[\ \        ]* | *[\ \      ]$$dir$$f[\ \   ]*) \
+    am__expect_failure=yes;;                           \
+  *)                                                   \
+    am__expect_failure=no;;                            \
+esac;                                                  \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+       $(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+       $(top_srcdir)/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+container_test_SOURCES = \
+       ../container.h \
+       ../container.c \
+       ../container-riff-wave.c \
+       ../container-au.c \
+       ../container-voc.c \
+       ../container-raw.c \
+       generator.c \
+       generator.h \
+       container-test.c
+
+mapper_test_SOURCES = \
+       ../container.h \
+       ../container.c \
+       ../container-riff-wave.c \
+       ../container-au.c \
+       ../container-voc.c \
+       ../container-raw.c \
+       ../mapper.h \
+       ../mapper.c \
+       ../mapper-single.c \
+       ../mapper-multiple.c \
+       generator.c \
+       generator.h \
+       mapper-test.c
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign axfer/test/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign axfer/test/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkPROGRAMS:
+       @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+../$(am__dirstamp):
+       @$(MKDIR_P) ..
+       @: > ../$(am__dirstamp)
+../$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) ../$(DEPDIR)
+       @: > ../$(DEPDIR)/$(am__dirstamp)
+../container.$(OBJEXT): ../$(am__dirstamp) \
+       ../$(DEPDIR)/$(am__dirstamp)
+../container-riff-wave.$(OBJEXT): ../$(am__dirstamp) \
+       ../$(DEPDIR)/$(am__dirstamp)
+../container-au.$(OBJEXT): ../$(am__dirstamp) \
+       ../$(DEPDIR)/$(am__dirstamp)
+../container-voc.$(OBJEXT): ../$(am__dirstamp) \
+       ../$(DEPDIR)/$(am__dirstamp)
+../container-raw.$(OBJEXT): ../$(am__dirstamp) \
+       ../$(DEPDIR)/$(am__dirstamp)
+
+container-test$(EXEEXT): $(container_test_OBJECTS) $(container_test_DEPENDENCIES) $(EXTRA_container_test_DEPENDENCIES) 
+       @rm -f container-test$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(container_test_OBJECTS) $(container_test_LDADD) $(LIBS)
+../mapper.$(OBJEXT): ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp)
+../mapper-single.$(OBJEXT): ../$(am__dirstamp) \
+       ../$(DEPDIR)/$(am__dirstamp)
+../mapper-multiple.$(OBJEXT): ../$(am__dirstamp) \
+       ../$(DEPDIR)/$(am__dirstamp)
+
+mapper-test$(EXEEXT): $(mapper_test_OBJECTS) $(mapper_test_DEPENDENCIES) $(EXTRA_mapper_test_DEPENDENCIES) 
+       @rm -f mapper-test$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(mapper_test_OBJECTS) $(mapper_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+       -rm -f ../*.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/container-au.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/container-raw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/container-riff-wave.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/container-voc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/container.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/mapper-multiple.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/mapper-single.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/mapper.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/container-test.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generator.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapper-test.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+       rm -f $< $@
+       $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+       @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+       @$(am__set_TESTS_bases); \
+       am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+       redo_bases=`for i in $$bases; do \
+                     am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+                   done`; \
+       if test -n "$$redo_bases"; then \
+         redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+         redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+         if $(am__make_dryrun); then :; else \
+           rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+         fi; \
+       fi; \
+       if test -n "$$am__remaking_logs"; then \
+         echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+              "recursion detected" >&2; \
+       elif test -n "$$redo_logs"; then \
+         am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+       fi; \
+       if $(am__make_dryrun); then :; else \
+         st=0;  \
+         errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+         for i in $$redo_bases; do \
+           test -f $$i.trs && test -r $$i.trs \
+             || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+           test -f $$i.log && test -r $$i.log \
+             || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+         done; \
+         test $$st -eq 0 || exit 1; \
+       fi
+       @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+       ws='[   ]'; \
+       results=`for b in $$bases; do echo $$b.trs; done`; \
+       test -n "$$results" || results=/dev/null; \
+       all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+       pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+       fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+       skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+       xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+       xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+       error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+       if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+         success=true; \
+       else \
+         success=false; \
+       fi; \
+       br='==================='; br=$$br$$br$$br$$br; \
+       result_count () \
+       { \
+           if test x"$$1" = x"--maybe-color"; then \
+             maybe_colorize=yes; \
+           elif test x"$$1" = x"--no-color"; then \
+             maybe_colorize=no; \
+           else \
+             echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+           fi; \
+           shift; \
+           desc=$$1 count=$$2; \
+           if test $$maybe_colorize = yes && test $$count -gt 0; then \
+             color_start=$$3 color_end=$$std; \
+           else \
+             color_start= color_end=; \
+           fi; \
+           echo "$${color_start}# $$desc $$count$${color_end}"; \
+       }; \
+       create_testsuite_report () \
+       { \
+         result_count $$1 "TOTAL:" $$all   "$$brg"; \
+         result_count $$1 "PASS: " $$pass  "$$grn"; \
+         result_count $$1 "SKIP: " $$skip  "$$blu"; \
+         result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+         result_count $$1 "FAIL: " $$fail  "$$red"; \
+         result_count $$1 "XPASS:" $$xpass "$$red"; \
+         result_count $$1 "ERROR:" $$error "$$mgn"; \
+       }; \
+       {                                                               \
+         echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |       \
+           $(am__rst_title);                                           \
+         create_testsuite_report --no-color;                           \
+         echo;                                                         \
+         echo ".. contents:: :depth: 2";                               \
+         echo;                                                         \
+         for b in $$bases; do echo $$b; done                           \
+           | $(am__create_global_log);                                 \
+       } >$(TEST_SUITE_LOG).tmp || exit 1;                             \
+       mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                     \
+       if $$success; then                                              \
+         col="$$grn";                                                  \
+        else                                                           \
+         col="$$red";                                                  \
+         test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);               \
+       fi;                                                             \
+       echo "$${col}$$br$${std}";                                      \
+       echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";   \
+       echo "$${col}$$br$${std}";                                      \
+       create_testsuite_report --maybe-color;                          \
+       echo "$$col$$br$$std";                                          \
+       if $$success; then :; else                                      \
+         echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";         \
+         if test -n "$(PACKAGE_BUGREPORT)"; then                       \
+           echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+         fi;                                                           \
+         echo "$$col$$br$$std";                                        \
+       fi;                                                             \
+       $$success || exit 1
+
+check-TESTS: $(check_PROGRAMS)
+       @list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+       @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+       @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+       @set +e; $(am__set_TESTS_bases); \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+       log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+       exit $$?;
+recheck: all $(check_PROGRAMS)
+       @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+       @set +e; $(am__set_TESTS_bases); \
+       bases=`for i in $$bases; do echo $$i; done \
+                | $(am__list_recheck_tests)` || exit 1; \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       log_list=`echo $$log_list`; \
+       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+               am__force_recheck=am--force-recheck \
+               TEST_LOGS="$$log_list"; \
+       exit $$?
+container-test.log: container-test$(EXEEXT)
+       @p='container-test$(EXEEXT)'; \
+       b='container-test'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+mapper-test.log: mapper-test$(EXEEXT)
+       @p='mapper-test$(EXEEXT)'; \
+       b='mapper-test'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+       @p='$<'; \
+       $(am__set_b); \
+       $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@      @p='$<'; \
+@am__EXEEXT_TRUE@      $(am__set_b); \
+@am__EXEEXT_TRUE@      $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@      --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@      $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@      "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+       $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+       -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+       -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+       -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+       -rm -f ../$(DEPDIR)/$(am__dirstamp)
+       -rm -f ../$(am__dirstamp)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+       mostlyclean-am
+
+distclean: distclean-am
+               -rm -f ../$(DEPDIR)/container-au.Po
+       -rm -f ../$(DEPDIR)/container-raw.Po
+       -rm -f ../$(DEPDIR)/container-riff-wave.Po
+       -rm -f ../$(DEPDIR)/container-voc.Po
+       -rm -f ../$(DEPDIR)/container.Po
+       -rm -f ../$(DEPDIR)/mapper-multiple.Po
+       -rm -f ../$(DEPDIR)/mapper-single.Po
+       -rm -f ../$(DEPDIR)/mapper.Po
+       -rm -f ./$(DEPDIR)/container-test.Po
+       -rm -f ./$(DEPDIR)/generator.Po
+       -rm -f ./$(DEPDIR)/mapper-test.Po
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+               -rm -f ../$(DEPDIR)/container-au.Po
+       -rm -f ../$(DEPDIR)/container-raw.Po
+       -rm -f ../$(DEPDIR)/container-riff-wave.Po
+       -rm -f ../$(DEPDIR)/container-voc.Po
+       -rm -f ../$(DEPDIR)/container.Po
+       -rm -f ../$(DEPDIR)/mapper-multiple.Po
+       -rm -f ../$(DEPDIR)/mapper-single.Po
+       -rm -f ../$(DEPDIR)/mapper.Po
+       -rm -f ./$(DEPDIR)/container-test.Po
+       -rm -f ./$(DEPDIR)/generator.Po
+       -rm -f ./$(DEPDIR)/mapper-test.Po
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+       check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
+       cscopelist-am ctags ctags-am distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       recheck tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/axfer/test/container-test.c b/axfer/test/container-test.c
new file mode 100644 (file)
index 0000000..45b6c6a
--- /dev/null
@@ -0,0 +1,324 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// container-io.c - a unit test for parser/builder of supported containers.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include <aconfig.h>
+#ifdef HAVE_MEMFD_CREATE
+#define _GNU_SOURCE
+#endif
+
+#include "../container.h"
+#include "../misc.h"
+
+#include "generator.h"
+
+#ifdef HAVE_MEMFD_CREATE
+#include <sys/mman.h>
+#endif
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#include <assert.h>
+
+struct container_trial {
+       enum container_format format;
+
+       struct container_context cntr;
+       bool verbose;
+};
+
+static void test_builder(struct container_context *cntr, int fd,
+                        enum container_format format,
+                        snd_pcm_access_t access,
+                        snd_pcm_format_t sample_format,
+                        unsigned int samples_per_frame,
+                        unsigned int frames_per_second,
+                        void *frame_buffer, unsigned int frame_count,
+                        bool verbose)
+{
+       snd_pcm_format_t sample;
+       unsigned int channels;
+       unsigned int rate;
+       uint64_t max_frame_count;
+       unsigned int handled_frame_count;
+       uint64_t total_frame_count;
+       int err;
+
+       err = container_builder_init(cntr, fd, format, verbose);
+       assert(err == 0);
+
+       sample = sample_format;
+       channels = samples_per_frame;
+       rate = frames_per_second;
+       max_frame_count = 0;
+       err = container_context_pre_process(cntr, &sample, &channels, &rate,
+                                           &max_frame_count);
+       assert(err == 0);
+       assert(sample == sample_format);
+       assert(channels == samples_per_frame);
+       assert(rate == frames_per_second);
+       assert(max_frame_count > 0);
+
+       handled_frame_count = frame_count;
+       err = container_context_process_frames(cntr, frame_buffer,
+                                              &handled_frame_count);
+       assert(err == 0);
+       assert(handled_frame_count > 0);
+       assert(handled_frame_count <= frame_count);
+
+       total_frame_count = 0;
+       err = container_context_post_process(cntr, &total_frame_count);
+       assert(err == 0);
+       assert(total_frame_count == frame_count);
+
+       container_context_destroy(cntr);
+}
+
+static void test_parser(struct container_context *cntr, int fd,
+                       enum container_format format,
+                       snd_pcm_access_t access, snd_pcm_format_t sample_format,
+                       unsigned int samples_per_frame,
+                       unsigned int frames_per_second,
+                       void *frame_buffer, unsigned int frame_count,
+                       bool verbose)
+{
+       snd_pcm_format_t sample;
+       unsigned int channels;
+       unsigned int rate;
+       uint64_t total_frame_count;
+       unsigned int handled_frame_count;
+       int err;
+
+       err = container_parser_init(cntr, fd, verbose);
+       assert(err == 0);
+
+       sample = sample_format;
+       channels = samples_per_frame;
+       rate = frames_per_second;
+       total_frame_count = 0;
+       err = container_context_pre_process(cntr, &sample, &channels, &rate,
+                                           &total_frame_count);
+       assert(err == 0);
+       assert(sample == sample_format);
+       assert(channels == samples_per_frame);
+       assert(rate == frames_per_second);
+       assert(total_frame_count == frame_count);
+
+       handled_frame_count = total_frame_count;
+       err = container_context_process_frames(cntr, frame_buffer,
+                                              &handled_frame_count);
+       assert(err == 0);
+       assert(handled_frame_count == frame_count);
+
+       total_frame_count = 0;
+       err = container_context_post_process(cntr, &total_frame_count);
+       assert(err == 0);
+       assert(total_frame_count == handled_frame_count);
+
+       container_context_destroy(cntr);
+}
+
+static int callback(struct test_generator *gen, snd_pcm_access_t access,
+                   snd_pcm_format_t sample_format,
+                   unsigned int samples_per_frame, void *frame_buffer,
+                   unsigned int frame_count)
+{
+       static const unsigned int entries[] = {
+               [0] = 44100,
+               [1] = 48000,
+               [2] = 88200,
+               [3] = 96000,
+               [4] = 176400,
+               [5] = 192000,
+       };
+       struct container_trial *trial = gen->private_data;
+       unsigned int frames_per_second;
+       const char *const name = "hoge";
+       unsigned int size;
+       void *buf;
+       int i;
+       int err = 0;
+
+       size = frame_count * samples_per_frame *
+                       snd_pcm_format_physical_width(sample_format) / 8;
+       buf = malloc(size);
+       if (buf == NULL)
+               return -ENOMEM;
+
+       for (i = 0; i < ARRAY_SIZE(entries); ++i) {
+               int fd;
+               off_t pos;
+
+               frames_per_second = entries[i];
+
+#ifdef HAVE_MEMFD_CREATE
+               fd = memfd_create(name, 0);
+#else
+               fd = open(name, O_RDWR | O_CREAT | O_TRUNC, 0644);
+#endif
+               if (fd < 0) {
+                       err = -errno;
+                       break;
+               }
+
+               test_builder(&trial->cntr, fd, trial->format, access,
+                            sample_format, samples_per_frame,
+                            frames_per_second, frame_buffer, frame_count,
+                            trial->verbose);
+
+               pos = lseek(fd, 0, SEEK_SET);
+               if (pos < 0) {
+                       err = -errno;
+                       break;
+               }
+
+               test_parser(&trial->cntr, fd, trial->format, access,
+                           sample_format, samples_per_frame, frames_per_second,
+                           buf, frame_count, trial->verbose);
+
+               err = memcmp(buf, frame_buffer, size);
+               assert(err == 0);
+
+               close(fd);
+       }
+
+       free(buf);
+
+       return err;
+}
+
+int main(int argc, const char *argv[])
+{
+       static const uint64_t sample_format_masks[] = {
+               [CONTAINER_FORMAT_RIFF_WAVE] =
+                       (1ull << SND_PCM_FORMAT_U8) |
+                       (1ull << SND_PCM_FORMAT_S16_LE) |
+                       (1ull << SND_PCM_FORMAT_S16_BE) |
+                       (1ull << SND_PCM_FORMAT_S24_LE) |
+                       (1ull << SND_PCM_FORMAT_S24_BE) |
+                       (1ull << SND_PCM_FORMAT_S32_LE) |
+                       (1ull << SND_PCM_FORMAT_S32_BE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT_LE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT_BE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT64_LE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT64_BE) |
+                       (1ull << SND_PCM_FORMAT_MU_LAW) |
+                       (1ull << SND_PCM_FORMAT_A_LAW) |
+                       (1ull << SND_PCM_FORMAT_S24_3LE) |
+                       (1ull << SND_PCM_FORMAT_S24_3BE) |
+                       (1ull << SND_PCM_FORMAT_S20_3LE) |
+                       (1ull << SND_PCM_FORMAT_S20_3BE) |
+                       (1ull << SND_PCM_FORMAT_S18_3LE) |
+                       (1ull << SND_PCM_FORMAT_S18_3BE),
+               [CONTAINER_FORMAT_AU] =
+                       (1ull << SND_PCM_FORMAT_S8) |
+                       (1ull << SND_PCM_FORMAT_S16_BE) |
+                       (1ull << SND_PCM_FORMAT_S32_BE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT_BE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT64_BE) |
+                       (1ull << SND_PCM_FORMAT_MU_LAW) |
+                       (1ull << SND_PCM_FORMAT_A_LAW),
+               [CONTAINER_FORMAT_VOC] =
+                       (1ull << SND_PCM_FORMAT_U8) |
+                       (1ull << SND_PCM_FORMAT_S16_LE) |
+                       (1ull << SND_PCM_FORMAT_MU_LAW) |
+                       (1ull << SND_PCM_FORMAT_A_LAW),
+               [CONTAINER_FORMAT_RAW] =
+                       (1ull << SND_PCM_FORMAT_S8) |
+                       (1ull << SND_PCM_FORMAT_U8) |
+                       (1ull << SND_PCM_FORMAT_S16_LE) |
+                       (1ull << SND_PCM_FORMAT_S16_BE) |
+                       (1ull << SND_PCM_FORMAT_U16_LE) |
+                       (1ull << SND_PCM_FORMAT_U16_BE) |
+                       (1ull << SND_PCM_FORMAT_S24_LE) |
+                       (1ull << SND_PCM_FORMAT_S24_BE) |
+                       (1ull << SND_PCM_FORMAT_U24_LE) |
+                       (1ull << SND_PCM_FORMAT_U24_BE) |
+                       (1ull << SND_PCM_FORMAT_S32_LE) |
+                       (1ull << SND_PCM_FORMAT_S32_BE) |
+                       (1ull << SND_PCM_FORMAT_U32_LE) |
+                       (1ull << SND_PCM_FORMAT_U32_BE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT_LE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT_BE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT64_LE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT64_BE) |
+                       (1ull << SND_PCM_FORMAT_IEC958_SUBFRAME_LE) |
+                       (1ull << SND_PCM_FORMAT_IEC958_SUBFRAME_BE) |
+                       (1ull << SND_PCM_FORMAT_MU_LAW) |
+                       (1ull << SND_PCM_FORMAT_A_LAW) |
+                       (1ull << SND_PCM_FORMAT_S24_3LE) |
+                       (1ull << SND_PCM_FORMAT_S24_3BE) |
+                       (1ull << SND_PCM_FORMAT_U24_3LE) |
+                       (1ull << SND_PCM_FORMAT_U24_3BE) |
+                       (1ull << SND_PCM_FORMAT_S20_3LE) |
+                       (1ull << SND_PCM_FORMAT_S20_3BE) |
+                       (1ull << SND_PCM_FORMAT_U20_3LE) |
+                       (1ull << SND_PCM_FORMAT_U20_3BE) |
+                       (1ull << SND_PCM_FORMAT_S18_3LE) |
+                       (1ull << SND_PCM_FORMAT_S18_3BE) |
+                       (1ull << SND_PCM_FORMAT_U18_3LE) |
+                       (1ull << SND_PCM_FORMAT_U18_3BE) |
+                       (1ull << SND_PCM_FORMAT_DSD_U8) |
+                       (1ull << SND_PCM_FORMAT_DSD_U16_LE) |
+                       (1ull << SND_PCM_FORMAT_DSD_U32_LE) |
+                       (1ull << SND_PCM_FORMAT_DSD_U16_BE) |
+                       (1ull << SND_PCM_FORMAT_DSD_U32_BE),
+       };
+       static const uint64_t access_mask =
+               (1ull << SND_PCM_ACCESS_MMAP_INTERLEAVED) |
+               (1ull << SND_PCM_ACCESS_RW_INTERLEAVED);
+       struct test_generator gen = {0};
+       struct container_trial *trial;
+       int i;
+       int begin;
+       int end;
+       bool verbose;
+       int err;
+
+       if (argc > 1) {
+               char *term;
+               begin = strtol(argv[1], &term, 10);
+               if (errno || *term != '\0')
+                       return EXIT_FAILURE;
+               if (begin < CONTAINER_FORMAT_RIFF_WAVE &&
+                   begin > CONTAINER_FORMAT_RAW)
+                       return -EXIT_FAILURE;
+               end = begin + 1;
+               verbose = true;
+       } else {
+               begin = CONTAINER_FORMAT_RIFF_WAVE;
+               end = CONTAINER_FORMAT_RAW + 1;
+               verbose = false;
+       }
+
+       for (i = begin; i < end; ++i) {
+               err = generator_context_init(&gen, access_mask,
+                                            sample_format_masks[i],
+                                            1, 32, 23, 3000, 512,
+                                            sizeof(struct container_trial));
+               if (err >= 0) {
+                       trial = gen.private_data;
+                       trial->format = i;
+                       trial->verbose = verbose;
+                       err = generator_context_run(&gen, callback);
+               }
+
+               generator_context_destroy(&gen);
+
+               if (err < 0)
+                       break;
+       }
+
+       if (err < 0) {
+               printf("%s\n", strerror(-err));
+               return EXIT_FAILURE;
+       }
+
+       return EXIT_SUCCESS;
+}
diff --git a/axfer/test/generator.c b/axfer/test/generator.c
new file mode 100644 (file)
index 0000000..bde8c5f
--- /dev/null
@@ -0,0 +1,260 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// allocator.h - a header of a generator for test with buffers of PCM frames.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "generator.h"
+
+#include <stdlib.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <unistd.h>
+
+int generator_context_init(struct test_generator *gen,
+                          uint64_t access_mask, uint64_t sample_format_mask,
+                          unsigned int min_samples_per_frame,
+                          unsigned int max_samples_per_frame,
+                          unsigned int min_frame_count,
+                          unsigned int max_frame_count,
+                          unsigned int step_frame_count,
+                          unsigned int private_size)
+{
+       gen->fd = open("/dev/urandom", O_RDONLY);
+       if (gen->fd < 0)
+               return -errno;
+
+       gen->private_data = malloc(private_size);
+       if (gen->private_data == NULL)
+               return -ENOMEM;
+       memset(gen->private_data, 0, private_size);
+
+       gen->access_mask = access_mask;
+       gen->sample_format_mask = sample_format_mask;
+       gen->min_samples_per_frame = min_samples_per_frame;
+       gen->max_samples_per_frame = max_samples_per_frame;
+       gen->min_frame_count = min_frame_count;
+       gen->max_frame_count = max_frame_count;
+       gen->step_frame_count = step_frame_count;
+
+       return 0;
+}
+
+static void *allocate_buf(snd_pcm_access_t access,
+                         snd_pcm_format_t sample_format,
+                         unsigned int samples_per_frame,
+                         unsigned int frame_count)
+{
+       unsigned int bytes_per_sample;
+
+       bytes_per_sample = snd_pcm_format_physical_width(sample_format) / 8;
+
+       return calloc(samples_per_frame * frame_count, bytes_per_sample);
+}
+
+static void *allocate_vector(snd_pcm_access_t access,
+                            snd_pcm_format_t sample_format,
+                            unsigned int samples_per_frame,
+                            unsigned int frame_count)
+{
+       unsigned int bytes_per_sample;
+       char **bufs;
+       int i;
+
+       bytes_per_sample = snd_pcm_format_physical_width(sample_format) / 8;
+
+       bufs = calloc(samples_per_frame, sizeof(char *));
+       if (bufs == NULL)
+               return NULL;
+
+       for (i = 0; i < samples_per_frame; ++i) {
+               bufs[i] = calloc(frame_count, bytes_per_sample);
+               if (bufs[i] == NULL) {
+                       for (; i >= 0; --i)
+                               free(bufs[i]);
+                       free(bufs);
+                       return NULL;
+               }
+       }
+
+       return bufs;
+}
+
+static int fill_buf(int fd, void *frame_buffer, snd_pcm_access_t access,
+                   snd_pcm_format_t sample_format,
+                   unsigned int samples_per_frame, unsigned int frame_count)
+{
+       unsigned int size;
+       int len;
+
+       size = snd_pcm_format_physical_width(sample_format) / 8 *
+                                               samples_per_frame * frame_count;
+       while (size > 0) {
+               len = read(fd, frame_buffer, size);
+               if (len < 0)
+                       return len;
+               size -= len;
+       }
+
+       return 0;
+}
+
+static int fill_vector(int fd, void *frame_buffer, snd_pcm_access_t access,
+                      snd_pcm_format_t sample_format,
+                      unsigned int samples_per_frame, unsigned int frame_count)
+{
+       char **bufs = frame_buffer;
+       unsigned int size;
+       int len;
+       int i;
+
+       for (i = 0; i < samples_per_frame; ++i) {
+               size = frame_count *
+                       snd_pcm_format_physical_width(sample_format) / 8;
+
+               while (size > 0) {
+                       len = read(fd, bufs[i], size);
+                       if (len < 0)
+                               return len;
+                       size -= len;
+               }
+       }
+
+       return 0;
+}
+
+static void deallocate_buf(void *frame_buffer, unsigned int samples_per_frame)
+{
+       free(frame_buffer);
+}
+
+static void deallocate_vector(void *frame_buffer,
+                             unsigned int samples_per_frame)
+{
+       char **bufs = frame_buffer;
+       int i;
+
+       for (i = 0; i < samples_per_frame; ++i)
+               free(bufs[i]);
+
+       free(bufs);
+}
+
+static int test_frame_count(struct test_generator *gen,
+                           snd_pcm_access_t access,
+                           snd_pcm_format_t sample_format,
+                           unsigned int samples_per_frame)
+{
+       void *(*allocator)(snd_pcm_access_t access,
+                          snd_pcm_format_t sample_format,
+                          unsigned int samples_per_frame,
+                          unsigned int frame_count);
+       int (*fill)(int fd, void *frame_buffer, snd_pcm_access_t access,
+                   snd_pcm_format_t sample_format,
+                   unsigned int samples_per_frame, unsigned int frame_count);
+       void (*deallocator)(void *frame_buffer, unsigned int samples_per_frame);
+       void *frame_buffer;
+       int i;
+       int err = 0;
+
+       if (access != SND_PCM_ACCESS_RW_NONINTERLEAVED) {
+               allocator = allocate_buf;
+               fill = fill_buf;
+               deallocator = deallocate_buf;
+       } else {
+               allocator = allocate_vector;
+               fill = fill_vector;
+               deallocator = deallocate_vector;
+       }
+
+       frame_buffer = allocator(access, sample_format, samples_per_frame,
+                                gen->max_frame_count);
+       if (frame_buffer == NULL)
+               return -ENOMEM;
+
+       err = fill(gen->fd, frame_buffer, access, sample_format,
+                  samples_per_frame, gen->max_frame_count);
+       if (err < 0)
+               goto end;
+
+
+       for (i = gen->min_frame_count;
+            i <= gen->max_frame_count; i += gen->step_frame_count) {
+               err = gen->cb(gen, access ,sample_format, samples_per_frame,
+                             frame_buffer, i);
+               if (err < 0)
+                       break;
+       }
+end:
+       deallocator(frame_buffer, samples_per_frame);
+
+       return err;
+}
+
+static int test_samples_per_frame(struct test_generator *gen,
+                                 snd_pcm_access_t access,
+                                 snd_pcm_format_t sample_format)
+{
+       int i;
+       int err = 0;
+
+       for (i = gen->min_samples_per_frame;
+            i <= gen->max_samples_per_frame; ++i) {
+               err = test_frame_count(gen, access, sample_format, i);
+               if (err < 0)
+                       break;
+       }
+
+       return err;
+}
+
+static int test_sample_format(struct test_generator *gen,
+                             snd_pcm_access_t access)
+{
+       int i;
+       int err = 0;
+
+       for (i = 0; i <= SND_PCM_FORMAT_LAST; ++i) {
+               if (!((1ull << i) & gen->sample_format_mask))
+                       continue;
+
+               err = test_samples_per_frame(gen, access, i);
+               if (err < 0)
+                       break;
+       }
+
+       return err;
+}
+
+static int test_access(struct test_generator *gen)
+{
+       int i;
+       int err = 0;
+
+       for (i = 0; i <= SND_PCM_ACCESS_LAST; ++i) {
+               if (!((1ull << i) & gen->access_mask))
+                       continue;
+
+               err = test_sample_format(gen, i);
+               if (err < 0)
+                       break;
+       }
+       return err;
+}
+
+int generator_context_run(struct test_generator *gen, generator_cb_t cb)
+{
+       gen->cb = cb;
+       return test_access(gen);
+}
+
+void generator_context_destroy(struct test_generator *gen)
+{
+       free(gen->private_data);
+       close(gen->fd);
+}
diff --git a/axfer/test/generator.h b/axfer/test/generator.h
new file mode 100644 (file)
index 0000000..c35ed98
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// generator.c - a generator for test with buffers of PCM frames.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#ifndef __ALSA_UTILS_AXFER_TEST_GENERATOR__H_
+#define __ALSA_UTILS_AXFER_TEST_GENERATOR__H_
+
+#include <stdint.h>
+#include <alsa/asoundlib.h>
+
+struct test_generator;
+typedef int (*generator_cb_t)(struct test_generator *gen,
+                             snd_pcm_access_t access,
+                             snd_pcm_format_t sample_format,
+                             unsigned int samples_per_frame,
+                             void *frame_buffer, unsigned int frame_count);
+
+struct test_generator {
+       int fd;
+       uint64_t access_mask;
+       uint64_t sample_format_mask;
+       unsigned int min_samples_per_frame;
+       unsigned int max_samples_per_frame;
+       unsigned int min_frame_count;
+       unsigned int max_frame_count;
+       unsigned int step_frame_count;
+
+       generator_cb_t cb;
+       void *private_data;
+};
+
+int generator_context_init(struct test_generator *gen,
+                          uint64_t access_mask, uint64_t sample_format_mask,
+                          unsigned int min_samples_per_frame,
+                          unsigned int max_samples_per_frame,
+                          unsigned int min_frame_count,
+                          unsigned int max_frame_count,
+                          unsigned int step_frame_count,
+                          unsigned int private_size);
+int generator_context_run(struct test_generator *gen, generator_cb_t cb);
+void generator_context_destroy(struct test_generator *gen);
+
+#endif
diff --git a/axfer/test/mapper-test.c b/axfer/test/mapper-test.c
new file mode 100644 (file)
index 0000000..6a389e9
--- /dev/null
@@ -0,0 +1,528 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// mapper-io.c - a unit test for muxer/demuxer for PCM frames on buffer.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include <aconfig.h>
+#ifdef HAVE_MEMFD_CREATE
+#define _GNU_SOURCE
+#endif
+
+#include "../mapper.h"
+#include "../misc.h"
+
+#include "generator.h"
+
+#ifdef HAVE_MEMFD_CREATE
+#include <sys/mman.h>
+#endif
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#include <assert.h>
+
+struct mapper_trial {
+       enum container_format cntr_format;
+       struct container_context *cntrs;
+
+       char **paths;
+
+       struct mapper_context mapper;
+       bool verbose;
+};
+
+static void test_demuxer(struct mapper_context *mapper, snd_pcm_access_t access,
+                        unsigned int bytes_per_sample,
+                        unsigned int samples_per_frame,
+                        unsigned int frames_per_buffer,
+                        void *frame_buffer, unsigned int frame_count,
+                        struct container_context *cntrs,
+                        unsigned int cntr_count, bool verbose)
+{
+       unsigned int total_frame_count;
+       int err;
+
+       err = mapper_context_init(mapper, MAPPER_TYPE_DEMUXER, cntr_count,
+                                 verbose);
+       assert(err == 0);
+
+       err = mapper_context_pre_process(mapper, access, bytes_per_sample,
+                                        samples_per_frame, frames_per_buffer,
+                                        cntrs);
+       assert(err == 0);
+
+       total_frame_count = frame_count;
+       err = mapper_context_process_frames(mapper, frame_buffer,
+                                           &total_frame_count, cntrs);
+       assert(err == 0);
+       assert(total_frame_count == frame_count);
+
+       mapper_context_post_process(mapper);
+       mapper_context_destroy(mapper);
+}
+
+static int test_demux(struct mapper_trial *trial, snd_pcm_access_t access,
+                     snd_pcm_format_t sample_format,
+                     unsigned int samples_per_frame,
+                     unsigned int frames_per_second,
+                     unsigned int frames_per_buffer,
+                     void *frame_buffer, unsigned int frame_count,
+                     int *cntr_fds, unsigned int cntr_count)
+{
+       struct container_context *cntrs = trial->cntrs;
+       enum container_format cntr_format = trial->cntr_format;
+       unsigned int bytes_per_sample;
+       uint64_t total_frame_count;
+       int i;
+       int err = 0;
+
+       for (i = 0; i < cntr_count; ++i) {
+               snd_pcm_format_t format;
+               unsigned int channels;
+               unsigned int rate;
+
+               err = container_builder_init(cntrs + i, cntr_fds[i], cntr_format, 0);
+               if (err < 0)
+                       goto end;
+
+               format = sample_format;
+               rate = frames_per_second;
+               total_frame_count = frame_count;
+               if (cntr_count > 1)
+                       channels = 1;
+               else
+                       channels = samples_per_frame;
+               err = container_context_pre_process(cntrs + i, &format,
+                                                   &channels, &rate,
+                                                   &total_frame_count);
+               if (err < 0)
+                       goto end;
+               assert(format == sample_format);
+               assert(rate == frames_per_second);
+               assert(total_frame_count >= 0);
+               if (cntr_count > 1)
+                       assert(channels == 1);
+               else
+                       assert(channels == samples_per_frame);
+       }
+
+       bytes_per_sample = snd_pcm_format_physical_width(sample_format) / 8;
+       test_demuxer(&trial->mapper, access, bytes_per_sample,
+                    samples_per_frame, frames_per_buffer, frame_buffer,
+                    frame_count, cntrs, cntr_count, trial->verbose);
+
+       for (i = 0; i < cntr_count; ++i) {
+               container_context_post_process(cntrs + i, &total_frame_count);
+               assert(total_frame_count == frame_count);
+       }
+end:
+       for (i = 0; i < cntr_count; ++i)
+               container_context_destroy(cntrs + i);
+
+       return err;
+}
+
+static void test_muxer(struct mapper_context *mapper, snd_pcm_access_t access,
+                      unsigned int bytes_per_sample,
+                      unsigned int samples_per_frame,
+                      unsigned int frames_per_buffer,
+                      void *frame_buffer, unsigned int frame_count,
+                      struct container_context *cntrs,
+                      unsigned int cntr_count, bool verbose)
+{
+       unsigned int total_frame_count;
+       int err;
+
+       err = mapper_context_init(mapper, MAPPER_TYPE_MUXER, cntr_count,
+                                 verbose);
+       assert(err == 0);
+
+       err = mapper_context_pre_process(mapper, access, bytes_per_sample,
+                                        samples_per_frame, frames_per_buffer,
+                                        cntrs);
+       assert(err == 0);
+
+       total_frame_count = frame_count;
+       err = mapper_context_process_frames(mapper, frame_buffer,
+                                           &total_frame_count, cntrs);
+       assert(err == 0);
+       assert(total_frame_count == frame_count);
+
+       mapper_context_post_process(mapper);
+       mapper_context_destroy(mapper);
+}
+
+static int test_mux(struct mapper_trial *trial, snd_pcm_access_t access,
+                   snd_pcm_format_t sample_format,
+                   unsigned int samples_per_frame,
+                   unsigned int frames_per_second,
+                   unsigned int frames_per_buffer,
+                   void *frame_buffer, unsigned int frame_count,
+                   int *cntr_fds, unsigned int cntr_count)
+{
+       struct container_context *cntrs = trial->cntrs;
+       unsigned int bytes_per_sample;
+       uint64_t total_frame_count;
+       int i;
+       int err = 0;
+
+       for (i = 0; i < cntr_count; ++i) {
+               snd_pcm_format_t format;
+               unsigned int channels;
+               unsigned int rate;
+
+               err = container_parser_init(cntrs + i, cntr_fds[i], 0);
+               if (err < 0)
+                       goto end;
+
+               format = sample_format;
+               rate = frames_per_second;
+               if (cntr_count > 1)
+                       channels = 1;
+               else
+                       channels = samples_per_frame;
+               err = container_context_pre_process(cntrs + i, &format,
+                                                   &channels, &rate,
+                                                   &total_frame_count);
+               if (err < 0)
+                       goto end;
+
+               assert(format == sample_format);
+               assert(rate == frames_per_second);
+               assert(total_frame_count == frame_count);
+               if (cntr_count > 1)
+                       assert(channels == 1);
+               else
+                       assert(channels == samples_per_frame);
+       }
+
+       bytes_per_sample = snd_pcm_format_physical_width(sample_format) / 8;
+       test_muxer(&trial->mapper, access, bytes_per_sample, samples_per_frame,
+                  frames_per_buffer, frame_buffer, frame_count, cntrs,
+                  cntr_count, trial->verbose);
+
+       for (i = 0; i < cntr_count; ++i) {
+               container_context_post_process(cntrs + i, &total_frame_count);
+               assert(total_frame_count == frame_count);
+       }
+end:
+       for (i = 0; i < cntr_count; ++i)
+               container_context_destroy(cntrs + i);
+
+       return err;
+}
+
+static int test_mapper(struct mapper_trial *trial, snd_pcm_access_t access,
+                   snd_pcm_format_t sample_format,
+                   unsigned int samples_per_frame,
+                   unsigned int frames_per_second, void *frame_buffer,
+                   void *check_buffer, unsigned int frame_count,
+                   unsigned int cntr_count)
+{
+       int *cntr_fds;
+       unsigned int frames_per_buffer;
+       int i;
+       int err;
+
+       // Use a buffer aligned by typical size of page frame.
+       frames_per_buffer = ((frame_count + 4096) / 4096) * 4096;
+
+       cntr_fds = calloc(cntr_count, sizeof(*cntr_fds));
+       if (cntr_fds == NULL)
+               return -ENOMEM;
+
+       for (i = 0; i < cntr_count; ++i) {
+               const char *path = trial->paths[i];
+
+#ifdef HAVE_MEMFD_CREATE
+               cntr_fds[i] = memfd_create(path, 0);
+#else
+               cntr_fds[i] = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
+#endif
+               if (cntr_fds[i] < 0) {
+                       err = -errno;
+                       goto end;
+               }
+       }
+
+       err = test_demux(trial, access, sample_format, samples_per_frame,
+                        frames_per_second, frames_per_buffer, frame_buffer,
+                        frame_count, cntr_fds, cntr_count);
+       if (err < 0)
+               goto end;
+
+       for (i = 0; i < cntr_count; ++i) {
+               off_t pos = lseek(cntr_fds[i], 0, SEEK_SET);
+               if (pos != 0) {
+                       err = -EIO;
+                       goto end;
+               }
+       }
+
+       err = test_mux(trial, access, sample_format, samples_per_frame,
+                      frames_per_second, frames_per_buffer, check_buffer,
+                      frame_count, cntr_fds, cntr_count);
+end:
+       for (i = 0; i < cntr_count; ++i)
+               close(cntr_fds[i]);
+
+       free(cntr_fds);
+
+       return err;
+}
+
+static int test_i_buf(struct mapper_trial *trial, snd_pcm_access_t access,
+                     snd_pcm_format_t sample_format,
+                     unsigned int samples_per_frame,
+                     unsigned int frames_per_second, void *frame_buffer,
+                     unsigned int frame_count, unsigned int cntr_count)
+{
+       unsigned int size;
+       char *buf;
+       int err;
+
+       size = frame_count * samples_per_frame *
+                       snd_pcm_format_physical_width(sample_format) / 8;
+       buf = malloc(size);
+       if (buf == 0)
+               return -ENOMEM;
+       memset(buf, 0, size);
+
+       // Test multiple target.
+       err = test_mapper(trial, access, sample_format, samples_per_frame,
+                         frames_per_second, frame_buffer, buf,
+                         frame_count, cntr_count);
+       if (err < 0)
+               goto end;
+       err = memcmp(frame_buffer, buf, size);
+       assert(err == 0);
+
+       // Test single target.
+       err = test_mapper(trial, access, sample_format, samples_per_frame,
+                         frames_per_second, frame_buffer, buf,
+                         frame_count, 1);
+       if (err < 0)
+               goto end;
+       err = memcmp(frame_buffer, buf, size);
+       assert(err == 0);
+end:
+       free(buf);
+
+       return err;
+}
+
+static int test_vector(struct mapper_trial *trial, snd_pcm_access_t access,
+                      snd_pcm_format_t sample_format,
+                      unsigned int samples_per_frame,
+                      unsigned int frames_per_second, void *frame_buffer,
+                      unsigned int frame_count, unsigned int cntr_count)
+{
+       unsigned int size;
+       char **bufs;
+       int i;
+       int err;
+
+       bufs = calloc(cntr_count, sizeof(*bufs));
+       if (bufs == NULL)
+               return -ENOMEM;
+
+       size = frame_count * snd_pcm_format_physical_width(sample_format) / 8;
+
+       for (i = 0; i < cntr_count; ++i) {
+               bufs[i] = malloc(size);
+               if (bufs[i] == NULL) {
+                       err = -ENOMEM;
+                       goto end;
+               }
+               memset(bufs[i], 0, size);
+       }
+
+       // Test multiple target.
+       err = test_mapper(trial, access, sample_format, samples_per_frame,
+                         frames_per_second, frame_buffer, bufs,
+                         frame_count, cntr_count);
+       if (err < 0)
+               goto end;
+       for (i = 0; i < cntr_count; ++i) {
+               char **target = frame_buffer;
+               err = memcmp(target[i], bufs[i], size);
+               assert(err == 0);
+       }
+
+       // Test single target.
+       err = test_mapper(trial, access, sample_format, samples_per_frame,
+                         frames_per_second, frame_buffer, bufs,
+                         frame_count, 1);
+       if (err < 0)
+               goto end;
+       for (i = 0; i < cntr_count; ++i) {
+               char **target = frame_buffer;
+               err = memcmp(target[i], bufs[i], size);
+               assert(err == 0);
+       }
+end:
+       for (i = 0; i < cntr_count; ++i) {
+               if (bufs[i])
+                       free(bufs[i]);
+       }
+       free(bufs);
+
+       return err;
+}
+
+static int test_n_buf(struct mapper_trial *trial, snd_pcm_access_t access,
+                     snd_pcm_format_t sample_format,
+                     unsigned int samples_per_frame,
+                     unsigned int frames_per_second, void *frame_buffer,
+                     unsigned int frame_count, unsigned int cntr_count)
+{
+       char *test_buf = frame_buffer;
+       unsigned int size;
+       char **test_vec;
+       int i;
+       int err;
+
+       size = frame_count * snd_pcm_format_physical_width(sample_format) / 8;
+
+       test_vec = calloc(cntr_count * 2, sizeof(*test_vec));
+       if (test_vec == NULL)
+               return -ENOMEM;
+
+       for (i = 0; i < cntr_count; ++i)
+               test_vec[i] = test_buf + size * i;
+
+       err = test_vector(trial, access, sample_format, samples_per_frame,
+                         frames_per_second, test_vec, frame_count, cntr_count);
+       free(test_vec);
+
+       return err;
+}
+
+static int callback(struct test_generator *gen, snd_pcm_access_t access,
+                   snd_pcm_format_t sample_format,
+                   unsigned int samples_per_frame, void *frame_buffer,
+                   unsigned int frame_count)
+{
+
+       int (*handler)(struct mapper_trial *trial, snd_pcm_access_t access,
+                      snd_pcm_format_t sample_format,
+                      unsigned int samples_per_frame,
+                      unsigned int frames_per_second, void *frame_buffer,
+                      unsigned int frame_count, unsigned int cntr_count);
+       struct mapper_trial *trial = gen->private_data;
+
+       if (access == SND_PCM_ACCESS_RW_NONINTERLEAVED)
+               handler = test_vector;
+       else if (access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED)
+               handler = test_n_buf;
+       else
+               handler = test_i_buf;
+
+       return handler(trial, access, sample_format, samples_per_frame, 48000,
+                      frame_buffer, frame_count, samples_per_frame);
+};
+
+int main(int argc, const char *argv[])
+{
+       // Test 8/16/18/20/24/32/64 bytes per sample.
+       static const uint64_t sample_format_mask =
+                       (1ull << SND_PCM_FORMAT_U8) |
+                       (1ull << SND_PCM_FORMAT_S16_LE) |
+                       (1ull << SND_PCM_FORMAT_S18_3LE) |
+                       (1ull << SND_PCM_FORMAT_S20_3LE) |
+                       (1ull << SND_PCM_FORMAT_S24_LE) |
+                       (1ull << SND_PCM_FORMAT_S32_LE) |
+                       (1ull << SND_PCM_FORMAT_FLOAT64_LE);
+       uint64_t access_mask;
+       struct test_generator gen = {0};
+       struct mapper_trial *trial;
+       struct container_context *cntrs;
+       unsigned int samples_per_frame;
+       char **paths = NULL;
+       snd_pcm_access_t access;
+       bool verbose;
+       int i;
+       int err;
+
+       // Test up to 32 channels.
+       samples_per_frame = 32;
+       cntrs = calloc(samples_per_frame, sizeof(*cntrs));
+       if (cntrs == NULL)
+               return -ENOMEM;
+
+       paths = calloc(samples_per_frame, sizeof(*paths));
+       if (paths == NULL) {
+               err = -ENOMEM;
+               goto end;
+       }
+       for (i = 0; i < samples_per_frame; ++i) {
+               paths[i] = malloc(8);
+               if (paths[i] == NULL) {
+                       err = -ENOMEM;
+                       goto end;
+               }
+               snprintf(paths[i], 8, "hoge%d", i);
+       }
+
+       if (argc > 1) {
+               char *term;
+               access = strtol(argv[1], &term, 10);
+               if (errno != 0 || *term != '\0') {
+                       err = -EINVAL;;
+                       goto end;
+               }
+               if (access < SND_PCM_ACCESS_MMAP_INTERLEAVED &&
+                   access > SND_PCM_ACCESS_RW_NONINTERLEAVED) {
+                       err = -EINVAL;
+                       goto end;
+               }
+               if (access == SND_PCM_ACCESS_MMAP_COMPLEX) {
+                       err = -EINVAL;
+                       goto end;
+               }
+
+               access_mask = 1ull << access;
+               verbose = true;
+       } else {
+               access_mask = (1ull << SND_PCM_ACCESS_MMAP_INTERLEAVED) |
+                             (1ull << SND_PCM_ACCESS_MMAP_NONINTERLEAVED) |
+                             (1ull << SND_PCM_ACCESS_RW_INTERLEAVED) |
+                             (1ull << SND_PCM_ACCESS_RW_NONINTERLEAVED);
+               verbose = false;
+       }
+
+       err = generator_context_init(&gen, access_mask, sample_format_mask,
+                                    1, samples_per_frame,
+                                    23, 4500, 1024,
+                                    sizeof(struct mapper_trial));
+       if (err < 0)
+               goto end;
+
+       trial = gen.private_data;
+       trial->cntrs = cntrs;
+       trial->cntr_format = CONTAINER_FORMAT_RIFF_WAVE;
+       trial->paths = paths;
+       trial->verbose = verbose;
+       err = generator_context_run(&gen, callback);
+
+       generator_context_destroy(&gen);
+end:
+       if (paths) {
+               for (i = 0; i < samples_per_frame; ++i)
+                       free(paths[i]);
+               free(paths);
+       }
+       free(cntrs);
+
+       if (err < 0) {
+               printf("%s\n", strerror(-err));
+               return EXIT_FAILURE;
+       }
+
+       return EXIT_SUCCESS;
+}
diff --git a/axfer/waiter-epoll.c b/axfer/waiter-epoll.c
new file mode 100644 (file)
index 0000000..c09641b
--- /dev/null
@@ -0,0 +1,107 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// waiter-epoll.c - Waiter for event notification by epoll(7).
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "waiter.h"
+#include "misc.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/epoll.h>
+
+struct epoll_state {
+       int epfd;
+       struct epoll_event *events;
+       unsigned int ev_count;
+};
+
+static int epoll_prepare(struct waiter_context *waiter)
+{
+       struct epoll_state *state = waiter->private_data;
+       int i;
+
+       state->ev_count = waiter->pfd_count;
+       state->events = calloc(state->ev_count, sizeof(*state->events));
+       if (state->events == NULL)
+               return -ENOMEM;
+
+       state->epfd = epoll_create(1);
+       if (state->epfd < 0)
+               return -errno;
+
+       for (i = 0; i < (int)waiter->pfd_count; ++i) {
+               struct epoll_event ev = {
+                       .data.fd = waiter->pfds[i].fd,
+                       .events = waiter->pfds[i].events,
+               };
+               if (epoll_ctl(state->epfd, EPOLL_CTL_ADD, ev.data.fd, &ev) < 0)
+                       return -errno;
+       }
+
+       return 0;
+}
+
+static int epoll_wait_event(struct waiter_context *waiter, int timeout_msec)
+{
+       struct epoll_state *state = waiter->private_data;
+       unsigned int ev_count;
+       int i, j;
+       int err;
+
+       memset(state->events, 0, state->ev_count * sizeof(*state->events));
+       err = epoll_wait(state->epfd, state->events, state->ev_count,
+                        timeout_msec);
+       if (err < 0)
+               return -errno;
+       ev_count = (unsigned int)err;
+
+       if (ev_count > 0) {
+               // Reconstruct data of pollfd structure.
+               for (i = 0; i < (int)ev_count; ++i) {
+                       struct epoll_event *ev = &state->events[i];
+                       for (j = 0; j < (int)waiter->pfd_count; ++j) {
+                               if (waiter->pfds[i].fd == ev->data.fd) {
+                                       waiter->pfds[i].revents = ev->events;
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       return ev_count;
+}
+
+static void epoll_release(struct waiter_context *waiter)
+{
+       struct epoll_state *state = waiter->private_data;
+       int i;
+
+       for (i = 0; i < (int)waiter->pfd_count; ++i) {
+               int fd = waiter->pfds[i].fd;
+               epoll_ctl(state->epfd, EPOLL_CTL_DEL, fd, NULL);
+       }
+
+       free(state->events);
+       state->events = NULL;
+
+       close(state->epfd);
+
+       state->ev_count = 0;
+       state->epfd = 0;
+}
+
+const struct waiter_data waiter_epoll = {
+       .ops = {
+               .prepare        = epoll_prepare,
+               .wait_event     = epoll_wait_event,
+               .release        = epoll_release,
+       },
+       .private_size = sizeof(struct epoll_state),
+};
diff --git a/axfer/waiter-poll.c b/axfer/waiter-poll.c
new file mode 100644 (file)
index 0000000..b81300c
--- /dev/null
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// waiter-poll.c - Waiter for event notification by poll(2).
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "waiter.h"
+#include "misc.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include <poll.h>
+
+static int poll_prepare(struct waiter_context *waiter ATTRIBUTE_UNUSED)
+{
+       // Nothing to do because an instance of waiter has required data.
+       return 0;
+}
+
+static int poll_wait_event(struct waiter_context *waiter, int timeout_msec)
+{
+       int err;
+
+       err = poll(waiter->pfds, waiter->pfd_count, timeout_msec);
+       if (err < 0)
+               return -errno;
+
+       return err;
+}
+
+static void poll_release(struct waiter_context *waiter ATTRIBUTE_UNUSED)
+{
+       // Nothing to do because an instance of waiter has required data.
+       return;
+}
+
+const struct waiter_data waiter_poll = {
+       .ops = {
+               .prepare        = poll_prepare,
+               .wait_event     = poll_wait_event,
+               .release        = poll_release,
+       },
+};
diff --git a/axfer/waiter-select.c b/axfer/waiter-select.c
new file mode 100644 (file)
index 0000000..fe19776
--- /dev/null
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// waiter-select.c - Waiter for event notification by select(2).
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "waiter.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/select.h>
+
+// Except for POLLERR.
+#ifdef POLLRDNORM
+// This program is for userspace compliant to POSIX 2008 (IEEE 1003.1:2008).
+// This is the default compliance level since glibc-2.12 or later.
+# define POLLIN_SET    (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP)
+# define POLLOUT_SET   (POLLWRBAND | POLLWRNORM | POLLOUT)
+#else
+// However it's allowed to be for old compliance levels.
+# define POLLIN_SET    (POLLIN | POLLHUP)
+# define POLLOUT_SET   (POLLOUT)
+#endif
+#define POLLEX_SET     (POLLPRI)
+
+
+struct select_state {
+       fd_set rfds_rd;
+       fd_set rfds_wr;
+       fd_set rfds_ex;
+};
+
+static int select_prepare(struct waiter_context *waiter ATTRIBUTE_UNUSED)
+{
+       return 0;
+}
+
+static int select_wait_event(struct waiter_context *waiter, int timeout_msec)
+{
+       struct select_state *state = waiter->private_data;
+       struct pollfd *pfd;
+       int fd_max;
+       struct timeval tv, *tv_ptr;
+       int i;
+       int err;
+
+       FD_ZERO(&state->rfds_rd);
+       FD_ZERO(&state->rfds_wr);
+       FD_ZERO(&state->rfds_ex);
+
+       fd_max = 0;
+       for (i = 0; i < (int)waiter->pfd_count; ++i) {
+               pfd = &waiter->pfds[i];
+
+               if (pfd->events & POLLIN_SET)
+                       FD_SET(pfd->fd, &state->rfds_rd);
+               if (pfd->events & POLLOUT_SET)
+                       FD_SET(pfd->fd, &state->rfds_wr);
+               if (pfd->events & POLLEX_SET)
+                       FD_SET(pfd->fd, &state->rfds_ex);
+               if (pfd->fd > fd_max)
+                       fd_max = pfd->fd;
+       }
+
+       if (timeout_msec < 0) {
+               tv_ptr = NULL;
+       } else {
+               tv.tv_sec = 0;
+               tv.tv_usec = timeout_msec * 1000;
+               tv_ptr = &tv;
+       }
+
+       err = select(fd_max + 1, &state->rfds_rd, &state->rfds_wr,
+                    &state->rfds_ex, tv_ptr);
+       if (err < 0)
+               return -errno;
+
+       for (i = 0; i < (int)waiter->pfd_count; ++i) {
+               pfd = &waiter->pfds[i];
+
+               pfd->revents = 0;
+               if (FD_ISSET(pfd->fd, &state->rfds_rd))
+                       pfd->revents |= POLLIN;
+               if (FD_ISSET(pfd->fd, &state->rfds_wr))
+                       pfd->revents |= POLLOUT;
+               if (FD_ISSET(pfd->fd, &state->rfds_ex))
+                       pfd->revents |= POLLHUP;
+       }
+
+       return err;
+}
+
+static void select_release(struct waiter_context *waiter ATTRIBUTE_UNUSED)
+{
+       return;
+}
+
+const struct waiter_data waiter_select = {
+       .ops = {
+               .prepare        = select_prepare,
+               .wait_event     = select_wait_event,
+               .release        = select_release,
+       },
+       .private_size = sizeof(struct select_state),
+};
diff --git a/axfer/waiter.c b/axfer/waiter.c
new file mode 100644 (file)
index 0000000..dcca028
--- /dev/null
@@ -0,0 +1,104 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// waiter.c - I/O event waiter.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "waiter.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "misc.h"
+
+static const char *const waiter_type_labels[] = {
+       [WAITER_TYPE_DEFAULT] = "default",
+       [WAITER_TYPE_POLL] = "poll",
+       [WAITER_TYPE_SELECT] = "select",
+       [WAITER_TYPE_EPOLL] = "epoll",
+};
+
+enum waiter_type waiter_type_from_label(const char *label)
+{
+       int i;
+
+       for (i = 0; i < (int)ARRAY_SIZE(waiter_type_labels); ++i) {
+               if (!strcmp(waiter_type_labels[i], label))
+                       return i;
+       }
+
+       return WAITER_TYPE_DEFAULT;
+}
+
+const char *waiter_label_from_type(enum waiter_type type)
+{
+       return waiter_type_labels[type];
+}
+
+int waiter_context_init(struct waiter_context *waiter,
+                       enum waiter_type type, unsigned int pfd_count)
+{
+       struct {
+               enum waiter_type type;
+               const struct waiter_data *waiter;
+       } entries[] = {
+               {WAITER_TYPE_POLL,      &waiter_poll},
+               {WAITER_TYPE_SELECT,    &waiter_select},
+               {WAITER_TYPE_EPOLL,     &waiter_epoll},
+       };
+       int i;
+
+       if (pfd_count == 0)
+               return -EINVAL;
+
+       for (i = 0; i < (int)ARRAY_SIZE(entries); ++i) {
+               if (entries[i].type == type)
+                       break;
+       }
+       if (i == ARRAY_SIZE(entries))
+               return -EINVAL;
+
+       waiter->private_data = malloc(entries[i].waiter->private_size);
+       if (waiter->private_data == NULL)
+               return -ENOMEM;
+       memset(waiter->private_data, 0, entries[i].waiter->private_size);
+
+       waiter->type = type;
+       waiter->ops = &entries[i].waiter->ops;
+
+       waiter->pfds = calloc(pfd_count, sizeof(*waiter->pfds));
+       if (waiter->pfds == NULL)
+               return -ENOMEM;
+       waiter->pfd_count = pfd_count;
+
+       return 0;
+}
+
+int waiter_context_prepare(struct waiter_context *waiter)
+{
+       return waiter->ops->prepare(waiter);
+}
+
+int waiter_context_wait_event(struct waiter_context *waiter,
+                               int timeout_msec)
+{
+       return waiter->ops->wait_event(waiter, timeout_msec);
+}
+
+void waiter_context_release(struct waiter_context *waiter)
+{
+       waiter->ops->release(waiter);
+}
+
+void waiter_context_destroy(struct waiter_context *waiter)
+{
+       if (waiter->pfds)
+               free(waiter->pfds);
+       waiter->pfd_count = 0;
+       if (waiter->private_data)
+               free(waiter->private_data);
+       waiter->private_data = NULL;
+}
diff --git a/axfer/waiter.h b/axfer/waiter.h
new file mode 100644 (file)
index 0000000..0f4e9b9
--- /dev/null
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// waiter.h - a header for I/O event waiter.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#ifndef __ALSA_UTILS_AXFER_WAITER__H_
+#define __ALSA_UTILS_AXFER_WAITER__H_
+
+#include <alsa/global.h>
+#include <poll.h>
+
+enum waiter_type {
+       WAITER_TYPE_DEFAULT = 0,
+       WAITER_TYPE_POLL,
+       WAITER_TYPE_SELECT,
+       WAITER_TYPE_EPOLL,
+       WAITER_TYPE_COUNT,
+};
+
+struct waiter_ops;
+
+struct waiter_context {
+       enum waiter_type type;
+       const struct waiter_ops *ops;
+       void *private_data;
+
+       struct pollfd *pfds;
+       unsigned int pfd_count;
+};
+
+enum waiter_type waiter_type_from_label(const char *label);
+const char *waiter_label_from_type(enum waiter_type type);
+
+int waiter_context_init(struct waiter_context *waiter,
+                       enum waiter_type type, unsigned int pfd_count);
+int waiter_context_prepare(struct waiter_context *waiter);
+int waiter_context_wait_event(struct waiter_context *waiter,
+                               int timeout_msec);
+void waiter_context_release(struct waiter_context *waiter);
+void waiter_context_destroy(struct waiter_context *waiter);
+
+// For internal use in 'waiter' module.
+
+struct waiter_ops {
+       int (*prepare)(struct waiter_context *waiter);
+       int (*wait_event)(struct waiter_context *waiter, int timeout_msec);
+       void (*release)(struct waiter_context *waiter);
+};
+
+struct waiter_data {
+       struct waiter_ops ops;
+       unsigned int private_size;
+};
+
+extern const struct waiter_data waiter_poll;
+extern const struct waiter_data waiter_select;
+extern const struct waiter_data waiter_epoll;
+
+#endif
diff --git a/axfer/xfer-libasound-irq-mmap.c b/axfer/xfer-libasound-irq-mmap.c
new file mode 100644 (file)
index 0000000..382ef92
--- /dev/null
@@ -0,0 +1,301 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// xfer-libasound-irq-mmap.c - IRQ-based scheduling model for mmap operation.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "xfer-libasound.h"
+#include "misc.h"
+
+struct map_layout {
+       snd_pcm_status_t *status;
+
+       char **vector;
+       unsigned int samples_per_frame;
+};
+
+static int irq_mmap_pre_process(struct libasound_state *state)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_access_t access;
+       snd_pcm_uframes_t frame_offset;
+       snd_pcm_uframes_t avail = 0;
+       int i;
+       int err;
+
+       err = snd_pcm_status_malloc(&layout->status);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_access(state->hw_params, &access);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_channels(state->hw_params,
+                                            &layout->samples_per_frame);
+       if (err < 0)
+               return err;
+
+       if (access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED) {
+               layout->vector = calloc(layout->samples_per_frame,
+                                       sizeof(*layout->vector));
+               if (layout->vector == NULL)
+                       return err;
+       }
+
+       if (state->verbose) {
+               const snd_pcm_channel_area_t *areas;
+               err = snd_pcm_mmap_begin(state->handle, &areas, &frame_offset,
+                                        &avail);
+               if (err < 0)
+                       return err;
+
+               logging(state, "attributes for mapped page frame:\n");
+               for (i = 0; i < (int)layout->samples_per_frame; ++i) {
+                       const snd_pcm_channel_area_t *area = areas + i;
+
+                       logging(state, "  sample number: %d\n", i);
+                       logging(state, "    address: %p\n", area->addr);
+                       logging(state, "    bits for offset: %u\n", area->first);
+                       logging(state, "    bits/frame: %u\n", area->step);
+               }
+               logging(state, "\n");
+       }
+
+       return 0;
+}
+
+static int irq_mmap_process_frames(struct libasound_state *state,
+                                  unsigned int *frame_count,
+                                  struct mapper_context *mapper,
+                                  struct container_context *cntrs)
+{
+       struct map_layout *layout = state->private_data;
+       const snd_pcm_channel_area_t *areas;
+       snd_pcm_uframes_t frame_offset;
+       snd_pcm_uframes_t avail;
+       unsigned int avail_count;
+       void *frame_buf;
+       snd_pcm_sframes_t consumed_count;
+       int err;
+
+       if (state->use_waiter) {
+               unsigned int msec_per_buffer;
+               unsigned short revents;
+
+               // Wait during msec equivalent to all audio data frames in
+               // buffer instead of period, for safe.
+               err = snd_pcm_hw_params_get_buffer_time(state->hw_params,
+                                                       &msec_per_buffer, NULL);
+               if (err < 0)
+                       return err;
+               msec_per_buffer /= 1000;
+
+               // Wait for hardware IRQ when no avail space in buffer.
+               err = xfer_libasound_wait_event(state, msec_per_buffer,
+                                               &revents);
+               if (err == -ETIMEDOUT) {
+                       logging(state,
+                               "No event occurs for PCM substream during %u "
+                               "msec. The implementaion of kernel driver or "
+                               "userland backend causes this issue.\n",
+                               msec_per_buffer);
+                       return err;
+               }
+               if (err < 0)
+                       return err;
+               if (revents & POLLERR) {
+                       // TODO: error reporting?
+                       return -EIO;
+               }
+               if (!(revents & (POLLIN | POLLOUT)))
+                       return -EAGAIN;
+
+               // When rescheduled, current position of data transmission was
+               // queried to actual hardware by a handler of IRQ. No need to
+               // perform it; e.g. ioctl(2) with SNDRV_PCM_IOCTL_HWSYNC.
+       }
+
+       // Sync cache in user space to data in kernel space to calculate avail
+       // frames according to the latest positions on PCM buffer.
+       //
+       // This has an additional advantage to handle libasound PCM plugins.
+       // Most of libasound PCM plugins perform resampling in .avail_update()
+       // callback for capture PCM substream, then update positions on buffer.
+       //
+       // MEMO: either snd_pcm_avail_update() and snd_pcm_mmap_begin() can
+       // return the same number of available frames.
+       avail = snd_pcm_avail_update(state->handle);
+       if ((snd_pcm_sframes_t)avail < 0)
+               return (int)avail;
+       if (*frame_count < avail)
+               avail = *frame_count;
+
+       err = snd_pcm_mmap_begin(state->handle, &areas, &frame_offset, &avail);
+       if (err < 0)
+               return err;
+
+       // Trim according up to expected frame count.
+       if (*frame_count < avail)
+               avail_count = *frame_count;
+       else
+               avail_count = (unsigned int)avail;
+
+       // TODO: Perhaps, the complex layout can be supported as a variation of
+       // vector type. However, there's no driver with this layout.
+       if (layout->vector == NULL) {
+               char *buf;
+               buf = areas[0].addr;
+               buf += snd_pcm_frames_to_bytes(state->handle, frame_offset);
+               frame_buf = buf;
+       } else {
+               int i;
+               for (i = 0; i < (int)layout->samples_per_frame; ++i) {
+                       layout->vector[i] = areas[i].addr;
+                       layout->vector[i] += snd_pcm_samples_to_bytes(
+                                               state->handle, frame_offset);
+               }
+               frame_buf = layout->vector;
+       }
+
+       err = mapper_context_process_frames(mapper, frame_buf, &avail_count,
+                                           cntrs);
+       if (err < 0)
+               return err;
+       if (avail_count == 0) {
+               *frame_count = 0;
+               return 0;
+       }
+
+       consumed_count = snd_pcm_mmap_commit(state->handle, frame_offset,
+                                            avail_count);
+       if (consumed_count < 0)
+               return (int)consumed_count;
+       if (consumed_count != avail_count)
+               logging(state, "A bug of access plugin for this PCM node.\n");
+
+       *frame_count = consumed_count;
+
+       return 0;
+}
+
+static int irq_mmap_r_process_frames(struct libasound_state *state,
+                                    unsigned *frame_count,
+                                    struct mapper_context *mapper,
+                                    struct container_context *cntrs)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_state_t s;
+       int err;
+
+       // To querying current status of hardware, we need to care of
+       // synchronization between 3 levels:
+       //  1. status to actual hardware by driver.
+       //  2. status data in kernel space.
+       //  3. status data in user space.
+       //
+       // Kernel driver query 1 and sync 2, according to requests of some
+       // ioctl(2) commands. For synchronization between 2 and 3, ALSA PCM core
+       // supports mmap(2) operation on cache coherent architectures, some
+       // ioctl(2) commands on cache incoherent architecture. In usage of the
+       // former mechanism, we need to care of concurrent access by IRQ context
+       // and process context to the mapped page frame.
+       // In a call of ioctl(2) with SNDRV_PCM_IOCTL_STATUS and
+       // SNDRV_PCM_IOCTL_STATUS_EXT, the above care is needless because
+       // mapped page frame is unused regardless of architectures in a point of
+       // cache coherency.
+       err = snd_pcm_status(state->handle, layout->status);
+       if (err < 0)
+               goto error;
+       s = snd_pcm_status_get_state(layout->status);
+
+       // TODO: if reporting something, do here with the status data.
+
+       // For capture direction, need to start stream explicitly.
+       if (s != SND_PCM_STATE_RUNNING) {
+               if (s != SND_PCM_STATE_PREPARED) {
+                       err = -EPIPE;
+                       goto error;
+               }
+
+               err = snd_pcm_start(state->handle);
+               if (err < 0)
+                       goto error;
+       }
+
+       err = irq_mmap_process_frames(state, frame_count, mapper, cntrs);
+       if (err < 0)
+               goto error;
+
+       return 0;
+error:
+       *frame_count = 0;
+       return err;
+}
+
+static int irq_mmap_w_process_frames(struct libasound_state *state,
+                                    unsigned *frame_count,
+                                    struct mapper_context *mapper,
+                                    struct container_context *cntrs)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_state_t s;
+       int err;
+
+       // Read my comment in 'irq_mmap_r_process_frames().
+       err = snd_pcm_status(state->handle, layout->status);
+       if (err < 0)
+               goto error;
+       s = snd_pcm_status_get_state(layout->status);
+
+       // TODO: if reporting something, do here with the status data.
+
+       err = irq_mmap_process_frames(state, frame_count, mapper, cntrs);
+       if (err < 0)
+               goto error;
+
+       // Need to start playback stream explicitly
+       if (s != SND_PCM_STATE_RUNNING) {
+               if (s != SND_PCM_STATE_PREPARED) {
+                       err = -EPIPE;
+                       goto error;
+               }
+
+               err = snd_pcm_start(state->handle);
+               if (err < 0)
+                       goto error;
+       }
+
+       return 0;
+error:
+       *frame_count = 0;
+       return err;
+}
+
+static void irq_mmap_post_process(struct libasound_state *state)
+{
+       struct map_layout *layout = state->private_data;
+
+       if (layout->status)
+               snd_pcm_status_free(layout->status);
+       layout->status = NULL;
+
+       free(layout->vector);
+       layout->vector = NULL;
+}
+
+const struct xfer_libasound_ops xfer_libasound_irq_mmap_w_ops = {
+       .pre_process    = irq_mmap_pre_process,
+       .process_frames = irq_mmap_w_process_frames,
+       .post_process   = irq_mmap_post_process,
+       .private_size   = sizeof(struct map_layout),
+};
+
+const struct xfer_libasound_ops xfer_libasound_irq_mmap_r_ops = {
+       .pre_process    = irq_mmap_pre_process,
+       .process_frames = irq_mmap_r_process_frames,
+       .post_process   = irq_mmap_post_process,
+       .private_size   = sizeof(struct map_layout),
+};
diff --git a/axfer/xfer-libasound-irq-rw.c b/axfer/xfer-libasound-irq-rw.c
new file mode 100644 (file)
index 0000000..45fb6d5
--- /dev/null
@@ -0,0 +1,438 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// xfer-libasound-irq-rw.c - IRQ-based scheduling model for read/write operation.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "xfer-libasound.h"
+#include "misc.h"
+#include "frame-cache.h"
+
+struct rw_closure {
+       snd_pcm_access_t access;
+       int (*process_frames)(struct libasound_state *state,
+                             snd_pcm_state_t status, unsigned int *frame_count,
+                             struct mapper_context *mapper,
+                     struct container_context *cntrs);
+       struct frame_cache cache;
+};
+
+static int wait_for_avail(struct libasound_state *state)
+{
+       unsigned int msec_per_buffer;
+       unsigned short revents;
+       unsigned short event;
+       int err;
+
+       // Wait during msec equivalent to all audio data frames in buffer
+       // instead of period, for safe.
+       err = snd_pcm_hw_params_get_buffer_time(state->hw_params,
+                                               &msec_per_buffer, NULL);
+       if (err < 0)
+               return err;
+       msec_per_buffer /= 1000;
+
+       // Wait for hardware IRQ when no available space.
+       err = xfer_libasound_wait_event(state, msec_per_buffer, &revents);
+       if (err < 0)
+               return err;
+
+       // TODO: error reporting.
+       if (revents & POLLERR)
+               return -EIO;
+
+       if (snd_pcm_stream(state->handle) == SND_PCM_STREAM_CAPTURE)
+               event = POLLIN;
+       else
+               event = POLLOUT;
+
+       if (!(revents & event))
+               return -EAGAIN;
+
+       return 0;
+}
+
+static int read_frames(struct libasound_state *state, unsigned int *frame_count,
+                      unsigned int avail_count, struct mapper_context *mapper,
+                      struct container_context *cntrs)
+{
+       struct rw_closure *closure = state->private_data;
+       snd_pcm_sframes_t handled_frame_count;
+       unsigned int consumed_count;
+       int err;
+
+       // Trim according up to expected frame count.
+       if (*frame_count < avail_count)
+               avail_count = *frame_count;
+
+       // Cache required amount of frames.
+       if (avail_count > frame_cache_get_count(&closure->cache)) {
+               avail_count -= frame_cache_get_count(&closure->cache);
+
+               // Execute write operation according to the shape of buffer.
+               // These operations automatically start the substream.
+               if (closure->access == SND_PCM_ACCESS_RW_INTERLEAVED) {
+                       handled_frame_count = snd_pcm_readi(state->handle,
+                                                       closure->cache.buf_ptr,
+                                                       avail_count);
+               } else {
+                       handled_frame_count = snd_pcm_readn(state->handle,
+                                                       closure->cache.buf_ptr,
+                                                       avail_count);
+               }
+               if (handled_frame_count < 0) {
+                       err = handled_frame_count;
+                       return err;
+               }
+               frame_cache_increase_count(&closure->cache, handled_frame_count);
+               avail_count = frame_cache_get_count(&closure->cache);
+       }
+
+       // Write out to file descriptors.
+       consumed_count = avail_count;
+       err = mapper_context_process_frames(mapper, closure->cache.buf,
+                                           &consumed_count, cntrs);
+       if (err < 0)
+               return err;
+
+       frame_cache_reduce(&closure->cache, consumed_count);
+
+       *frame_count = consumed_count;
+
+       return 0;
+}
+
+static int r_process_frames_blocking(struct libasound_state *state,
+                                    snd_pcm_state_t status,
+                                    unsigned int *frame_count,
+                                    struct mapper_context *mapper,
+                                    struct container_context *cntrs)
+{
+       snd_pcm_sframes_t avail;
+       snd_pcm_uframes_t avail_count;
+       int err = 0;
+
+       if (status == SND_PCM_STATE_RUNNING) {
+               // Check available space on the buffer.
+               avail = snd_pcm_avail(state->handle);
+               if (avail < 0) {
+                       err = avail;
+                       goto error;
+               }
+               avail_count = (snd_pcm_uframes_t)avail;
+
+               if (avail_count == 0) {
+                       // Request data frames so that blocking is just
+                       // released.
+                       err = snd_pcm_sw_params_get_avail_min(state->sw_params,
+                                                             &avail_count);
+                       if (err < 0)
+                               goto error;
+               }
+       } else {
+               // Request data frames so that the PCM substream starts.
+               snd_pcm_uframes_t frame_count;
+               err = snd_pcm_sw_params_get_start_threshold(state->sw_params,
+                                                           &frame_count);
+               if (err < 0)
+                       goto error;
+
+               avail_count = (unsigned int)frame_count;
+       }
+
+       err = read_frames(state, frame_count, avail_count, mapper, cntrs);
+       if (err < 0)
+               goto error;
+
+       return 0;
+error:
+       *frame_count = 0;
+       return err;
+}
+
+static int r_process_frames_nonblocking(struct libasound_state *state,
+                                       snd_pcm_state_t status,
+                                       unsigned int *frame_count,
+                                       struct mapper_context *mapper,
+                                       struct container_context *cntrs)
+{
+       snd_pcm_sframes_t avail;
+       snd_pcm_uframes_t avail_count;
+       int err = 0;
+
+       if (status != SND_PCM_STATE_RUNNING) {
+               err = snd_pcm_start(state->handle);
+               if (err < 0)
+                       goto error;
+       }
+
+       if (state->use_waiter) {
+               err = wait_for_avail(state);
+               if (err < 0)
+                       goto error;
+       }
+
+       // Check available space on the buffer.
+       avail = snd_pcm_avail(state->handle);
+       if (avail < 0) {
+               err = avail;
+               goto error;
+       }
+       avail_count = (snd_pcm_uframes_t)avail;
+
+       if (avail_count == 0) {
+               // Let's go to a next iteration.
+               err = 0;
+               goto error;
+       }
+
+       err = read_frames(state, frame_count, avail_count, mapper, cntrs);
+       if (err < 0)
+               goto error;
+
+       return 0;
+error:
+       *frame_count = 0;
+       return err;
+}
+
+static int write_frames(struct libasound_state *state,
+                       unsigned int *frame_count, unsigned int avail_count,
+                       struct mapper_context *mapper,
+                       struct container_context *cntrs)
+{
+       struct rw_closure *closure = state->private_data;
+       snd_pcm_uframes_t consumed_count;
+       snd_pcm_sframes_t handled_frame_count;
+       int err;
+
+       // Trim according up to expected frame count.
+       if (*frame_count < avail_count)
+               avail_count = *frame_count;
+
+       // Cache required amount of frames.
+       if (avail_count > frame_cache_get_count(&closure->cache)) {
+               avail_count -= frame_cache_get_count(&closure->cache);
+
+               // Read frames to transfer.
+               err = mapper_context_process_frames(mapper,
+                               closure->cache.buf_ptr, &avail_count, cntrs);
+               if (err < 0)
+                       return err;
+               frame_cache_increase_count(&closure->cache, avail_count);
+               avail_count = frame_cache_get_count(&closure->cache);
+       }
+
+       // Execute write operation according to the shape of buffer. These
+       // operations automatically start the stream.
+       consumed_count = avail_count;
+       if (closure->access == SND_PCM_ACCESS_RW_INTERLEAVED) {
+               handled_frame_count = snd_pcm_writei(state->handle,
+                                       closure->cache.buf, consumed_count);
+       } else {
+               handled_frame_count = snd_pcm_writen(state->handle,
+                                       closure->cache.buf, consumed_count);
+       }
+       if (handled_frame_count < 0) {
+               err = handled_frame_count;
+               return err;
+       }
+
+       consumed_count = handled_frame_count;
+       frame_cache_reduce(&closure->cache, consumed_count);
+
+       *frame_count = consumed_count;
+
+       return 0;
+}
+
+static int w_process_frames_blocking(struct libasound_state *state,
+                                    snd_pcm_state_t status,
+                                    unsigned int *frame_count,
+                                    struct mapper_context *mapper,
+                                    struct container_context *cntrs)
+{
+       snd_pcm_sframes_t avail;
+       unsigned int avail_count;
+       int err;
+
+       if (status == SND_PCM_STATE_RUNNING) {
+               // Check available space on the buffer.
+               avail = snd_pcm_avail(state->handle);
+               if (avail < 0) {
+                       err = avail;
+                       goto error;
+               }
+               avail_count = (unsigned int)avail;
+
+               if (avail_count == 0) {
+                       // Fill with data frames so that blocking is just
+                       // released.
+                       snd_pcm_uframes_t avail_min;
+                       err = snd_pcm_sw_params_get_avail_min(state->sw_params,
+                                                             &avail_min);
+                       if (err < 0)
+                               goto error;
+                       avail_count = (unsigned int)avail_min;
+               }
+       } else {
+               snd_pcm_uframes_t frames_for_start_threshold;
+               snd_pcm_uframes_t frames_per_period;
+
+               // Fill with data frames so that the PCM substream starts.
+               err = snd_pcm_sw_params_get_start_threshold(state->sw_params,
+                                               &frames_for_start_threshold);
+               if (err < 0)
+                       goto error;
+
+               // But the above number can be too small and cause XRUN because
+               // I/O operation is done per period.
+               err = snd_pcm_hw_params_get_period_size(state->hw_params,
+                                               &frames_per_period, NULL);
+               if (err < 0)
+                       goto error;
+
+               // Use larger one to prevent from both of XRUN and successive
+               // blocking.
+               if (frames_for_start_threshold > frames_per_period)
+                       avail_count = (unsigned int)frames_for_start_threshold;
+               else
+                       avail_count = (unsigned int)frames_per_period;
+       }
+
+       err = write_frames(state, frame_count, avail_count, mapper, cntrs);
+       if (err < 0)
+               goto error;
+
+       return 0;
+error:
+       *frame_count = 0;
+       return err;
+}
+
+static int w_process_frames_nonblocking(struct libasound_state *state,
+                                       snd_pcm_state_t pcm_state ATTRIBUTE_UNUSED,
+                                       unsigned int *frame_count,
+                                       struct mapper_context *mapper,
+                                       struct container_context *cntrs)
+{
+       snd_pcm_sframes_t avail;
+       unsigned int avail_count;
+       int err;
+
+       if (state->use_waiter) {
+               err = wait_for_avail(state);
+               if (err < 0)
+                       goto error;
+       }
+
+       // Check available space on the buffer.
+       avail = snd_pcm_avail(state->handle);
+       if (avail < 0) {
+               err = avail;
+               goto error;
+       }
+       avail_count = (unsigned int)avail;
+
+       if (avail_count == 0) {
+               // Let's go to a next iteration.
+               err = 0;
+               goto error;
+       }
+
+       err = write_frames(state, frame_count, avail_count, mapper, cntrs);
+       if (err < 0)
+               goto error;
+
+       // NOTE: The substream starts automatically when the accumulated number
+       // of queued data frame exceeds start_threshold.
+
+       return 0;
+error:
+       *frame_count = 0;
+       return err;
+}
+
+static int irq_rw_pre_process(struct libasound_state *state)
+{
+       struct rw_closure *closure = state->private_data;
+       snd_pcm_format_t format;
+       snd_pcm_uframes_t frames_per_buffer;
+       int bytes_per_sample;
+       unsigned int samples_per_frame;
+       int err;
+
+       err = snd_pcm_hw_params_get_format(state->hw_params, &format);
+       if (err < 0)
+               return err;
+       bytes_per_sample = snd_pcm_format_physical_width(format) / 8;
+       if (bytes_per_sample <= 0)
+               return -ENXIO;
+
+       err = snd_pcm_hw_params_get_channels(state->hw_params,
+                                            &samples_per_frame);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_buffer_size(state->hw_params,
+                                               &frames_per_buffer);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_access(state->hw_params, &closure->access);
+       if (err < 0)
+               return err;
+
+       err = frame_cache_init(&closure->cache, closure->access,
+                              bytes_per_sample, samples_per_frame,
+                              frames_per_buffer);
+       if (err < 0)
+               return err;
+
+       if (snd_pcm_stream(state->handle) == SND_PCM_STREAM_CAPTURE) {
+               if (state->nonblock)
+                       closure->process_frames = r_process_frames_nonblocking;
+               else
+                       closure->process_frames = r_process_frames_blocking;
+       } else {
+               if (state->nonblock)
+                       closure->process_frames = w_process_frames_nonblocking;
+               else
+                       closure->process_frames = w_process_frames_blocking;
+       }
+
+       return 0;
+}
+
+static int irq_rw_process_frames(struct libasound_state *state,
+                               unsigned int *frame_count,
+                               struct mapper_context *mapper,
+                               struct container_context *cntrs)
+{
+       struct rw_closure *closure = state->private_data;
+       snd_pcm_state_t status;
+
+       // Need to recover the stream.
+       status = snd_pcm_state(state->handle);
+       if (status != SND_PCM_STATE_RUNNING && status != SND_PCM_STATE_PREPARED)
+               return -EPIPE;
+
+       // NOTE: Actually, status can be shift always.
+       return closure->process_frames(state, status, frame_count, mapper, cntrs);
+}
+
+static void irq_rw_post_process(struct libasound_state *state)
+{
+       struct rw_closure *closure = state->private_data;
+
+       frame_cache_destroy(&closure->cache);
+}
+
+const struct xfer_libasound_ops xfer_libasound_irq_rw_ops = {
+       .pre_process    = irq_rw_pre_process,
+       .process_frames = irq_rw_process_frames,
+       .post_process   = irq_rw_post_process,
+       .private_size   = sizeof(struct rw_closure),
+};
diff --git a/axfer/xfer-libasound-timer-mmap.c b/axfer/xfer-libasound-timer-mmap.c
new file mode 100644 (file)
index 0000000..cbe5c97
--- /dev/null
@@ -0,0 +1,456 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// xfer-libasound-irq-mmap.c - Timer-based scheduling model for mmap operation.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "xfer-libasound.h"
+#include "misc.h"
+
+struct map_layout {
+       snd_pcm_status_t *status;
+       bool need_forward_or_rewind;
+       char **vector;
+
+       unsigned int frames_per_second;
+       unsigned int samples_per_frame;
+       unsigned int frames_per_buffer;
+};
+
+static int timer_mmap_pre_process(struct libasound_state *state)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_access_t access;
+       snd_pcm_uframes_t frame_offset;
+       snd_pcm_uframes_t avail = 0;
+       snd_pcm_uframes_t frames_per_buffer;
+       int i;
+       int err;
+
+       // This parameter, 'period event', is a software feature in alsa-lib.
+       // This switch a handler in 'hw' PCM plugin from irq-based one to
+       // timer-based one. This handler has two file descriptors for
+       // ALSA PCM character device and ALSA timer device. The latter is used
+       // to catch suspend/resume events as wakeup event.
+       err = snd_pcm_sw_params_set_period_event(state->handle,
+                                                state->sw_params, 1);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_status_malloc(&layout->status);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_access(state->hw_params, &access);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_channels(state->hw_params,
+                                            &layout->samples_per_frame);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_rate(state->hw_params,
+                                        &layout->frames_per_second, NULL);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_buffer_size(state->hw_params,
+                                               &frames_per_buffer);
+       if (err < 0)
+               return err;
+       layout->frames_per_buffer = (unsigned int)frames_per_buffer;
+
+       if (access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED) {
+               layout->vector = calloc(layout->samples_per_frame,
+                                       sizeof(*layout->vector));
+               if (layout->vector == NULL)
+                       return err;
+       }
+
+       if (state->verbose) {
+               const snd_pcm_channel_area_t *areas;
+               err = snd_pcm_mmap_begin(state->handle, &areas, &frame_offset,
+                                        &avail);
+               if (err < 0)
+                       return err;
+
+               logging(state, "attributes for mapped page frame:\n");
+               for (i = 0; i < (int)layout->samples_per_frame; ++i) {
+                       const snd_pcm_channel_area_t *area = areas + i;
+
+                       logging(state, "  sample number: %d\n", i);
+                       logging(state, "    address: %p\n", area->addr);
+                       logging(state, "    bits for offset: %u\n", area->first);
+                       logging(state, "    bits/frame: %u\n", area->step);
+               }
+       }
+
+       return 0;
+}
+
+static void *get_buffer(struct libasound_state *state,
+                       const snd_pcm_channel_area_t *areas,
+                       snd_pcm_uframes_t frame_offset)
+{
+       struct map_layout *layout = state->private_data;
+       void *frame_buf;
+
+       if (layout->vector == NULL) {
+               char *buf;
+               buf = areas[0].addr;
+               buf += snd_pcm_frames_to_bytes(state->handle, frame_offset);
+               frame_buf = buf;
+       } else {
+               int i;
+               for (i = 0; i < (int)layout->samples_per_frame; ++i) {
+                       layout->vector[i] = areas[i].addr;
+                       layout->vector[i] += snd_pcm_samples_to_bytes(
+                                               state->handle, frame_offset);
+               }
+               frame_buf = layout->vector;
+       }
+
+       return frame_buf;
+}
+
+static int timer_mmap_process_frames(struct libasound_state *state,
+                                    unsigned int *frame_count,
+                                    struct mapper_context *mapper,
+                                    struct container_context *cntrs)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_uframes_t planned_count;
+       snd_pcm_sframes_t avail;
+       snd_pcm_uframes_t avail_count;
+       const snd_pcm_channel_area_t *areas;
+       snd_pcm_uframes_t frame_offset;
+       void *frame_buf;
+       snd_pcm_sframes_t consumed_count;
+       int err;
+
+       // Retrieve avail space on PCM buffer between kernel/user spaces.
+       // On cache incoherent architectures, still care of data
+       // synchronization.
+       avail = snd_pcm_avail_update(state->handle);
+       if (avail < 0)
+               return (int)avail;
+
+       // Retrieve pointers of the buffer and left space up to the boundary.
+       avail_count = (snd_pcm_uframes_t)avail;
+       err = snd_pcm_mmap_begin(state->handle, &areas, &frame_offset,
+                                &avail_count);
+       if (err < 0)
+               return err;
+
+       // MEMO: Use the amount of data frames as you like.
+       planned_count = layout->frames_per_buffer * random() / RAND_MAX;
+       if (frame_offset + planned_count > layout->frames_per_buffer)
+               planned_count = layout->frames_per_buffer - frame_offset;
+
+       // Trim up to expected frame count.
+       if (*frame_count < planned_count)
+               planned_count = *frame_count;
+
+       // Yield this CPU till planned amount of frames become available.
+       if (avail_count < planned_count) {
+               unsigned short revents;
+               int timeout_msec;
+
+               // TODO; precise granularity of timeout; e.g. ppoll(2).
+               // Furthermore, wrap up according to granularity of reported
+               // value for hw_ptr.
+               timeout_msec = ((planned_count - avail_count) * 1000 +
+                               layout->frames_per_second - 1) /
+                              layout->frames_per_second;
+
+               // TODO: However, experimentally, the above is not enough to
+               // keep planned amount of frames when waking up. I don't know
+               // exactly the mechanism yet.
+               err = xfer_libasound_wait_event(state, timeout_msec,
+                                               &revents);
+               // MEMO: timeout is expected since the above call is just to measure time elapse.
+               if (err < 0 && err != -ETIMEDOUT)
+                       return err;
+               if (revents & POLLERR) {
+                       // TODO: error reporting.
+                       return -EIO;
+               }
+               if (!(revents & (POLLIN | POLLOUT)))
+                       return -EAGAIN;
+
+               // MEMO: Need to perform hwsync explicitly because hwptr is not
+               // synchronized to actual position of data frame transmission
+               // on hardware because IRQ handlers are not used in this
+               // scheduling strategy.
+               avail = snd_pcm_avail(state->handle);
+               if (avail < 0)
+                       return (int)avail;
+               if (avail < (snd_pcm_sframes_t)planned_count) {
+                       logging(state,
+                               "Wake up but not enough space: %lu %lu %u\n",
+                               planned_count, avail, timeout_msec);
+                       planned_count = avail;
+               }
+       }
+
+       // Let's process data frames.
+       *frame_count = planned_count;
+       frame_buf = get_buffer(state, areas, frame_offset);
+       err = mapper_context_process_frames(mapper, frame_buf, frame_count,
+                                           cntrs);
+       if (err < 0)
+               return err;
+
+       consumed_count = snd_pcm_mmap_commit(state->handle, frame_offset,
+                                            *frame_count);
+       if (consumed_count != *frame_count) {
+               logging(state,
+                       "A bug of 'hw' PCM plugin or driver for this PCM "
+                       "node.\n");
+       }
+       *frame_count = consumed_count;
+
+       return 0;
+}
+
+static int forward_appl_ptr(struct libasound_state *state)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_uframes_t forwardable_count;
+       snd_pcm_sframes_t forward_count;
+
+       forward_count = snd_pcm_forwardable(state->handle);
+       if (forward_count < 0)
+               return (int)forward_count;
+       forwardable_count = forward_count;
+
+       // No need to add safe-gurard because hwptr goes ahead.
+       forward_count = snd_pcm_forward(state->handle, forwardable_count);
+       if (forward_count < 0)
+               return (int)forward_count;
+
+       if (state->verbose) {
+               logging(state,
+                       "  forwarded: %lu/%u\n",
+                       forward_count, layout->frames_per_buffer);
+       }
+
+       return 0;
+}
+
+static int timer_mmap_r_process_frames(struct libasound_state *state,
+                                      unsigned *frame_count,
+                                      struct mapper_context *mapper,
+                                      struct container_context *cntrs)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_state_t s;
+       int err;
+
+       // SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP suppresses any IRQ to notify
+       // period elapse for data transmission, therefore no need to care of
+       // concurrent access by IRQ context and process context, unlike
+       // IRQ-based operations.
+       // Here, this is just to query current status to hardware, for later
+       // processing.
+       err = snd_pcm_status(state->handle, layout->status);
+       if (err < 0)
+               goto error;
+       s = snd_pcm_status_get_state(layout->status);
+
+       // TODO: if reporting something, do here with the status data.
+
+       if (s == SND_PCM_STATE_RUNNING) {
+               // Reduce delay between sampling on hardware and handling by
+               // this program.
+               if (layout->need_forward_or_rewind) {
+                       err = forward_appl_ptr(state);
+                       if (err < 0)
+                               goto error;
+                       layout->need_forward_or_rewind = false;
+               }
+
+               err = timer_mmap_process_frames(state, frame_count, mapper,
+                                               cntrs);
+               if (err < 0)
+                       goto error;
+       } else {
+               if (s == SND_PCM_STATE_PREPARED) {
+                       // For capture direction, need to start stream
+                       // explicitly.
+                       err = snd_pcm_start(state->handle);
+                       if (err < 0)
+                               goto error;
+                       layout->need_forward_or_rewind = true;
+                       // Not yet.
+                       *frame_count = 0;
+               } else {
+                       err = -EPIPE;
+                       goto error;
+               }
+       }
+
+       return 0;
+error:
+       *frame_count = 0;
+       return err;
+}
+
+static int rewind_appl_ptr(struct libasound_state *state)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_uframes_t rewindable_count;
+       snd_pcm_sframes_t rewind_count;
+
+       rewind_count = snd_pcm_rewindable(state->handle);
+       if (rewind_count < 0)
+               return (int)rewind_count;
+       rewindable_count = rewind_count;
+
+       // If appl_ptr were rewound just to position of hw_ptr, at next time,
+       // hw_ptr could catch up appl_ptr. This is overrun. We need a space
+       // between these two pointers to prevent this XRUN.
+       // This space is largely affected by time to process data frames later.
+       //
+       // TODO: a generous way to estimate a good value.
+       if (rewindable_count < 32)
+               return 0;
+       rewindable_count -= 32;
+
+       rewind_count = snd_pcm_rewind(state->handle, rewindable_count);
+       if (rewind_count < 0)
+               return (int)rewind_count;
+
+       if (state->verbose) {
+               logging(state,
+                       "  rewound: %lu/%u\n",
+                       rewind_count, layout->frames_per_buffer);
+       }
+
+       return 0;
+}
+
+static int fill_buffer_with_zero_samples(struct libasound_state *state)
+{
+       struct map_layout *layout = state->private_data;
+       const snd_pcm_channel_area_t *areas;
+       snd_pcm_uframes_t frame_offset;
+       snd_pcm_uframes_t avail_count;
+       snd_pcm_format_t sample_format;
+       snd_pcm_uframes_t consumed_count;
+       int err;
+
+       err = snd_pcm_hw_params_get_buffer_size(state->hw_params,
+                                               &avail_count);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_mmap_begin(state->handle, &areas, &frame_offset,
+                                &avail_count);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_format(state->hw_params, &sample_format);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_areas_silence(areas, frame_offset,
+                                   layout->samples_per_frame, avail_count,
+                                   sample_format);
+       if (err < 0)
+               return err;
+
+       consumed_count = snd_pcm_mmap_commit(state->handle, frame_offset,
+                                            avail_count);
+       if (consumed_count != avail_count)
+               logging(state, "A bug of access plugin for this PCM node.\n");
+
+       return 0;
+}
+
+static int timer_mmap_w_process_frames(struct libasound_state *state,
+                                      unsigned *frame_count,
+                                      struct mapper_context *mapper,
+                                      struct container_context *cntrs)
+{
+       struct map_layout *layout = state->private_data;
+       snd_pcm_state_t s;
+       int err;
+
+       // Read my comment in 'timer_mmap_w_process_frames()'.
+       err = snd_pcm_status(state->handle, layout->status);
+       if (err < 0)
+               goto error;
+       s = snd_pcm_status_get_state(layout->status);
+
+       // TODO: if reporting something, do here with the status data.
+
+       if (s == SND_PCM_STATE_RUNNING) {
+               // Reduce delay between queueing by this program and presenting
+               // on hardware.
+               if (layout->need_forward_or_rewind) {
+                       err = rewind_appl_ptr(state);
+                       if (err < 0)
+                               goto error;
+                       layout->need_forward_or_rewind = false;
+               }
+
+               err = timer_mmap_process_frames(state, frame_count, mapper,
+                                               cntrs);
+               if (err < 0)
+                       goto error;
+       } else {
+               // Need to start playback stream explicitly
+               if (s == SND_PCM_STATE_PREPARED) {
+                       err = fill_buffer_with_zero_samples(state);
+                       if (err < 0)
+                               goto error;
+
+                       err = snd_pcm_start(state->handle);
+                       if (err < 0)
+                               goto error;
+
+                       layout->need_forward_or_rewind = true;
+                       // Not yet.
+                       *frame_count = 0;
+               } else {
+                       err = -EPIPE;
+                       goto error;
+               }
+       }
+
+       return 0;
+error:
+       *frame_count = 0;
+       return err;
+}
+
+static void timer_mmap_post_process(struct libasound_state *state)
+{
+       struct map_layout *layout = state->private_data;
+
+       if (layout->status)
+               snd_pcm_status_free(layout->status);
+       layout->status = NULL;
+
+       if (layout->vector)
+               free(layout->vector);
+       layout->vector = NULL;
+}
+
+const struct xfer_libasound_ops xfer_libasound_timer_mmap_w_ops = {
+       .pre_process    = timer_mmap_pre_process,
+       .process_frames = timer_mmap_w_process_frames,
+       .post_process   = timer_mmap_post_process,
+       .private_size   = sizeof(struct map_layout),
+};
+
+const struct xfer_libasound_ops xfer_libasound_timer_mmap_r_ops = {
+       .pre_process    = timer_mmap_pre_process,
+       .process_frames = timer_mmap_r_process_frames,
+       .post_process   = timer_mmap_post_process,
+       .private_size   = sizeof(struct map_layout),
+};
diff --git a/axfer/xfer-libasound.c b/axfer/xfer-libasound.c
new file mode 100644 (file)
index 0000000..36ee08d
--- /dev/null
@@ -0,0 +1,934 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// xfer-libasound.c - receive/transmit frames by alsa-lib.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "xfer-libasound.h"
+#include "misc.h"
+
+static const char *const sched_model_labels [] = {
+       [SCHED_MODEL_IRQ] = "irq",
+       [SCHED_MODEL_TIMER] = "timer",
+};
+
+enum no_short_opts {
+        // 200 or later belong to non us-ascii character set.
+       OPT_PERIOD_SIZE = 200,
+       OPT_BUFFER_SIZE,
+       OPT_WAITER_TYPE,
+       OPT_SCHED_MODEL,
+       OPT_DISABLE_RESAMPLE,
+       OPT_DISABLE_CHANNELS,
+       OPT_DISABLE_FORMAT,
+       OPT_DISABLE_SOFTVOL,
+       OPT_FATAL_ERRORS,
+       OPT_TEST_NOWAIT,
+       // Obsoleted.
+       OPT_TEST_POSITION,
+       OPT_TEST_COEF,
+};
+
+#define S_OPTS "D:NMF:B:A:R:T:m:"
+static const struct option l_opts[] = {
+       {"device",              1, 0, 'D'},
+       {"nonblock",            0, 0, 'N'},
+       {"mmap",                0, 0, 'M'},
+       {"period-time",         1, 0, 'F'},
+       {"buffer-time",         1, 0, 'B'},
+       {"period-size",         1, 0, OPT_PERIOD_SIZE},
+       {"buffer-size",         1, 0, OPT_BUFFER_SIZE},
+       {"avail-min",           1, 0, 'A'},
+       {"start-delay",         1, 0, 'R'},
+       {"stop-delay",          1, 0, 'T'},
+       {"waiter-type",         1, 0, OPT_WAITER_TYPE},
+       {"sched-model",         1, 0, OPT_SCHED_MODEL},
+       // For plugins in alsa-lib.
+       {"disable-resample",    0, 0, OPT_DISABLE_RESAMPLE},
+       {"disable-channels",    0, 0, OPT_DISABLE_CHANNELS},
+       {"disable-format",      0, 0, OPT_DISABLE_FORMAT},
+       {"disable-softvol",     0, 0, OPT_DISABLE_SOFTVOL},
+       // For debugging.
+       {"fatal-errors",        0, 0, OPT_FATAL_ERRORS},
+       {"test-nowait",         0, 0, OPT_TEST_NOWAIT},
+       // Obsoleted.
+       {"chmap",               1, 0, 'm'},
+       {"test-position",       0, 0, OPT_TEST_POSITION},
+       {"test-coef",           1, 0, OPT_TEST_COEF},
+};
+
+static int xfer_libasound_init(struct xfer_context *xfer,
+                              snd_pcm_stream_t stream ATTRIBUTE_UNUSED)
+{
+       struct libasound_state *state = xfer->private_data;
+       int err;
+
+       err = snd_output_stdio_attach(&state->log, stderr, 0);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_malloc(&state->hw_params);
+       if (err < 0)
+               return err;
+
+       return snd_pcm_sw_params_malloc(&state->sw_params);
+}
+
+static int xfer_libasound_parse_opt(struct xfer_context *xfer, int key,
+                                   const char *optarg)
+{
+       struct libasound_state *state = xfer->private_data;
+       int err = 0;
+
+       if (key == 'D')
+               state->node_literal = arg_duplicate_string(optarg, &err);
+       else if (key == 'N')
+               state->nonblock = true;
+       else if (key == 'M')
+               state->mmap = true;
+       else if (key == 'F')
+               state->msec_per_period = arg_parse_decimal_num(optarg, &err);
+       else if (key == 'B')
+               state->msec_per_buffer = arg_parse_decimal_num(optarg, &err);
+       else if (key == OPT_PERIOD_SIZE)
+               state->frames_per_period = arg_parse_decimal_num(optarg, &err);
+       else if (key == OPT_BUFFER_SIZE)
+               state->frames_per_buffer = arg_parse_decimal_num(optarg, &err);
+       else if (key == 'A')
+               state->msec_for_avail_min = arg_parse_decimal_num(optarg, &err);
+       else if (key == 'R')
+               state->msec_for_start_threshold = arg_parse_decimal_num(optarg, &err);
+       else if (key == 'T')
+               state->msec_for_stop_threshold = arg_parse_decimal_num(optarg, &err);
+       else if (key == OPT_WAITER_TYPE)
+               state->waiter_type_literal = arg_duplicate_string(optarg, &err);
+       else if (key == OPT_SCHED_MODEL)
+               state->sched_model_literal = arg_duplicate_string(optarg, &err);
+       else if (key == OPT_DISABLE_RESAMPLE)
+               state->no_auto_resample = true;
+       else if (key == OPT_DISABLE_CHANNELS)
+               state->no_auto_channels = true;
+       else if (key == OPT_DISABLE_FORMAT)
+               state->no_auto_format = true;
+       else if (key == OPT_DISABLE_SOFTVOL)
+               state->no_softvol = true;
+       else if (key == 'm' ||
+                key == OPT_TEST_POSITION ||
+                key == OPT_TEST_COEF)
+               err = -EINVAL;
+       else if (key == OPT_FATAL_ERRORS)
+               state->finish_at_xrun = true;
+       else if (key == OPT_TEST_NOWAIT)
+               state->test_nowait = true;
+       else
+               err = -ENXIO;
+
+       return err;
+}
+
+int xfer_libasound_validate_opts(struct xfer_context *xfer)
+{
+       struct libasound_state *state = xfer->private_data;
+       int err = 0;
+
+       state->verbose = xfer->verbose > 1;
+
+       if (state->node_literal == NULL) {
+               state->node_literal = strdup("default");
+               if (state->node_literal == NULL)
+                       return -ENOMEM;
+       }
+
+       if (state->mmap && state->nonblock) {
+               fprintf(stderr,
+                       "An option for mmap operation should not be used with "
+                       "nonblocking option.\n");
+               return -EINVAL;
+       }
+
+       if (state->test_nowait) {
+               if (!state->nonblock && !state->mmap) {
+                       fprintf(stderr,
+                               "An option for nowait test should be used with "
+                               "nonblock or mmap options.\n");
+                       return -EINVAL;
+               }
+       }
+
+       if (state->msec_per_period > 0 && state->msec_per_buffer > 0) {
+               if (state->msec_per_period > state->msec_per_buffer) {
+                       state->msec_per_period = state->msec_per_buffer;
+                       state->msec_per_buffer = 0;
+               }
+       }
+
+       if (state->frames_per_period > 0 && state->frames_per_buffer > 0) {
+               if (state->frames_per_period > state->frames_per_buffer) {
+                       state->frames_per_period = state->frames_per_buffer;
+                       state->frames_per_buffer = 0;
+               }
+       }
+
+       state->sched_model = SCHED_MODEL_IRQ;
+       if (state->sched_model_literal != NULL) {
+               if (!strcmp(state->sched_model_literal, "timer")) {
+                       state->sched_model = SCHED_MODEL_TIMER;
+                       state->mmap = true;
+                       state->nonblock = true;
+               }
+       }
+
+       if (state->waiter_type_literal != NULL) {
+               if (state->test_nowait) {
+                       fprintf(stderr,
+                               "An option for waiter type should not be "
+                               "used with nowait test option.\n");
+                       return -EINVAL;
+               }
+               if (!state->nonblock && !state->mmap) {
+                       fprintf(stderr,
+                               "An option for waiter type should be used "
+                               "with nonblock or mmap or timer-based "
+                               "scheduling options.\n");
+                       return -EINVAL;
+               }
+               state->waiter_type =
+                       waiter_type_from_label(state->waiter_type_literal);
+       } else {
+               state->waiter_type = WAITER_TYPE_DEFAULT;
+       }
+
+       return err;
+}
+
+static int set_access_hw_param(struct libasound_state *state)
+{
+       snd_pcm_access_mask_t *mask;
+       int err;
+
+       err = snd_pcm_access_mask_malloc(&mask);
+       if (err < 0)
+               return err;
+       snd_pcm_access_mask_none(mask);
+       if (state->mmap) {
+               snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_INTERLEAVED);
+               snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_NONINTERLEAVED);
+       } else {
+               snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_RW_INTERLEAVED);
+               snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_RW_NONINTERLEAVED);
+       }
+       err = snd_pcm_hw_params_set_access_mask(state->handle, state->hw_params,
+                                               mask);
+       snd_pcm_access_mask_free(mask);
+
+       return err;
+}
+
+static int disable_period_wakeup(struct libasound_state *state)
+{
+       int err;
+
+       if (snd_pcm_type(state->handle) != SND_PCM_TYPE_HW) {
+               logging(state,
+                       "Timer-based scheduling is only available for 'hw' "
+                       "PCM plugin.\n");
+               return -ENXIO;
+       }
+
+       if (!snd_pcm_hw_params_can_disable_period_wakeup(state->hw_params)) {
+               logging(state,
+                       "This hardware doesn't support the mode of no-period-"
+                       "wakeup. In this case, timer-based scheduling is not "
+                       "available.\n");
+               return -EIO;
+       }
+
+       err = snd_pcm_hw_params_set_period_wakeup(state->handle,
+                                                 state->hw_params, 0);
+       if (err < 0) {
+               logging(state,
+                       "Fail to disable period wakeup so that the hardware "
+                       "generates no IRQs during transmission of data "
+                       "frames.\n");
+       }
+
+       return err;
+}
+
+static int open_handle(struct xfer_context *xfer)
+{
+       struct libasound_state *state = xfer->private_data;
+       int mode = 0;
+       int err;
+
+       if (state->nonblock)
+               mode |= SND_PCM_NONBLOCK;
+       if (state->no_auto_resample)
+               mode |= SND_PCM_NO_AUTO_RESAMPLE;
+       if (state->no_auto_channels)
+               mode |= SND_PCM_NO_AUTO_CHANNELS;
+       if (state->no_auto_format)
+               mode |= SND_PCM_NO_AUTO_FORMAT;
+       if (state->no_softvol)
+               mode |= SND_PCM_NO_SOFTVOL;
+
+       err = snd_pcm_open(&state->handle, state->node_literal, xfer->direction,
+                          mode);
+       if (err < 0) {
+               logging(state, "Fail to open libasound PCM node for %s: %s\n",
+                       snd_pcm_stream_name(xfer->direction),
+                       state->node_literal);
+               return err;
+       }
+
+       if ((state->nonblock || state->mmap) && !state->test_nowait)
+               state->use_waiter = true;
+
+       err = snd_pcm_hw_params_any(state->handle, state->hw_params);
+       if (err < 0)
+               return err;
+
+       if (state->sched_model == SCHED_MODEL_TIMER) {
+               err = disable_period_wakeup(state);
+               if (err < 0)
+                       return err;
+       }
+
+       if (xfer->dump_hw_params) {
+               logging(state, "Available HW Params of node: %s\n",
+                       snd_pcm_name(state->handle));
+               snd_pcm_hw_params_dump(state->hw_params, state->log);
+               // TODO: there're more parameters which are not dumped by
+               // alsa-lib.
+               return 0;
+       }
+
+       return set_access_hw_param(state);
+}
+
+static int prepare_waiter(struct libasound_state *state)
+{
+       unsigned int pfd_count;
+       int err;
+
+       // Nothing to do for dafault waiter (=snd_pcm_wait()).
+       if (state->waiter_type == WAITER_TYPE_DEFAULT)
+               return 0;
+
+       err = snd_pcm_poll_descriptors_count(state->handle);
+       if (err < 0)
+               return err;
+       if (err == 0)
+               return -ENXIO;
+       pfd_count = (unsigned int)err;
+
+       state->waiter = malloc(sizeof(*state->waiter));
+       if (state->waiter == NULL)
+               return -ENOMEM;
+
+       err = waiter_context_init(state->waiter, state->waiter_type, pfd_count);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_poll_descriptors(state->handle, state->waiter->pfds,
+                                      pfd_count);
+       if (err < 0)
+               return err;
+
+       return waiter_context_prepare(state->waiter);
+}
+
+int xfer_libasound_wait_event(struct libasound_state *state, int timeout_msec,
+                             unsigned short *revents)
+{
+       int count;
+
+       if (state->waiter_type != WAITER_TYPE_DEFAULT) {
+               struct waiter_context *waiter = state->waiter;
+               int err;
+
+               count = waiter_context_wait_event(waiter, timeout_msec);
+               if (count < 0)
+                       return count;
+               if (count == 0 && timeout_msec > 0)
+                       return -ETIMEDOUT;
+
+               err = snd_pcm_poll_descriptors_revents(state->handle,
+                               waiter->pfds, waiter->pfd_count, revents);
+               if (err < 0)
+                       return err;
+       } else {
+               count = snd_pcm_wait(state->handle, timeout_msec);
+               if (count < 0)
+                       return count;
+               if (count == 0 && timeout_msec > 0)
+                       return -ETIMEDOUT;
+
+               if (snd_pcm_stream(state->handle) == SND_PCM_STREAM_PLAYBACK)
+                       *revents = POLLOUT;
+               else
+                       *revents = POLLIN;
+       }
+
+       return 0;
+}
+
+static int configure_hw_params(struct libasound_state *state,
+                              snd_pcm_format_t format,
+                              unsigned int samples_per_frame,
+                              unsigned int frames_per_second,
+                              unsigned int msec_per_period,
+                              unsigned int msec_per_buffer,
+                              snd_pcm_uframes_t frames_per_period,
+                              snd_pcm_uframes_t frames_per_buffer)
+{
+       int err;
+
+       // Configure sample format.
+       if (format == SND_PCM_FORMAT_UNKNOWN) {
+               snd_pcm_format_mask_t *mask;
+
+               err = snd_pcm_format_mask_malloc(&mask);
+               if (err < 0)
+                       return err;
+               snd_pcm_hw_params_get_format_mask(state->hw_params, mask);
+               for (format = 0; format <= SND_PCM_FORMAT_LAST; ++format) {
+                       if (snd_pcm_format_mask_test(mask, format))
+                               break;
+               }
+               snd_pcm_format_mask_free(mask);
+               if (format > SND_PCM_FORMAT_LAST) {
+                       logging(state,
+                               "Any sample format is not available.\n");
+                       return -EINVAL;
+               }
+       }
+       err = snd_pcm_hw_params_set_format(state->handle, state->hw_params,
+                                          format);
+       if (err < 0) {
+               logging(state,
+                       "Sample format '%s' is not available: %s\n",
+                       snd_pcm_format_name(format), snd_strerror(err));
+               return err;
+       }
+
+       // Configure channels.
+       if (samples_per_frame == 0) {
+               err = snd_pcm_hw_params_get_channels_min(state->hw_params,
+                                                        &samples_per_frame);
+               if (err < 0) {
+                       logging(state,
+                               "Any channel number is not available.\n");
+                       return err;
+               }
+       }
+       err = snd_pcm_hw_params_set_channels(state->handle, state->hw_params,
+                                            samples_per_frame);
+       if (err < 0) {
+               logging(state,
+                       "Channels count '%u' is not available: %s\n",
+                       samples_per_frame, snd_strerror(err));
+               return err;
+       }
+
+       // Configure rate.
+       if (frames_per_second == 0) {
+               err = snd_pcm_hw_params_get_rate_min(state->hw_params,
+                                                    &frames_per_second, NULL);
+               if (err < 0) {
+                       logging(state,
+                               "Any rate is not available.\n");
+                       return err;
+               }
+
+       }
+       err = snd_pcm_hw_params_set_rate(state->handle, state->hw_params,
+                                        frames_per_second, 0);
+       if (err < 0) {
+               logging(state,
+                       "Sampling rate '%u' is not available: %s\n",
+                       frames_per_second, snd_strerror(err));
+               return err;
+       }
+
+       // Keep one of 'frames_per_buffer' and 'msec_per_buffer'.
+       if (frames_per_buffer == 0) {
+               if (msec_per_buffer == 0) {
+                       err = snd_pcm_hw_params_get_buffer_time_max(
+                               state->hw_params, &msec_per_buffer, NULL);
+                       if (err < 0) {
+                               logging(state,
+                                       "The maximum msec per buffer is not "
+                                       "available.\n");
+                               return err;
+                       }
+                       if (msec_per_buffer > 500000)
+                               msec_per_buffer = 500000;
+               }
+       } else if (msec_per_buffer > 0) {
+               uint64_t msec;
+
+               msec = 1000000 * frames_per_buffer / frames_per_second;
+               if (msec < msec_per_buffer)
+                       msec_per_buffer = 0;
+       }
+
+       // Keep one of 'frames_per_period' and 'msec_per_period'.
+       if (frames_per_period == 0) {
+               if (msec_per_period == 0) {
+                       if (msec_per_buffer > 0)
+                               msec_per_period = msec_per_buffer / 4;
+                       else
+                               frames_per_period = frames_per_buffer / 4;
+               }
+       } else if (msec_per_period > 0) {
+               uint64_t msec;
+
+               msec = 1000000 * frames_per_period / frames_per_second;
+               if (msec < msec_per_period)
+                       msec_per_period = 0;
+       }
+
+       if (msec_per_period) {
+               err = snd_pcm_hw_params_set_period_time_near(state->handle,
+                               state->hw_params, &msec_per_period, NULL);
+               if (err < 0) {
+                       logging(state,
+                               "Fail to configure period time: %u msec\n",
+                               msec_per_period);
+                       return err;
+               }
+       } else {
+               err = snd_pcm_hw_params_set_period_size_near(state->handle,
+                               state->hw_params, &frames_per_period, NULL);
+               if (err < 0) {
+                       logging(state,
+                               "Fail to configure period size: %lu frames\n",
+                               frames_per_period);
+                       return err;
+               }
+       }
+
+       if (msec_per_buffer) {
+               err = snd_pcm_hw_params_set_buffer_time_near(state->handle,
+                               state->hw_params, &msec_per_buffer, NULL);
+               if (err < 0) {
+                       logging(state,
+                               "Fail to configure buffer time: %u msec\n",
+                               msec_per_buffer);
+                       return err;
+               }
+       } else {
+               err = snd_pcm_hw_params_set_buffer_size_near(state->handle,
+                                       state->hw_params, &frames_per_buffer);
+               if (err < 0) {
+                       logging(state,
+                               "Fail to configure buffer size: %lu frames\n",
+                               frames_per_buffer);
+                       return err;
+               }
+       }
+
+       return snd_pcm_hw_params(state->handle, state->hw_params);
+}
+
+static int retrieve_actual_hw_params(snd_pcm_hw_params_t *hw_params,
+                                    snd_pcm_format_t *format,
+                                    unsigned int *samples_per_frame,
+                                    unsigned int *frames_per_second,
+                                    snd_pcm_access_t *access,
+                                    snd_pcm_uframes_t *frames_per_buffer)
+{
+       int err;
+
+       err = snd_pcm_hw_params_get_format(hw_params, format);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_channels(hw_params,
+                                            samples_per_frame);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_rate(hw_params, frames_per_second,
+                                        NULL);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_params_get_access(hw_params, access);
+       if (err < 0)
+               return err;
+
+       return snd_pcm_hw_params_get_buffer_size(hw_params, frames_per_buffer);
+}
+
+static int configure_sw_params(struct libasound_state *state,
+                              unsigned int frames_per_second,
+                              unsigned int frames_per_buffer,
+                              unsigned int msec_for_avail_min,
+                              unsigned int msec_for_start_threshold,
+                              unsigned int msec_for_stop_threshold)
+{
+       snd_pcm_uframes_t frame_count;
+       int err;
+
+       if (msec_for_avail_min > 0) {
+               frame_count = msec_for_avail_min * frames_per_second / 1000000;
+               if (frame_count == 0 || frame_count > frames_per_buffer) {
+                       logging(state,
+                               "The msec for 'avail_min' is too %s: %u "
+                               "msec (%lu frames at %u).\n",
+                               frame_count == 0 ? "small" : "large",
+                               msec_for_avail_min, frame_count,
+                               frames_per_second);
+                       return -EINVAL;
+               }
+               err = snd_pcm_sw_params_set_avail_min(state->handle,
+                                               state->sw_params, frame_count);
+               if (err < 0) {
+                       logging(state,
+                               "Fail to configure 'avail-min'.\n");
+                       return -EINVAL;
+               }
+       }
+
+       if (msec_for_start_threshold > 0) {
+               frame_count = msec_for_start_threshold * frames_per_second /
+                             1000000;
+               if (frame_count == 0 || frame_count > frames_per_buffer) {
+                       logging(state,
+                               "The msec for 'start-delay' is too %s: %u "
+                               "msec (%lu frames at %u).\n",
+                               frame_count == 0 ? "small" : "large",
+                               msec_for_start_threshold, frame_count,
+                               frames_per_second);
+                       return -EINVAL;
+               }
+               err = snd_pcm_sw_params_set_start_threshold(state->handle,
+                                               state->sw_params, frame_count);
+               if (err < 0) {
+                       logging(state,
+                               "Fail to configure 'start-delay'.\n");
+                       return -EINVAL;
+               }
+       }
+
+       if (msec_for_stop_threshold > 0) {
+               frame_count = msec_for_stop_threshold * frames_per_second /
+                             1000000;
+               if (frame_count == 0 || frame_count > frames_per_buffer) {
+                       logging(state,
+                               "The msec for 'stop-delay' is too %s: %u "
+                               "msec (%lu frames at %u).\n",
+                               frame_count == 0 ? "small" : "large",
+                               msec_for_stop_threshold, frame_count,
+                               frames_per_second);
+                       return -EINVAL;
+               }
+               err = snd_pcm_sw_params_set_stop_threshold(state->handle,
+                                               state->sw_params, frame_count);
+               if (err < 0) {
+                       logging(state,
+                               "Fail to configure 'stop-delay'.\n");
+                       return -EINVAL;
+               }
+       }
+
+       return snd_pcm_sw_params(state->handle, state->sw_params);
+}
+
+static int xfer_libasound_pre_process(struct xfer_context *xfer,
+                                     snd_pcm_format_t *format,
+                                     unsigned int *samples_per_frame,
+                                     unsigned int *frames_per_second,
+                                     snd_pcm_access_t *access,
+                                     snd_pcm_uframes_t *frames_per_buffer)
+{
+       struct libasound_state *state = xfer->private_data;
+       unsigned int flag;
+       int err;
+
+       err = open_handle(xfer);
+       if (err < 0)
+               return -ENXIO;
+
+       err = configure_hw_params(state, *format, *samples_per_frame,
+                                 *frames_per_second,
+                                 state->msec_per_period,
+                                 state->msec_per_buffer,
+                                 state->frames_per_period,
+                                 state->frames_per_buffer);
+       if (err < 0) {
+               logging(state, "Current hardware parameters:\n");
+               snd_pcm_hw_params_dump(state->hw_params, state->log);
+               return err;
+       }
+
+       // Retrieve actual parameters.
+       err = retrieve_actual_hw_params(state->hw_params, format,
+                                       samples_per_frame, frames_per_second,
+                                       access, frames_per_buffer);
+       if (err < 0)
+               return err;
+
+       // Query software parameters.
+       err = snd_pcm_sw_params_current(state->handle, state->sw_params);
+       if (err < 0)
+               return err;
+
+       // Assign I/O operation.
+       err = snd_pcm_hw_params_get_period_wakeup(state->handle,
+                                                 state->hw_params, &flag);
+       if (err < 0)
+               return err;
+
+       if (flag) {
+               if (*access == SND_PCM_ACCESS_RW_INTERLEAVED ||
+                   *access == SND_PCM_ACCESS_RW_NONINTERLEAVED) {
+                       state->ops = &xfer_libasound_irq_rw_ops;
+               } else if (*access == SND_PCM_ACCESS_MMAP_INTERLEAVED ||
+                          *access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED) {
+                       if (snd_pcm_stream(state->handle) == SND_PCM_STREAM_CAPTURE)
+                               state->ops = &xfer_libasound_irq_mmap_r_ops;
+                       else
+                               state->ops = &xfer_libasound_irq_mmap_w_ops;
+               } else {
+                       return -ENXIO;
+               }
+       } else {
+               if (*access == SND_PCM_ACCESS_MMAP_INTERLEAVED ||
+                   *access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED) {
+                       if (snd_pcm_stream(state->handle) == SND_PCM_STREAM_CAPTURE)
+                               state->ops = &xfer_libasound_timer_mmap_r_ops;
+                       else
+                               state->ops = &xfer_libasound_timer_mmap_w_ops;
+               } else {
+                       return -ENXIO;
+               }
+       }
+
+       if (state->ops->private_size > 0) {
+               state->private_data = malloc(state->ops->private_size);
+               if (state->private_data == NULL)
+                       return -ENOMEM;
+               memset(state->private_data, 0, state->ops->private_size);
+       }
+
+       err = state->ops->pre_process(state);
+       if (err < 0)
+               return err;
+
+       err = configure_sw_params(state, *frames_per_second,
+                                 *frames_per_buffer,
+                                 state->msec_for_avail_min,
+                                 state->msec_for_start_threshold,
+                                 state->msec_for_stop_threshold);
+       if (err < 0) {
+               logging(state, "Current software parameters:\n");
+               snd_pcm_sw_params_dump(state->sw_params, state->log);
+               return err;
+       }
+
+       if (xfer->verbose > 0) {
+               snd_pcm_dump(state->handle, state->log);
+               logging(state, "Scheduling model:\n");
+               logging(state, "  %s\n", sched_model_labels[state->sched_model]);
+       }
+
+       if (state->use_waiter) {
+               // NOTE: This should be after configuring sw_params due to
+               // timer descriptor for time-based scheduling model.
+               err = prepare_waiter(state);
+               if (err < 0)
+                       return err;
+
+               if (xfer->verbose > 0) {
+                       logging(state, "Waiter type:\n");
+                       logging(state,
+                               "  %s\n",
+                               waiter_label_from_type(state->waiter_type));
+               }
+       }
+
+       return 0;
+}
+
+static int xfer_libasound_process_frames(struct xfer_context *xfer,
+                                        unsigned int *frame_count,
+                                        struct mapper_context *mapper,
+                                        struct container_context *cntrs)
+{
+       struct libasound_state *state = xfer->private_data;
+       int err;
+
+       if (state->handle == NULL)
+               return -ENXIO;
+
+       err = state->ops->process_frames(state, frame_count, mapper, cntrs);
+       if (err < 0) {
+               if (err == -EAGAIN)
+                       return err;
+               if (err == -EPIPE && !state->finish_at_xrun) {
+                       // Recover the stream and continue processing
+                       // immediately. In this program -EPIPE comes from
+                       // libasound implementation instead of file I/O.
+                       err = snd_pcm_prepare(state->handle);
+               }
+
+               if (err < 0) {
+                       // TODO: -EIO from libasound for hw PCM node means
+                       // that IRQ disorder. This should be reported to help
+                       // developers for drivers.
+                       logging(state, "Fail to process frames: %s\n",
+                               snd_strerror(err));
+               }
+       }
+
+       return err;
+}
+
+static void xfer_libasound_pause(struct xfer_context *xfer, bool enable)
+{
+       struct libasound_state *state = xfer->private_data;
+       snd_pcm_state_t s = snd_pcm_state(state->handle);
+       int err;
+
+       if (state->handle == NULL)
+               return;
+
+       if (enable) {
+               if (s != SND_PCM_STATE_RUNNING)
+                       return;
+       } else {
+               if (s != SND_PCM_STATE_PAUSED)
+                       return;
+       }
+
+       // Not supported. Leave the substream to enter XRUN state.
+       if (!snd_pcm_hw_params_can_pause(state->hw_params))
+               return;
+
+       err = snd_pcm_pause(state->handle, enable);
+       if (err < 0 && state->verbose) {
+               logging(state, "snd_pcm_pause(): %s\n", snd_strerror(err));
+       }
+}
+
+static void xfer_libasound_post_process(struct xfer_context *xfer)
+{
+       struct libasound_state *state = xfer->private_data;
+       snd_pcm_state_t pcm_state;
+       int err;
+
+       if (state->handle == NULL)
+               return;
+
+       pcm_state = snd_pcm_state(state->handle);
+       if (pcm_state != SND_PCM_STATE_OPEN &&
+           pcm_state != SND_PCM_STATE_DISCONNECTED) {
+               if (snd_pcm_stream(state->handle) == SND_PCM_STREAM_CAPTURE ||
+                   state->ops == &xfer_libasound_timer_mmap_w_ops) {
+                       err = snd_pcm_drop(state->handle);
+                       if (err < 0)
+                               logging(state, "snd_pcm_drop(): %s\n",
+                                      snd_strerror(err));
+               } else {
+                       // TODO: this is a bug in kernel land.
+                       if (state->nonblock)
+                               snd_pcm_nonblock(state->handle, 0);
+                       err = snd_pcm_drain(state->handle);
+                       if (state->nonblock)
+                               snd_pcm_nonblock(state->handle, 1);
+                       if (err < 0)
+                               logging(state, "snd_pcm_drain(): %s\n",
+                                      snd_strerror(err));
+               }
+       }
+
+       err = snd_pcm_hw_free(state->handle);
+       if (err < 0)
+               logging(state, "snd_pcm_hw_free(): %s\n", snd_strerror(err));
+
+       snd_pcm_close(state->handle);
+       state->handle = NULL;
+
+       if (state->ops && state->ops->post_process)
+               state->ops->post_process(state);
+       free(state->private_data);
+       state->private_data = NULL;
+
+       // Free cache of content for configuration files so that memory leaks
+       // are not detected.
+       snd_config_update_free_global();
+}
+
+static void xfer_libasound_destroy(struct xfer_context *xfer)
+{
+       struct libasound_state *state = xfer->private_data;
+
+       free(state->node_literal);
+       free(state->waiter_type_literal);
+       free(state->sched_model_literal);
+       state->node_literal = NULL;
+       state->waiter_type_literal = NULL;
+       state->sched_model_literal = NULL;
+
+       if (state->hw_params)
+               snd_pcm_hw_params_free(state->hw_params);
+       if (state->sw_params)
+               snd_pcm_sw_params_free(state->sw_params);
+       state->hw_params = NULL;
+       state->sw_params = NULL;
+
+       if (state->log)
+               snd_output_close(state->log);
+       state->log = NULL;
+}
+
+static void xfer_libasound_help(struct xfer_context *xfer ATTRIBUTE_UNUSED)
+{
+       printf(
+"      [BASICS]\n"
+"        -D, --device          select node by name in coniguration space\n"
+"        -N, --nonblock        nonblocking mode\n"
+"        -M, --mmap            use mmap(2) for zero copying technique\n"
+"        -F, --period-time     interval between interrupts (msec unit)\n"
+"        --period-size         interval between interrupts (frame unit)\n"
+"        -B, --buffer-time     size of buffer for frame(msec unit)\n"
+"        --buffer-size         size of buffer for frame(frame unit)\n"
+"        --waiter-type         type of waiter to handle available frames\n"
+"        --sched-model         model of process scheduling\n"
+"      [SOFTWARE FEATURES]\n"
+"        -A, --avail-min       threshold of frames to wake up process\n"
+"        -R, --start-delay     threshold of frames to start PCM substream\n"
+"        -T, --stop-delay      threshold of frames to stop PCM substream\n"
+"      [LIBASOUND PLUGIN OPTIONS]\n"
+"        --disable-resample    disable rate conversion for plug plugin\n"
+"        --disable-channels    disable channel conversion for plug plugin\n"
+"        --disable-format      disable format conversion for plug plugin\n"
+"        --disable-softvol     disable software volume for sofvol plugin\n"
+"      [DEBUG ASSISTANT]\n"
+"        --fatal-errors        finish at XRUN\n"
+"        --test-nowait         busy poll without any waiter\n"
+       );
+}
+
+const struct xfer_data xfer_libasound = {
+       .s_opts = S_OPTS,
+       .l_opts = l_opts,
+       .l_opts_count = ARRAY_SIZE(l_opts),
+       .ops = {
+               .init           = xfer_libasound_init,
+               .parse_opt      = xfer_libasound_parse_opt,
+               .validate_opts  = xfer_libasound_validate_opts,
+               .pre_process    = xfer_libasound_pre_process,
+               .process_frames = xfer_libasound_process_frames,
+               .pause          = xfer_libasound_pause,
+               .post_process   = xfer_libasound_post_process,
+               .destroy        = xfer_libasound_destroy,
+               .help           = xfer_libasound_help,
+       },
+       .private_size = sizeof(struct libasound_state),
+};
diff --git a/axfer/xfer-libasound.h b/axfer/xfer-libasound.h
new file mode 100644 (file)
index 0000000..dfe8577
--- /dev/null
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// xfer-libasound.h - a header for receiver/transmitter of frames by alsa-lib.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#ifndef __ALSA_UTILS_AXFER_XFER_LIBASOUND__H_
+#define __ALSA_UTILS_AXFER_XFER_LIBASOUND__H_
+
+#include "xfer.h"
+#include "waiter.h"
+
+#define logging(state, ...) \
+       snd_output_printf(state->log, __VA_ARGS__)
+
+enum sched_model {
+       SCHED_MODEL_IRQ = 0,
+       SCHED_MODEL_TIMER,
+       SCHED_MODEL_COUNT,
+};
+
+struct xfer_libasound_ops;
+
+struct libasound_state {
+       snd_pcm_t *handle;
+
+       snd_output_t *log;
+       snd_pcm_hw_params_t *hw_params;
+       snd_pcm_sw_params_t *sw_params;
+
+       const struct xfer_libasound_ops *ops;
+       void *private_data;
+
+       bool verbose;
+
+       char *node_literal;
+       char *waiter_type_literal;
+       char *sched_model_literal;
+
+       unsigned int msec_per_period;
+       unsigned int msec_per_buffer;
+       unsigned int frames_per_period;
+       unsigned int frames_per_buffer;
+
+       unsigned int msec_for_avail_min;
+       unsigned int msec_for_start_threshold;
+       unsigned int msec_for_stop_threshold;
+
+       bool finish_at_xrun:1;
+       bool nonblock:1;
+       bool mmap:1;
+       bool test_nowait:1;
+       bool no_auto_resample:1;
+       bool no_auto_channels:1;
+       bool no_auto_format:1;
+       bool no_softvol:1;
+
+       bool use_waiter:1;
+
+       enum waiter_type waiter_type;
+       struct waiter_context *waiter;
+
+       // For scheduling type.
+       enum sched_model sched_model;
+};
+
+// For internal use in 'libasound' module.
+
+struct xfer_libasound_ops {
+       int (*pre_process)(struct libasound_state *state);
+       int (*process_frames)(struct libasound_state *state,
+                             unsigned int *frame_count,
+                             struct mapper_context *mapper,
+                             struct container_context *cntrs);
+       void (*post_process)(struct libasound_state *state);
+       unsigned int private_size;
+};
+
+int xfer_libasound_wait_event(struct libasound_state *state, int timeout_msec,
+                             unsigned short *revents);
+
+extern const struct xfer_libasound_ops xfer_libasound_irq_rw_ops;
+
+extern const struct xfer_libasound_ops xfer_libasound_irq_mmap_r_ops;
+extern const struct xfer_libasound_ops xfer_libasound_irq_mmap_w_ops;
+
+extern const struct xfer_libasound_ops xfer_libasound_timer_mmap_w_ops;
+extern const struct xfer_libasound_ops xfer_libasound_timer_mmap_r_ops;
+
+#endif
diff --git a/axfer/xfer-libffado.c b/axfer/xfer-libffado.c
new file mode 100644 (file)
index 0000000..6db835d
--- /dev/null
@@ -0,0 +1,570 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// xfer-libffado.c - receive/transmit frames by libffado.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "xfer.h"
+#include "misc.h"
+
+#include "frame-cache.h"
+
+#include <stdio.h>
+#include <sched.h>
+
+#include <libffado/ffado.h>
+
+struct libffado_state {
+       ffado_device_t *handle;
+       enum ffado_direction direction;
+
+       char *port_literal;
+       char *node_literal;
+       char *guid_literal;
+       unsigned int frames_per_period;
+       unsigned int periods_per_buffer;
+       unsigned int sched_priority;
+       bool slave_mode:1;
+       bool snoop_mode:1;
+
+       unsigned int data_ch_count;
+       ffado_streaming_stream_type *data_ch_map;
+
+       int (*process_frames)(struct xfer_context *xfer,
+                             unsigned int *frame_count,
+                             struct mapper_context *mapper,
+                             struct container_context *cntrs);
+
+       struct frame_cache cache;
+};
+
+enum no_short_opts {
+       OPT_FRAMES_PER_PERIOD = 200,
+       OPT_PERIODS_PER_BUFFER,
+       OPT_SLAVE_MODE,
+       OPT_SNOOP_MODE,
+       OPT_SCHED_PRIORITY,
+};
+
+#define S_OPTS "p:n:g:"
+static const struct option l_opts[] = {
+       {"port",                1, 0, 'p'},
+       {"node",                1, 0, 'n'},
+       {"guid",                1, 0, 'g'},
+       {"frames-per-period",   1, 0, OPT_FRAMES_PER_PERIOD},
+       {"periods-per-buffer",  1, 0, OPT_PERIODS_PER_BUFFER},
+       {"slave",               0, 0, OPT_SLAVE_MODE},
+       {"snoop",               0, 0, OPT_SNOOP_MODE},
+       {"sched-priority",      1, 0, OPT_SCHED_PRIORITY}, // to SCHED_FIFO
+};
+
+static int xfer_libffado_init(struct xfer_context *xfer,
+                              snd_pcm_stream_t direction)
+{
+       struct libffado_state *state = xfer->private_data;
+
+       if (direction == SND_PCM_STREAM_CAPTURE)
+               state->direction = FFADO_CAPTURE;
+       else if (direction == SND_PCM_STREAM_PLAYBACK)
+               state->direction = FFADO_PLAYBACK;
+       else
+               return -EINVAL;
+
+       return 0;
+}
+
+static int xfer_libffado_parse_opt(struct xfer_context *xfer, int key,
+                                   const char *optarg)
+{
+       struct libffado_state *state = xfer->private_data;
+       int err;
+
+       if (key == 'p')
+               state->port_literal = arg_duplicate_string(optarg, &err);
+       else if (key == 'n')
+               state->node_literal = arg_duplicate_string(optarg, &err);
+       else if (key == 'g')
+               state->guid_literal = arg_duplicate_string(optarg, &err);
+       else if (key == OPT_FRAMES_PER_PERIOD)
+               state->frames_per_period = arg_parse_decimal_num(optarg, &err);
+       else if (key == OPT_PERIODS_PER_BUFFER)
+               state->periods_per_buffer = arg_parse_decimal_num(optarg, &err);
+       else if (key == OPT_SLAVE_MODE)
+               state->slave_mode = true;
+       else if (key == OPT_SNOOP_MODE)
+               state->snoop_mode = true;
+       else if (key == OPT_SCHED_PRIORITY)
+               state->sched_priority = arg_parse_decimal_num(optarg, &err);
+       else
+               err = -ENXIO;
+
+       return err;
+}
+
+static int validate_sched_priority(struct libffado_state *state)
+{
+       int val;
+
+       val = sched_get_priority_max(SCHED_FIFO);
+       if (val < 0)
+               return -errno;
+       if (state->sched_priority > val)
+               return -EINVAL;
+
+       val = sched_get_priority_min(SCHED_FIFO);
+       if (val < 0)
+               return -errno;
+       if (state->sched_priority < val)
+               return -EINVAL;
+
+       return 0;
+}
+
+static int xfer_libffado_validate_opts(struct xfer_context *xfer)
+{
+       struct libffado_state *state = xfer->private_data;
+       int err;
+
+       if (state->node_literal != NULL) {
+               if (state->port_literal == NULL) {
+                       fprintf(stderr,
+                               "'n' option should correspond 'p' option.\n");
+                       return -EINVAL;
+               }
+       }
+
+       if (state->port_literal != NULL && state->guid_literal != NULL) {
+               fprintf(stderr,
+                       "Neither 'p' option nor 'g' option is available at the "
+                       "same time.\n");
+               return -EINVAL;
+       }
+
+       if (state->guid_literal != NULL) {
+               if (strstr(state->guid_literal, "0x") != state->guid_literal) {
+                       fprintf(stderr,
+                               "A value of 'g' option should have '0x' as its "
+                               "prefix for hexadecimal number.\n");
+                       return -EINVAL;
+               }
+       }
+
+       if (state->slave_mode && state->snoop_mode) {
+               fprintf(stderr, "Neither slave mode nor snoop mode is available"
+                               "at the same time.\n");
+               return -EINVAL;
+       }
+
+       if (state->sched_priority > 0) {
+               err = validate_sched_priority(state);
+               if (err < 0)
+                       return err;
+       }
+
+       if (state->frames_per_period == 0)
+               state->frames_per_period = 512;
+       if (state->periods_per_buffer == 0)
+               state->periods_per_buffer = 2;
+
+       return 0;
+}
+
+static int r_process_frames(struct xfer_context *xfer,
+                           unsigned int *frame_count,
+                           struct mapper_context *mapper,
+                           struct container_context *cntrs)
+{
+       struct libffado_state *state = xfer->private_data;
+       unsigned int avail_count;
+       unsigned int bytes_per_frame;
+       unsigned int consumed_count;
+       int err;
+
+       // Trim up to expected frame count.
+       avail_count = state->frames_per_period;
+       if (*frame_count < avail_count)
+               avail_count = *frame_count;
+
+       // Cache required amount of frames.
+       if (avail_count > frame_cache_get_count(&state->cache)) {
+               int ch;
+               int pos;
+
+               // Register buffers.
+               pos = 0;
+               bytes_per_frame = state->cache.bytes_per_sample *
+                                 state->cache.samples_per_frame;
+               for (ch = 0; ch < state->data_ch_count; ++ch) {
+                       char *buf;
+
+                       if (state->data_ch_map[ch] != ffado_stream_type_audio)
+                               continue;
+
+                       buf = state->cache.buf_ptr;
+                       buf += ch * bytes_per_frame;
+                       if (ffado_streaming_set_capture_stream_buffer(state->handle,
+                                                                     ch, buf))
+                               return -EIO;
+                       ++pos;
+               }
+
+               assert(pos == xfer->samples_per_frame);
+
+               // Move data to the buffer from intermediate buffer.
+               if (!ffado_streaming_transfer_buffers(state->handle))
+                       return -EIO;
+
+               frame_cache_increase_count(&state->cache,
+                                          state->frames_per_period);
+       }
+
+       // Write out to file descriptors.
+       consumed_count = frame_cache_get_count(&state->cache);
+       err = mapper_context_process_frames(mapper, state->cache.buf,
+                                           &consumed_count, cntrs);
+       if (err < 0)
+               return err;
+
+       frame_cache_reduce(&state->cache, consumed_count);
+
+       *frame_count = consumed_count;
+
+       return 0;
+}
+
+static int w_process_frames(struct xfer_context *xfer,
+                           unsigned int *frame_count,
+                           struct mapper_context *mapper,
+                           struct container_context *cntrs)
+{
+       struct libffado_state *state = xfer->private_data;
+       unsigned int avail_count;
+       int pos;
+       int ch;
+       unsigned int bytes_per_frame;
+       unsigned int consumed_count;
+       int err;
+
+       // Trim up to expected frame_count.
+       avail_count = state->frames_per_period;
+       if (*frame_count < avail_count)
+               avail_count = *frame_count;
+
+       // Cache required amount of frames.
+       if (avail_count > frame_cache_get_count(&state->cache)) {
+               avail_count -= frame_cache_get_count(&state->cache);
+
+               err = mapper_context_process_frames(mapper, state->cache.buf_ptr,
+                                                   &avail_count, cntrs);
+               if (err < 0)
+                       return err;
+               frame_cache_increase_count(&state->cache, avail_count);
+               avail_count = state->cache.remained_count;
+       }
+
+       // Register buffers.
+       pos = 0;
+       bytes_per_frame = state->cache.bytes_per_sample *
+                         state->cache.samples_per_frame;
+       for (ch = 0; ch < state->data_ch_count; ++ch) {
+               char *buf;
+
+               if (state->data_ch_map[ch] != ffado_stream_type_audio)
+                       continue;
+
+               buf = state->cache.buf;
+               buf += bytes_per_frame;
+               if (ffado_streaming_set_playback_stream_buffer(state->handle,
+                                                               ch, buf))
+                       return -EIO;
+               ++pos;
+       }
+
+       assert(pos == xfer->samples_per_frame);
+
+       // Move data on the buffer for transmission.
+       if (!ffado_streaming_transfer_buffers(state->handle))
+               return -EIO;
+       consumed_count = state->frames_per_period;
+
+       frame_cache_reduce(&state->cache, consumed_count);
+
+       *frame_count = consumed_count;
+
+       return 0;
+}
+
+static int open_handle(struct xfer_context *xfer,
+                      unsigned int frames_per_second)
+{
+       struct libffado_state *state = xfer->private_data;
+       ffado_options_t options = {0};
+       ffado_device_info_t info = {0};
+
+       char str[32] = {0};
+       char *strings[1];
+
+       // Set target unit if given.
+       if (state->port_literal != NULL) {
+               if (state->node_literal != NULL) {
+                       snprintf(str, sizeof(str), "hw:%s,%s",
+                                state->port_literal, state->node_literal);
+               } else {
+                       snprintf(str, sizeof(str), "hw:%s",
+                                state->port_literal);
+               }
+       } else if (state->guid_literal != NULL) {
+               snprintf(str, sizeof(str), "guid:%s", state->guid_literal);
+       }
+       if (str[0] != '\0') {
+               info.nb_device_spec_strings = 1;
+               strings[0] = str;
+               info.device_spec_strings = strings;
+       }
+
+       // Set common options.
+       options.sample_rate = frames_per_second;
+       options.period_size = state->frames_per_period;
+       options.nb_buffers = state->periods_per_buffer;
+       options.realtime = !!(state->sched_priority > 0);
+       options.packetizer_priority = state->sched_priority;
+       options.slave_mode = state->slave_mode;
+       options.snoop_mode = state->snoop_mode;
+       options.verbose = xfer->verbose;
+
+       state->handle = ffado_streaming_init(info, options);
+       if (state->handle == NULL)
+               return -EINVAL;
+
+       return 0;
+}
+
+static int enable_mbla_data_ch(struct libffado_state *state,
+                              unsigned int *samples_per_frame)
+{
+       int (*func_type)(ffado_device_t *handle, int pos);
+       int (*func_onoff)(ffado_device_t *handle, int pos, int on);
+       int count;
+       int ch;
+
+       if (state->direction == FFADO_CAPTURE) {
+               func_type = ffado_streaming_get_capture_stream_type;
+               func_onoff = ffado_streaming_capture_stream_onoff;
+               count = ffado_streaming_get_nb_capture_streams(state->handle);
+       } else {
+               func_type = ffado_streaming_get_playback_stream_type;
+               func_onoff = ffado_streaming_playback_stream_onoff;
+               count = ffado_streaming_get_nb_playback_streams(state->handle);
+       }
+       if (count <= 0)
+               return -EIO;
+
+       state->data_ch_map = calloc(count, sizeof(*state->data_ch_map));
+       if (state->data_ch_map == NULL)
+               return -ENOMEM;
+       state->data_ch_count = count;
+
+       // When a data ch is off, data in the ch is truncated. This helps to
+       // align PCM frames in interleaved order.
+       *samples_per_frame = 0;
+       for (ch = 0; ch < count; ++ch) {
+               int on;
+
+               state->data_ch_map[ch] = func_type(state->handle, ch);
+
+               on = !!(state->data_ch_map[ch] == ffado_stream_type_audio);
+               if (func_onoff(state->handle, ch, on))
+                       return -EIO;
+               if (on)
+                       ++(*samples_per_frame);
+       }
+
+       return 0;
+}
+
+static int xfer_libffado_pre_process(struct xfer_context *xfer,
+                                    snd_pcm_format_t *format,
+                                    unsigned int *samples_per_frame,
+                                    unsigned int *frames_per_second,
+                                    snd_pcm_access_t *access,
+                                    snd_pcm_uframes_t *frames_per_buffer)
+{
+       struct libffado_state *state = xfer->private_data;
+       unsigned int channels;
+       int err;
+
+       // Supported format of sample is 24 bit multi bit linear audio in
+       // AM824 format or the others.
+       if (state->direction == FFADO_CAPTURE) {
+               if (*format == SND_PCM_FORMAT_UNKNOWN)
+                       *format = SND_PCM_FORMAT_S24;
+       }
+       if (*format != SND_PCM_FORMAT_S24) {
+               fprintf(stderr,
+                       "A libffado backend supports S24 only.\n");
+               return -EINVAL;
+       }
+
+       // The backend requires the number of frames per second for its
+       // initialization.
+       if (state->direction == FFADO_CAPTURE) {
+               if (*frames_per_second == 0)
+                       *frames_per_second = 48000;
+       }
+       if (*frames_per_second < 32000 || *frames_per_second > 192000) {
+               fprintf(stderr,
+                       "A libffado backend supports sampling rate between "
+                       "32000 and 192000, discretely.\n");
+               return -EINVAL;
+       }
+
+       err = open_handle(xfer, *frames_per_second);
+       if (err < 0)
+               return err;
+
+       if (ffado_streaming_set_audio_datatype(state->handle,
+                                              ffado_audio_datatype_int24))
+               return -EINVAL;
+
+       // Decide buffer layout.
+       err = enable_mbla_data_ch(state, &channels);
+       if (err < 0)
+               return err;
+
+       // This backend doesn't support resampling.
+       if (state->direction == FFADO_CAPTURE) {
+               if (*samples_per_frame == 0)
+                       *samples_per_frame = channels;
+       }
+       if (*samples_per_frame != channels) {
+               fprintf(stderr,
+                       "The number of samples per frame should be %u.\n",
+                       channels);
+               return -EINVAL;
+       }
+
+       // A buffer has interleaved-aligned PCM frames.
+       *access = SND_PCM_ACCESS_RW_INTERLEAVED;
+       *frames_per_buffer =
+                       state->frames_per_period * state->periods_per_buffer;
+
+       // Use cache for double number of frames per period.
+       err = frame_cache_init(&state->cache, *access,
+                              snd_pcm_format_physical_width(*format) / 8,
+                              *samples_per_frame, state->frames_per_period * 2);
+       if (err < 0)
+               return err;
+
+       if (state->direction == FFADO_CAPTURE)
+               state->process_frames = r_process_frames;
+       else
+               state->process_frames = w_process_frames;
+
+       if (ffado_streaming_prepare(state->handle))
+               return -EIO;
+
+       if (ffado_streaming_start(state->handle))
+               return -EIO;
+
+       return 0;
+}
+
+static int xfer_libffado_process_frames(struct xfer_context *xfer,
+                                       unsigned int *frame_count,
+                                       struct mapper_context *mapper,
+                                       struct container_context *cntrs)
+{
+       struct libffado_state *state = xfer->private_data;
+       ffado_wait_response res;
+       int err;
+
+       res = ffado_streaming_wait(state->handle);
+       if (res == ffado_wait_shutdown || res == ffado_wait_error) {
+               err = -EIO;
+       } else if (res == ffado_wait_xrun) {
+               // No way to recover in this backend.
+               err = -EPIPE;
+       } else if (res == ffado_wait_ok) {
+               err = state->process_frames(xfer, frame_count, mapper, cntrs);
+       } else {
+               err = -ENXIO;
+       }
+
+       if (err < 0)
+               *frame_count = 0;
+
+       return err;
+}
+
+static void xfer_libffado_pause(struct xfer_context *xfer, bool enable)
+{
+       struct libffado_state *state = xfer->private_data;
+
+       // This is an emergency avoidance because this backend doesn't support
+       // suspend/aresume operation.
+       if (enable) {
+               ffado_streaming_stop(state->handle);
+               ffado_streaming_finish(state->handle);
+               exit(EXIT_FAILURE);
+       }
+}
+
+static void xfer_libffado_post_process(struct xfer_context *xfer)
+{
+       struct libffado_state *state = xfer->private_data;
+
+       if (state->handle != NULL) {
+               ffado_streaming_stop(state->handle);
+               ffado_streaming_finish(state->handle);
+       }
+
+       frame_cache_destroy(&state->cache);
+       free(state->data_ch_map);
+       state->data_ch_map = NULL;
+}
+
+static void xfer_libffado_destroy(struct xfer_context *xfer)
+{
+       struct libffado_state *state = xfer->private_data;
+
+       free(state->port_literal);
+       free(state->node_literal);
+       free(state->guid_literal);
+       state->port_literal = NULL;
+       state->node_literal = NULL;
+       state->guid_literal = NULL;
+}
+
+static void xfer_libffado_help(struct xfer_context *xfer)
+{
+       printf(
+"      -p, --port           decimal ID of port to decide 1394 OHCI controller for communication on IEEE 1394 bus\n"
+"      -n, --node           decimal ID of node to decide unit on IEEE 1394 bus for transmission of audio data frame\n"
+"      -g, --guid           hexadecimal ID for node on IEEE 1394 bus for transmission of audio data frame\n"
+"      --frames-per-period  the number of audio data frame to handle one operation (frame unit)\n"
+"      --periods-per-bufer  the number of periods in intermediate buffer between libffado (frame unit)\n"
+"      --slave              receive frames from the other Linux system on IEEE 1394 bus running with libffado.\n"
+"      --snoop              receive frames on packets of all isochronous channels.\n"
+"      --sched-priority     set SCHED_FIFO with given priority. see RLIMIT_RTPRIO in getrlimit(2).\n"
+       );
+}
+
+const struct xfer_data xfer_libffado = {
+       .s_opts = S_OPTS,
+       .l_opts = l_opts,
+       .l_opts_count = ARRAY_SIZE(l_opts),
+       .ops = {
+               .init           = xfer_libffado_init,
+               .parse_opt      = xfer_libffado_parse_opt,
+               .validate_opts  = xfer_libffado_validate_opts,
+               .pre_process    = xfer_libffado_pre_process,
+               .process_frames = xfer_libffado_process_frames,
+               .pause          = xfer_libffado_pause,
+               .post_process   = xfer_libffado_post_process,
+               .destroy        = xfer_libffado_destroy,
+               .help           = xfer_libffado_help,
+       },
+       .private_size = sizeof(struct libffado_state),
+};
diff --git a/axfer/xfer-options.c b/axfer/xfer-options.c
new file mode 100644 (file)
index 0000000..e716ded
--- /dev/null
@@ -0,0 +1,628 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// xfer-options.c - a parser of commandline options for xfer.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "xfer.h"
+#include "misc.h"
+
+#include <getopt.h>
+#include <math.h>
+#include <limits.h>
+
+enum no_short_opts {
+       // 128 or later belong to non us-ascii character set.
+       OPT_XFER_TYPE = 128,
+       OPT_DUMP_HW_PARAMS,
+       OPT_PERIOD_SIZE,
+       OPT_BUFFER_SIZE,
+       // Obsoleted.
+       OPT_MAX_FILE_TIME,
+       OPT_USE_STRFTIME,
+       OPT_PROCESS_ID_FILE,
+};
+
+static void print_help()
+{
+       printf(
+"Usage:\n"
+"  axfer transfer DIRECTION [ COMMON-OPTIONS ] [ BACKEND-OPTIONS ]\n"
+"\n"
+"  where:\n"
+"    DIRECTION = capture | playback\n"
+"    COMMON-OPTIONS =\n"
+"      -h, --help              help\n"
+"      -v, --verbose           verbose\n"
+"      -q, --quiet             quiet mode\n"
+"      -d, --duration=#        interrupt after # seconds\n"
+"      -s, --samples=#         interrupt after # frames\n"
+"      -f, --format=FORMAT     sample format (case-insensitive)\n"
+"      -c, --channels=#        channels\n"
+"      -r, --rate=#            numeric sample rate in unit of Hz or kHz\n"
+"      -t, --file-type=TYPE    file type (wav, au, sparc, voc or raw, case-insentive)\n"
+"      -I, --separate-channels one file for each channel\n"
+"      --dump-hw-params        dump hw_params of the device\n"
+"      --xfer-type=BACKEND     backend type (libasound, libffado)\n"
+       );
+}
+
+static int allocate_paths(struct xfer_context *xfer, char *const *paths,
+                          unsigned int count)
+{
+       bool stdio = false;
+       unsigned int i;
+
+       if (count == 0) {
+               stdio = true;
+               count = 1;
+       }
+
+       xfer->paths = calloc(count, sizeof(xfer->paths[0]));
+       if (xfer->paths == NULL)
+               return -ENOMEM;
+       xfer->path_count = count;
+
+       if (stdio) {
+               xfer->paths[0] = strdup("-");
+               if (xfer->paths[0] == NULL)
+                       return -ENOMEM;
+       } else {
+               for (i = 0; i < count; ++i) {
+                       xfer->paths[i] = strndup(paths[i], PATH_MAX);
+                       if (xfer->paths[i] == NULL)
+                               return -ENOMEM;
+               }
+       }
+
+       return 0;
+}
+
+static int verify_cntr_format(struct xfer_context *xfer)
+{
+       static const struct {
+               const char *const literal;
+               enum container_format cntr_format;
+       } *entry, entries[] = {
+               {"raw",         CONTAINER_FORMAT_RAW},
+               {"voc",         CONTAINER_FORMAT_VOC},
+               {"wav",         CONTAINER_FORMAT_RIFF_WAVE},
+               {"au",          CONTAINER_FORMAT_AU},
+               {"sparc",       CONTAINER_FORMAT_AU},
+       };
+       int i;
+
+       for (i = 0; i < (int)ARRAY_SIZE(entries); ++i) {
+               entry = &entries[i];
+               if (strcasecmp(xfer->cntr_format_literal, entry->literal))
+                       continue;
+
+               xfer->cntr_format = entry->cntr_format;
+               return 0;
+       }
+
+       fprintf(stderr, "unrecognized file format '%s'\n",
+               xfer->cntr_format_literal);
+
+       return -EINVAL;
+}
+
+// This should be called after 'verify_cntr_format()'.
+static int verify_sample_format(struct xfer_context *xfer)
+{
+       static const struct {
+               const char *const literal;
+               unsigned int frames_per_second;
+               unsigned int samples_per_frame;
+               snd_pcm_format_t le_format;
+               snd_pcm_format_t be_format;
+       } *entry, entries[] = {
+               {"cd",  44100, 2, SND_PCM_FORMAT_S16_LE, SND_PCM_FORMAT_S16_BE},
+               {"cdr", 44100, 2, SND_PCM_FORMAT_S16_LE, SND_PCM_FORMAT_S16_BE},
+               {"dat", 48000, 2, SND_PCM_FORMAT_S16_LE, SND_PCM_FORMAT_S16_BE},
+       };
+       unsigned int i;
+
+       xfer->sample_format = snd_pcm_format_value(xfer->sample_format_literal);
+       if (xfer->sample_format != SND_PCM_FORMAT_UNKNOWN)
+               return 0;
+
+       for (i = 0; i < ARRAY_SIZE(entries); ++i) {
+               entry = &entries[i];
+               if (strcmp(entry->literal, xfer->sample_format_literal))
+                       continue;
+
+               if (xfer->frames_per_second > 0 &&
+                   xfer->frames_per_second != entry->frames_per_second) {
+                       fprintf(stderr,
+                               "'%s' format can't be used with rate except "
+                               "for %u.\n",
+                               entry->literal, entry->frames_per_second);
+                       return -EINVAL;
+               }
+
+               if (xfer->samples_per_frame > 0 &&
+                   xfer->samples_per_frame != entry->samples_per_frame) {
+                       fprintf(stderr,
+                               "'%s' format can't be used with channel except "
+                               "for %u.\n",
+                               entry->literal, entry->samples_per_frame);
+                       return -EINVAL;
+               }
+
+               xfer->frames_per_second = entry->frames_per_second;
+               xfer->samples_per_frame = entry->samples_per_frame;
+               if (xfer->cntr_format == CONTAINER_FORMAT_AU)
+                       xfer->sample_format = entry->be_format;
+               else
+                       xfer->sample_format = entry->le_format;
+
+               return 0;
+       }
+
+       fprintf(stderr, "wrong extended format '%s'\n",
+               xfer->sample_format_literal);
+
+       return -EINVAL;
+}
+
+static int validate_options(struct xfer_context *xfer)
+{
+       unsigned int val;
+       int err = 0;
+
+       if (xfer->cntr_format_literal == NULL) {
+               if (xfer->direction == SND_PCM_STREAM_CAPTURE) {
+                       // To stdout.
+                       if (xfer->path_count == 1 &&
+                           !strcmp(xfer->paths[0], "-")) {
+                               xfer->cntr_format = CONTAINER_FORMAT_RAW;
+                       } else {
+                               // Use first path as a representative.
+                               xfer->cntr_format = container_format_from_path(
+                                                               xfer->paths[0]);
+                       }
+               }
+               // For playback, perform auto-detection.
+       } else {
+               err = verify_cntr_format(xfer);
+       }
+       if (err < 0)
+               return err;
+
+       if (xfer->multiple_cntrs) {
+               if (!strcmp(xfer->paths[0], "-")) {
+                       fprintf(stderr,
+                               "An option for separated channels is not "
+                               "available with stdin/stdout.\n");
+                       return -EINVAL;
+               }
+
+               // For captured PCM frames, even if one path is given for
+               // container files, it can be used to generate several paths.
+               // For this purpose, please see
+               // 'xfer_options_fixup_paths()'.
+               if (xfer->direction == SND_PCM_STREAM_PLAYBACK) {
+                       // Require several paths for containers.
+                       if (xfer->path_count == 1) {
+                               fprintf(stderr,
+                                       "An option for separated channels "
+                                       "requires several files to playback "
+                                       "PCM frames.\n");
+                               return -EINVAL;
+                       }
+               }
+       } else {
+               // A single path is available only.
+               if (xfer->path_count > 1) {
+                       fprintf(stderr,
+                               "When using several files, an option for "
+                               "sepatated channels is used with.\n");
+                       return -EINVAL;
+               }
+       }
+
+       xfer->sample_format = SND_PCM_FORMAT_UNKNOWN;
+       if (xfer->sample_format_literal) {
+               err = verify_sample_format(xfer);
+               if (err < 0)
+                       return err;
+       }
+
+       val = xfer->frames_per_second;
+       if (xfer->frames_per_second == 0)
+               xfer->frames_per_second = 8000;
+       if (xfer->frames_per_second < 1000)
+               xfer->frames_per_second *= 1000;
+       if (xfer->frames_per_second < 2000 ||
+           xfer->frames_per_second > 192000) {
+               fprintf(stderr, "bad speed value '%u'\n", val);
+               return -EINVAL;
+       }
+
+       if (xfer->samples_per_frame > 0) {
+               if (xfer->samples_per_frame < 1 ||
+                   xfer->samples_per_frame > 256) {
+                       fprintf(stderr, "invalid channels argument '%u'\n",
+                               xfer->samples_per_frame);
+                       return -EINVAL;
+               }
+       }
+
+       return err;
+}
+
+int xfer_options_parse_args(struct xfer_context *xfer,
+                           const struct xfer_data *data, int argc,
+                           char *const *argv)
+{
+       static const char *short_opts = "CPhvqd:s:f:c:r:t:IV:i";
+       static const struct option long_opts[] = {
+               // For generic purposes.
+               {"capture",             0, 0, 'C'},
+               {"playback",            0, 0, 'P'},
+               {"xfer-type",           1, 0, OPT_XFER_TYPE},
+               {"help",                0, 0, 'h'},
+               {"verbose",             0, 0, 'v'},
+               {"quiet",               0, 0, 'q'},
+               {"duration",            1, 0, 'd'},
+               {"samples",             1, 0, 's'},
+               // For transfer backend.
+               {"format",              1, 0, 'f'},
+               {"channels",            1, 0, 'c'},
+               {"rate",                1, 0, 'r'},
+               // For containers.
+               {"file-type",           1, 0, 't'},
+               // For mapper.
+               {"separate-channels",   0, 0, 'I'},
+               // For debugging.
+               {"dump-hw-params",      0, 0, OPT_DUMP_HW_PARAMS},
+               // Obsoleted.
+               {"max-file-time",       1, 0, OPT_MAX_FILE_TIME},
+               {"use-strftime",        0, 0, OPT_USE_STRFTIME},
+               {"process-id-file",     1, 0, OPT_PROCESS_ID_FILE},
+               {"vumeter",             1, 0, 'V'},
+               {"interactive",         0, 0, 'i'},
+       };
+       char *s_opts;
+       struct option *l_opts;
+       int l_index;
+       int key;
+       int err = 0;
+
+       // Concatenate short options.
+       s_opts = malloc(strlen(data->s_opts) + strlen(short_opts) + 1);
+       if (s_opts == NULL)
+               return -ENOMEM;
+       strcpy(s_opts, data->s_opts);
+       strcpy(s_opts + strlen(s_opts), short_opts);
+       s_opts[strlen(data->s_opts) + strlen(short_opts)] = '\0';
+
+       // Concatenate long options, including a sentinel.
+       l_opts = calloc(ARRAY_SIZE(long_opts) * data->l_opts_count + 1,
+                       sizeof(*l_opts));
+       if (l_opts == NULL) {
+               free(s_opts);
+               return -ENOMEM;
+       }
+       memcpy(l_opts, long_opts, ARRAY_SIZE(long_opts) * sizeof(*l_opts));
+       memcpy(&l_opts[ARRAY_SIZE(long_opts)], data->l_opts,
+              data->l_opts_count * sizeof(*l_opts));
+
+       // Parse options.
+       l_index = 0;
+       optarg = NULL;
+       optind = 1;
+       opterr = 1;     // use error output.
+       optopt = 0;
+       while (1) {
+               key = getopt_long(argc, argv, s_opts, l_opts, &l_index);
+               if (key < 0)
+                       break;
+               else if (key == 'C')
+                       ;       // already parsed.
+               else if (key == 'P')
+                       ;       // already parsed.
+               else if (key == OPT_XFER_TYPE)
+                       ;       // already parsed.
+               else if (key == 'h')
+                       xfer->help = true;
+               else if (key == 'v')
+                       ++xfer->verbose;
+               else if (key == 'q')
+                       xfer->quiet = true;
+               else if (key == 'd')
+                       xfer->duration_seconds = arg_parse_decimal_num(optarg, &err);
+               else if (key == 's')
+                       xfer->duration_frames = arg_parse_decimal_num(optarg, &err);
+               else if (key == 'f')
+                       xfer->sample_format_literal = arg_duplicate_string(optarg, &err);
+               else if (key == 'c')
+                       xfer->samples_per_frame = arg_parse_decimal_num(optarg, &err);
+               else if (key == 'r')
+                       xfer->frames_per_second = arg_parse_decimal_num(optarg, &err);
+               else if (key == 't')
+                       xfer->cntr_format_literal = arg_duplicate_string(optarg, &err);
+               else if (key == 'I')
+                       xfer->multiple_cntrs = true;
+               else if (key == OPT_DUMP_HW_PARAMS)
+                       xfer->dump_hw_params = true;
+               else if (key == '?') {
+                       free(l_opts);
+                       free(s_opts);
+                       return -EINVAL;
+               }
+               else if (key == OPT_MAX_FILE_TIME ||
+                        key == OPT_USE_STRFTIME ||
+                        key == OPT_PROCESS_ID_FILE ||
+                        key == 'V' ||
+                        key == 'i') {
+                       fprintf(stderr,
+                               "An option '--%s' is obsoleted and has no "
+                               "effect.\n",
+                               l_opts[l_index].name);
+                       err = -EINVAL;
+               } else {
+                       err = xfer->ops->parse_opt(xfer, key, optarg);
+                       if (err < 0 && err != -ENXIO)
+                               break;
+               }
+       }
+
+       free(l_opts);
+       free(s_opts);
+
+       if (xfer->help) {
+               print_help();
+               if (xfer->ops->help) {
+                       printf("\n");
+                       printf("    BACKEND-OPTIONS (%s) =\n",
+                              xfer_label_from_type(xfer->type));
+                       xfer->ops->help(xfer);
+               }
+               return 0;
+       }
+
+       err = allocate_paths(xfer, argv + optind, argc - optind);
+       if (err < 0)
+               return err;
+
+       return validate_options(xfer);
+}
+
+void xfer_options_calculate_duration(struct xfer_context *xfer,
+                                    uint64_t *total_frame_count)
+{
+       uint64_t frame_count;
+
+       if (xfer->duration_seconds > 0) {
+               frame_count = (uint64_t)xfer->duration_seconds * (uint64_t)xfer->frames_per_second;
+               if (frame_count < *total_frame_count)
+                       *total_frame_count = frame_count;
+       }
+
+       if (xfer->duration_frames > 0) {
+               frame_count = xfer->duration_frames;
+               if (frame_count < *total_frame_count)
+                       *total_frame_count = frame_count;
+       }
+}
+
+static const char *const allowed_duplication[] = {
+       "/dev/null",
+       "/dev/zero",
+       "/dev/full",
+       "/dev/random",
+       "/dev/urandom",
+};
+
+static int generate_path_with_suffix(struct xfer_context *xfer,
+                                    const char *template, unsigned int index,
+                                    const char *suffix)
+{
+       static const char *const single_format = "%s%s";
+       static const char *const multiple_format = "%s-%i%s";
+       unsigned int len;
+
+       len = strlen(template) + strlen(suffix) + 1;
+       if (xfer->path_count > 1)
+               len += (unsigned int)log10(xfer->path_count) + 2;
+
+       xfer->paths[index] = malloc(len);
+       if (xfer->paths[index] == NULL)
+               return -ENOMEM;
+
+       if (xfer->path_count == 1) {
+               snprintf(xfer->paths[index], len, single_format, template,
+                        suffix);
+       } else {
+               snprintf(xfer->paths[index], len, multiple_format, template,
+                        index, suffix);
+       }
+
+       return 0;
+}
+
+static int generate_path_without_suffix(struct xfer_context *xfer,
+                                       const char *template,
+                                       unsigned int index,
+                                       const char *suffix ATTRIBUTE_UNUSED)
+{
+       static const char *const single_format = "%s";
+       static const char *const multiple_format = "%s-%i";
+       unsigned int len;
+
+       len = strlen(template) + 1;
+       if (xfer->path_count > 1)
+               len += (unsigned int)log10(xfer->path_count) + 2;
+
+       xfer->paths[index] = malloc(len);
+       if (xfer->paths[index] == NULL)
+               return -ENOMEM;
+
+       if (xfer->path_count == 1) {
+               snprintf(xfer->paths[index], len, single_format, template);
+       } else {
+               snprintf(xfer->paths[index], len, multiple_format, template,
+                       index);
+       }
+
+       return 0;
+}
+
+static int generate_path(struct xfer_context *xfer, char *template,
+                        unsigned int index, const char *suffix)
+{
+       int (*generator)(struct xfer_context *xfer, const char *template,
+                        unsigned int index, const char *suffix);
+       char *pos;
+
+       if (strlen(suffix) > 0) {
+               pos = template + strlen(template) - strlen(suffix);
+               // Separate filename and suffix.
+               if (!strcmp(pos, suffix))
+                       *pos = '\0';
+       }
+
+       // Select handlers.
+       if (strlen(suffix) > 0)
+               generator = generate_path_with_suffix;
+       else
+               generator = generate_path_without_suffix;
+
+       return generator(xfer, template, index, suffix);
+}
+
+static int create_paths(struct xfer_context *xfer, unsigned int path_count)
+{
+       char *template;
+       const char *suffix;
+       unsigned int i, j;
+       int err = 0;
+
+       // Can cause memory leak.
+       assert(xfer->path_count == 1);
+       assert(xfer->paths);
+       assert(xfer->paths[0]);
+       assert(xfer->paths[0][0] != '\0');
+
+       // Release at first.
+       template = xfer->paths[0];
+       free(xfer->paths);
+       xfer->paths = NULL;
+
+       // Allocate again.
+       xfer->paths = calloc(path_count, sizeof(*xfer->paths));
+       if (xfer->paths == NULL) {
+               err = -ENOMEM;
+               goto end;
+       }
+       xfer->path_count = path_count;
+
+       suffix = container_suffix_from_format(xfer->cntr_format);
+
+       for (i = 0; i < xfer->path_count; ++i) {
+               // Some file names are allowed to be duplicated.
+               for (j = 0; j < ARRAY_SIZE(allowed_duplication); ++j) {
+                       if (!strcmp(template, allowed_duplication[j]))
+                               break;
+               }
+               if (j < ARRAY_SIZE(allowed_duplication))
+                       continue;
+
+               err = generate_path(xfer, template, i, suffix);
+               if (err < 0)
+                       break;
+       }
+end:
+       free(template);
+
+       return err;
+}
+
+static int fixup_paths(struct xfer_context *xfer)
+{
+       const char *suffix;
+       char *template;
+       unsigned int i, j;
+       int err = 0;
+
+       suffix = container_suffix_from_format(xfer->cntr_format);
+
+       for (i = 0; i < xfer->path_count; ++i) {
+               // Some file names are allowed to be duplicated.
+               for (j = 0; j < ARRAY_SIZE(allowed_duplication); ++j) {
+                       if (!strcmp(xfer->paths[i], allowed_duplication[j]))
+                               break;
+               }
+               if (j < ARRAY_SIZE(allowed_duplication))
+                       continue;
+
+               template = xfer->paths[i];
+               xfer->paths[i] = NULL;
+               err = generate_path(xfer, template, i, suffix);
+               free(template);
+               if (err < 0)
+                       break;
+       }
+
+       return err;
+}
+
+int xfer_options_fixup_paths(struct xfer_context *xfer)
+{
+       unsigned int i, j;
+       int err;
+
+       if (xfer->path_count == 1) {
+               // Nothing to do for sign of stdin/stdout.
+               if (!strcmp(xfer->paths[0], "-"))
+                       return 0;
+               if (!xfer->multiple_cntrs)
+                       err = fixup_paths(xfer);
+               else
+                       err = create_paths(xfer, xfer->samples_per_frame);
+       } else {
+               if (!xfer->multiple_cntrs)
+                       return -EINVAL;
+               if (xfer->path_count != xfer->samples_per_frame)
+                       return -EINVAL;
+               else
+                       err = fixup_paths(xfer);
+       }
+       if (err < 0)
+               return err;
+
+       // Check duplication of the paths.
+       for (i = 0; i < xfer->path_count - 1; ++i) {
+               // Some file names are allowed to be duplicated.
+               for (j = 0; j < ARRAY_SIZE(allowed_duplication); ++j) {
+                       if (!strcmp(xfer->paths[i], allowed_duplication[j]))
+                               break;
+               }
+               if (j < ARRAY_SIZE(allowed_duplication))
+                       continue;
+
+               for (j = i + 1; j < xfer->path_count; ++j) {
+                       if (!strcmp(xfer->paths[i], xfer->paths[j])) {
+                               fprintf(stderr,
+                                       "Detect duplicated file names:\n");
+                               err = -EINVAL;
+                               break;
+                       }
+               }
+               if (j < xfer->path_count)
+                       break;
+       }
+
+       if (xfer->verbose > 1)
+               fprintf(stderr, "Handled file names:\n");
+       if (err < 0 || xfer->verbose > 1) {
+               for (i = 0; i < xfer->path_count; ++i)
+                       fprintf(stderr, "    %d: %s\n", i, xfer->paths[i]);
+       }
+
+       return err;
+}
diff --git a/axfer/xfer.c b/axfer/xfer.c
new file mode 100644 (file)
index 0000000..3750e8a
--- /dev/null
@@ -0,0 +1,259 @@
+
+//
+// xfer.c - receiver/transmiter of data frames.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#include "xfer.h"
+#include "misc.h"
+
+#include <stdio.h>
+
+static const char *const xfer_type_labels[] = {
+       [XFER_TYPE_LIBASOUND] = "libasound",
+#if WITH_FFADO
+       [XFER_TYPE_LIBFFADO] = "libffado",
+#endif
+};
+
+enum xfer_type xfer_type_from_label(const char *label)
+{
+       unsigned int i;
+
+       for (i = 0; i < ARRAY_SIZE(xfer_type_labels); ++i) {
+               if (!strcmp(xfer_type_labels[i], label))
+                       return i;
+       }
+
+       return XFER_TYPE_UNSUPPORTED;
+}
+
+const char *xfer_label_from_type(enum xfer_type type)
+{
+       return xfer_type_labels[type];
+}
+
+int xfer_context_init(struct xfer_context *xfer, enum xfer_type type,
+                     snd_pcm_stream_t direction, int argc, char *const *argv)
+{
+       struct {
+               enum xfer_type type;
+               const struct xfer_data *data;
+       } *entry, entries[] = {
+               {XFER_TYPE_LIBASOUND, &xfer_libasound},
+#if WITH_FFADO
+               {XFER_TYPE_LIBFFADO, &xfer_libffado},
+#endif
+       };
+       unsigned int i;
+       int err;
+
+       assert(xfer);
+       assert(direction >= SND_PCM_STREAM_PLAYBACK);
+       assert(direction <= SND_PCM_STREAM_CAPTURE);
+
+       for (i = 0; i < ARRAY_SIZE(entries); ++i) {
+               if (entries[i].type == type)
+                       break;
+       }
+       if (i == ARRAY_SIZE(entries))
+               return -EINVAL;
+       entry = &entries[i];
+
+       xfer->direction = direction;
+       xfer->type = type;
+       xfer->ops = &entry->data->ops;
+
+       xfer->private_data = malloc(entry->data->private_size);
+       if (xfer->private_data == NULL)
+               return -ENOMEM;
+       memset(xfer->private_data, 0, entry->data->private_size);
+
+       err = xfer->ops->init(xfer, direction);
+       if (err < 0)
+               return err;
+
+       err = xfer_options_parse_args(xfer, entry->data, argc, argv);
+       if (err < 0)
+               return err;
+
+       return xfer->ops->validate_opts(xfer);
+}
+
+void xfer_context_destroy(struct xfer_context *xfer)
+{
+       unsigned int i;
+
+       assert(xfer);
+
+       if (!xfer->ops)
+               return;
+
+       if (xfer->ops->destroy)
+               xfer->ops->destroy(xfer);
+       if (xfer->private_data)
+               free(xfer->private_data);
+
+       if (xfer->paths) {
+               for (i = 0; i < xfer->path_count; ++i)
+                       free(xfer->paths[i]);
+               free(xfer->paths);
+       }
+
+       xfer->paths = NULL;
+
+       free(xfer->sample_format_literal);
+       xfer->sample_format_literal = NULL;
+
+       free(xfer->cntr_format_literal);
+       xfer->cntr_format_literal = NULL;
+}
+
+int xfer_context_pre_process(struct xfer_context *xfer,
+                            snd_pcm_format_t *format,
+                            unsigned int *samples_per_frame,
+                            unsigned int *frames_per_second,
+                            snd_pcm_access_t *access,
+                            snd_pcm_uframes_t *frames_per_buffer)
+{
+       int err;
+
+       assert(xfer);
+       assert(format);
+       assert(samples_per_frame);
+       assert(frames_per_second);
+       assert(access);
+       assert(frames_per_buffer);
+
+       if (!xfer->ops)
+               return -ENXIO;
+
+       if (xfer->direction == SND_PCM_STREAM_CAPTURE) {
+               // For capture direction, use values in options if given.
+               if (xfer->sample_format != SND_PCM_FORMAT_UNKNOWN)
+                       *format = xfer->sample_format;
+               if (xfer->samples_per_frame > 0)
+                       *samples_per_frame = xfer->samples_per_frame;
+               if (xfer->frames_per_second > 0)
+                       *frames_per_second = xfer->frames_per_second;
+       } else if (xfer->direction == SND_PCM_STREAM_PLAYBACK) {
+               // For playback direction, check values in given options so that
+               // they don't mismatch to parameters from media container.
+               if (*format != xfer->sample_format) {
+                       // Not initial value.
+                       if (xfer->sample_format != SND_PCM_FORMAT_UNKNOWN) {
+                               fprintf(stderr,
+                                       "Sample format mismatch: %s is given "
+                                       "but %s by files\n",
+                                       snd_pcm_format_name(xfer->sample_format),
+                                       snd_pcm_format_name(*format));
+                               return -EINVAL;
+                       }
+               }
+
+               if (*samples_per_frame != xfer->samples_per_frame) {
+                       // Not initial value.
+                       if (xfer->samples_per_frame > 0) {
+                               fprintf(stderr,
+                                       "The number of channels mismatch: %u "
+                                       "is given but %u by files\n",
+                                       xfer->samples_per_frame,
+                                       *samples_per_frame);
+                               return -EINVAL;
+                       }
+               }
+
+               if (*frames_per_second != xfer->frames_per_second) {
+                       // Not initial value.
+                       if (xfer->frames_per_second != 8000) {
+                               fprintf(stderr,
+                                       "Sampling rate mismatch: %u is given "
+                                       "but %u by files\n",
+                                       xfer->frames_per_second,
+                                       *frames_per_second);
+                               return -EINVAL;
+                       }
+               }
+       }
+
+       err = xfer->ops->pre_process(xfer, format, samples_per_frame,
+                                    frames_per_second, access,
+                                    frames_per_buffer);
+       if (err < 0)
+               return err;
+
+       assert(*format >= SND_PCM_FORMAT_S8);
+       assert(*format <= SND_PCM_FORMAT_LAST);
+       assert(*samples_per_frame > 0);
+       assert(*frames_per_second > 0);
+       assert(*access >= SND_PCM_ACCESS_MMAP_INTERLEAVED);
+       assert(*access <= SND_PCM_ACCESS_LAST);
+       assert(*frames_per_buffer > 0);
+
+       xfer->sample_format = *format;
+       xfer->samples_per_frame = *samples_per_frame;
+       xfer->frames_per_second = *frames_per_second;
+
+       if (xfer->direction == SND_PCM_STREAM_CAPTURE) {
+               err = xfer_options_fixup_paths(xfer);
+               if (err < 0)
+                       return err;
+       }
+
+       if (xfer->verbose > 1) {
+               fprintf(stderr, "Transfer: %s\n",
+                       xfer_type_labels[xfer->type]);
+               fprintf(stderr, "  access: %s\n",
+                       snd_pcm_access_name(*access));
+               fprintf(stderr, "  sample format: %s\n",
+                       snd_pcm_format_name(*format));
+               fprintf(stderr, "  bytes/sample: %u\n",
+                      snd_pcm_format_physical_width(*format) / 8);
+               fprintf(stderr, "  samples/frame: %u\n",
+                       *samples_per_frame);
+               fprintf(stderr, "  frames/second: %u\n",
+                       *frames_per_second);
+               fprintf(stderr, "  frames/buffer: %lu\n",
+                       *frames_per_buffer);
+       }
+
+       return 0;
+}
+
+int xfer_context_process_frames(struct xfer_context *xfer,
+                               struct mapper_context *mapper,
+                               struct container_context *cntrs,
+                               unsigned int *frame_count)
+{
+       assert(xfer);
+       assert(mapper);
+       assert(cntrs);
+       assert(frame_count);
+
+       if (!xfer->ops)
+               return -ENXIO;
+
+       return xfer->ops->process_frames(xfer, frame_count, mapper, cntrs);
+}
+
+void xfer_context_pause(struct xfer_context *xfer, bool enable)
+{
+       assert(xfer);
+
+       if (!xfer->ops)
+               return;
+
+       xfer->ops->pause(xfer, enable);
+}
+
+void xfer_context_post_process(struct xfer_context *xfer)
+{
+       assert(xfer);
+
+       if (!xfer->ops)
+               return;
+
+       xfer->ops->post_process(xfer);
+}
diff --git a/axfer/xfer.h b/axfer/xfer.h
new file mode 100644 (file)
index 0000000..b5a0e29
--- /dev/null
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// xfer.h - a header for receiver/transmiter of data frames.
+//
+// Copyright (c) 2018 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+//
+// Licensed under the terms of the GNU General Public License, version 2.
+
+#ifndef __ALSA_UTILS_AXFER_XFER__H_
+#define __ALSA_UTILS_AXFER_XFER__H_
+
+#include "aconfig.h"
+
+#include "mapper.h"
+
+#include <getopt.h>
+
+enum xfer_type {
+       XFER_TYPE_UNSUPPORTED = -1,
+       XFER_TYPE_LIBASOUND = 0,
+#if WITH_FFADO
+       XFER_TYPE_LIBFFADO,
+#endif
+       XFER_TYPE_COUNT,
+};
+
+struct xfer_ops;
+
+struct xfer_context {
+       snd_pcm_stream_t direction;
+       enum xfer_type type;
+       const struct xfer_ops *ops;
+       void *private_data;
+
+       char *sample_format_literal;
+       char *cntr_format_literal;
+       unsigned int verbose;
+       unsigned int duration_seconds;
+       unsigned int duration_frames;
+       unsigned int frames_per_second;
+       unsigned int samples_per_frame;
+       bool help:1;
+       bool quiet:1;
+       bool dump_hw_params:1;
+       bool multiple_cntrs:1;  // For mapper.
+
+       snd_pcm_format_t sample_format;
+
+       // For containers.
+       char **paths;
+       unsigned int path_count;
+       enum container_format cntr_format;
+};
+
+enum xfer_type xfer_type_from_label(const char *label);
+const char *xfer_label_from_type(enum xfer_type type);
+
+int xfer_context_init(struct xfer_context *xfer, enum xfer_type type,
+                     snd_pcm_stream_t direction, int argc, char *const *argv);
+void xfer_context_destroy(struct xfer_context *xfer);
+int xfer_context_pre_process(struct xfer_context *xfer,
+                            snd_pcm_format_t *format,
+                            unsigned int *samples_per_frame,
+                            unsigned int *frames_per_second,
+                            snd_pcm_access_t *access,
+                            snd_pcm_uframes_t *frames_per_buffer);
+int xfer_context_process_frames(struct xfer_context *xfer,
+                               struct mapper_context *mapper,
+                               struct container_context *cntrs,
+                               unsigned int *frame_count);
+void xfer_context_pause(struct xfer_context *xfer, bool enable);
+void xfer_context_post_process(struct xfer_context *xfer);
+
+struct xfer_data;
+int xfer_options_parse_args(struct xfer_context *xfer,
+                           const struct xfer_data *data, int argc,
+                           char *const *argv);
+int xfer_options_fixup_paths(struct xfer_context *xfer);
+void xfer_options_calculate_duration(struct xfer_context *xfer,
+                                    uint64_t *total_frame_count);
+
+// For internal use in 'xfer' module.
+
+struct xfer_ops {
+       int (*init)(struct xfer_context *xfer, snd_pcm_stream_t direction);
+       int (*parse_opt)(struct xfer_context *xfer, int key, const char *optarg);
+       int (*validate_opts)(struct xfer_context *xfer);
+       int (*pre_process)(struct xfer_context *xfer, snd_pcm_format_t *format,
+                          unsigned int *samples_per_frame,
+                          unsigned int *frames_per_second,
+                          snd_pcm_access_t *access,
+                          snd_pcm_uframes_t *frames_per_buffer);
+       int (*process_frames)(struct xfer_context *xfer,
+                             unsigned int *frame_count,
+                             struct mapper_context *mapper,
+                             struct container_context *cntrs);
+       void (*post_process)(struct xfer_context *xfer);
+       void (*destroy)(struct xfer_context *xfer);
+       void (*pause)(struct xfer_context *xfer, bool enable);
+       void (*help)(struct xfer_context *xfer);
+};
+
+struct xfer_data {
+       const char *s_opts;
+       const struct option *l_opts;
+       unsigned int l_opts_count;
+       struct xfer_ops ops;
+       unsigned int private_size;
+};
+
+extern const struct xfer_data xfer_libasound;
+
+#if WITH_FFADO
+       extern const struct xfer_data xfer_libffado;
+#endif
+
+#endif
diff --git a/bat/Makefile.am b/bat/Makefile.am
new file mode 100644 (file)
index 0000000..5151f77
--- /dev/null
@@ -0,0 +1,36 @@
+SUBDIRS=tests
+bin_PROGRAMS = alsabat
+man_MANS = alsabat.1
+EXTRA_DIST = alsabat.1 alsabat-test.sh
+sbin_SCRIPTS = alsabat-test.sh
+
+alsabat_SOURCES = \
+       bat.c \
+       common.c \
+       signal.c \
+       latencytest.c \
+       convert.c
+
+noinst_HEADERS = \
+       common.h \
+       bat-signal.h \
+       latencytest.h \
+       convert.h
+
+if HAVE_LIBFFTW3
+alsabat_SOURCES += analyze.c
+noinst_HEADERS += analyze.h
+endif
+
+if HAVE_LIBTINYALSA
+alsabat_SOURCES += tinyalsa.c
+noinst_HEADERS += tinyalsa.h
+else
+alsabat_SOURCES += alsa.c
+noinst_HEADERS += alsa.h
+endif
+
+AM_CPPFLAGS = \
+             -Wall -I$(top_srcdir)/include
+
+alsabat_LDADD = @FFTW_LIB@
diff --git a/bat/Makefile.in b/bat/Makefile.in
new file mode 100644 (file)
index 0000000..b53f9de
--- /dev/null
@@ -0,0 +1,982 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = alsabat$(EXEEXT)
+@HAVE_LIBFFTW3_TRUE@am__append_1 = analyze.c
+@HAVE_LIBFFTW3_TRUE@am__append_2 = analyze.h
+@HAVE_LIBTINYALSA_TRUE@am__append_3 = tinyalsa.c
+@HAVE_LIBTINYALSA_TRUE@am__append_4 = tinyalsa.h
+@HAVE_LIBTINYALSA_FALSE@am__append_5 = alsa.c
+@HAVE_LIBTINYALSA_FALSE@am__append_6 = alsa.h
+subdir = bat
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__noinst_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \
+       "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__alsabat_SOURCES_DIST = bat.c common.c signal.c latencytest.c \
+       convert.c analyze.c tinyalsa.c alsa.c
+@HAVE_LIBFFTW3_TRUE@am__objects_1 = analyze.$(OBJEXT)
+@HAVE_LIBTINYALSA_TRUE@am__objects_2 = tinyalsa.$(OBJEXT)
+@HAVE_LIBTINYALSA_FALSE@am__objects_3 = alsa.$(OBJEXT)
+am_alsabat_OBJECTS = bat.$(OBJEXT) common.$(OBJEXT) signal.$(OBJEXT) \
+       latencytest.$(OBJEXT) convert.$(OBJEXT) $(am__objects_1) \
+       $(am__objects_2) $(am__objects_3)
+alsabat_OBJECTS = $(am_alsabat_OBJECTS)
+alsabat_DEPENDENCIES =
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+SCRIPTS = $(sbin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/alsa.Po ./$(DEPDIR)/analyze.Po \
+       ./$(DEPDIR)/bat.Po ./$(DEPDIR)/common.Po \
+       ./$(DEPDIR)/convert.Po ./$(DEPDIR)/latencytest.Po \
+       ./$(DEPDIR)/signal.Po ./$(DEPDIR)/tinyalsa.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(alsabat_SOURCES)
+DIST_SOURCES = $(am__alsabat_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+am__noinst_HEADERS_DIST = common.h bat-signal.h latencytest.h \
+       convert.h analyze.h tinyalsa.h alsa.h
+HEADERS = $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+SUBDIRS = tests
+man_MANS = alsabat.1
+EXTRA_DIST = alsabat.1 alsabat-test.sh
+sbin_SCRIPTS = alsabat-test.sh
+alsabat_SOURCES = bat.c common.c signal.c latencytest.c convert.c \
+       $(am__append_1) $(am__append_3) $(am__append_5)
+noinst_HEADERS = common.h bat-signal.h latencytest.h convert.h \
+       $(am__append_2) $(am__append_4) $(am__append_6)
+AM_CPPFLAGS = \
+             -Wall -I$(top_srcdir)/include
+
+alsabat_LDADD = @FFTW_LIB@
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bat/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign bat/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
+alsabat$(EXEEXT): $(alsabat_OBJECTS) $(alsabat_DEPENDENCIES) $(EXTRA_alsabat_DEPENDENCIES) 
+       @rm -f alsabat$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(alsabat_OBJECTS) $(alsabat_LDADD) $(LIBS)
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-sbinSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsa.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/analyze.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/latencytest.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyalsa.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man1: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man1dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.1[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
+           dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+           $(am__relativize); \
+           new_distdir=$$reldir; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+               -rm -f ./$(DEPDIR)/alsa.Po
+       -rm -f ./$(DEPDIR)/analyze.Po
+       -rm -f ./$(DEPDIR)/bat.Po
+       -rm -f ./$(DEPDIR)/common.Po
+       -rm -f ./$(DEPDIR)/convert.Po
+       -rm -f ./$(DEPDIR)/latencytest.Po
+       -rm -f ./$(DEPDIR)/signal.Po
+       -rm -f ./$(DEPDIR)/tinyalsa.Po
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-sbinSCRIPTS
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+               -rm -f ./$(DEPDIR)/alsa.Po
+       -rm -f ./$(DEPDIR)/analyze.Po
+       -rm -f ./$(DEPDIR)/bat.Po
+       -rm -f ./$(DEPDIR)/common.Po
+       -rm -f ./$(DEPDIR)/convert.Po
+       -rm -f ./$(DEPDIR)/latencytest.Po
+       -rm -f ./$(DEPDIR)/signal.Po
+       -rm -f ./$(DEPDIR)/tinyalsa.Po
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man \
+       uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--depfiles check check-am clean clean-binPROGRAMS \
+       clean-generic clean-libtool cscopelist-am ctags ctags-am \
+       distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-sbinSCRIPTS install-strip installcheck installcheck-am \
+       installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
+       uninstall-man uninstall-man1 uninstall-sbinSCRIPTS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bat/alsa.c b/bat/alsa.c
new file mode 100644 (file)
index 0000000..67489c4
--- /dev/null
@@ -0,0 +1,733 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+#include "aconfig.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <pthread.h>
+#include <errno.h>
+
+#include <alsa/asoundlib.h>
+
+#include "gettext.h"
+
+#include "common.h"
+#include "alsa.h"
+#include "latencytest.h"
+#include "os_compat.h"
+
+struct pcm_container {
+       snd_pcm_t *handle;
+       snd_pcm_uframes_t period_size;
+       snd_pcm_uframes_t buffer_size;
+       snd_pcm_format_t format;
+       unsigned short channels;
+       size_t period_bytes;
+       size_t sample_bits;
+       size_t frame_bits;
+       char *buffer;
+};
+
+struct format_map_table {
+       enum _bat_pcm_format format_bat;
+       snd_pcm_format_t format_alsa;
+};
+
+static struct format_map_table map_tables[] = {
+       { BAT_PCM_FORMAT_UNKNOWN, SND_PCM_FORMAT_UNKNOWN },
+       { BAT_PCM_FORMAT_U8, SND_PCM_FORMAT_U8 },
+       { BAT_PCM_FORMAT_S16_LE, SND_PCM_FORMAT_S16_LE },
+       { BAT_PCM_FORMAT_S24_3LE, SND_PCM_FORMAT_S24_3LE },
+       { BAT_PCM_FORMAT_S32_LE, SND_PCM_FORMAT_S32_LE },
+       { BAT_PCM_FORMAT_MAX, 0 },
+};
+
+static int format_convert(struct bat *bat, snd_pcm_format_t *fmt)
+{
+       struct format_map_table *t = map_tables;
+
+       for (; t->format_bat != BAT_PCM_FORMAT_MAX; t++) {
+               if (t->format_bat == bat->format) {
+                       *fmt = t->format_alsa;
+                       return 0;
+               }
+       }
+       fprintf(bat->err, _("Invalid format!\n"));
+       return -EINVAL;
+}
+
+static int set_snd_pcm_params(struct bat *bat, struct pcm_container *sndpcm)
+{
+       snd_pcm_hw_params_t *params;
+       snd_pcm_format_t format;
+       unsigned int buffer_time = 0;
+       unsigned int period_time = 0;
+       snd_pcm_uframes_t buffer_size = 0;
+       snd_pcm_uframes_t period_size = 0;
+       unsigned int rate;
+       int err;
+       const char *device_name = snd_pcm_name(sndpcm->handle);
+
+       /* Convert common format to ALSA format */
+       err = format_convert(bat, &format);
+       if (err != 0)
+               return err;
+
+       /* Allocate a hardware parameters object. */
+       snd_pcm_hw_params_alloca(&params);
+
+       /* Fill it in with default values. */
+       err = snd_pcm_hw_params_any(sndpcm->handle, params);
+       if (err < 0) {
+               fprintf(bat->err, _("Set parameter to device error: "));
+               fprintf(bat->err, _("default params: %s: %s(%d)\n"),
+                               device_name, snd_strerror(err), err);
+               return err;
+       }
+
+       /* Set access mode */
+       err = snd_pcm_hw_params_set_access(sndpcm->handle, params,
+                       SND_PCM_ACCESS_RW_INTERLEAVED);
+       if (err < 0) {
+               fprintf(bat->err, _("Set parameter to device error: "));
+               fprintf(bat->err, _("access type: %s: %s(%d)\n"),
+                               device_name, snd_strerror(err), err);
+               return err;
+       }
+
+       /* Set format */
+       err = snd_pcm_hw_params_set_format(sndpcm->handle, params, format);
+       if (err < 0) {
+               fprintf(bat->err, _("Set parameter to device error: "));
+               fprintf(bat->err, _("PCM format: %d %s: %s(%d)\n"), format,
+                               device_name, snd_strerror(err), err);
+               return err;
+       }
+
+       /* Set channels */
+       err = snd_pcm_hw_params_set_channels(sndpcm->handle,
+                       params, bat->channels);
+       if (err < 0) {
+               fprintf(bat->err, _("Set parameter to device error: "));
+               fprintf(bat->err, _("channel number: %d %s: %s(%d)\n"),
+                               bat->channels,
+                               device_name, snd_strerror(err), err);
+               return err;
+       }
+
+       /* Set sampling rate */
+       rate = bat->rate;
+       err = snd_pcm_hw_params_set_rate_near(sndpcm->handle,
+                       params, &bat->rate,
+                       0);
+       if (err < 0) {
+               fprintf(bat->err, _("Set parameter to device error: "));
+               fprintf(bat->err, _("sample rate: %d %s: %s(%d)\n"),
+                               bat->rate,
+                               device_name, snd_strerror(err), err);
+               return err;
+       }
+       if ((float) rate * (1 + RATE_RANGE) < bat->rate
+                       || (float) rate * (1 - RATE_RANGE) > bat->rate) {
+               fprintf(bat->err, _("Invalid parameters: sample rate: "));
+               fprintf(bat->err, _("requested %dHz, got %dHz\n"),
+                               rate, bat->rate);
+               return -EINVAL;
+       }
+
+       if (bat->buffer_size > 0 && bat->period_size == 0)
+               bat->period_size = bat->buffer_size / DIV_BUFFERSIZE;
+
+       if (bat->roundtriplatency && bat->buffer_size == 0) {
+               /* Set to minimum buffer size and period size
+                  for latency test */
+               if (snd_pcm_hw_params_get_buffer_size_min(params,
+                               &buffer_size) < 0) {
+                       fprintf(bat->err,
+                                       _("Get parameter from device error: "));
+                       fprintf(bat->err, _("buffer size min: %d %s: %s(%d)\n"),
+                                       (int) buffer_size,
+                                       device_name, snd_strerror(err), err);
+                       return -EINVAL;
+               }
+
+               if (snd_pcm_hw_params_get_period_size_min(params,
+                               &period_size, 0) < 0) {
+                       fprintf(bat->err,
+                                       _("Get parameter from device error: "));
+                       fprintf(bat->err, _("period size min: %d %s: %s(%d)\n"),
+                                       (int) period_size,
+                                       device_name, snd_strerror(err), err);
+                       return -EINVAL;
+               }
+               bat->buffer_size = (int) buffer_size;
+               bat->period_size = (int) period_size;
+       }
+
+       if (bat->buffer_size > 0) {
+               buffer_size = bat->buffer_size;
+               period_size = bat->period_size;
+
+               fprintf(bat->log, _("Set period size: %d  buffer size: %d\n"),
+                               (int) period_size, (int) buffer_size);
+
+               err = snd_pcm_hw_params_set_buffer_size_near(sndpcm->handle,
+                               params, &buffer_size);
+               if (err < 0) {
+                       fprintf(bat->err, _("Set parameter to device error: "));
+                       fprintf(bat->err, _("buffer size: %d %s: %s(%d)\n"),
+                                       (int) buffer_size,
+                                       device_name, snd_strerror(err), err);
+                       return err;
+               }
+
+               err = snd_pcm_hw_params_set_period_size_near(sndpcm->handle,
+                               params, &period_size, 0);
+               if (err < 0) {
+                       fprintf(bat->err, _("Set parameter to device error: "));
+                       fprintf(bat->err, _("period size: %d %s: %s(%d)\n"),
+                                       (int) period_size,
+                                       device_name, snd_strerror(err), err);
+                       return err;
+               }
+       } else {
+               if (snd_pcm_hw_params_get_buffer_time_max(params,
+                               &buffer_time, 0) < 0) {
+                       fprintf(bat->err,
+                                       _("Get parameter from device error: "));
+                       fprintf(bat->err, _("buffer time: %d %s: %s(%d)\n"),
+                                       buffer_time,
+                                       device_name, snd_strerror(err), err);
+                       return -EINVAL;
+               }
+
+               if (buffer_time > MAX_BUFFERTIME)
+                       buffer_time = MAX_BUFFERTIME;
+
+               period_time = buffer_time / DIV_BUFFERTIME;
+
+               /* Set buffer time and period time */
+               err = snd_pcm_hw_params_set_buffer_time_near(sndpcm->handle,
+                               params, &buffer_time, 0);
+               if (err < 0) {
+                       fprintf(bat->err, _("Set parameter to device error: "));
+                       fprintf(bat->err, _("buffer time: %d %s: %s(%d)\n"),
+                                       buffer_time,
+                                       device_name, snd_strerror(err), err);
+                       return err;
+               }
+
+               err = snd_pcm_hw_params_set_period_time_near(sndpcm->handle,
+                               params, &period_time, 0);
+               if (err < 0) {
+                       fprintf(bat->err, _("Set parameter to device error: "));
+                       fprintf(bat->err, _("period time: %d %s: %s(%d)\n"),
+                                       period_time,
+                                       device_name, snd_strerror(err), err);
+                       return err;
+               }
+       }
+
+       /* Write the parameters to the driver */
+       if (snd_pcm_hw_params(sndpcm->handle, params) < 0) {
+               fprintf(bat->err, _("Set parameter to device error: "));
+               fprintf(bat->err, _("hw params: %s: %s(%d)\n"),
+                               device_name, snd_strerror(err), err);
+               return -EINVAL;
+       }
+
+       err = snd_pcm_hw_params_get_period_size(params,
+                       &sndpcm->period_size, 0);
+       if (err < 0) {
+               fprintf(bat->err, _("Get parameter from device error: "));
+               fprintf(bat->err, _("period size: %zd %s: %s(%d)\n"),
+                               sndpcm->period_size,
+                               device_name, snd_strerror(err), err);
+               return err;
+       }
+
+       err = snd_pcm_hw_params_get_buffer_size(params, &sndpcm->buffer_size);
+       if (err < 0) {
+               fprintf(bat->err, _("Get parameter from device error: "));
+               fprintf(bat->err, _("buffer size: %zd %s: %s(%d)\n"),
+                               sndpcm->buffer_size,
+                               device_name, snd_strerror(err), err);
+               return err;
+       }
+
+       if (sndpcm->period_size == sndpcm->buffer_size) {
+               fprintf(bat->err, _("Invalid parameters: can't use period "));
+               fprintf(bat->err, _("equal to buffer size (%zd)\n"),
+                               sndpcm->period_size);
+               return -EINVAL;
+       }
+
+       fprintf(bat->log, _("Get period size: %d  buffer size: %d\n"),
+                       (int) sndpcm->period_size, (int) sndpcm->buffer_size);
+
+       err = snd_pcm_format_physical_width(format);
+       if (err < 0) {
+               fprintf(bat->err, _("Invalid parameters: "));
+               fprintf(bat->err, _("snd_pcm_format_physical_width: %d\n"),
+                               err);
+               return err;
+       }
+       sndpcm->sample_bits = err;
+
+       sndpcm->frame_bits = sndpcm->sample_bits * bat->channels;
+
+       /* Calculate the period bytes */
+       sndpcm->period_bytes = sndpcm->period_size * sndpcm->frame_bits / 8;
+       sndpcm->buffer = (char *) malloc(sndpcm->period_bytes);
+       if (sndpcm->buffer == NULL) {
+               fprintf(bat->err, _("Not enough memory: size=%zd\n"),
+                               sndpcm->period_bytes);
+               return -ENOMEM;
+       }
+
+       return 0;
+}
+
+static int write_to_pcm(const struct pcm_container *sndpcm,
+               int frames, struct bat *bat)
+{
+       int err;
+       int offset = 0;
+       int remain = frames;
+
+       while (remain > 0) {
+               err = snd_pcm_writei(sndpcm->handle, sndpcm->buffer + offset,
+                               remain);
+               if (err == -EAGAIN || (err >= 0 && err < frames)) {
+                       snd_pcm_wait(sndpcm->handle, 500);
+               } else if (err == -EPIPE) {
+                       fprintf(bat->err, _("Underrun: %s(%d)\n"),
+                                       snd_strerror(err), err);
+                       if (bat->roundtriplatency)
+                               bat->latency.xrun_error = true;
+                       snd_pcm_prepare(sndpcm->handle);
+               } else if (err == -ESTRPIPE) {
+                       while ((err = snd_pcm_resume(sndpcm->handle)) == -EAGAIN)
+                               sleep(1);  /* wait until resume flag is released */
+                       if (err < 0)
+                               snd_pcm_prepare(sndpcm->handle);
+               } else if (err < 0) {
+                       fprintf(bat->err, _("Write PCM device error: %s(%d)\n"),
+                                       snd_strerror(err), err);
+                       return err;
+               }
+
+               if (err > 0) {
+                       remain -= err;
+                       offset += err * sndpcm->frame_bits / 8;
+               }
+       }
+
+       return 0;
+}
+
+/**
+ * Process output data for latency test
+ */
+static int latencytest_process_output(struct pcm_container *sndpcm,
+               struct bat *bat)
+{
+       int err = 0;
+       int bytes = sndpcm->period_bytes; /* playback buffer size */
+       int frames = sndpcm->period_size; /* frame count */
+
+       bat->latency.is_playing = true;
+
+       while (1) {
+               /* generate output data */
+               err = handleoutput(bat, sndpcm->buffer, bytes, frames);
+               if (err != 0)
+                       break;
+
+               err = write_to_pcm(sndpcm, frames, bat);
+               if (err != 0)
+                       break;
+
+               /* Xrun error, terminate the playback thread*/
+               if (bat->latency.xrun_error == true)
+                       break;
+
+               if (bat->latency.state == LATENCY_STATE_COMPLETE_SUCCESS)
+                       break;
+
+               bat->periods_played++;
+       }
+
+       bat->latency.is_playing = false;
+
+       return err;
+}
+
+static int write_to_pcm_loop(struct pcm_container *sndpcm, struct bat *bat)
+{
+       int err = 0;
+       int bytes = sndpcm->period_bytes; /* playback buffer size */
+       int frames = bytes * 8 / sndpcm->frame_bits; /* frame count */
+       FILE *fp = NULL;
+       int bytes_total = 0;
+
+       if (bat->debugplay) {
+               fp = fopen(bat->debugplay, "wb");
+               err = -errno;
+               if (fp == NULL) {
+                       fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                                       bat->debugplay, err);
+                       return err;
+               }
+               /* leave space for wav header */
+               if (fseek(fp, sizeof(struct wav_container), SEEK_SET) != 0) {
+                       err = -errno;
+                       fclose(fp);
+                       return err;
+               }
+       }
+
+       while (1) {
+               err = generate_input_data(bat, sndpcm->buffer, bytes, frames);
+               if (err != 0)
+                       break;
+
+               if (bat->debugplay) {
+                       if (fwrite(sndpcm->buffer, 1, bytes, fp) != (size_t)bytes) {
+                               err = -EIO;
+                               break;
+                       }
+                       bytes_total += bytes;
+               }
+
+               bat->periods_played++;
+               if (bat->period_is_limited
+                               && bat->periods_played >= bat->periods_total)
+                       break;
+
+               err = write_to_pcm(sndpcm, frames, bat);
+               if (err != 0)
+                       break;
+       }
+
+       if (bat->debugplay) {
+               update_wav_header(bat, fp, bytes_total);
+               fclose(fp);
+       }
+
+       snd_pcm_drain(sndpcm->handle);
+
+       return err;
+}
+
+/**
+ * Play
+ */
+void *playback_alsa(struct bat *bat)
+{
+       int err = 0;
+       struct pcm_container sndpcm;
+
+       fprintf(bat->log, _("Entering playback thread (ALSA).\n"));
+
+       retval_play = 0;
+       memset(&sndpcm, 0, sizeof(sndpcm));
+
+       err = snd_pcm_open(&sndpcm.handle, bat->playback.device,
+                       SND_PCM_STREAM_PLAYBACK, 0);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot open PCM playback device: "));
+               fprintf(bat->err, _("%s(%d)\n"), snd_strerror(err), err);
+               retval_play = err;
+               goto exit1;
+       }
+
+       err = set_snd_pcm_params(bat, &sndpcm);
+       if (err != 0) {
+               retval_play = err;
+               goto exit2;
+       }
+
+       if (bat->playback.file == NULL) {
+               fprintf(bat->log, _("Playing generated audio sine wave"));
+               bat->sinus_duration == 0 ?
+                       fprintf(bat->log, _(" endlessly\n")) :
+                       fprintf(bat->log, _("\n"));
+       } else {
+               fprintf(bat->log, _("Playing input audio file: %s\n"),
+                               bat->playback.file);
+               bat->fp = fopen(bat->playback.file, "rb");
+               err = -errno;
+               if (bat->fp == NULL) {
+                       fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                                       bat->playback.file, err);
+                       retval_play = err;
+                       goto exit3;
+               }
+               /* Skip header */
+               err = read_wav_header(bat, bat->playback.file, bat->fp, true);
+               if (err != 0) {
+                       retval_play = err;
+                       goto exit4;
+               }
+       }
+
+       if (bat->roundtriplatency)
+               err = latencytest_process_output(&sndpcm, bat);
+       else
+               err = write_to_pcm_loop(&sndpcm, bat);
+       if (err < 0) {
+               retval_play = err;
+               goto exit4;
+       }
+
+exit4:
+       if (bat->playback.file)
+               fclose(bat->fp);
+exit3:
+       free(sndpcm.buffer);
+exit2:
+       snd_pcm_close(sndpcm.handle);
+exit1:
+       pthread_exit(&retval_play);
+}
+
+static int read_from_pcm(struct pcm_container *sndpcm,
+               int frames, struct bat *bat)
+{
+       int err = 0;
+       int offset = 0;
+       int remain = frames;
+
+       while (remain > 0) {
+               err = snd_pcm_readi(sndpcm->handle,
+                               sndpcm->buffer + offset, remain);
+               if (err == -EAGAIN || (err >= 0 && err < remain)) {
+                       snd_pcm_wait(sndpcm->handle, 500);
+               } else if (err == -EPIPE) {
+                       snd_pcm_prepare(sndpcm->handle);
+                       fprintf(bat->err, _("Overrun: %s(%d)\n"),
+                                       snd_strerror(err), err);
+                       if (bat->roundtriplatency)
+                               bat->latency.xrun_error = true;
+               } else if (err == -ESTRPIPE) {
+                       while ((err = snd_pcm_resume(sndpcm->handle)) == -EAGAIN)
+                               sleep(1);  /* wait until resume flag is released */
+                       if (err < 0)
+                               snd_pcm_prepare(sndpcm->handle);
+               } else if (err < 0) {
+                       fprintf(bat->err, _("Read PCM device error: %s(%d)\n"),
+                                       snd_strerror(err), err);
+                       return err;
+               }
+
+               if (err > 0) {
+                       remain -= err;
+                       offset += err * sndpcm->frame_bits / 8;
+               }
+       }
+
+       return 0;
+}
+
+static int read_from_pcm_loop(struct pcm_container *sndpcm, struct bat *bat)
+{
+       int err = 0;
+       FILE *fp = NULL;
+       int size, frames;
+       int bytes_read = 0;
+       int bytes_count = bat->frames * bat->frame_size;
+       unsigned int remain = bytes_count;
+
+       remove(bat->capture.file);
+       fp = fopen(bat->capture.file, "wb");
+       err = -errno;
+       if (fp == NULL) {
+               fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                               bat->capture.file, err);
+               return err;
+       }
+       /* leave space for file header */
+       if (fseek(fp, sizeof(struct wav_container), SEEK_SET) != 0) {
+               err = -errno;
+               fclose(fp);
+               return err;
+       }
+
+       while (remain > 0) {
+               size = (remain <= sndpcm->period_bytes) ?
+                       remain : sndpcm->period_bytes;
+               frames = size * 8 / sndpcm->frame_bits;
+
+               /* read a chunk from pcm device */
+               err = read_from_pcm(sndpcm, frames, bat);
+               if (err != 0)
+                       break;
+
+               /* write the chunk to file */
+               if (fwrite(sndpcm->buffer, 1, size, fp) != (size_t)size) {
+                       err = -EIO;
+                       break;
+               }
+
+               bytes_read += size;
+               remain -= size;
+               bat->periods_played++;
+
+               if (bat->period_is_limited
+                               && bat->periods_played >= bat->periods_total)
+                       break;
+       }
+
+       update_wav_header(bat, fp, bytes_read);
+
+       fclose(fp);
+       return err;
+}
+
+/**
+ * Process input data for latency test
+ */
+static int latencytest_process_input(struct pcm_container *sndpcm,
+               struct bat *bat)
+{
+       int err = 0;
+       FILE *fp = NULL;
+       int bytes_read = 0;
+       int frames = sndpcm->period_size;
+       int size = sndpcm->period_bytes;
+       int bytes_count = bat->frames * bat->frame_size;
+
+       remove(bat->capture.file);
+       fp = fopen(bat->capture.file, "wb");
+       err = -errno;
+       if (fp == NULL) {
+               fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                               bat->capture.file, err);
+               return err;
+       }
+       /* leave space for file header */
+       if (fseek(fp, sizeof(struct wav_container), SEEK_SET) != 0) {
+               fclose(fp);
+               return err;
+       }
+
+       bat->latency.is_capturing = true;
+
+       while (bytes_read < bytes_count) {
+               /* read a chunk from pcm device */
+               err = read_from_pcm(sndpcm, frames, bat);
+               if (err != 0)
+                       break;
+
+               /* Xrun error, terminate the capture thread*/
+               if (bat->latency.xrun_error == true)
+                       break;
+
+               err = handleinput(bat, sndpcm->buffer, frames);
+               if (err != 0)
+                       break;
+
+               if (bat->latency.is_playing == false)
+                       break;
+
+               /* write the chunk to file */
+               if (fwrite(sndpcm->buffer, 1, size, fp) != (size_t)size) {
+                       err = -EIO;
+                       break;
+               }
+
+               bytes_read += size;
+       }
+
+       bat->latency.is_capturing = false;
+
+       update_wav_header(bat, fp, bytes_read);
+
+       fclose(fp);
+       return err;
+}
+
+
+static void pcm_cleanup(void *p)
+{
+       snd_pcm_close(p);
+}
+
+/**
+ * Record
+ */
+void *record_alsa(struct bat *bat)
+{
+       int err = 0;
+       struct pcm_container sndpcm;
+
+       pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+
+       fprintf(bat->log, _("Entering capture thread (ALSA).\n"));
+
+       retval_record = 0;
+       memset(&sndpcm, 0, sizeof(sndpcm));
+
+       err = snd_pcm_open(&sndpcm.handle, bat->capture.device,
+                       SND_PCM_STREAM_CAPTURE, 0);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot open PCM capture device: "));
+               fprintf(bat->err, _("%s(%d)\n"), snd_strerror(err), err);
+               retval_record = err;
+               goto exit1;
+       }
+
+       err = set_snd_pcm_params(bat, &sndpcm);
+       if (err != 0) {
+               retval_record = err;
+               goto exit2;
+       }
+
+       pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+       pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+       pthread_cleanup_push(pcm_cleanup, sndpcm.handle);
+       pthread_cleanup_push(free, sndpcm.buffer);
+
+       fprintf(bat->log, _("Recording ...\n"));
+       if (bat->roundtriplatency)
+               err = latencytest_process_input(&sndpcm, bat);
+       else
+               err = read_from_pcm_loop(&sndpcm, bat);
+
+       pthread_cleanup_pop(0);
+       pthread_cleanup_pop(0);
+
+       if (err != 0) {
+               retval_record = err;
+               goto exit3;
+       }
+
+       /* Normally we will never reach this part of code (unless error in
+        * previous call) (before exit3) as this thread will be cancelled
+        * by end of play thread. Except in single line mode. */
+       snd_pcm_drain(sndpcm.handle);
+       pthread_exit(&retval_record);
+
+exit3:
+       free(sndpcm.buffer);
+exit2:
+       snd_pcm_close(sndpcm.handle);
+exit1:
+       pthread_exit(&retval_record);
+}
diff --git a/bat/alsa.h b/bat/alsa.h
new file mode 100644 (file)
index 0000000..d5c9972
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+extern int retval_play;
+extern int retval_record;
+
+void *playback_alsa(struct bat *);
+void *record_alsa(struct bat *);
diff --git a/bat/alsabat-test.sh b/bat/alsabat-test.sh
new file mode 100755 (executable)
index 0000000..bc3d512
--- /dev/null
@@ -0,0 +1,152 @@
+#!/bin/bash
+
+# default devices
+dev_playback="default"
+dev_capture="default"
+
+bin="alsabat"
+commands="$bin -P $dev_playback -C $dev_capture"
+
+file_sin_mono="default_mono.wav"
+file_sin_dual="default_dual.wav"
+logdir="tmp"
+
+# frequency range of signal
+maxfreq=16547
+minfreq=17
+
+# sleep time and pause time
+sleep_time=5
+pause_time=2
+
+# features passes vs. features all
+feature_pass=0
+feature_cnt=0
+
+init_counter () {
+       feature_pass=0
+       feature_all=0
+}
+
+evaluate_result () {
+       feature_cnt=$((feature_cnt+1))
+       if [ $1 -eq 0 ]; then
+               feature_pass=$((feature_pass+1))
+               echo "pass"
+       else
+               echo "fail"
+       fi
+}
+
+print_result () {
+       echo "[$feature_pass/$feature_cnt] features passes."
+}
+
+feature_test () {
+       echo "============================================"
+       echo "$feature_cnt: ALSA $2"
+       echo "-------------------------------------------"
+       echo "$commands $1 --log=$logdir/$feature_cnt.log"
+       $commands $1 --log=$logdir/$feature_cnt.log
+       evaluate_result $?
+       echo "$commands $1" >> $logdir/$((feature_cnt-1)).log
+}
+
+feature_test_power () {
+       echo "============================================"
+       echo "$feature_cnt: ALSA $2"
+       echo "-------------------------------------------"
+       echo "$commands $1 --log=$logdir/$feature_cnt.log"
+
+       # run alsabat in the background
+       nohup $commands $1 > $logdir/$feature_cnt.log 2>&1 &
+       sleep $pause_time
+       pid=`ps -aux |grep alsabat|head -1 |awk -F ' ' '{print $2}'`
+
+       # stop the alsabat thread
+       kill -STOP $pid > /dev/null
+       sleep 4
+
+       # do system S3
+       rtcwake -m mem -s $sleep_time
+       sleep $pause_time
+
+       # resume the alasbat thread to run
+       kill -CONT $pid > /dev/null
+
+       # wait for alsabat to complete the analysis
+       sleep $pause_time
+       cat $logdir/$feature_cnt.log |grep -i "Return value is 0" > /dev/null
+       evaluate_result $?
+       echo "$commands $1" >> $logdir/$((feature_cnt-1)).log
+}
+
+# test items
+feature_list_test () {
+       init_counter
+
+       commands="$bin"
+       feature_test "-c1 --saveplay $file_sin_mono" \
+                       "generate mono wav file with default params"
+       feature_test "-c2 --saveplay $file_sin_dual" \
+                       "generate dual wav file with default params"
+       sleep 5
+       feature_test "-P $dev_playback" "single line mode, playback"
+       feature_test "-C $dev_capture --standalone" "single line mode, capture"
+
+       commands="$bin -P $dev_playback -C $dev_capture"
+       feature_test "--file $file_sin_mono" "play mono wav file and detect"
+       feature_test "--file $file_sin_dual" "play dual wav file and detect"
+       feature_test "-c1" "configurable channel number: 1"
+       feature_test "-c2 -F $minfreq:$maxfreq" "configurable channel number: 2"
+       feature_test "-r44100" "configurable sample rate: 44100"
+       feature_test "-r48000" "configurable sample rate: 48000"
+       feature_test "-n10000" "configurable duration: in samples"
+       feature_test "-n2.5s" "configurable duration: in seconds"
+       feature_test "-f U8" "configurable data format: U8"
+       feature_test "-f S16_LE" "configurable data format: S16_LE"
+       feature_test "-f S24_3LE" "configurable data format: S24_3LE"
+       feature_test "-f S32_LE" "configurable data format: S32_LE"
+       feature_test "-f cd" "configurable data format: cd"
+       feature_test "-f dat" "configurable data format: dat"
+       feature_test "-F $maxfreq --standalone" \
+                       "standalone mode: play and capture"
+       latestfile=`ls -t1 /tmp/bat.wav.* | head -n 1`
+       feature_test "--local -F $maxfreq --file $latestfile" \
+                       "local mode: analyze local file"
+       feature_test "--roundtriplatency" \
+                       "round trip latency test"
+       feature_test "--snr-db 26" \
+                       "noise detect threshold in SNR(dB)"
+       feature_test "--snr-pc 5" \
+                       "noise detect threshold in noise percentage(%)"
+       feature_test_power "-n5s" "power management: S3 test"
+
+       print_result
+}
+
+echo "*******************************************"
+echo "                BAT Test                   "
+echo "-------------------------------------------"
+
+# get device
+echo "usage:"
+echo "  $0 <sound card>"
+echo "  $0 <device-playback> <device-capture>"
+
+if [ $# -eq 2 ]; then
+       dev_playback=$1
+       dev_capture=$2
+elif [ $# -eq 1 ]; then
+       dev_playback=$1
+       dev_capture=$1
+fi
+
+echo "current setting:"
+echo "  $0 $dev_playback $dev_capture"
+
+# run
+mkdir -p $logdir
+feature_list_test
+
+echo "*******************************************"
diff --git a/bat/alsabat.1 b/bat/alsabat.1
new file mode 100644 (file)
index 0000000..67b6ca8
--- /dev/null
@@ -0,0 +1,185 @@
+.TH ALSABAT 1 "20th October 2015"
+.SH NAME
+alsabat \- command\-line sound tester for ALSA sound card driver
+
+.SH SYNOPSIS
+\fBalsabat\fP [\fIflags\fP]
+
+.SH DESCRIPTION
+\fBALSABAT(ALSA Basic Audio Tester)\fP is a simple command\-line utility
+intended to help automate audio driver and sound server testing with little
+human interaction. ALSABAT can be used to test audio quality, stress test
+features and test audio before and after PM state changes.
+
+ALSABAT's design is relatively simple. ALSABAT plays an audio stream and
+captures the same stream in either a digital or analog loop back. It then
+compares the captured stream using a FFT to the original to determine if
+the test case passes or fails.
+
+ALSABAT can either run wholly on the target machine being tested (standalone
+mode) or can run as a client/server mode where by alsabat client runs on the
+target and runs as a server on a separate tester machine. The client/server
+mode still requires some manual interaction for synchronization, but this
+is actively being developed for future releases.
+
+The hardware testing configuration may require the use of an analog cable
+connecting target to tester machines or a cable to create an analog
+loopback if no loopback mode is available on the sound hardware that is
+being tested.
+An analog loopback cable can be used to connect the "line in" to "line out"
+jacks to create a loopback. If only headphone and mic jacks (or combo jack)
+are available then the following simple circuit can be used to create an
+analog loopback :-
+
+https://source.android.com/devices/audio/loopback.html
+
+If tinyalsa is installed in system, user can choose tinyalsa as backend lib
+of alsabat, with configure option "--enable-alsabat-backend-tiny".
+
+.SH OPTIONS
+.TP
+\fI\-h, \-\-help\fP
+Help: show syntax.
+.TP
+\fI\-D\fP
+Select sound card to be tested by name.
+.TP
+\fI\-P\fP
+Select the playback PCM device.
+.TP
+\fI\-C\fP
+Select the capture PCM device.
+.TP
+\fI\-f\fP
+Sample format
+.br
+Recognized sample formats are: U8 S16_LE S24_3LE S32_LE
+.br
+Some of these may not be available on selected hardware
+.br
+The available format shortcuts are:
+.nf
+\-f cd (16 bit little endian, 44100, stereo) [\-f S16_LE \-c2 \-r44100]
+\-f dat (16 bit little endian, 48000, stereo) [\-f S16_LE \-c2 \-r48000]
+.fi
+If no format is given S16_LE is used.
+.TP
+\fI\-c\fP
+The number of channels. The default is one channel.
+Valid values at the moment are 1 or 2.
+.TP
+\fI\-r\fP
+Sampling rate in Hertz. The default rate is 44100 Hertz.
+Valid values depends on hardware support.
+.TP
+\fI\-n\fP
+Duration of generated signal.
+The value could be either of the two forms:
+.br
+1. Decimal integer, means number of frames;
+.br
+2. Floating point with suffix 's', means number of seconds.
+.br
+The default is 2 seconds.
+.TP
+\fI\-k\fP
+Sigma k value for analysis.
+.br
+The analysis function reads data from WAV file, run FFT against the data
+to get magnitude of frequency vectors, and then calculates the average
+value and standard deviation of frequency vectors. After that, we define
+a threshold:
+.br
+threshold = k * standard_deviation + mean_value
+.br
+Frequencies with amplitude larger than threshold will be recognized as a
+peak, and the frequency with largest peak value will be recognized as a
+detected frequency.
+.br
+ALSABAT then compares the detected frequency to target frequency, to
+decide if the detecting passes or fails.
+.br
+The default value is 3.0.
+.TP
+\fI\-F\fP
+Target frequency for signal generation and analysis, in Hertz.
+The default is 997.0 Hertz.
+Valid range is (DC_THRESHOLD, 40% * Sampling rate).
+.TP
+\fI\-p\fP
+Total number of periods to play or capture.
+.TP
+\fI\-\-log=#\fP
+Write stderr and stdout output to this log file.
+.TP
+\fI\-\-file=#\fP
+Input WAV file for playback.
+.TP
+\fI\-\-saveplay=#\fP
+Target WAV file to save capture test content.
+.TP
+\fI\-\-local\fP
+Internal loopback mode.
+Playback, capture and analysis internal to ALSABAT only. This is intended
+for developers to test new ALSABAT features as no audio is routed outside
+of ALSABAT.
+.TP
+\fI\-\-standalone\fP
+Add support for standalone mode where ALSABAT will run on a different machine
+to the one being tested.
+In standalone mode, the sound data can be generated, playback and captured
+just like in normal mode, but will not be analyzed.
+The ALSABAT being built without libfftw3 support is always in standalone mode.
+The ALSABAT in normal mode can also bypass data analysis using option
+"--standalone".
+.TP
+\fI\-\-roundtriplatency\fP
+Round trip latency test.
+Audio latency is the time delay as an audio signal passes through a system.
+There are many kinds of audio latency metrics. One useful metric is the
+round trip latency, which is the sum of output latency and input latency.
+.TP
+\fI\-\-snr\-db=#\fP
+Noise detection threshold in SNR (dB). 26dB indicates 5% noise in amplitude.
+ALSABAT will return error if signal SNR is smaller than the threshold.
+.TP
+\fI\-\-snr\-pc=#\fP
+Noise detection threshold in percentage of noise amplitude (%).
+ALSABAT will return error if the noise amplitude is larger than the threshold.
+
+.SH EXAMPLES
+
+.TP
+\fBalsabat \-P plughw:0,0 \-C plughw:0,0 \-c 2 \-f S32_LE \-F 250\fR
+Generate and play a sine wave of 250 Hertz with 2 channel and S32_LE format,
+and then capture and analyze.
+
+.TP
+\fBalsabat \-P plughw:0,0 \-C plughw:0,0 \-\-file 500Hz.wav\fR
+Play the RIFF WAV file "500Hz.wav" which contains 500 Hertz waveform LPCM
+data, and then capture and analyze.
+
+.SH RETURN VALUE
+.br
+On success, returns 0.
+.br
+If no peak be detected, returns -1001;
+.br
+If only DC be detected, returns -1002;
+.br
+If peak frequency does not match with the target frequency, returns -1003.
+
+.SH SEE ALSO
+\fB
+aplay(1)
+\fP
+
+.SH BUGS
+Currently only support RIFF WAV format with PCM data. Please report any bugs to
+the alsa-devel mailing list.
+
+.SH AUTHOR
+\fBalsabat\fP is by Liam Girdwood <liam.r.girdwood@linux.intel.com>, Bernard
+Gautier <bernard.gautier@intel.com> and Han Lu <han.lu@intel.com>.
+This document is by Liam Girdwood <liam.r.girdwood@linux.intel.com> and Han Lu
+<han.lu@intel.com>.
diff --git a/bat/analyze.c b/bat/analyze.c
new file mode 100644 (file)
index 0000000..b8d0270
--- /dev/null
@@ -0,0 +1,514 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+#include "aconfig.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#include <math.h>
+#include <fftw3.h>
+
+#include "gettext.h"
+
+#include "common.h"
+#include "bat-signal.h"
+
+static void check_amplitude(struct bat *bat, float *buf)
+{
+       float sum, average, amplitude;
+       int i, percent;
+
+       /* calculate average value */
+       for (i = 0, sum = 0.0, average = 0.0; i < bat->frames; i++)
+               sum += buf[i];
+       average = sum / bat->frames;
+
+       /* calculate peak-to-average amplitude */
+       for (i = 0, sum = 0.0; i < bat->frames; i++)
+               sum += fabsf(buf[i] - average);
+       amplitude = sum / bat->frames * M_PI / 2.0;
+
+       /* calculate amplitude percentage against full range */
+       percent = amplitude * 100 / ((1 << ((bat->sample_size << 3) - 1)) - 1);
+
+       fprintf(bat->log, _("Amplitude: %.1f; Percentage: [%d]\n"),
+                       amplitude, percent);
+       if (percent < 0)
+               fprintf(bat->err, _("ERROR: Amplitude can't be negative!\n"));
+       else if (percent < 1)
+               fprintf(bat->err, _("WARNING: Signal too weak!\n"));
+       else if (percent > 100)
+               fprintf(bat->err, _("WARNING: Signal overflow!\n"));
+}
+
+/**
+ *
+ * @return 0 if peak detected at right frequency,
+ *         1 if peak detected somewhere else
+ *         2 if DC detected
+ */
+int check_peak(struct bat *bat, struct analyze *a, int end, int peak, float hz,
+               float mean, float p, int channel, int start)
+{
+       int err;
+       float hz_peak = (float) (peak) * hz;
+       float delta_rate = DELTA_RATE * bat->target_freq[channel];
+       float delta_HZ = DELTA_HZ;
+       float tolerance = (delta_rate > delta_HZ) ? delta_rate : delta_HZ;
+
+       fprintf(bat->log, _("Detected peak at %2.2f Hz of %2.2f dB\n"), hz_peak,
+                       10.0 * log10f(a->mag[peak] / mean));
+       fprintf(bat->log, _(" Total %3.1f dB from %2.2f to %2.2f Hz\n"),
+                       10.0 * log10f(p / mean), start * hz, end * hz);
+
+       if (hz_peak < DC_THRESHOLD) {
+               fprintf(bat->err, _(" WARNING: Found low peak %2.2f Hz,"),
+                               hz_peak);
+               fprintf(bat->err, _(" very close to DC\n"));
+               err = FOUND_DC;
+       } else if (hz_peak < bat->target_freq[channel] - tolerance) {
+               fprintf(bat->err, _(" FAIL: Peak freq too low %2.2f Hz\n"),
+                               hz_peak);
+               err = FOUND_WRONG_PEAK;
+       } else if (hz_peak > bat->target_freq[channel] + tolerance) {
+               fprintf(bat->err, _(" FAIL: Peak freq too high %2.2f Hz\n"),
+                               hz_peak);
+               err = FOUND_WRONG_PEAK;
+       } else {
+               fprintf(bat->log, _(" PASS: Peak detected"));
+               fprintf(bat->log, _(" at target frequency\n"));
+               err = 0;
+       }
+
+       return err;
+}
+
+/**
+ * Search for main frequencies in fft results and compare it to target
+ */
+static int check(struct bat *bat, struct analyze *a, int channel)
+{
+       float hz = 1.0 / ((float) bat->frames / (float) bat->rate);
+       float mean = 0.0, t, sigma = 0.0, p = 0.0;
+       int i, start = -1, end = -1, peak = 0, signals = 0;
+       int err = 0, N = bat->frames / 2;
+
+       /* calculate mean */
+       for (i = 0; i < N; i++)
+               mean += a->mag[i];
+       mean /= (float) N;
+
+       /* calculate standard deviation */
+       for (i = 0; i < N; i++) {
+               t = a->mag[i] - mean;
+               t *= t;
+               sigma += t;
+       }
+       sigma /= (float) N;
+       sigma = sqrtf(sigma);
+
+       /* clip any data less than k sigma + mean */
+       for (i = 0; i < N; i++) {
+               if (a->mag[i] > mean + bat->sigma_k * sigma) {
+
+                       /* find peak start points */
+                       if (start == -1) {
+                               start = peak = end = i;
+                               signals++;
+                       } else {
+                               if (a->mag[i] > a->mag[peak])
+                                       peak = i;
+                               end = i;
+                       }
+                       p += a->mag[i];
+               } else if (start != -1) {
+                       /* Check if peak is as expected */
+                       err |= check_peak(bat, a, end, peak, hz, mean,
+                                       p, channel, start);
+                       end = start = -1;
+                       if (signals == MAX_PEAKS)
+                               break;
+               }
+       }
+       if (signals == 0)
+               err = -ENOPEAK; /* No peak detected */
+       else if ((err == FOUND_DC) && (signals == 1))
+               err = -EONLYDC; /* Only DC detected */
+       else if ((err & FOUND_WRONG_PEAK) == FOUND_WRONG_PEAK)
+               err = -EBADPEAK; /* Bad peak detected */
+       else
+               err = 0; /* Correct peak detected */
+
+       fprintf(bat->log, _("Detected at least %d signal(s) in total\n"),
+                       signals);
+
+       return err;
+}
+
+static void calc_magnitude(struct bat *bat, struct analyze *a, int N)
+{
+       float r2, i2;
+       int i;
+
+       for (i = 1; i < N / 2; i++) {
+               r2 = a->out[i] * a->out[i];
+               i2 = a->out[N - i] * a->out[N - i];
+
+               a->mag[i] = sqrtf(r2 + i2);
+       }
+       a->mag[0] = 0.0;
+}
+
+static int find_and_check_harmonics(struct bat *bat, struct analyze *a,
+               int channel)
+{
+       fftwf_plan p;
+       int err = -ENOMEM, N = bat->frames;
+
+       /* Allocate FFT buffers */
+       a->in = (float *) fftwf_malloc(sizeof(float) * bat->frames);
+       if (a->in == NULL)
+               goto out1;
+
+       a->out = (float *) fftwf_malloc(sizeof(float) * bat->frames);
+       if (a->out == NULL)
+               goto out2;
+
+       a->mag = (float *) fftwf_malloc(sizeof(float) * bat->frames);
+       if (a->mag == NULL)
+               goto out3;
+
+       /* create FFT plan */
+       p = fftwf_plan_r2r_1d(N, a->in, a->out, FFTW_R2HC,
+                       FFTW_MEASURE | FFTW_PRESERVE_INPUT);
+       if (p == NULL)
+               goto out4;
+
+       /* convert source PCM to floats */
+       bat->convert_sample_to_float(a->buf, a->in, bat->frames);
+
+       /* check amplitude */
+       check_amplitude(bat, a->in);
+
+       /* run FFT */
+       fftwf_execute(p);
+
+       /* FFT out is real and imaginary numbers - calc magnitude for each */
+       calc_magnitude(bat, a, N);
+
+       /* check data */
+       err = check(bat, a, channel);
+
+       fftwf_destroy_plan(p);
+
+out4:
+       fftwf_free(a->mag);
+out3:
+       fftwf_free(a->out);
+out2:
+       fftwf_free(a->in);
+out1:
+       return err;
+}
+
+static int calculate_noise_one_period(struct bat *bat,
+               struct noise_analyzer *na, float *src,
+               int length, int channel)
+{
+       int i, shift = 0;
+       float tmp, rms, gain, residual;
+       float a = 0.0, b = 1.0;
+
+       /* step 1. phase compensation */
+
+       if (length < 2 * na->nsamples)
+               return -EINVAL;
+
+       /* search for the beginning of a sine period */
+       for (i = 0, tmp = 0.0, shift = -1; i < na->nsamples; i++) {
+               /* find i where src[i] >= 0 && src[i+1] < 0 */
+               if (src[i] < 0.0)
+                       continue;
+               if (src[i + 1] < 0.0) {
+                       tmp = src[i] - src[i + 1];
+                       a = src[i] / tmp;
+                       b = -src[i + 1] / tmp;
+                       shift = i;
+                       break;
+               }
+       }
+
+       /* didn't find the beginning of a sine period */
+       if (shift == -1)
+               return -EINVAL;
+
+       /* shift sine waveform to source[0] = 0.0 */
+       for (i = 0; i < na->nsamples; i++)
+               na->source[i] = a * src[i + shift + 1] + b * src[i + shift];
+
+       /* step 2. gain compensation */
+
+       /* calculate rms of signal amplitude */
+       for (i = 0, tmp = 0.0; i < na->nsamples; i++)
+               tmp += na->source[i] * na->source[i];
+       rms = sqrtf(tmp / na->nsamples);
+
+       gain = na->rms_tgt / rms;
+
+       for (i = 0; i < na->nsamples; i++)
+               na->source[i] *= gain;
+
+       /* step 3. calculate snr in dB */
+
+       for (i = 0, tmp = 0.0, residual = 0.0; i < na->nsamples; i++) {
+               tmp = fabsf(na->target[i] - na->source[i]);
+               residual += tmp * tmp;
+       }
+
+       tmp = na->rms_tgt / sqrtf(residual / na->nsamples);
+       na->snr_db = 20.0 * log10f(tmp);
+
+       return 0;
+}
+
+static int calculate_noise(struct bat *bat, float *src, int channel)
+{
+       int err = 0;
+       struct noise_analyzer na;
+       float freq = bat->target_freq[channel];
+       float tmp, sum_snr_pc, avg_snr_pc, avg_snr_db;
+       int offset, i, cnt_noise, cnt_clean;
+       /* num of samples in each sine period */
+       int nsamples = (int) ceilf(bat->rate / freq);
+       /* each section has 2 sine periods, the first one for locating
+        * and the second one for noise calculating */
+       int nsamples_per_section = nsamples * 2;
+       /* all sine periods will be calculated except the first and last one */
+       int nsection = bat->frames / nsamples - 1;
+
+       fprintf(bat->log, _("samples per period: %d\n"), nsamples);
+       fprintf(bat->log, _("total sections to detect: %d\n"), nsection);
+       na.source = (float *)malloc(sizeof(float) * nsamples);
+       if (!na.source) {
+               err = -ENOMEM;
+               goto out1;
+       }
+
+       na.target = (float *)malloc(sizeof(float) * nsamples);
+       if (!na.target) {
+               err = -ENOMEM;
+               goto out2;
+       }
+
+       /* generate standard single-tone signal */
+       err = generate_sine_wave_raw_mono(bat, na.target, freq, nsamples);
+       if (err < 0)
+               goto out3;
+
+       na.nsamples = nsamples;
+
+       /* calculate rms of standard signal */
+       for (i = 0, tmp = 0.0; i < nsamples; i++)
+               tmp += na.target[i] * na.target[i];
+       na.rms_tgt = sqrtf(tmp / nsamples);
+
+       /* calculate average noise level */
+       sum_snr_pc = 0.0;
+       cnt_clean = cnt_noise = 0;
+       for (i = 1, offset = nsamples; i < nsection; i++) {
+               na.snr_db = SNR_DB_INVALID;
+
+               err = calculate_noise_one_period(bat, &na, src + offset,
+                               nsamples_per_section, channel);
+               if (err < 0)
+                       goto out3;
+
+               if (na.snr_db > bat->snr_thd_db) {
+                       cnt_clean++;
+                       sum_snr_pc += 100.0 / powf(10.0, na.snr_db / 20.0);
+               } else {
+                       cnt_noise++;
+               }
+               offset += nsamples;
+       }
+
+       if (cnt_noise > 0) {
+               fprintf(bat->err, _("Noise detected at %d points.\n"),
+                               cnt_noise);
+               err = -cnt_noise;
+               if (cnt_clean == 0)
+                       goto out3;
+       } else {
+               fprintf(bat->log, _("No noise detected.\n"));
+       }
+
+       avg_snr_pc = sum_snr_pc / cnt_clean;
+       avg_snr_db = 20.0 * log10f(100.0 / avg_snr_pc);
+       fprintf(bat->log, _("Average SNR is %.2f dB (%.2f %%) at %d points.\n"),
+                       avg_snr_db, avg_snr_pc, cnt_clean);
+
+out3:
+       free(na.target);
+out2:
+       free(na.source);
+out1:
+       return err;
+}
+
+static int find_and_check_noise(struct bat *bat, void *buf, int channel)
+{
+       int err = 0;
+       float *source;
+
+       source = (float *)malloc(sizeof(float) * bat->frames);
+       if (!source)
+               return -ENOMEM;
+
+       /* convert source PCM to floats */
+       bat->convert_sample_to_float(buf, source, bat->frames);
+
+       /* adjust waveform and calculate noise */
+       err = calculate_noise(bat, source, channel);
+
+       free(source);
+       return err;
+}
+
+/**
+ * Convert interleaved samples from channels in samples from a single channel
+ */
+static int reorder_data(struct bat *bat)
+{
+       char *p, *new_bat_buf;
+       int ch, i, j;
+
+       if (bat->channels == 1)
+               return 0; /* No need for reordering */
+
+       p = malloc(bat->frames * bat->frame_size);
+       new_bat_buf = p;
+       if (p == NULL)
+               return -ENOMEM;
+
+       for (ch = 0; ch < bat->channels; ch++) {
+               for (j = 0; j < bat->frames; j++) {
+                       for (i = 0; i < bat->sample_size; i++) {
+                               *p++ = ((char *) (bat->buf))[j * bat->frame_size
+                                               + ch * bat->sample_size + i];
+                       }
+               }
+       }
+
+       free(bat->buf);
+       bat->buf = new_bat_buf;
+
+       return 0;
+}
+
+/* truncate sample frames for faster FFT analysis process */
+static int truncate_frames(struct bat *bat)
+{
+       int shift = SHIFT_MAX;
+
+       for (; shift > SHIFT_MIN; shift--)
+               if (bat->frames & (1 << shift)) {
+                       bat->frames = 1 << shift;
+                       return 0;
+               }
+
+       return -EINVAL;
+}
+
+int analyze_capture(struct bat *bat)
+{
+       int err = 0;
+       size_t items;
+       int c;
+       struct analyze a;
+
+       err = truncate_frames(bat);
+       if (err < 0) {
+               fprintf(bat->err, _("Invalid frame number for analysis: %d\n"),
+                               bat->frames);
+               return err;
+       }
+
+       fprintf(bat->log, _("\nBAT analysis: signal has %d frames at %d Hz,"),
+                       bat->frames, bat->rate);
+       fprintf(bat->log, _(" %d channels, %d bytes per sample.\n"),
+                       bat->channels, bat->sample_size);
+
+       bat->buf = malloc(bat->frames * bat->frame_size);
+       if (bat->buf == NULL)
+               return -ENOMEM;
+
+       bat->fp = fopen(bat->capture.file, "rb");
+       err = -errno;
+       if (bat->fp == NULL) {
+               fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                               bat->capture.file, err);
+               goto exit1;
+       }
+
+       /* Skip header */
+       err = read_wav_header(bat, bat->capture.file, bat->fp, true);
+       if (err != 0)
+               goto exit2;
+
+       items = fread(bat->buf, bat->frame_size, bat->frames, bat->fp);
+       if (items != bat->frames) {
+               err = -EIO;
+               goto exit2;
+       }
+
+       err = reorder_data(bat);
+       if (err != 0)
+               goto exit2;
+
+       for (c = 0; c < bat->channels; c++) {
+               fprintf(bat->log, _("\nChannel %i - "), c + 1);
+               fprintf(bat->log, _("Checking for target frequency %2.2f Hz\n"),
+                               bat->target_freq[c]);
+               a.buf = bat->buf +
+                               c * bat->frames * bat->frame_size
+                               / bat->channels;
+               if (!bat->standalone) {
+                       err = find_and_check_harmonics(bat, &a, c);
+                       if (err != 0)
+                               goto exit2;
+               }
+
+               if (snr_is_valid(bat->snr_thd_db)) {
+                       fprintf(bat->log, _("\nChecking for SNR: "));
+                       fprintf(bat->log, _("Threshold is %.2f dB (%.2f%%)\n"),
+                                       bat->snr_thd_db, 100.0
+                                       / powf(10.0, bat->snr_thd_db / 20.0));
+                       err = find_and_check_noise(bat, a.buf, c);
+                       if (err != 0)
+                               goto exit2;
+               }
+       }
+
+exit2:
+       fclose(bat->fp);
+exit1:
+       free(bat->buf);
+
+       return err;
+}
diff --git a/bat/analyze.h b/bat/analyze.h
new file mode 100644 (file)
index 0000000..3fd03d4
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+int analyze_capture(struct bat *);
diff --git a/bat/bat-signal.h b/bat/bat-signal.h
new file mode 100644 (file)
index 0000000..3c314a5
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2015 Caleb Crome
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+/*
+ * Here's a generic sine wave generator that will work indefinitely
+ * for any frequency.
+ *
+ * Note:  the state & phasor are stored as doubles (and updated as
+ * doubles) because after a million samples the magnitude drifts a
+ * bit.  If we really need floats, it can be done with periodic
+ * renormalization of the state_real+state_imag magnitudes.
+ */
+
+int sin_generator_init(struct sin_generator *, float, float, float);
+float sin_generator_next_sample(struct sin_generator *);
+void sin_generator_vfill(struct sin_generator *, float *, int);
+int generate_sine_wave(struct bat *, int, void *);
+int generate_sine_wave_raw_mono(struct bat *, float *, float, int);
diff --git a/bat/bat.c b/bat/bat.c
new file mode 100644 (file)
index 0000000..ea04ed9
--- /dev/null
+++ b/bat/bat.c
@@ -0,0 +1,747 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <errno.h>
+#include <pthread.h>
+#include <getopt.h>
+#include <math.h>
+#include <limits.h>
+#include <locale.h>
+#include <math.h>
+
+#include "aconfig.h"
+#include "gettext.h"
+#include "version.h"
+
+#include "common.h"
+
+#ifdef HAVE_LIBTINYALSA
+#include "tinyalsa.h"
+#else
+#include "alsa.h"
+#endif
+#include "convert.h"
+#ifdef HAVE_LIBFFTW3F
+#include "analyze.h"
+#endif
+#include "latencytest.h"
+
+/* get snr threshold in dB */
+static void get_snr_thd_db(struct bat *bat, char *thd)
+{
+       int err;
+       float thd_db;
+       char *ptrf;
+
+       thd_db = strtof(thd, &ptrf);
+       err = -errno;
+       if (!snr_is_valid(thd_db)) {
+               fprintf(bat->err, _("Invalid threshold '%s':%d\n"), thd, err);
+               exit(EXIT_FAILURE);
+       }
+       bat->snr_thd_db = thd_db;
+}
+
+/* get snr threshold in %, and convert to dB */
+static void get_snr_thd_pc(struct bat *bat, char *thd)
+{
+       int err;
+       float thd_pc;
+       char *ptrf;
+
+       thd_pc = strtof(thd, &ptrf);
+       err = -errno;
+       if (thd_pc <= 0.0 || thd_pc >= 100.0) {
+               fprintf(bat->err, _("Invalid threshold '%s':%d\n"), thd, err);
+               exit(EXIT_FAILURE);
+       }
+       bat->snr_thd_db = 20.0 * log10f(100.0 / thd_pc);
+}
+
+static int get_duration(struct bat *bat)
+{
+       int err;
+       float duration_f;
+       long duration_i;
+       char *ptrf, *ptri;
+
+       duration_f = strtof(bat->narg, &ptrf);
+       err = -errno;
+       if (duration_f == HUGE_VALF || duration_f == -HUGE_VALF
+                       || (duration_f == 0.0 && err != 0))
+               goto err_exit;
+
+       duration_i = strtol(bat->narg, &ptri, 10);
+       if (duration_i == LONG_MAX || duration_i == LONG_MIN)
+               goto err_exit;
+
+       if (*ptrf == 's')
+               bat->frames = duration_f * bat->rate;
+       else if (*ptri == 0)
+               bat->frames = duration_i;
+       else
+               bat->frames = -1;
+
+       if (bat->frames <= 0 || bat->frames > MAX_FRAMES) {
+               fprintf(bat->err, _("Invalid duration. Range: (0, %d(%fs))\n"),
+                               MAX_FRAMES, (float)MAX_FRAMES / bat->rate);
+               return -EINVAL;
+       }
+
+       return 0;
+
+err_exit:
+       fprintf(bat->err, _("Duration overflow/underflow: %d\n"), err);
+
+       return err;
+}
+
+static void get_sine_frequencies(struct bat *bat, char *freq)
+{
+       char *tmp1;
+
+       tmp1 = strchr(freq, ':');
+       if (tmp1 == NULL) {
+               bat->target_freq[1] = bat->target_freq[0] = atof(optarg);
+       } else {
+               *tmp1 = '\0';
+               bat->target_freq[0] = atof(optarg);
+               bat->target_freq[1] = atof(tmp1 + 1);
+       }
+}
+
+static void get_format(struct bat *bat, char *optarg)
+{
+       if (strcasecmp(optarg, "cd") == 0) {
+               bat->format = BAT_PCM_FORMAT_S16_LE;
+               bat->rate = 44100;
+               bat->channels = 2;
+               bat->sample_size = 2;
+       } else if (strcasecmp(optarg, "dat") == 0) {
+               bat->format = BAT_PCM_FORMAT_S16_LE;
+               bat->rate = 48000;
+               bat->channels = 2;
+               bat->sample_size = 2;
+       } else if (strcasecmp(optarg, "U8") == 0) {
+               bat->format = BAT_PCM_FORMAT_U8;
+               bat->sample_size = 1;
+       } else if (strcasecmp(optarg, "S16_LE") == 0) {
+               bat->format = BAT_PCM_FORMAT_S16_LE;
+               bat->sample_size = 2;
+       } else if (strcasecmp(optarg, "S24_3LE") == 0) {
+               bat->format = BAT_PCM_FORMAT_S24_3LE;
+               bat->sample_size = 3;
+       } else if (strcasecmp(optarg, "S32_LE") == 0) {
+               bat->format = BAT_PCM_FORMAT_S32_LE;
+               bat->sample_size = 4;
+       } else {
+               bat->format = BAT_PCM_FORMAT_UNKNOWN;
+               fprintf(bat->err, _("wrong extended format '%s'\n"), optarg);
+               exit(EXIT_FAILURE);
+       }
+}
+
+static inline int thread_wait_completion(struct bat *bat ATTRIBUTE_UNUSED,
+                                        pthread_t id, int **val)
+{
+       int err;
+
+       err = pthread_join(id, (void **) val);
+       if (err)
+               pthread_cancel(id);
+
+       return err;
+}
+
+/* loopback test where we play sine wave and capture the same sine wave */
+static void test_loopback(struct bat *bat)
+{
+       pthread_t capture_id, playback_id;
+       int err;
+       int *thread_result_capture, *thread_result_playback;
+
+       /* start playback */
+       err = pthread_create(&playback_id, NULL,
+                       (void *) bat->playback.fct, bat);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot create playback thread: %d\n"),
+                               err);
+               exit(EXIT_FAILURE);
+       }
+
+       /* TODO: use a pipe to signal stream start etc - i.e. to sync threads */
+       /* Let some time for playing something before capturing */
+       usleep(CAPTURE_DELAY * 1000);
+
+       /* start capture */
+       err = pthread_create(&capture_id, NULL, (void *) bat->capture.fct, bat);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot create capture thread: %d\n"), err);
+               pthread_cancel(playback_id);
+               exit(EXIT_FAILURE);
+       }
+
+       /* wait for playback to complete */
+       err = thread_wait_completion(bat, playback_id, &thread_result_playback);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot join playback thread: %d\n"), err);
+               free(thread_result_playback);
+               pthread_cancel(capture_id);
+               exit(EXIT_FAILURE);
+       }
+
+       /* check playback status */
+       if (*thread_result_playback != 0) {
+               fprintf(bat->err, _("Exit playback thread fail: %d\n"),
+                               *thread_result_playback);
+               pthread_cancel(capture_id);
+               exit(EXIT_FAILURE);
+       } else {
+               fprintf(bat->log, _("Playback completed.\n"));
+       }
+
+       /* now stop and wait for capture to finish */
+       pthread_cancel(capture_id);
+       err = thread_wait_completion(bat, capture_id, &thread_result_capture);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot join capture thread: %d\n"), err);
+               free(thread_result_capture);
+               exit(EXIT_FAILURE);
+       }
+
+       /* check if capture thread is canceled or not */
+       if (thread_result_capture == PTHREAD_CANCELED) {
+               fprintf(bat->log, _("Capture canceled.\n"));
+               return;
+       }
+
+       /* check capture status */
+       if (*thread_result_capture != 0) {
+               fprintf(bat->err, _("Exit capture thread fail: %d\n"),
+                               *thread_result_capture);
+               exit(EXIT_FAILURE);
+       } else {
+               fprintf(bat->log, _("Capture completed.\n"));
+       }
+}
+
+/* single ended playback only test */
+static void test_playback(struct bat *bat)
+{
+       pthread_t playback_id;
+       int err;
+       int *thread_result;
+
+       /* start playback */
+       err = pthread_create(&playback_id, NULL,
+                       (void *) bat->playback.fct, bat);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot create playback thread: %d\n"),
+                               err);
+               exit(EXIT_FAILURE);
+       }
+
+       /* wait for playback to complete */
+       err = thread_wait_completion(bat, playback_id, &thread_result);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot join playback thread: %d\n"), err);
+               free(thread_result);
+               exit(EXIT_FAILURE);
+       }
+
+       /* check playback status */
+       if (*thread_result != 0) {
+               fprintf(bat->err, _("Exit playback thread fail: %d\n"),
+                               *thread_result);
+               exit(EXIT_FAILURE);
+       } else {
+               fprintf(bat->log, _("Playback completed.\n"));
+       }
+}
+
+/* single ended capture only test */
+static void test_capture(struct bat *bat)
+{
+       pthread_t capture_id;
+       int err;
+       int *thread_result;
+
+       /* start capture */
+       err = pthread_create(&capture_id, NULL, (void *) bat->capture.fct, bat);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot create capture thread: %d\n"), err);
+               exit(EXIT_FAILURE);
+       }
+
+       /* TODO: stop capture */
+
+       /* wait for capture to complete */
+       err = thread_wait_completion(bat, capture_id, &thread_result);
+       if (err != 0) {
+               fprintf(bat->err, _("Cannot join capture thread: %d\n"), err);
+               free(thread_result);
+               exit(EXIT_FAILURE);
+       }
+
+       /* check playback status */
+       if (*thread_result != 0) {
+               fprintf(bat->err, _("Exit capture thread fail: %d\n"),
+                               *thread_result);
+               exit(EXIT_FAILURE);
+       } else {
+               fprintf(bat->log, _("Capture completed.\n"));
+       }
+}
+
+static void usage(struct bat *bat)
+{
+       fprintf(bat->log,
+_("Usage: alsabat [-options]...\n"
+"\n"
+"  -h, --help             this help\n"
+"  -D                     pcm device for both playback and capture\n"
+"  -P                     pcm device for playback\n"
+"  -C                     pcm device for capture\n"
+"  -f                     sample format\n"
+"  -c                     number of channels\n"
+"  -r                     sampling rate\n"
+"  -n                     frames to playback or capture\n"
+"  -k                     parameter for frequency detecting threshold\n"
+"  -F                     target frequency\n"
+"  -p                     total number of periods to play/capture\n"
+"  -B                     buffer size in frames\n"
+"  -E                     period size in frames\n"
+"      --log=#            file that both stdout and strerr redirecting to\n"
+"      --file=#           file for playback\n"
+"      --saveplay=#       file that storing playback content, for debug\n"
+"      --readcapture=#    file with previously captured content.  File data\n"
+"                         is used for analysis instead of capturing it.\n"
+"      --local            internal loop, set to bypass pcm hardware devices\n"
+"      --standalone       standalone mode, to bypass analysis\n"
+"      --roundtriplatency round trip latency mode\n"
+"      --snr-db=#         noise detect threshold, in SNR(dB)\n"
+"      --snr-pc=#         noise detect threshold, in noise percentage(%%)\n"
+));
+       fprintf(bat->log, _("Recognized sample formats are: "));
+       fprintf(bat->log, _("U8 S16_LE S24_3LE S32_LE\n"));
+       fprintf(bat->log, _("The available format shotcuts are:\n"));
+       fprintf(bat->log, _("-f cd (16 bit little endian, 44100, stereo)\n"));
+       fprintf(bat->log, _("-f dat (16 bit little endian, 48000, stereo)\n"));
+}
+
+static void set_defaults(struct bat *bat)
+{
+       memset(bat, 0, sizeof(struct bat));
+
+       /* Set default values */
+       bat->rate = 44100;
+       bat->frame_size = 2;
+       bat->sample_size = 2;
+       bat->format = BAT_PCM_FORMAT_S16_LE;
+       bat->convert_float_to_sample = convert_float_to_int16;
+       bat->convert_sample_to_float = convert_int16_to_float;
+       bat->frames = bat->rate * 2;
+       bat->target_freq[0] = 997.0;
+       bat->target_freq[1] = 997.0;
+       bat->sigma_k = 3.0;
+       bat->snr_thd_db = SNR_DB_INVALID;
+       bat->playback.device = NULL;
+       bat->capture.device = NULL;
+       bat->buf = NULL;
+       bat->local = false;
+       bat->buffer_size = 0;
+       bat->period_size = 0;
+       bat->roundtriplatency = false;
+#ifdef HAVE_LIBTINYALSA
+       bat->channels = 2;
+       bat->playback.fct = &playback_tinyalsa;
+       bat->capture.fct = &record_tinyalsa;
+#else
+       bat->channels = 1;
+       bat->playback.fct = &playback_alsa;
+       bat->capture.fct = &record_alsa;
+#endif
+       bat->playback.mode = MODE_LOOPBACK;
+       bat->capture.mode = MODE_LOOPBACK;
+       bat->period_is_limited = false;
+       bat->log = stdout;
+       bat->err = stderr;
+}
+
+static void parse_arguments(struct bat *bat, int argc, char *argv[])
+{
+       int c, option_index, err;
+       static const char short_options[] = "D:P:C:f:n:F:c:r:s:k:p:B:E:lth";
+       static const struct option long_options[] = {
+               {"help",     0, 0, 'h'},
+               {"log",      1, 0, OPT_LOG},
+               {"file",     1, 0, OPT_READFILE},
+               {"saveplay", 1, 0, OPT_SAVEPLAY},
+               {"local",    0, 0, OPT_LOCAL},
+               {"standalone", 0, 0, OPT_STANDALONE},
+               {"roundtriplatency", 0, 0, OPT_ROUNDTRIPLATENCY},
+               {"snr-db",   1, 0, OPT_SNRTHD_DB},
+               {"snr-pc",   1, 0, OPT_SNRTHD_PC},
+               {"readcapture", 1, 0, OPT_READCAPTURE},
+               {0, 0, 0, 0}
+       };
+
+       while ((c = getopt_long(argc, argv, short_options, long_options,
+                                       &option_index)) != -1) {
+               switch (c) {
+               case OPT_LOG:
+                       bat->logarg = optarg;
+                       break;
+               case OPT_READFILE:
+                       bat->playback.file = optarg;
+                       break;
+               case OPT_SAVEPLAY:
+                       bat->debugplay = optarg;
+                       break;
+               case OPT_READCAPTURE:
+                       bat->capturefile = optarg;
+                       bat->capture.mode = MODE_ANALYZE_ONLY;
+                       bat->playback.mode = MODE_ANALYZE_ONLY;
+                       break;
+               case OPT_LOCAL:
+                       bat->local = true;
+                       break;
+               case OPT_STANDALONE:
+                       bat->standalone = true;
+                       break;
+               case OPT_ROUNDTRIPLATENCY:
+                       bat->roundtriplatency = true;
+                       break;
+               case OPT_SNRTHD_DB:
+                       get_snr_thd_db(bat, optarg);
+                       break;
+               case OPT_SNRTHD_PC:
+                       get_snr_thd_pc(bat, optarg);
+                       break;
+               case 'D':
+                       if (bat->playback.device == NULL)
+                               bat->playback.device = optarg;
+                       if (bat->capture.device == NULL)
+                               bat->capture.device = optarg;
+                       break;
+               case 'P':
+                       if (bat->capture.mode == MODE_SINGLE)
+                               bat->capture.mode = MODE_LOOPBACK;
+                       else
+                               bat->playback.mode = MODE_SINGLE;
+                       bat->playback.device = optarg;
+                       break;
+               case 'C':
+                       if (bat->playback.mode == MODE_SINGLE)
+                               bat->playback.mode = MODE_LOOPBACK;
+                       else
+                               bat->capture.mode = MODE_SINGLE;
+                       bat->capture.device = optarg;
+                       break;
+               case 'n':
+                       bat->narg = optarg;
+                       break;
+               case 'F':
+                       get_sine_frequencies(bat, optarg);
+                       break;
+               case 'c':
+                       bat->channels = atoi(optarg);
+                       break;
+               case 'r':
+                       bat->rate = atoi(optarg);
+                       break;
+               case 'f':
+                       get_format(bat, optarg);
+                       break;
+               case 'k':
+                       bat->sigma_k = atof(optarg);
+                       break;
+               case 'p':
+                       bat->periods_total = atoi(optarg);
+                       bat->period_is_limited = true;
+                       break;
+               case 'B':
+                       err = atoi(optarg);
+                       bat->buffer_size = err >= MIN_BUFFERSIZE
+                                       && err < MAX_BUFFERSIZE ? err : 0;
+                       break;
+               case 'E':
+                       err = atoi(optarg);
+                       bat->period_size = err >= MIN_PERIODSIZE
+                                       && err < MAX_PERIODSIZE ? err : 0;
+                       break;
+               case 'h':
+               default:
+                       usage(bat);
+                       exit(EXIT_SUCCESS);
+               }
+       }
+}
+
+static int validate_options(struct bat *bat)
+{
+       int c;
+       float freq_low, freq_high;
+
+       /* check if we have an input file for local mode */
+       if ((bat->local == true) && (bat->capture.file == NULL)) {
+               fprintf(bat->err, _("no input file for local testing\n"));
+               return -EINVAL;
+       }
+
+       /* check supported channels */
+       if (bat->channels > MAX_CHANNELS || bat->channels < MIN_CHANNELS) {
+               fprintf(bat->err, _("%d channels not supported\n"),
+                               bat->channels);
+               return -EINVAL;
+       }
+
+       /* check single ended is in either playback or capture - not both */
+       if ((bat->playback.mode == MODE_SINGLE)
+                       && (bat->capture.mode == MODE_SINGLE)) {
+               fprintf(bat->err, _("single ended mode is simplex\n"));
+               return -EINVAL;
+       }
+
+       /* check sine wave frequency range */
+       freq_low = DC_THRESHOLD;
+       freq_high = bat->rate * RATE_FACTOR;
+       for (c = 0; c < bat->channels; c++) {
+               if (bat->target_freq[c] < freq_low
+                               || bat->target_freq[c] > freq_high) {
+                       fprintf(bat->err, _("sine wave frequency out of"));
+                       fprintf(bat->err, _(" range: (%.1f, %.1f)\n"),
+                               freq_low, freq_high);
+                       return -EINVAL;
+               }
+       }
+
+       return 0;
+}
+
+static int bat_init(struct bat *bat)
+{
+       int err = 0;
+       int fd = 0;
+       char name[] = TEMP_RECORD_FILE_NAME;
+
+       /* Determine logging to a file or stdout and stderr */
+       if (bat->logarg) {
+               bat->log = NULL;
+               bat->log = fopen(bat->logarg, "wb");
+               if (bat->log == NULL) {
+                       err = -errno;
+                       fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                                       bat->logarg, err);
+                       return err;
+               }
+               bat->err = bat->log;
+       }
+
+       /* Determine duration of playback and/or capture */
+       if (bat->narg) {
+               err = get_duration(bat);
+               if (err < 0)
+                       return err;
+       }
+
+       /* Set default playback and capture devices */
+       if (bat->playback.device == NULL && bat->capture.device == NULL)
+               bat->playback.device = bat->capture.device = DEFAULT_DEV_NAME;
+
+       /* Determine capture file */
+       if (bat->local) {
+               bat->capture.file = bat->playback.file;
+       } else {
+               /* create temp file for sound record and analysis */
+               fd = mkstemp(name);
+               if (fd == -1) {
+                       err = -errno;
+                       fprintf(bat->err, _("Fail to create record file: %d\n"),
+                                       err);
+                       return err;
+               }
+               /* store file name which is dynamically created */
+               bat->capture.file = strdup(name);
+               if (bat->capture.file == NULL)
+                       return -ENOMEM;
+               /* close temp file */
+               close(fd);
+       }
+
+       /* Initial for playback */
+       if (bat->playback.file == NULL) {
+               /* No input file so we will generate our own sine wave */
+               if (bat->frames) {
+                       if (bat->playback.mode == MODE_SINGLE) {
+                               /* Play nb of frames given by -n argument */
+                               bat->sinus_duration = bat->frames;
+                       } else {
+                               /* Play CAPTURE_DELAY msec +
+                                * 150% of the nb of frames to be analyzed */
+                               bat->sinus_duration = bat->rate *
+                                               CAPTURE_DELAY / 1000;
+                               bat->sinus_duration +=
+                                               (bat->frames + bat->frames / 2);
+                       }
+               } else {
+                       /* Special case where we want to generate a sine wave
+                        * endlessly without capturing */
+                       bat->sinus_duration = 0;
+                       bat->playback.mode = MODE_SINGLE;
+               }
+       } else {
+               bat->fp = fopen(bat->playback.file, "rb");
+               if (bat->fp == NULL) {
+                       err = -errno;
+                       fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                                       bat->playback.file, err);
+                       return err;
+               }
+               err = read_wav_header(bat, bat->playback.file, bat->fp, false);
+               fclose(bat->fp);
+               if (err != 0)
+                       return err;
+       }
+
+       bat->frame_size = bat->sample_size * bat->channels;
+
+       /* Set conversion functions */
+       switch (bat->sample_size) {
+       case 1:
+               bat->convert_float_to_sample = convert_float_to_uint8;
+               bat->convert_sample_to_float = convert_uint8_to_float;
+               break;
+       case 2:
+               bat->convert_float_to_sample = convert_float_to_int16;
+               bat->convert_sample_to_float = convert_int16_to_float;
+               break;
+       case 3:
+               bat->convert_float_to_sample = convert_float_to_int24;
+               bat->convert_sample_to_float = convert_int24_to_float;
+               break;
+       case 4:
+               bat->convert_float_to_sample = convert_float_to_int32;
+               bat->convert_sample_to_float = convert_int32_to_float;
+               break;
+       default:
+               fprintf(bat->err, _("Invalid PCM format: size=%d\n"),
+                               bat->sample_size);
+               return -EINVAL;
+       }
+
+       return err;
+}
+
+int main(int argc, char *argv[])
+{
+       struct bat bat;
+       int err = 0;
+
+       set_defaults(&bat);
+
+#ifdef ENABLE_NLS
+       setlocale(LC_ALL, "");
+       textdomain(PACKAGE);
+#endif
+
+       fprintf(bat.log, _("%s version %s\n\n"), PACKAGE_NAME, PACKAGE_VERSION);
+
+       parse_arguments(&bat, argc, argv);
+
+       err = bat_init(&bat);
+       if (err < 0)
+               goto out;
+
+       err = validate_options(&bat);
+       if (err < 0)
+               goto out;
+
+       /* round trip latency test thread */
+       if (bat.roundtriplatency) {
+               while (1) {
+                       fprintf(bat.log,
+                               _("\nStart round trip latency\n"));
+                       roundtrip_latency_init(&bat);
+                       test_loopback(&bat);
+
+                       if (bat.latency.xrun_error == false)
+                               break;
+                       else {
+                               /* Xrun error in playback or capture,
+                               increase period size and try again */
+                               bat.period_size += bat.rate / 1000;
+                               bat.buffer_size =
+                                       bat.period_size * DIV_BUFFERSIZE;
+
+                               /* terminate the test if period_size is
+                               large enough */
+                               if (bat.period_size > bat.rate * 0.2)
+                                       break;
+                       }
+
+                       /* Waiting 500ms and start the next round */
+                       usleep(CAPTURE_DELAY * 1000);
+               }
+               goto out;
+       }
+
+       /* single line playback thread: playback only, no capture */
+       if (bat.playback.mode == MODE_SINGLE) {
+               test_playback(&bat);
+               goto out;
+       }
+
+       /* single line capture thread: capture only, no playback */
+       if (bat.capture.mode == MODE_SINGLE) {
+               test_capture(&bat);
+               goto analyze;
+       }
+
+       if (bat.capture.mode == MODE_ANALYZE_ONLY && bat.capturefile) {
+               bat.capture.file = strdup(bat.capturefile);
+               fprintf(bat.log,
+                       _("Using data from file %s for analysis\n"),
+                       bat.capture.file);
+               fprintf(bat.log, _("Skipping playback and capture\n"));
+               goto analyze;
+       }
+
+       /* loopback thread: playback and capture in a loop */
+       if (bat.local == false)
+               test_loopback(&bat);
+
+analyze:
+#ifdef HAVE_LIBFFTW3F
+       if (!bat.standalone || snr_is_valid(bat.snr_thd_db))
+               err = analyze_capture(&bat);
+#else
+       fprintf(bat.log, _("No libfftw3 library. Exit without analysis.\n"));
+#endif
+out:
+       fprintf(bat.log, _("\nReturn value is %d\n"), err);
+
+       if (bat.logarg)
+               fclose(bat.log);
+       if (!bat.local)
+               free(bat.capture.file);
+
+       return err;
+}
diff --git a/bat/common.c b/bat/common.c
new file mode 100644 (file)
index 0000000..470a7e6
--- /dev/null
@@ -0,0 +1,267 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+#include "aconfig.h"
+
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <errno.h>
+
+#include "gettext.h"
+
+#include "common.h"
+#include "alsa.h"
+#include "bat-signal.h"
+
+int retval_play;
+int retval_record;
+
+/* update chunk_fmt data to bat */
+static int update_fmt_to_bat(struct bat *bat, struct chunk_fmt *fmt)
+{
+       bat->channels = fmt->channels;
+       bat->rate = fmt->sample_rate;
+       bat->sample_size = fmt->sample_length / 8;
+       if (bat->sample_size > 4) {
+               fprintf(bat->err, _("Invalid format: sample size=%d\n"),
+                               bat->sample_size);
+               return -EINVAL;
+       }
+       bat->frame_size = fmt->blocks_align;
+
+       return 0;
+}
+
+/* calculate frames and update to bat */
+static int update_frames_to_bat(struct bat *bat, struct wav_chunk_header *header,
+                               FILE *file ATTRIBUTE_UNUSED)
+{
+       /* The number of analyzed captured frames is arbitrarily set to half of
+          the number of frames of the wav file or the number of frames of the
+          wav file when doing direct analysis (--local) */
+       bat->frames = header->length / bat->frame_size;
+       if (!bat->local)
+               bat->frames /= 2;
+
+       return 0;
+}
+
+static int read_chunk_fmt(struct bat *bat, char *file, FILE *fp, bool skip,
+               struct wav_chunk_header *header)
+{
+       size_t err;
+       int ret, header_skip;
+       struct chunk_fmt chunk_fmt;
+
+       err = fread(&chunk_fmt, sizeof(chunk_fmt), 1, fp);
+       if (err != 1) {
+               fprintf(bat->err, _("Read chunk fmt error: %s:%zd\n"),
+                               file, err);
+               return -EIO;
+       }
+       /* If the format header is larger, skip the rest */
+       header_skip = header->length - sizeof(chunk_fmt);
+       if (header_skip > 0) {
+               ret = fseek(fp, header_skip, SEEK_CUR);
+               if (ret == -1) {
+                       fprintf(bat->err, _("Seek fmt header error: %s:%d\n"),
+                                       file, ret);
+                       return -EINVAL;
+               }
+       }
+       /* If the file is opened for playback, update BAT data;
+          If the file is opened for analysis, no update */
+       if (skip == false) {
+               err = update_fmt_to_bat(bat, &chunk_fmt);
+               if (err != 0)
+                       return err;
+       }
+
+       return 0;
+}
+
+int read_wav_header(struct bat *bat, char *file, FILE *fp, bool skip)
+{
+       struct wav_header riff_wave_header;
+       struct wav_chunk_header chunk_header;
+       int more_chunks = 1;
+       size_t err;
+       int ret;
+
+       /* Read header of RIFF wav file */
+       err = fread(&riff_wave_header, sizeof(riff_wave_header), 1, fp);
+       if (err != 1) {
+               fprintf(bat->err, _("Read header error: %s:%zd\n"), file, err);
+               return -EIO;
+       }
+       if ((riff_wave_header.magic != WAV_RIFF)
+                       || (riff_wave_header.type != WAV_WAVE)) {
+               fprintf(bat->err, _("%s is not a riff/wave file\n"), file);
+               return -EINVAL;
+       }
+
+       /* Read chunks in RIFF wav file */
+       do {
+               err = fread(&chunk_header, sizeof(chunk_header), 1, fp);
+               if (err != 1) {
+                       fprintf(bat->err, _("Read chunk header error: "));
+                       fprintf(bat->err, _("%s:%zd\n"), file, err);
+                       return -EIO;
+               }
+
+               switch (chunk_header.type) {
+               case WAV_FMT:
+                       /* WAV_FMT chunk, read and analyze */
+                       err = read_chunk_fmt(bat, file, fp, skip,
+                                       &chunk_header);
+                       if (err != 0)
+                               return err;
+                       break;
+               case WAV_DATA:
+                       /* WAV_DATA chunk, break looping */
+                       /* If the file is opened for playback, update BAT data;
+                          If the file is opened for analysis, no update */
+                       if (skip == false) {
+                               err = update_frames_to_bat(bat, &chunk_header,
+                                               fp);
+                               if (err != 0)
+                                       return err;
+                       }
+                       /* Stop looking for chunks */
+                       more_chunks = 0;
+                       break;
+               default:
+                       /* Unknown chunk, skip bytes */
+                       ret = fseek(fp, chunk_header.length, SEEK_CUR);
+                       if (ret == -1) {
+                               fprintf(bat->err, _("Fail to skip unknown"));
+                               fprintf(bat->err, _(" chunk of %s:%d\n"),
+                                               file, ret);
+                               return -EINVAL;
+                       }
+               }
+       } while (more_chunks);
+
+       return 0;
+}
+
+void prepare_wav_info(struct wav_container *wav, struct bat *bat)
+{
+       wav->header.magic = WAV_RIFF;
+       wav->header.type = WAV_WAVE;
+       wav->format.magic = WAV_FMT;
+       wav->format.fmt_size = 16;
+       wav->format.format = WAV_FORMAT_PCM;
+       wav->format.channels = bat->channels;
+       wav->format.sample_rate = bat->rate;
+       wav->format.sample_length = bat->sample_size * 8;
+       wav->format.blocks_align = bat->channels * bat->sample_size;
+       wav->format.bytes_p_second = wav->format.blocks_align * bat->rate;
+       wav->chunk.length = bat->frames * bat->frame_size;
+       wav->chunk.type = WAV_DATA;
+       wav->header.length = (wav->chunk.length) + sizeof(wav->chunk)
+                       + sizeof(wav->format) + sizeof(wav->header) - 8;
+}
+
+int write_wav_header(FILE *fp, struct wav_container *wav, struct bat *bat)
+{
+       int err = 0;
+
+       err = fwrite(&wav->header, 1, sizeof(wav->header), fp);
+       if (err != sizeof(wav->header)) {
+               fprintf(bat->err, _("Write file error: header %d\n"), err);
+               return -EIO;
+       }
+       err = fwrite(&wav->format, 1, sizeof(wav->format), fp);
+       if (err != sizeof(wav->format)) {
+               fprintf(bat->err, _("Write file error: format %d\n"), err);
+               return -EIO;
+       }
+       err = fwrite(&wav->chunk, 1, sizeof(wav->chunk), fp);
+       if (err != sizeof(wav->chunk)) {
+               fprintf(bat->err, _("Write file error: chunk %d\n"), err);
+               return -EIO;
+       }
+
+       return 0;
+}
+
+/* update wav header when data size changed */
+int update_wav_header(struct bat *bat, FILE *fp, int bytes)
+{
+       int err = 0;
+       struct wav_container wav;
+
+       prepare_wav_info(&wav, bat);
+       wav.chunk.length = bytes;
+       wav.header.length = (wav.chunk.length) + sizeof(wav.chunk)
+               + sizeof(wav.format) + sizeof(wav.header) - 8;
+       rewind(fp);
+       err = write_wav_header(fp, &wav, bat);
+
+       return err;
+}
+
+/*
+ * Generate buffer to be played either from input file or from generated data
+ * Return value
+ * <0 error
+ * 0 ok
+ * >0 break
+ */
+int generate_input_data(struct bat *bat, void *buffer, int bytes, int frames)
+{
+       int err;
+       static int load;
+
+       if (bat->playback.file != NULL) {
+               /* From input file */
+               load = 0;
+
+               while (1) {
+                       err = fread((char *)buffer + load, 1, bytes - load, bat->fp);
+                       if (0 == err) {
+                               if (feof(bat->fp)) {
+                                       fprintf(bat->log,
+                                                       _("End of playing.\n"));
+                                       return 1;
+                               }
+                       } else if (err < bytes - load) {
+                               if (ferror(bat->fp)) {
+                                       fprintf(bat->err, _("Read file error"));
+                                       fprintf(bat->err, _(": %d\n"), err);
+                                       return -EIO;
+                               }
+                               load += err;
+                       } else {
+                               break;
+                       }
+               }
+       } else {
+               /* Generate sine wave */
+               if ((bat->sinus_duration) && (load > bat->sinus_duration))
+                       return 1;
+
+               err = generate_sine_wave(bat, frames, buffer);
+               if (err != 0)
+                       return err;
+
+               load += frames;
+       }
+
+       return 0;
+}
diff --git a/bat/common.h b/bat/common.h
new file mode 100644 (file)
index 0000000..bb51b0d
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+#ifndef ATTRIBUTE_UNUSED
+/** do not print warning (gcc) when function parameter is not used */
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif
+
+#define TEMP_RECORD_FILE_NAME          "/tmp/bat.wav.XXXXXX"
+#define DEFAULT_DEV_NAME               "default"
+
+#define OPT_BASE                       300
+#define OPT_LOG                                (OPT_BASE + 1)
+#define OPT_READFILE                   (OPT_BASE + 2)
+#define OPT_SAVEPLAY                   (OPT_BASE + 3)
+#define OPT_LOCAL                      (OPT_BASE + 4)
+#define OPT_STANDALONE                 (OPT_BASE + 5)
+#define OPT_ROUNDTRIPLATENCY           (OPT_BASE + 6)
+#define OPT_SNRTHD_DB                  (OPT_BASE + 7)
+#define OPT_SNRTHD_PC                  (OPT_BASE + 8)
+#define OPT_READCAPTURE                        (OPT_BASE + 9)
+
+#define COMPOSE(a, b, c, d)            ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))
+#define WAV_RIFF                       COMPOSE('R', 'I', 'F', 'F')
+#define WAV_WAVE                       COMPOSE('W', 'A', 'V', 'E')
+#define WAV_FMT                                COMPOSE('f', 'm', 't', ' ')
+#define WAV_DATA                       COMPOSE('d', 'a', 't', 'a')
+#define WAV_FORMAT_PCM                 1       /* PCM WAVE file encoding */
+
+#define MAX_CHANNELS                   2
+#define MIN_CHANNELS                   1
+#define MAX_PEAKS                      10
+#define MAX_FRAMES                     (10 * 1024 * 1024)
+/* Given in ms */
+#define CAPTURE_DELAY                  500
+/* signal frequency should be less than samplerate * RATE_FACTOR */
+#define RATE_FACTOR                    0.4
+/* valid range of samplerate: (1 - RATE_RANGE, 1 + RATE_RANGE) * samplerate */
+#define RATE_RANGE                     0.05
+/* Given in us */
+#define MAX_BUFFERTIME                 500000
+/* devide factor, was 4, changed to 8 to remove reduce capture overrun */
+#define DIV_BUFFERTIME                 8
+/* margin to avoid sign inversion when generate sine wav */
+#define RANGE_FACTOR                   0.95
+#define MAX_BUFFERSIZE                 200000
+#define MIN_BUFFERSIZE                 32
+#define MAX_PERIODSIZE                 200000
+#define MIN_PERIODSIZE                 32
+/* default period size for tinyalsa */
+#define TINYALSA_PERIODSIZE                    1024
+
+#define LATENCY_TEST_NUMBER                    5
+#define LATENCY_TEST_TIME_LIMIT                        25
+#define DIV_BUFFERSIZE                 2
+
+#define EBATBASE                       1000
+#define ENOPEAK                                (EBATBASE + 1)
+#define EONLYDC                                (EBATBASE + 2)
+#define EBADPEAK                       (EBATBASE + 3)
+
+#define DC_THRESHOLD                   7.01
+
+/* tolerance of detected peak = max (DELTA_HZ, DELTA_RATE * target_freq).
+ * If DELTA_RATE is too high, BAT may not be able to recognize negative result;
+ * if too low, BAT may be too sensitive and results in uncecessary failure. */
+#define DELTA_RATE                     0.005
+#define DELTA_HZ                       1
+
+#define FOUND_DC                       (1<<1)
+#define FOUND_WRONG_PEAK               (1<<0)
+
+/* Truncate sample frames to (1 << N), for faster FFT analysis process. The
+ * valid range of N is (SHIFT_MIN, SHIFT_MAX). When N increases, the analysis
+ * will be more time-consuming, and the result will be more accurate. */
+#define SHIFT_MAX                      (sizeof(int) * 8 - 2)
+#define SHIFT_MIN                      8
+
+/* Define SNR range in dB.
+ * if the noise is equal to signal, SNR = 0.0dB;
+ * if the noise is zero, SNR is limited by RIFF wav data width:
+ *     8 bit  -->  20.0 * log10f (powf(2.0, 8.0))  = 48.16 dB
+ *    16 bit  -->  20.0 * log10f (powf(2.0, 16.0)) = 96.33 dB
+ *    24 bit  -->  20.0 * log10f (powf(2.0, 24.0)) = 144.49 dB
+ *    32 bit  -->  20.0 * log10f (powf(2.0, 32.0)) = 192.66 dB
+ * so define the SNR range (0.0, 200.0) dB, value out of range is invalid. */
+#define SNR_DB_INVALID                 -1.0
+#define SNR_DB_MIN                     0.0
+#define SNR_DB_MAX                     200.0
+
+static inline bool snr_is_valid(float db)
+{
+       return (db > SNR_DB_MIN && db < SNR_DB_MAX);
+}
+
+struct wav_header {
+       unsigned int magic; /* 'RIFF' */
+       unsigned int length; /* file len */
+       unsigned int type; /* 'WAVE' */
+};
+
+struct wav_chunk_header {
+       unsigned int type; /* 'data' */
+       unsigned int length; /* sample count */
+};
+
+struct wav_fmt {
+       unsigned int magic; /* 'FMT '*/
+       unsigned int fmt_size; /* 16 or 18 */
+       unsigned short format; /* see WAV_FMT_* */
+       unsigned short channels;
+       unsigned int sample_rate; /* Frequency of sample */
+       unsigned int bytes_p_second;
+       unsigned short blocks_align; /* sample size; 1 or 2 bytes */
+       unsigned short sample_length; /* 8, 12 or 16 bit */
+};
+
+struct chunk_fmt {
+       unsigned short format; /* see WAV_FMT_* */
+       unsigned short channels;
+       unsigned int sample_rate; /* Frequency of sample */
+       unsigned int bytes_p_second;
+       unsigned short blocks_align; /* sample size; 1 or 2 bytes */
+       unsigned short sample_length; /* 8, 12 or 16 bit */
+};
+
+struct wav_container {
+       struct wav_header header;
+       struct wav_fmt format;
+       struct wav_chunk_header chunk;
+};
+
+struct bat;
+
+enum _bat_pcm_format {
+       BAT_PCM_FORMAT_UNKNOWN = -1,
+       BAT_PCM_FORMAT_S16_LE = 0,
+       BAT_PCM_FORMAT_S32_LE,
+       BAT_PCM_FORMAT_U8,
+       BAT_PCM_FORMAT_S24_3LE,
+       BAT_PCM_FORMAT_MAX
+};
+
+enum _bat_op_mode {
+       MODE_UNKNOWN = -1,
+       MODE_SINGLE = 0,
+       MODE_LOOPBACK,
+       MODE_ANALYZE_ONLY,
+       MODE_LAST
+};
+
+enum latency_state {
+       LATENCY_STATE_COMPLETE_FAILURE = -1,
+       LATENCY_STATE_COMPLETE_SUCCESS = 0,
+       LATENCY_STATE_MEASURE_FOR_1_SECOND,
+       LATENCY_STATE_PLAY_AND_LISTEN,
+       LATENCY_STATE_WAITING,
+};
+
+struct pcm {
+       unsigned int card_tiny;
+       unsigned int device_tiny;
+       char *device;
+       char *file;
+       enum _bat_op_mode mode;
+       void *(*fct)(struct bat *);
+};
+
+struct sin_generator;
+
+struct sin_generator {
+       double state_real;
+       double state_imag;
+       double phasor_real;
+       double phasor_imag;
+       float frequency;
+       float sample_rate;
+       float magnitude;
+};
+
+struct roundtrip_latency {
+       int number;
+       enum latency_state state;
+       float result[LATENCY_TEST_NUMBER];
+       int final_result;
+       int samples;
+       float sum;
+       int threshold;
+       int error;
+       bool is_capturing;
+       bool is_playing;
+       bool xrun_error;
+};
+
+struct noise_analyzer {
+       int nsamples;                   /* number of sample */
+       float *source;                  /* single-tone to be analyzed */
+       float *target;                  /* target single-tone as standard */
+       float rms_tgt;                  /* rms of target single-tone */
+       float snr_db;                   /* snr in dB */
+};
+
+struct bat {
+       unsigned int rate;              /* sampling rate */
+       int channels;                   /* nb of channels */
+       int frames;                     /* nb of frames */
+       int frame_size;                 /* size of frame */
+       int sample_size;                /* size of sample */
+       enum _bat_pcm_format format;    /* PCM format */
+       int buffer_size;                /* buffer size in frames */
+       int period_size;                /* period size in frames */
+
+       float sigma_k;                  /* threshold for peak detection */
+       float snr_thd_db;               /* threshold for noise detection (dB) */
+       float target_freq[MAX_CHANNELS];
+
+       int sinus_duration;             /* number of frames for playback */
+       char *narg;                     /* argument string of duration */
+       char *logarg;                   /* path name of log file */
+       char *debugplay;                /* path name to store playback signal */
+       char *capturefile;              /* path name for previously saved recording */
+       bool standalone;                /* enable to bypass analysis */
+       bool roundtriplatency;          /* enable round trip latency */
+
+       struct pcm playback;
+       struct pcm capture;
+       struct roundtrip_latency latency;
+
+       unsigned int periods_played;
+       unsigned int periods_total;
+       bool period_is_limited;
+
+       FILE *fp;
+
+       FILE *log;
+       FILE *err;
+
+       void (*convert_sample_to_float)(void *, float *, int);
+       void (*convert_float_to_sample)(float *, void *, int, int);
+
+       void *buf;                      /* PCM Buffer */
+
+       bool local;                     /* true for internal test */
+};
+
+struct analyze {
+       void *buf;
+       float *in;
+       float *out;
+       float *mag;
+};
+
+void prepare_wav_info(struct wav_container *, struct bat *);
+int read_wav_header(struct bat *, char *, FILE *, bool);
+int write_wav_header(FILE *, struct wav_container *, struct bat *);
+int update_wav_header(struct bat *, FILE *, int);
+int generate_input_data(struct bat *, void *, int, int);
diff --git a/bat/convert.c b/bat/convert.c
new file mode 100644 (file)
index 0000000..c502ae5
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+#include "aconfig.h"
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+void convert_uint8_to_float(void *buf, float *val, int samples)
+{
+       int i;
+
+       for (i = 0; i < samples; i++)
+               val[i] = ((uint8_t *) buf)[i];
+}
+
+void convert_int16_to_float(void *buf, float *val, int samples)
+{
+       int i;
+
+       for (i = 0; i < samples; i++)
+               val[i] = ((int16_t *) buf)[i];
+}
+
+void convert_int24_to_float(void *buf, float *val, int samples)
+{
+       int i;
+       int32_t tmp;
+
+       for (i = 0; i < samples; i++) {
+               tmp = ((uint8_t *) buf)[i * 3 + 2] << 24;
+               tmp |= ((uint8_t *) buf)[i * 3 + 1] << 16;
+               tmp |= ((uint8_t *) buf)[i * 3] << 8;
+               tmp >>= 8;
+               val[i] = tmp;
+       }
+}
+
+void convert_int32_to_float(void *buf, float *val, int samples)
+{
+       int i;
+
+       for (i = 0; i < samples; i++)
+               val[i] = ((int32_t *) buf)[i];
+}
+
+void convert_float_to_uint8(float *val, void *buf, int samples, int channels)
+{
+       int i, c, idx;
+
+       for (i = 0; i < samples; i++) {
+               for (c = 0; c < channels; c++) {
+                       idx = i * channels + c;
+                       ((uint8_t *) buf)[idx] = (uint8_t) val[idx];
+               }
+       }
+}
+
+void convert_float_to_int16(float *val, void *buf, int samples, int channels)
+{
+       int i, c, idx;
+
+       for (i = 0; i < samples; i++) {
+               for (c = 0; c < channels; c++) {
+                       idx = i * channels + c;
+                       ((int16_t *) buf)[idx] = (int16_t) val[idx];
+               }
+       }
+}
+
+void convert_float_to_int24(float *val, void *buf, int samples, int channels)
+{
+       int i, c, idx_f, idx_i;
+       int32_t val_f_i;
+
+       for (i = 0; i < samples; i++) {
+               for (c = 0; c < channels; c++) {
+                       idx_f = i * channels + c;
+                       idx_i = 3 * idx_f;
+                       val_f_i = (int32_t) val[idx_f];
+                       ((int8_t *) buf)[idx_i + 0] =
+                               (int8_t) (val_f_i & 0xff);
+                       ((int8_t *) buf)[idx_i + 1] =
+                               (int8_t) ((val_f_i >> 8) & 0xff);
+                       ((int8_t *) buf)[idx_i + 2] =
+                               (int8_t) ((val_f_i >> 16) & 0xff);
+               }
+       }
+}
+
+void convert_float_to_int32(float *val, void *buf, int samples, int channels)
+{
+       int i, c, idx;
+
+       for (i = 0; i < samples; i++) {
+               for (c = 0; c < channels; c++) {
+                       idx = i * channels + c;
+                       ((int32_t *) buf)[idx] = (int32_t) val[idx];
+               }
+       }
+}
diff --git a/bat/convert.h b/bat/convert.h
new file mode 100644 (file)
index 0000000..699c07a
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+void convert_uint8_to_float(void *, float *, int);
+void convert_int16_to_float(void *, float *, int);
+void convert_int24_to_float(void *, float *, int);
+void convert_int32_to_float(void *, float *, int);
+void convert_float_to_uint8(float *, void *, int, int);
+void convert_float_to_int16(float *, void *, int, int);
+void convert_float_to_int24(float *, void *, int, int);
+void convert_float_to_int32(float *, void *, int, int);
diff --git a/bat/latencytest.c b/bat/latencytest.c
new file mode 100644 (file)
index 0000000..7c9db61
--- /dev/null
@@ -0,0 +1,243 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+#include "aconfig.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+
+#include "common.h"
+#include "bat-signal.h"
+#include "gettext.h"
+
+/* How one measurement step works:
+   - Listen and measure the average loudness of the environment for 1 second.
+   - Create a threshold value 16 decibels higher than the average loudness.
+   - Begin playing a ~1000 Hz sine wave and start counting the samples elapsed.
+   - Stop counting and playing if the input's loudness is higher than the
+     threshold, as the output wave is probably coming back.
+   - Calculate the round trip audio latency value in milliseconds. */
+
+static float sumaudio(struct bat *bat, short int *buffer, int frames)
+{
+       float sum = 0;
+       int n = 0;
+
+       while (frames) {
+               frames--;
+
+               for (n = 0; n < bat->channels; n++) {
+                       sum += abs(buffer[0]);
+                       buffer++;
+               }
+       }
+
+       sum = sum / bat->channels;
+
+       return sum;
+}
+
+static void play_and_listen(struct bat *bat, void *buffer, int frames)
+{
+       int averageinput;
+       int n = 0;
+       float sum = 0;
+       float max = 0;
+       float min = 100000.0f;
+       short int *input;
+       int num = bat->latency.number;
+
+       averageinput = (int) (sumaudio(bat, buffer, frames) / frames);
+
+       /* The signal is above threshold
+          So our sine wave comes back on the input */
+       if (averageinput > bat->latency.threshold) {
+               input = buffer;
+
+               /* Check the location when it became loud enough */
+               while (n < frames) {
+                       if (*input++ > bat->latency.threshold)
+                               break;
+                       *input += bat->channels;
+                       n++;
+               }
+
+               /* Now we get the total round trip latency*/
+               bat->latency.samples += n;
+
+               /* Expect at least 1 buffer of round trip latency. */
+               if (bat->latency.samples > frames) {
+                       bat->latency.result[num - 1] =
+                               (float) bat->latency.samples * 1000 / bat->rate;
+                       fprintf(bat->log,
+                                        _("Test%d, round trip latency %dms\n"),
+                                       num,
+                                       (int) bat->latency.result[num - 1]);
+
+                       for (n = 0; n < num; n++) {
+                               if (bat->latency.result[n] > max)
+                                       max = bat->latency.result[n];
+                               if (bat->latency.result[n] < min)
+                                       min = bat->latency.result[n];
+                               sum += bat->latency.result[n];
+                       }
+
+                       /* The maximum is higher than the minimum's double */
+                       if (max / min > 2.0f) {
+                               bat->latency.state =
+                                       LATENCY_STATE_COMPLETE_FAILURE;
+                               bat->latency.is_capturing = false;
+                               return;
+
+                       /* Final results */
+                       } else if (num == LATENCY_TEST_NUMBER) {
+                               bat->latency.final_result =
+                                       (int) (sum / LATENCY_TEST_NUMBER);
+                               fprintf(bat->log,
+                                       _("Final round trip latency: %dms\n"),
+                                       bat->latency.final_result);
+
+                               bat->latency.state =
+                                       LATENCY_STATE_COMPLETE_SUCCESS;
+                               bat->latency.is_capturing = false;
+                               return;
+
+                       /* Next step */
+                       } else
+                               bat->latency.state = LATENCY_STATE_WAITING;
+
+                       bat->latency.number++;
+
+               } else
+                       /* Happens when an early noise comes in */
+                       bat->latency.state = LATENCY_STATE_WAITING;
+
+       } else {
+               /* Still listening */
+               bat->latency.samples += frames;
+
+               /* Do not listen to more than a second
+                  Maybe too much background noise */
+               if ((unsigned int)bat->latency.samples > bat->rate) {
+                       bat->latency.error++;
+
+                       if (bat->latency.error > LATENCY_TEST_NUMBER) {
+                               fprintf(bat->err,
+                                       _("Could not detect signal."));
+                               fprintf(bat->err,
+                                       _("Too much background noise?\n"));
+                               bat->latency.state =
+                                       LATENCY_STATE_COMPLETE_FAILURE;
+                               bat->latency.is_capturing = false;
+                               return;
+                       }
+
+                       /* let's start over */
+                       bat->latency.state = LATENCY_STATE_WAITING;
+               }
+       }
+
+       return;
+}
+
+static void calculate_threshold(struct bat *bat)
+{
+       float average;
+       float reference;
+
+       /* Calculate the average loudness of the environment and create
+          a threshold value 16 decibels higher than the average loudness */
+       average = bat->latency.sum / bat->latency.samples / 32767.0f;
+       reference = 20.0f * log10f(average) + 16.0f;
+       bat->latency.threshold = (int) (powf(10.0f, reference / 20.0f)
+                                               * 32767.0f);
+}
+
+void roundtrip_latency_init(struct bat *bat)
+{
+       bat->latency.number = 1;
+       bat->latency.state = LATENCY_STATE_MEASURE_FOR_1_SECOND;
+       bat->latency.final_result = 0;
+       bat->latency.samples = 0;
+       bat->latency.sum = 0;
+       bat->latency.threshold = 0;
+       bat->latency.is_capturing = false;
+       bat->latency.is_playing = false;
+       bat->latency.error = 0;
+       bat->latency.xrun_error = false;
+       bat->frames = LATENCY_TEST_TIME_LIMIT * bat->rate;
+       bat->periods_played = 0;
+}
+
+int handleinput(struct bat *bat, void *buffer, int frames)
+{
+       switch (bat->latency.state) {
+       /* Measuring average loudness for 1 second */
+       case LATENCY_STATE_MEASURE_FOR_1_SECOND:
+               bat->latency.sum += sumaudio(bat, buffer, frames);
+               bat->latency.samples += frames;
+
+               /* 1 second elapsed */
+               if ((unsigned int)bat->latency.samples >= bat->rate) {
+                       calculate_threshold(bat);
+                       bat->latency.state = LATENCY_STATE_PLAY_AND_LISTEN;
+                       bat->latency.samples = 0;
+                       bat->latency.sum = 0;
+               }
+               break;
+
+       /* Playing sine wave and listening if it comes back */
+       case LATENCY_STATE_PLAY_AND_LISTEN:
+               play_and_listen(bat, buffer, frames);
+               break;
+
+       /* Waiting 1 second */
+       case LATENCY_STATE_WAITING:
+               bat->latency.samples += frames;
+
+               if ((unsigned int)bat->latency.samples > bat->rate) {
+                       /* 1 second elapsed, start over */
+                       bat->latency.samples = 0;
+                       bat->latency.state = LATENCY_STATE_MEASURE_FOR_1_SECOND;
+               }
+               break;
+
+       default:
+               return 0;
+       }
+
+       return 0;
+}
+
+int handleoutput(struct bat *bat, void *buffer, int bytes, int frames)
+{
+       int err = 0;
+
+       /* If capture completed, terminate the playback */
+       if (bat->periods_played * frames > 2 * bat->rate
+                       && bat->latency.is_capturing == false)
+               return bat->latency.state;
+
+       if (bat->latency.state == LATENCY_STATE_PLAY_AND_LISTEN)
+               err = generate_sine_wave(bat, frames, buffer);
+       else
+               /* Output silence */
+               memset(buffer, 0, bytes);
+
+       return err;
+}
diff --git a/bat/latencytest.h b/bat/latencytest.h
new file mode 100644 (file)
index 0000000..be5e661
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+void roundtrip_latency_init(struct bat *);
+int handleinput(struct bat *, void *, int);
+int handleoutput(struct bat *, void *, int, int);
diff --git a/bat/signal.c b/bat/signal.c
new file mode 100644 (file)
index 0000000..da5368c
--- /dev/null
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2015 Caleb Crome
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This is a general purpose sine wave generator that will stay stable
+ * for a long time, and with a little renormalization, could stay stay
+ * stable indefinitely
+ */
+
+#include "aconfig.h"
+
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <errno.h>
+
+#include "gettext.h"
+#include "common.h"
+#include "signal.h"
+
+/*
+ * Initialize the sine wave generator.
+ * sin_generator:  gets initialized by this call.
+ * frequency:      the frequency for the sine wave.  must be < 0.5*sample_rate
+ * sample_rate:    the sample rate...
+ * returns 0 on success, -1 on error.
+ */
+int sin_generator_init(struct sin_generator *sg, float magnitude,
+               float frequency, float sample_rate)
+{
+       /* angular frequency:  cycles/sec / (samp/sec) * rad/cycle = rad/samp */
+       float w = frequency / sample_rate * 2 * M_PI;
+       if (frequency >= sample_rate / 2)
+               return -1;
+       sg->phasor_real = cos(w);
+       sg->phasor_imag = sin(w);
+       sg->magnitude   = magnitude;
+       sg->state_real  = 0.0;
+       sg->state_imag  = magnitude;
+       sg->frequency = frequency;
+       sg->sample_rate = sample_rate;
+       return 0;
+}
+
+/*
+ * Generates the next sample in the sine wave.
+ * should be much faster than calling a sin function
+ * if it's inlined and optimized.
+ *
+ * returns the next value.  no possibility of error.
+ */
+float sin_generator_next_sample(struct sin_generator *sg)
+{
+       /* get shorthand to pointers */
+       const double pr = sg->phasor_real;
+       const double pi = sg->phasor_imag;
+       const double sr = sg->state_real;
+       const double si = sg->state_imag;
+       /* step the phasor -- complex multiply */
+       sg->state_real = sr * pr - si * pi;
+       sg->state_imag = sr * pi + pr * si;
+       /* return the input value so sine wave starts at exactly 0.0 */
+       return (float)sr;
+}
+
+/* fills a vector with a sine wave */
+void sin_generator_vfill(struct sin_generator *sg, float *buf, int n)
+{
+       int i;
+       for (i = 0; i < n; i++)
+               *buf++ = sin_generator_next_sample(sg);
+}
+
+static int reorder(struct bat *bat, float *val, int frames)
+{
+       float *new_buf = NULL;
+       int i, c, bytes;
+
+       bytes = frames * bat->channels * sizeof(float);
+
+       new_buf = (float *) malloc(bytes);
+       if (new_buf == NULL) {
+               fprintf(bat->err, _("Not enough memory.\n"));
+               return -ENOMEM;
+       }
+
+       memcpy(new_buf, val, bytes);
+       for (i = 0; i < frames; i++)
+               for (c = 0; c < bat->channels; c++)
+                       val[i * bat->channels + c] =
+                               new_buf[c * frames + i];
+       free(new_buf);
+
+       return 0;
+}
+
+static int adjust_waveform(struct bat *bat, float *val, int frames,
+               int channels)
+{
+       int i, nsamples, max;
+       float factor, offset = 0.0;
+
+       switch (bat->format) {
+       case BAT_PCM_FORMAT_U8:
+               max = INT8_MAX;
+               offset = max;   /* shift for unsigned format */
+               break;
+       case BAT_PCM_FORMAT_S16_LE:
+               max  = INT16_MAX;
+               break;
+       case BAT_PCM_FORMAT_S24_3LE:
+               max = (1 << 23) - 1;
+               break;
+       case BAT_PCM_FORMAT_S32_LE:
+               max = INT32_MAX;
+               break;
+       default:
+               fprintf(bat->err, _("Invalid PCM format: %d\n"), bat->format);
+               return -EINVAL;
+       }
+
+       factor = max * RANGE_FACTOR;
+       nsamples = channels * frames;
+
+       for (i = 0; i < nsamples; i++)
+               val[i] = val[i] * factor + offset;
+
+       return 0;
+}
+
+int generate_sine_wave(struct bat *bat, int frames, void *buf)
+{
+       int err = 0;
+       int c, nsamples;
+       float *sinus_f = NULL;
+       static struct sin_generator sg[MAX_CHANNELS];
+
+       nsamples = bat->channels * frames;
+       sinus_f = (float *) malloc(nsamples * sizeof(float));
+       if (sinus_f == NULL) {
+               fprintf(bat->err, _("Not enough memory.\n"));
+               return -ENOMEM;
+       }
+
+       for (c = 0; c < bat->channels; c++) {
+               /* initialize static struct at the first time */
+               if (sg[c].frequency != bat->target_freq[c])
+                       sin_generator_init(&sg[c], 1.0, bat->target_freq[c],
+                                       bat->rate);
+               /* fill buffer for each channel */
+               sin_generator_vfill(&sg[c], sinus_f + c * frames, frames);
+       }
+
+       /* reorder samples to interleaved mode */
+       err = reorder(bat, sinus_f, frames);
+       if (err != 0)
+               goto exit;
+
+       /* adjust amplitude and offset of waveform */
+       err = adjust_waveform(bat, sinus_f, frames, bat->channels);
+       if (err != 0)
+               goto exit;
+
+       bat->convert_float_to_sample(sinus_f, buf, frames, bat->channels);
+
+exit:
+       free(sinus_f);
+
+       return err;
+}
+
+/* generate single channel sine waveform without sample conversion */
+int generate_sine_wave_raw_mono(struct bat *bat, float *buf,
+               float freq, int nsamples)
+{
+       int err = 0;
+       struct sin_generator sg;
+
+       err = sin_generator_init(&sg, 1.0, freq, bat->rate);
+       if (err < 0)
+               return err;
+       sin_generator_vfill(&sg, buf, nsamples);
+
+       /* adjust amplitude and offset of waveform */
+       err = adjust_waveform(bat, buf, nsamples, 1);
+
+       return err;
+}
diff --git a/bat/tests/Makefile.am b/bat/tests/Makefile.am
new file mode 100644 (file)
index 0000000..d20eb3c
--- /dev/null
@@ -0,0 +1,11 @@
+SUBDIRS=asound_state
+alsabat_script_files = analog_audio_playback_and_capture.sh \
+       dp_audio_playback.sh \
+       dp_audio_subdevice_number.sh \
+       hdmi_audio_playback.sh \
+       hdmi_audio_subdevice_number.sh \
+       map_test_case \
+       README
+
+EXTRA_DIST = \
+       $(alsabat_script_files)
diff --git a/bat/tests/Makefile.in b/bat/tests/Makefile.in
new file mode 100644 (file)
index 0000000..82a9f3d
--- /dev/null
@@ -0,0 +1,689 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bat/tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in README
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+SUBDIRS = asound_state
+alsabat_script_files = analog_audio_playback_and_capture.sh \
+       dp_audio_playback.sh \
+       dp_audio_subdevice_number.sh \
+       hdmi_audio_playback.sh \
+       hdmi_audio_subdevice_number.sh \
+       map_test_case \
+       README
+
+EXTRA_DIST = \
+       $(alsabat_script_files)
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bat/tests/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign bat/tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
+           dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+           $(am__relativize); \
+           new_distdir=$$reldir; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool cscopelist-am ctags \
+       ctags-am distclean distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bat/tests/README b/bat/tests/README
new file mode 100644 (file)
index 0000000..de69686
--- /dev/null
@@ -0,0 +1,32 @@
+
+       automated test scripts for linux audio driver
+       based on alsa-lib interface by using alsabat
+===============================================================================
+
+This package contains the test scripts for linux audio driver based on
+alsa-lib interface by using alsabat.
+It supports analog and display(HDMI/DP) audio test.
+The package needs  the alsa-utils, alsa-lib installed environment.
+
+alsabat_main.sh
+       - the main entrance test script,
+       it will call the other scripts to run the tests
+       (test result will save in the ./log/ folder)
+analog_audio_playback_and_capture.sh
+       - analog audio test script (please to loopback the
+       analog audio output to analog audio input)
+hdmi_audio_playback.sh
+       - hdmi audio test script (please to loopback the hdmi audio output
+       to analog audio input)
+dp_audio_playback.sh
+       - dp audio test script (please to loopback the dp audio
+       output to analog audio input)
+map_test_case
+       - to map the test suite/cases to a test script
+asound_state/
+       - some asound.state config reference files
+       based on different platforms
+
+                               Focus Luo <focus.luo@linux.intel.com>
+                               Wang,Jinliang <jinliang.wang@intel.com>
+                               Zhang,Keqiao <keqiao.zhang@intel.com>
diff --git a/bat/tests/analog_audio_playback_and_capture.sh b/bat/tests/analog_audio_playback_and_capture.sh
new file mode 100755 (executable)
index 0000000..bac491e
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+#/*
+# * Copyright (C) 2013-2016 Intel Corporation
+# *
+# * 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.
+# *
+# */
+
+#set test freq table (HZ)
+freq_table="10 31 73 155 380 977 1932 4119 8197 16197"
+
+#set test number of channels
+test_channel=2
+
+#get Analog audio card number
+card_number=$(aplay -l | grep "Analog" | cut -b 6)
+if [ "$card_number" = "" ]; then
+        echo "Can not get Analog card number."
+        exit 1
+fi
+
+#get Analog audio device number
+device_number=$(aplay -l | grep "Analog"| cut -d " " -f 8 |cut -b 1)
+if [ "$device_number" = "" ]; then
+        echo "Can not get Analog device number"
+        exit 1
+fi
+
+
+device="hw:$card_number,$device_number"
+echo $device
+
+#get Analog audio record card number
+record_card_number=$(arecord -l | grep "Analog" | cut -b 6)
+if [ "$record_card_number" = "" ]; then
+        echo "Can not get record card number."
+        exit 1
+fi
+
+#get Analog audio record device number
+record_device_number=$(arecord -l | grep "Analog"| cut -d " " -f 8 |cut -b 1)
+echo $record_device_number
+if [ "$record_device_number" = "" ]; then
+        echo "Can not get record device number"
+        exit 1
+fi
+
+#Notice: to loopback the analog audio output to the analog audio input
+record_device="hw:$record_card_number,$record_device_number"
+test_flag=0
+
+echo  -e "\e[31m Notice: to loopback the analog audio output to \
+the analog audio input"
+echo -e "\e[0m"
+read -p "Press enter to continue"
+
+#call alsabat to do the test for each frequency in the freq_table
+for freq in $freq_table
+       do
+       alsabat -P $device -C plug$record_device -c $test_channel -F $freq
+               if [ $? = 0 ]; then
+                       echo "Test target frequency:$freq for Analog playback -- Passed \
+" >> $ABAT_TEST_LOG_FILE
+                       echo "Test target frequency:$freq for Analog capture -- Passed \
+" >> $ABAT_TEST_LOG_FILE
+               else
+                       echo "Test target frequency:$freq for Analog playback -- Failed \
+" >> $ABAT_TEST_LOG_FILE
+                       echo "Test target frequency:$freq for Analog capture -- Failed \
+" >> $ABAT_TEST_LOG_FILE
+                       test_flag=1
+               fi
+       done
+
+exit $test_flag
diff --git a/bat/tests/asound_state/Makefile.am b/bat/tests/asound_state/Makefile.am
new file mode 100644 (file)
index 0000000..7010310
--- /dev/null
@@ -0,0 +1,6 @@
+alsabat_cfg_files = asound.state.Broadwell \
+       asound.state.Haswell \
+       asound.state.Skylake
+
+EXTRA_DIST = \
+       $(alsabat_cfg_files)
diff --git a/bat/tests/asound_state/Makefile.in b/bat/tests/asound_state/Makefile.in
new file mode 100644 (file)
index 0000000..25f4b24
--- /dev/null
@@ -0,0 +1,504 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = bat/tests/asound_state
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+alsabat_cfg_files = asound.state.Broadwell \
+       asound.state.Haswell \
+       asound.state.Skylake
+
+EXTRA_DIST = \
+       $(alsabat_cfg_files)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bat/tests/asound_state/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign bat/tests/asound_state/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       cscopelist-am ctags-am distclean distclean-generic \
+       distclean-libtool distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/bat/tests/asound_state/asound.state.Broadwell b/bat/tests/asound_state/asound.state.Broadwell
new file mode 100644 (file)
index 0000000..bea75e5
--- /dev/null
@@ -0,0 +1,439 @@
+state.HDMI {
+       control.1 {
+               iface CARD
+               name 'HDMI/DP,pcm=3 Jack'
+               value false
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.2 {
+               iface MIXER
+               name 'IEC958 Playback Con Mask'
+               value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.3 {
+               iface MIXER
+               name 'IEC958 Playback Pro Mask'
+               value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.4 {
+               iface MIXER
+               name 'IEC958 Playback Default'
+               value '0482000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.5 {
+               iface MIXER
+               name 'IEC958 Playback Switch'
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.6 {
+               iface PCM
+               device 3
+               name ELD
+               value ''
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 0
+               }
+       }
+       control.7 {
+               iface CARD
+               name 'HDMI/DP,pcm=7 Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.8 {
+               iface MIXER
+               name 'IEC958 Playback Con Mask'
+               index 1
+               value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.9 {
+               iface MIXER
+               name 'IEC958 Playback Pro Mask'
+               index 1
+               value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.10 {
+               iface MIXER
+               name 'IEC958 Playback Default'
+               index 1
+               value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.11 {
+               iface MIXER
+               name 'IEC958 Playback Switch'
+               index 1
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.12 {
+               iface PCM
+               device 7
+               name ELD
+               value '100008006a10000100000000000000000469b12341535553205041323338091707000000'
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 36
+               }
+       }
+       control.13 {
+               iface CARD
+               name 'HDMI/DP,pcm=8 Jack'
+               value false
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.14 {
+               iface MIXER
+               name 'IEC958 Playback Con Mask'
+               index 2
+               value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.15 {
+               iface MIXER
+               name 'IEC958 Playback Pro Mask'
+               index 2
+               value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.16 {
+               iface MIXER
+               name 'IEC958 Playback Default'
+               index 2
+               value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.17 {
+               iface MIXER
+               name 'IEC958 Playback Switch'
+               index 2
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.18 {
+               iface PCM
+               device 8
+               name ELD
+               value ''
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 0
+               }
+       }
+       control.19 {
+               iface PCM
+               device 3
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+       control.20 {
+               iface PCM
+               device 7
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+       control.21 {
+               iface PCM
+               device 8
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+}
+state.PCH {
+       control.1 {
+               iface MIXER
+               name 'Master Playback Volume'
+               value.0 41
+               value.1 41
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 87'
+                       dbmin -6525
+                       dbmax 0
+                       dbvalue.0 -3450
+                       dbvalue.1 -3450
+               }
+       }
+       control.2 {
+               iface MIXER
+               name 'Master Playback Switch'
+               value.0 true
+               value.1 true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 2
+               }
+       }
+       control.3 {
+               iface MIXER
+               name 'Loopback Mixing'
+               value Enabled
+               comment {
+                       access 'read write'
+                       type ENUMERATED
+                       count 1
+                       item.0 Disabled
+                       item.1 Enabled
+               }
+       }
+       control.4 {
+               iface MIXER
+               name 'Mic Playback Volume'
+               value.0 0
+               value.1 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 31'
+                       dbmin -3450
+                       dbmax 1200
+                       dbvalue.0 -3450
+                       dbvalue.1 -3450
+               }
+       }
+       control.5 {
+               iface MIXER
+               name 'Mic Playback Switch'
+               value.0 true
+               value.1 true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 2
+               }
+       }
+       control.6 {
+               iface MIXER
+               name 'Capture Volume'
+               value.0 21
+               value.1 21
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 63'
+                       dbmin -1725
+                       dbmax 3000
+                       dbvalue.0 -150
+                       dbvalue.1 -150
+               }
+       }
+       control.7 {
+               iface MIXER
+               name 'Capture Switch'
+               value.0 true
+               value.1 true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 2
+               }
+       }
+       control.8 {
+               iface MIXER
+               name 'Mic Boost Volume'
+               value.0 0
+               value.1 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 3'
+                       dbmin 0
+                       dbmax 3600
+                       dbvalue.0 0
+                       dbvalue.1 0
+               }
+       }
+       control.9 {
+               iface CARD
+               name 'Mic Jack'
+               value false
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.10 {
+               iface CARD
+               name 'Headphone Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.11 {
+               iface PCM
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               comment {
+                       access read
+                       type INTEGER
+                       count 2
+                       range '0 - 36'
+               }
+       }
+       control.12 {
+               iface PCM
+               name 'Capture Channel Map'
+               value.0 0
+               value.1 0
+               comment {
+                       access read
+                       type INTEGER
+                       count 2
+                       range '0 - 36'
+               }
+       }
+       control.13 {
+               iface MIXER
+               name 'PCM Playback Volume'
+               value.0 105
+               value.1 105
+               comment {
+                       access 'read write user'
+                       type INTEGER
+                       count 2
+                       range '0 - 255'
+                       tlv '0000000100000008ffffec1400000014'
+                       dbmin -5100
+                       dbmax 0
+                       dbvalue.0 -3000
+                       dbvalue.1 -3000
+               }
+       }
+       control.14 {
+               iface MIXER
+               name 'Digital Capture Volume'
+               value.0 60
+               value.1 60
+               comment {
+                       access 'read write user'
+                       type INTEGER
+                       count 2
+                       range '0 - 120'
+                       tlv '0000000100000008fffff44800000032'
+                       dbmin -3000
+                       dbmax 3000
+                       dbvalue.0 0
+                       dbvalue.1 0
+               }
+       }
+}
diff --git a/bat/tests/asound_state/asound.state.Haswell b/bat/tests/asound_state/asound.state.Haswell
new file mode 100644 (file)
index 0000000..04b05c1
--- /dev/null
@@ -0,0 +1,342 @@
+state.HDMI {
+       control.1 {
+               iface CARD
+               name 'HDMI/DP,pcm=3 Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.2 {
+               iface MIXER
+               name 'IEC958 Playback Con Mask'
+               value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.3 {
+               iface MIXER
+               name 'IEC958 Playback Pro Mask'
+               value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.4 {
+               iface MIXER
+               name 'IEC958 Playback Default'
+               value '0482000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.5 {
+               iface MIXER
+               name 'IEC958 Playback Switch'
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.6 {
+               iface PCM
+               device 3
+               name ELD
+               value '100008006a10000100000000000000000469d22341535553205653323339091707000000'
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 36
+               }
+       }
+       control.7 {
+               iface CARD
+               name 'HDMI/DP,pcm=7 Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.8 {
+               iface MIXER
+               name 'IEC958 Playback Con Mask'
+               index 1
+               value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.9 {
+               iface MIXER
+               name 'IEC958 Playback Pro Mask'
+               index 1
+               value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.10 {
+               iface MIXER
+               name 'IEC958 Playback Default'
+               index 1
+               value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.11 {
+               iface MIXER
+               name 'IEC958 Playback Switch'
+               index 1
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.12 {
+               iface PCM
+               device 7
+               name ELD
+               value '100008006a10000100000000000000000469b12341535553205041323338091707000000'
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 36
+               }
+       }
+       control.13 {
+               iface PCM
+               device 3
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+       control.14 {
+               iface PCM
+               device 7
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+}
+state.PCH {
+       control.1 {
+               iface MIXER
+               name 'Master Playback Volume'
+               value.0 45
+               value.1 45
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 87'
+                       dbmin -6525
+                       dbmax 0
+                       dbvalue.0 -3150
+                       dbvalue.1 -3150
+               }
+       }
+       control.2 {
+               iface MIXER
+               name 'Master Playback Switch'
+               value.0 true
+               value.1 true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 2
+               }
+       }
+       control.3 {
+               iface MIXER
+               name 'Capture Volume'
+               value.0 27
+               value.1 27
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 63'
+                       dbmin -1725
+                       dbmax 3000
+                       dbvalue.0 300
+                       dbvalue.1 300
+               }
+       }
+       control.4 {
+               iface MIXER
+               name 'Capture Switch'
+               value.0 true
+               value.1 true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 2
+               }
+       }
+       control.5 {
+               iface MIXER
+               name 'Mic Boost Volume'
+               value.0 0
+               value.1 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 3'
+                       dbmin 0
+                       dbmax 3600
+                       dbvalue.0 0
+                       dbvalue.1 0
+               }
+       }
+       control.6 {
+               iface MIXER
+               name 'Internal Mic Boost Volume'
+               value.0 0
+               value.1 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 3'
+                       dbmin 0
+                       dbmax 3600
+                       dbvalue.0 0
+                       dbvalue.1 0
+               }
+       }
+       control.7 {
+               iface CARD
+               name 'Mic Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.8 {
+               iface CARD
+               name 'Internal Mic Phantom Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.9 {
+               iface CARD
+               name 'Headphone Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.10 {
+               iface PCM
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               comment {
+                       access read
+                       type INTEGER
+                       count 2
+                       range '0 - 36'
+               }
+       }
+       control.11 {
+               iface PCM
+               name 'Capture Channel Map'
+               value.0 0
+               value.1 0
+               comment {
+                       access read
+                       type INTEGER
+                       count 2
+                       range '0 - 36'
+               }
+       }
+       control.12 {
+               iface MIXER
+               name 'PCM Playback Volume'
+               value.0 167
+               value.1 167
+               comment {
+                       access 'read write user'
+                       type INTEGER
+                       count 2
+                       range '0 - 255'
+                       tlv '0000000100000008ffffec1400000014'
+                       dbmin -5100
+                       dbmax 0
+                       dbvalue.0 -1760
+                       dbvalue.1 -1760
+               }
+       }
+       control.13 {
+               iface MIXER
+               name 'Digital Capture Volume'
+               value.0 60
+               value.1 60
+               comment {
+                       access 'read write user'
+                       type INTEGER
+                       count 2
+                       range '0 - 120'
+                       tlv '0000000100000008fffff44800000032'
+                       dbmin -3000
+                       dbmax 3000
+                       dbvalue.0 0
+                       dbvalue.1 0
+               }
+       }
+}
diff --git a/bat/tests/asound_state/asound.state.Skylake b/bat/tests/asound_state/asound.state.Skylake
new file mode 100644 (file)
index 0000000..50f672a
--- /dev/null
@@ -0,0 +1,437 @@
+state.PCH {
+       control.1 {
+               iface MIXER
+               name 'Master Playback Volume'
+               value.0 57
+               value.1 57
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 87'
+                       dbmin -6525
+                       dbmax 0
+                       dbvalue.0 -2250
+                       dbvalue.1 -2250
+               }
+       }
+       control.2 {
+               iface MIXER
+               name 'Master Playback Switch'
+               value.0 true
+               value.1 true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 2
+               }
+       }
+       control.3 {
+               iface MIXER
+               name 'Loopback Mixing'
+               value Enabled
+               comment {
+                       access 'read write'
+                       type ENUMERATED
+                       count 1
+                       item.0 Disabled
+                       item.1 Enabled
+               }
+       }
+       control.4 {
+               iface MIXER
+               name 'Mic Playback Volume'
+               value.0 15
+               value.1 15
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 31'
+                       dbmin -3450
+                       dbmax 1200
+                       dbvalue.0 -1200
+                       dbvalue.1 -1200
+               }
+       }
+       control.5 {
+               iface MIXER
+               name 'Mic Playback Switch'
+               value.0 true
+               value.1 true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 2
+               }
+       }
+       control.6 {
+               iface MIXER
+               name 'Capture Volume'
+               value.0 27
+               value.1 27
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 63'
+                       dbmin -1725
+                       dbmax 3000
+                       dbvalue.0 300
+                       dbvalue.1 300
+               }
+       }
+       control.7 {
+               iface MIXER
+               name 'Capture Switch'
+               value.0 true
+               value.1 true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 2
+               }
+       }
+       control.8 {
+               iface MIXER
+               name 'Mic Boost Volume'
+               value.0 0
+               value.1 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 2
+                       range '0 - 3'
+                       dbmin 0
+                       dbmax 3600
+                       dbvalue.0 0
+                       dbvalue.1 0
+               }
+       }
+       control.9 {
+               iface CARD
+               name 'Mic Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.10 {
+               iface CARD
+               name 'Headphone Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.11 {
+               iface PCM
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               comment {
+                       access read
+                       type INTEGER
+                       count 2
+                       range '0 - 36'
+               }
+       }
+       control.12 {
+               iface PCM
+               name 'Capture Channel Map'
+               value.0 0
+               value.1 0
+               comment {
+                       access read
+                       type INTEGER
+                       count 2
+                       range '0 - 36'
+               }
+       }
+       control.13 {
+               iface CARD
+               name 'HDMI/DP,pcm=3 Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.14 {
+               iface MIXER
+               name 'IEC958 Playback Con Mask'
+               value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.15 {
+               iface MIXER
+               name 'IEC958 Playback Pro Mask'
+               value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.16 {
+               iface MIXER
+               name 'IEC958 Playback Default'
+               value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.17 {
+               iface MIXER
+               name 'IEC958 Playback Switch'
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.18 {
+               iface PCM
+               device 3
+               name ELD
+               value '100008006a10000100000000000000000469d22341535553205653323339091707000000'
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 36
+               }
+       }
+       control.19 {
+               iface CARD
+               name 'HDMI/DP,pcm=7 Jack'
+               value true
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.20 {
+               iface MIXER
+               name 'IEC958 Playback Con Mask'
+               index 1
+               value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.21 {
+               iface MIXER
+               name 'IEC958 Playback Pro Mask'
+               index 1
+               value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.22 {
+               iface MIXER
+               name 'IEC958 Playback Default'
+               index 1
+               value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.23 {
+               iface MIXER
+               name 'IEC958 Playback Switch'
+               index 1
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.24 {
+               iface PCM
+               device 7
+               name ELD
+               value '100008006a14000100000000000000000469b12341535553205041323338091707000000'
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 36
+               }
+       }
+       control.25 {
+               iface CARD
+               name 'HDMI/DP,pcm=8 Jack'
+               value false
+               comment {
+                       access read
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.26 {
+               iface MIXER
+               name 'IEC958 Playback Con Mask'
+               index 2
+               value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.27 {
+               iface MIXER
+               name 'IEC958 Playback Pro Mask'
+               index 2
+               value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.28 {
+               iface MIXER
+               name 'IEC958 Playback Default'
+               index 2
+               value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.29 {
+               iface MIXER
+               name 'IEC958 Playback Switch'
+               index 2
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.30 {
+               iface PCM
+               device 8
+               name ELD
+               value ''
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 0
+               }
+       }
+       control.31 {
+               iface PCM
+               device 3
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+       control.32 {
+               iface PCM
+               device 7
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+       control.33 {
+               iface PCM
+               device 8
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+       control.34 {
+               iface MIXER
+               name 'PCM Playback Volume'
+               value.0 158
+               value.1 158
+               comment {
+                       access 'read write user'
+                       type INTEGER
+                       count 2
+                       range '0 - 255'
+                       tlv '0000000100000008ffffec1400000014'
+                       dbmin -5100
+                       dbmax 0
+                       dbvalue.0 -1940
+                       dbvalue.1 -1940
+               }
+       }
+       control.35 {
+               iface MIXER
+               name 'Digital Capture Volume'
+               value.0 60
+               value.1 60
+               comment {
+                       access 'read write user'
+                       type INTEGER
+                       count 2
+                       range '0 - 120'
+                       tlv '0000000100000008fffff44800000032'
+                       dbmin -3000
+                       dbmax 3000
+                       dbvalue.0 0
+                       dbvalue.1 0
+               }
+       }
+}
diff --git a/bat/tests/dp_audio_playback.sh b/bat/tests/dp_audio_playback.sh
new file mode 100755 (executable)
index 0000000..9c7ee7e
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+#/*
+# * Copyright (C) 2013-2016 Intel Corporation
+# *
+# * 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.
+# *
+# */
+
+#set test freq table (HZ)
+freq_table="10 31 73 155 380 977 1932 4119 8197 16197"
+
+#set test number of channels
+test_channel=2
+
+#get device number for DP
+DP_device_num=0
+$ABAT_TEST_PATH/dp_audio_subdevice_number.sh
+DP_device_num=$?
+if [ $DP_device_num = 77 ]; then
+       echo "Prompt: Can not get device with DP audio or \
+show the wrong connection type as HDMI in ELD info"
+       exit 1
+fi
+
+#To get DP audio device number
+DP_card_number=$(aplay -l | grep "HDMI 0" | cut -b 6)
+if [ "$DP_card_number" = "" ]; then
+       echo "Error: Can not get Display audio card."
+       exit 1
+fi
+
+DP_device="hw:$DP_card_number,$DP_device_num"
+echo $device
+sleep 2
+
+#get Analog audio record card number
+record_card_number=$(arecord -l | grep "Analog" | cut -b 6)
+if [ "$record_card_number" = "" ]; then
+       echo "Can not get record card number."
+       exit 1
+fi
+
+#get Analog audio record device number
+record_device_number=$(arecord -l | grep "Analog"| cut -d " " -f 8 |cut -b 1)
+echo $record_device_number
+if [ "$record_device_number" = "" ]; then
+        echo "Can not get record device number"
+        exit 1
+fi
+
+#Notice: to loopback the DP audio output to the analog audio input
+record_device="hw:$record_card_number,$record_device_number"
+test_flag=0
+
+echo -e "\e[31m Notice: to loopback the DP audio \
+output to the analog audio input"
+echo -e "\e[0m"
+read -p "Press enter to continue"
+
+#call alsabat to do the test for each frequency in the freq_table
+for freq in $freq_table
+       do
+               alsabat -P $DP_device -C plug$record_device -c $test_channel -F $freq
+               if [ $? = 0 ]; then
+                       echo "Test target frequency:$freq for DP audio playback--Passed" \
+>> $ABAT_TEST_LOG_FILE
+               else
+                       echo "Test target frequency:$freq for DP audio playback--Failed" \
+>> $ABAT_TEST_LOG_FILE
+                       test_flag=1
+               fi
+       done
+
+exit $test_flag
diff --git a/bat/tests/dp_audio_subdevice_number.sh b/bat/tests/dp_audio_subdevice_number.sh
new file mode 100755 (executable)
index 0000000..db2e79e
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+#/*
+# * Copyright (C) 2013-2016 Intel Corporation
+# *
+# * 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.
+# *
+# */
+#set -x
+
+subdevice_number=0
+get_subdevice=0
+
+#make sure the DP monitor is connected and active
+
+# To get DisplayPort audio device number
+card_number=$(aplay -l | grep "HDMI 1" | cut -b 6)
+echo $card_number
+if [ "$card_number" = "" ]; then
+       echo "Can not get Display audio card."
+       exit 254
+fi
+
+audio_card_dir="/proc/asound/card$card_number/"
+
+cd $audio_card_dir
+
+for file in `ls`
+do
+       #To get the ELD info according to the connented monitor with DisplayPort.
+       if [[ $file == eld* ]]; then
+               let subdevice_number+=1
+               cat $file | grep connection_type | grep DisplayPort > /dev/null
+               if [ $? = 0 ]; then
+                       echo "Get the ELD information according to the connented \
+monitor with DisplayPort."
+                       get_subdevice=1
+                       break
+               fi
+       fi
+done
+
+#failed to get the subdevice number of DisplayPort audio
+if [ $get_subdevice == 0 ]; then
+        exit 77
+fi
+
+#the subdevice number of DisplayPort audio is 3
+if [ $subdevice_number == 1 ]; then
+       exit 3
+#the subdevice number of DisplayPort audio is 7.
+elif [ $subdevice_number == 2 ]; then
+       exit 7
+#the subdevice number of DisplayPort audio is 8
+elif [ $subdevice_number == 3 ]; then
+       exit 8
+#default: failed to get the subdevice number of DisplayPort audio
+else
+       exit 77
+fi
diff --git a/bat/tests/hdmi_audio_playback.sh b/bat/tests/hdmi_audio_playback.sh
new file mode 100755 (executable)
index 0000000..3c45d91
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+#/*
+# * Copyright (C) 2013-2016 Intel Corporation
+# *
+# * 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.
+# *
+# */
+
+#set test freq table (HZ)
+freq_table="10 31 73 155 380 977 1932 4119 8197 16197"
+
+#set test number of channels
+test_channel=2
+
+#get device number for HDMI
+HDMI_device_num=0
+$ABAT_TEST_PATH/hdmi_audio_subdevice_number.sh
+HDMI_device_num=$?
+if [ $HDMI_device_num = 77 ]; then
+       echo "Prompt: Can not get device with HDMI audio or \
+show the wrong connection type as DP in ELD info"
+       exit 1
+fi
+
+#To get HDMI audio device number
+HDMI_card_number=$(aplay -l | grep "HDMI 0" | cut -b 6)
+if [ "$HDMI_card_number" = "" ]; then
+        echo "Error: Can not get Display audio card."
+        exit 1
+fi
+
+HDMI_device="hw:$HDMI_card_number,$HDMI_device_num"
+echo $device
+sleep 2
+
+#get Analog audio record card number
+record_card_number=$(arecord -l | grep "Analog" | cut -b 6)
+if [ "$record_card_number" = "" ]; then
+        echo "Can not get record card number."
+        exit 1
+fi
+
+#get Analog audio record device number
+record_device_number=$(arecord -l | grep "Analog"| cut -d " " -f 8 |cut -b 1)
+if [ "$record_device_number" = "" ]; then
+        echo "Can not get record device number"
+        exit 1
+fi
+
+#Notice: to loopback the HDMI audio output to the analog audio input
+record_device="hw:$record_card_number,$record_device_number"
+test_flag=0
+
+echo -e "\e[31m Notice: to loopback the HDMI audio output \
+to the analog audio input"
+echo -e "\e[0m"
+read -p "Press enter to continue"
+#call alsabat to do the test for each frequency in the freq_table
+for freq in $freq_table
+       do
+               alsabat -P $HDMI_device -C plug$record_device -c $test_channel -F $freq
+               if [ $? = 0 ]; then
+                       echo "Test target frequency:$freq for HDMI audio playback \
+-- Passed    " >> $ABAT_TEST_LOG_FILE
+               else
+                       echo "Test target frequency:$freq for HDMI audio playback \
+-- Failed    " >> $ABAT_TEST_LOG_FILE
+                       test_flag=1
+               fi
+       done
+
+exit $test_flag
diff --git a/bat/tests/hdmi_audio_subdevice_number.sh b/bat/tests/hdmi_audio_subdevice_number.sh
new file mode 100755 (executable)
index 0000000..7811577
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+#/*
+# * Copyright (C) 2013-2016 Intel Corporation
+# *
+# * 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.
+# *
+# */
+#set -x
+
+subdevice_number=0
+get_subdevice=0
+
+#make sure the HDMI monitor is connected and active ########
+
+# To get HDMI audio device number
+card_number=$(aplay -l | grep "HDMI 0" | cut -b 6)
+if [ "$card_number" = "" ]; then
+       echo "Can not get Display audio card."
+       #failed to get Display audio card.
+       exit 1
+fi
+
+audio_card_dir="/proc/asound/card$card_number/"
+
+cd $audio_card_dir
+for file in `ls`
+       do
+               #To get the ELD information according to the connented monitor with HDMI
+               if [[ $file == eld* ]]; then
+                       let subdevice_number+=1
+                       cat $file | grep connection_type | grep HDMI > /dev/null
+                       if [ $? = 0 ]; then
+                               get_subdevice=1
+                               break
+                       fi
+               fi
+       done
+
+#failed to get the subdevice number of HDMI audio.
+if [ $get_subdevice == 0 ]; then
+       exit 77
+fi
+
+#the subdevice number of HDMI audio is 3.
+if [ $subdevice_number == 1 ]; then
+       exit 3
+#the subdevice number of HDMI audio is 7.
+elif [ $subdevice_number == 2 ]; then
+       exit 7
+#the subdevice number of HDMI audio is 8.
+elif [ $subdevice_number == 3 ]; then
+       exit 8
+#default: failed to get the subdevice number of HDMI audio.
+else
+       exit 77
+fi
diff --git a/bat/tests/map_test_case b/bat/tests/map_test_case
new file mode 100644 (file)
index 0000000..20eb223
--- /dev/null
@@ -0,0 +1,8 @@
+# Analog audio basic test
+verify_Analog_audio_playback_and_capture="$ABAT_TEST_PATH/analog_audio_playback_and_capture.sh"
+
+# Display audio basic test cases - for HDMI
+verify_HDMI_audio_playback="$ABAT_TEST_PATH/hdmi_audio_playback.sh"
+
+# Display audio basic test cases - for DP
+verify_DP_audio_playback="$ABAT_TEST_PATH/dp_audio_playback.sh"
diff --git a/bat/tinyalsa.c b/bat/tinyalsa.c
new file mode 100644 (file)
index 0000000..cde5709
--- /dev/null
@@ -0,0 +1,555 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+#include "aconfig.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <errno.h>
+
+#include <tinyalsa/asoundlib.h>
+
+#include "gettext.h"
+
+#include "common.h"
+#include "tinyalsa.h"
+#include "latencytest.h"
+
+struct format_map_table {
+       enum _bat_pcm_format format_bat;
+       enum pcm_format format_tiny;
+};
+
+static struct format_map_table map_tables[] = {
+       { BAT_PCM_FORMAT_S16_LE, PCM_FORMAT_S16_LE },
+       { BAT_PCM_FORMAT_S32_LE, PCM_FORMAT_S32_LE },
+       { BAT_PCM_FORMAT_MAX, },
+};
+
+static int format_convert(struct bat *bat, struct pcm_config *config)
+{
+       struct format_map_table *t = map_tables;
+
+       for (; t->format_bat != BAT_PCM_FORMAT_MAX; t++) {
+               if (t->format_bat == bat->format) {
+                       config->format = t->format_tiny;
+                       return 0;
+               }
+       }
+       fprintf(bat->err, _("Invalid format!\n"));
+       return -EINVAL;
+}
+
+static int init_config(struct bat *bat, struct pcm_config *config)
+{
+       config->channels = bat->channels;
+       config->rate = bat->rate;
+       if (bat->period_size > 0)
+               config->period_size = bat->period_size;
+       else
+               config->period_size = TINYALSA_PERIODSIZE;
+       config->period_count = 4;
+       config->start_threshold = 0;
+       config->stop_threshold = 0;
+       config->silence_threshold = 0;
+
+       return format_convert(bat, config);
+}
+
+/**
+ * Called when thread is finished
+ */
+static void close_handle(void *handle)
+{
+       struct pcm *pcm = handle;
+
+       if (NULL != pcm)
+               pcm_close(pcm);
+}
+
+/**
+ * Check that a parameter is inside bounds
+ */
+static int check_param(struct bat *bat, struct pcm_params *params,
+               unsigned int param, unsigned int value,
+               char *param_name, char *param_unit)
+{
+       unsigned int min;
+       unsigned int max;
+       int ret = 0;
+
+       min = pcm_params_get_min(params, param);
+       if (value < min) {
+               fprintf(bat->err,
+                       _("%s is %u%s, device only supports >= %u%s!\n"),
+                       param_name, value, param_unit, min, param_unit);
+               ret = -EINVAL;
+       }
+
+       max = pcm_params_get_max(params, param);
+       if (value > max) {
+               fprintf(bat->err,
+                       _("%s is %u%s, device only supports <= %u%s!\n"),
+                       param_name, value, param_unit, max, param_unit);
+               ret = -EINVAL;
+       }
+
+       return ret;
+}
+
+/**
+ * Check all parameters
+ */
+static int check_playback_params(struct bat *bat,
+               struct pcm_config *config)
+{
+       struct pcm_params *params;
+       unsigned int card = bat->playback.card_tiny;
+       unsigned int device = bat->playback.device_tiny;
+       int err = 0;
+
+       params = pcm_params_get(card, device, PCM_OUT);
+       if (params == NULL) {
+               fprintf(bat->err, _("Unable to open PCM device %u!\n"),
+                               device);
+               return -EINVAL;
+       }
+
+       err = check_param(bat, params, PCM_PARAM_RATE,
+                       config->rate, "Sample rate", "Hz");
+       if (err < 0)
+               goto exit;
+       err = check_param(bat, params, PCM_PARAM_CHANNELS,
+                       config->channels, "Sample", " channels");
+       if (err < 0)
+               goto exit;
+       err = check_param(bat, params, PCM_PARAM_SAMPLE_BITS,
+                       bat->sample_size * 8, "Bitrate", " bits");
+       if (err < 0)
+               goto exit;
+       err = check_param(bat, params, PCM_PARAM_PERIOD_SIZE,
+                       config->period_size, "Period size", "Hz");
+       if (err < 0)
+               goto exit;
+       err = check_param(bat, params, PCM_PARAM_PERIODS,
+                       config->period_count, "Period count", "Hz");
+       if (err < 0)
+               goto exit;
+
+exit:
+       pcm_params_free(params);
+
+       return err;
+}
+
+/**
+ * Process output data for latency test
+ */
+static int latencytest_process_output(struct bat *bat, struct pcm *pcm,
+               void *buffer, int bytes)
+{
+       int err = 0;
+       int frames = bytes / bat->frame_size;
+
+       fprintf(bat->log, _("Play sample with %d frames buffer\n"), frames);
+
+       bat->latency.is_playing = true;
+
+       while (1) {
+               /* generate output data */
+               err = handleoutput(bat, buffer, bytes, frames);
+               if (err != 0)
+                       break;
+
+               err = pcm_write(pcm, buffer, bytes);
+               if (err != 0)
+                       break;
+
+               if (bat->latency.state == LATENCY_STATE_COMPLETE_SUCCESS)
+                       break;
+
+               bat->periods_played++;
+       }
+
+       bat->latency.is_playing = false;
+
+       return err;
+}
+
+/**
+ * Play sample
+ */
+static int play_sample(struct bat *bat, struct pcm *pcm,
+               void *buffer, int bytes)
+{
+       int err = 0;
+       int frames = bytes / bat->frame_size;
+       FILE *fp = NULL;
+       int bytes_total = 0;
+
+       if (bat->debugplay) {
+               fp = fopen(bat->debugplay, "wb");
+               err = -errno;
+               if (fp == NULL) {
+                       fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                                       bat->debugplay, err);
+                       return err;
+               }
+               /* leave space for file header */
+               if (fseek(fp, sizeof(struct wav_container), SEEK_SET) != 0) {
+                       err = -errno;
+                       fclose(fp);
+                       return err;
+               }
+       }
+
+       while (1) {
+               err = generate_input_data(bat, buffer, bytes, frames);
+               if (err != 0)
+                       break;
+
+               if (bat->debugplay) {
+                       if (fwrite(buffer, 1, bytes, fp) != bytes) {
+                               err = -EIO;
+                               break;
+                       }
+                       bytes_total += bytes;
+               }
+
+               bat->periods_played++;
+               if (bat->period_is_limited
+                               && bat->periods_played >= bat->periods_total)
+                       break;
+
+               err = pcm_write(pcm, buffer, bytes);
+               if (err != 0)
+                       break;
+       }
+
+       if (bat->debugplay) {
+               update_wav_header(bat, fp, bytes_total);
+               fclose(fp);
+       }
+       return err;
+}
+
+static int get_tiny_device(struct bat *bat, char *alsa_device,
+               unsigned int *tiny_card, unsigned int *tiny_device)
+{
+       char *tmp1, *tmp2, *tmp3;
+
+       if (alsa_device == NULL)
+               goto fail;
+
+       tmp1 = strchr(alsa_device, ':');
+       if (tmp1 == NULL)
+               goto fail;
+
+       tmp3 = tmp1 + 1;
+       tmp2 = strchr(tmp3, ',');
+       if (tmp2 == NULL)
+               goto fail;
+
+       tmp1 = tmp2 + 1;
+       *tiny_device = atoi(tmp1);
+       *tmp2 = '\0';
+       *tiny_card = atoi(tmp3);
+       *tmp2 = ',';
+
+       return 0;
+fail:
+       fprintf(bat->err, _("Invalid tiny device: %s\n"), alsa_device);
+       return -EINVAL;
+}
+
+/**
+ * Play
+ */
+void *playback_tinyalsa(struct bat *bat)
+{
+       int err = 0;
+       struct pcm_config config;
+       struct pcm *pcm = NULL;
+       void *buffer = NULL;
+       int bufbytes;
+
+       fprintf(bat->log, _("Entering playback thread (tinyalsa).\n"));
+
+       retval_play = 0;
+
+       /* init device */
+       err = get_tiny_device(bat, bat->playback.device,
+                       &bat->playback.card_tiny,
+                       &bat->playback.device_tiny);
+       if (err < 0) {
+               retval_play = err;
+               goto exit1;
+       }
+
+       /* init config */
+       err = init_config(bat, &config);
+       if (err < 0) {
+               retval_play = err;
+               goto exit1;
+       }
+
+       /* check param before open device */
+       err = check_playback_params(bat, &config);
+       if (err < 0) {
+               retval_play = err;
+               goto exit1;
+       }
+
+       /* open device */
+       pcm = pcm_open(bat->playback.card_tiny, bat->playback.device_tiny,
+                       PCM_OUT, &config);
+       if (!pcm || !pcm_is_ready(pcm)) {
+               fprintf(bat->err, _("Unable to open PCM device %u (%s)!\n"),
+                               bat->playback.device_tiny, pcm_get_error(pcm));
+               retval_play = -EINVAL;
+               goto exit1;
+       }
+
+       /* init buffer */
+       bufbytes = pcm_frames_to_bytes(pcm, pcm_get_buffer_size(pcm));
+       buffer = malloc(bufbytes);
+       if (!buffer) {
+               retval_play = -ENOMEM;
+               goto exit2;
+       }
+
+       /* init playback source */
+       if (bat->playback.file == NULL) {
+               fprintf(bat->log, _("Playing generated audio sine wave"));
+               bat->sinus_duration == 0 ?
+                       fprintf(bat->log, _(" endlessly\n")) :
+                       fprintf(bat->log, _("\n"));
+       } else {
+               fprintf(bat->log, _("Playing input audio file: %s\n"),
+                               bat->playback.file);
+               bat->fp = fopen(bat->playback.file, "rb");
+               err = -errno;
+               if (bat->fp == NULL) {
+                       fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                                       bat->playback.file, err);
+                       retval_play = err;
+                       goto exit3;
+               }
+               /* Skip header */
+               err = read_wav_header(bat, bat->playback.file, bat->fp, true);
+               if (err != 0) {
+                       retval_play = err;
+                       goto exit4;
+               }
+       }
+
+       if (bat->roundtriplatency)
+               err = latencytest_process_output(bat, pcm, buffer, bufbytes);
+       else
+               err = play_sample(bat, pcm, buffer, bufbytes);
+       if (err < 0) {
+               retval_play = err;
+               goto exit4;
+       }
+
+exit4:
+       if (bat->playback.file)
+               fclose(bat->fp);
+exit3:
+       free(buffer);
+exit2:
+       pcm_close(pcm);
+exit1:
+       pthread_exit(&retval_play);
+}
+
+/**
+ * Capture sample
+ */
+static int capture_sample(struct bat *bat, struct pcm *pcm,
+               void *buffer, unsigned int bytes)
+{
+       int err = 0;
+       FILE *fp = NULL;
+       unsigned int bytes_read = 0;
+       unsigned int bytes_count = bat->frames * bat->frame_size;
+
+       remove(bat->capture.file);
+       fp = fopen(bat->capture.file, "wb");
+       err = -errno;
+       if (fp == NULL) {
+               fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                               bat->capture.file, err);
+               return err;
+       }
+       /* leave space for file header */
+       if (fseek(fp, sizeof(struct wav_container), SEEK_SET) != 0) {
+               err = -errno;
+               fclose(fp);
+               return err;
+       }
+
+       while (bytes_read < bytes_count && !pcm_read(pcm, buffer, bytes)) {
+               if (fwrite(buffer, 1, bytes, fp) != bytes)
+                       break;
+
+               bytes_read += bytes;
+
+               bat->periods_played++;
+
+               if (bat->period_is_limited
+                               && bat->periods_played >= bat->periods_total)
+                       break;
+       }
+
+       err = update_wav_header(bat, fp, bytes_read);
+
+       fclose(fp);
+       return err;
+}
+
+/**
+ * Process input data for latency test
+ */
+static int latencytest_process_input(struct bat *bat, struct pcm *pcm,
+               void *buffer, unsigned int bytes)
+{
+       int err = 0;
+       FILE *fp = NULL;
+       unsigned int bytes_read = 0;
+       unsigned int bytes_count = bat->frames * bat->frame_size;
+
+       remove(bat->capture.file);
+       fp = fopen(bat->capture.file, "wb");
+       err = -errno;
+       if (fp == NULL) {
+               fprintf(bat->err, _("Cannot open file: %s %d\n"),
+                               bat->capture.file, err);
+               return err;
+       }
+       /* leave space for file header */
+       if (fseek(fp, sizeof(struct wav_container), SEEK_SET) != 0) {
+               err = -errno;
+               fclose(fp);
+               return err;
+       }
+
+       bat->latency.is_capturing = true;
+
+       while (bytes_read < bytes_count && !pcm_read(pcm, buffer, bytes)) {
+               if (fwrite(buffer, 1, bytes, fp) != bytes)
+                       break;
+
+               err = handleinput(bat, buffer, bytes / bat->frame_size);
+               if (err != 0)
+                       break;
+
+               if (bat->latency.is_playing == false)
+                       break;
+
+               bytes_read += bytes;
+       }
+
+       bat->latency.is_capturing = false;
+
+       err = update_wav_header(bat, fp, bytes_read);
+
+       fclose(fp);
+       return err;
+}
+
+/**
+ * Record
+ */
+void *record_tinyalsa(struct bat *bat)
+{
+       int err = 0;
+       struct pcm_config config;
+       struct pcm *pcm;
+       void *buffer;
+       unsigned int bufbytes;
+
+       pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+
+       fprintf(bat->log, _("Entering capture thread (tinyalsa).\n"));
+
+       retval_record = 0;
+
+       /* init device */
+       err = get_tiny_device(bat, bat->capture.device,
+                       &bat->capture.card_tiny,
+                       &bat->capture.device_tiny);
+       if (err < 0) {
+               retval_record = err;
+               goto exit1;
+       }
+
+       /* init config */
+       err = init_config(bat, &config);
+       if (err < 0) {
+               retval_record = err;
+               goto exit1;
+       }
+
+       /* open device */
+       pcm = pcm_open(bat->capture.card_tiny, bat->capture.device_tiny,
+                       PCM_IN, &config);
+       if (!pcm || !pcm_is_ready(pcm)) {
+               fprintf(bat->err, _("Unable to open PCM device (%s)!\n"),
+                               pcm_get_error(pcm));
+               retval_record = -EINVAL;
+               goto exit1;
+       }
+
+       /* init buffer */
+       bufbytes = pcm_frames_to_bytes(pcm, pcm_get_buffer_size(pcm));
+       buffer = malloc(bufbytes);
+       if (!buffer) {
+               retval_record = -ENOMEM;
+               goto exit2;
+       }
+
+       pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+       pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+       pthread_cleanup_push(close_handle, pcm);
+       pthread_cleanup_push(free, buffer);
+
+       fprintf(bat->log, _("Recording ...\n"));
+       if (bat->roundtriplatency)
+               err = latencytest_process_input(bat, pcm, buffer, bufbytes);
+       else
+               err = capture_sample(bat, pcm, buffer, bufbytes);
+       if (err != 0) {
+               retval_record = err;
+               goto exit3;
+       }
+
+       /* Normally we will never reach this part of code (unless error in
+        * previous call) (before exit3) as this thread will be cancelled
+        *  by end of play thread. Except in single line mode. */
+       pthread_cleanup_pop(0);
+       pthread_cleanup_pop(0);
+       pthread_exit(&retval_record);
+
+exit3:
+       free(buffer);
+exit2:
+       pcm_close(pcm);
+exit1:
+       pthread_exit(&retval_record);
+}
diff --git a/bat/tinyalsa.h b/bat/tinyalsa.h
new file mode 100644 (file)
index 0000000..60f78f7
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013-2015 Intel Corporation
+ *
+ * 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.
+ *
+ */
+
+extern int retval_play;
+extern int retval_record;
+
+void *playback_tinyalsa(struct bat *);
+void *record_tinyalsa(struct bat *);
diff --git a/compile b/compile
new file mode 100755 (executable)
index 0000000..23fcba0
--- /dev/null
+++ b/compile
@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN* | MSYS*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin/* | msys/*)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine/*)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       -o)
+         # configure might choose to run compile as 'compile cc -o foo foo.c'.
+         eat=1
+         case $2 in
+           *.o | *.[oO][bB][jJ])
+             func_file_conv "$2"
+             set x "$@" -Fo"$file"
+             shift
+             ;;
+           *)
+             func_file_conv "$2"
+             set x "$@" -Fe"$file"
+             shift
+             ;;
+         esac
+         ;;
+       -I)
+         eat=1
+         func_file_conv "$2" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -I*)
+         func_file_conv "${1#-I}" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -l)
+         eat=1
+         func_cl_dashl "$2"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -l*)
+         func_cl_dashl "${1#-l}"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -L)
+         eat=1
+         func_cl_dashL "$2"
+         ;;
+       -L*)
+         func_cl_dashL "${1#-L}"
+         ;;
+       -static)
+         shared=false
+         ;;
+       -Wl,*)
+         arg=${1#-Wl,}
+         save_ifs="$IFS"; IFS=','
+         for flag in $arg; do
+           IFS="$save_ifs"
+           linker_opts="$linker_opts $flag"
+         done
+         IFS="$save_ifs"
+         ;;
+       -Xlinker)
+         eat=1
+         linker_opts="$linker_opts $2"
+         ;;
+       -*)
+         set x "$@" "$1"
+         shift
+         ;;
+       *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+         func_file_conv "$1"
+         set x "$@" -Tp"$file"
+         shift
+         ;;
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+         func_file_conv "$1" mingw
+         set x "$@" "$file"
+         shift
+         ;;
+       *)
+         set x "$@" "$1"
+         shift
+         ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+       # configure might choose to run compile as 'compile cc -o foo foo.c'.
+       # So we strip '-o arg' only if arg is an object.
+       eat=1
+       case $2 in
+         *.o | *.obj)
+           ofile=$2
+           ;;
+         *)
+           set x "$@" -o "$2"
+           shift
+           ;;
+       esac
+       ;;
+      *.c)
+       cfile=$1
+       set x "$@" "$1"
+       shift
+       ;;
+      *)
+       set x "$@" "$1"
+       shift
+       ;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
index c0adba9..b33c9e8 100755 (executable)
@@ -1,14 +1,12 @@
 #! /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, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2012-06-10'
+timestamp='2018-08-29'
 
 # 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
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -17,24 +15,22 @@ timestamp='2012-06-10'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 #
-# 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.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+#
+# Please send patches to <config-patches@gnu.org>.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -43,7 +39,7 @@ Usage: $0 [OPTION]
 
 Output the configuration name of the system \`$me' is run on.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -54,9 +50,7 @@ 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, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2018 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."
@@ -90,8 +84,6 @@ if test $# != 0; then
   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
@@ -102,34 +94,39 @@ trap 'exit 1' 1 2 15
 
 # 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= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15
+trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
+
+set_cc_for_build() {
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { 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" 2>/dev/null) ; } ||
+       { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+       { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+       ,,)    echo "int x;" > "$dummy.c"
+              for driver in cc gcc c89 c99 ; do
+                  if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+                      CC_FOR_BUILD="$driver"
+                      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
+}
 
 # 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
+if test -f /.attbin/uname ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -138,9 +135,37 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "$UNAME_SYSTEM" in
+Linux|GNU|GNU/*)
+       # If the system lacks a compiler, then just pick glibc.
+       # We could probably try harder.
+       LIBC=gnu
+
+       set_cc_for_build
+       cat <<-EOF > "$dummy.c"
+       #include <features.h>
+       #if defined(__UCLIBC__)
+       LIBC=uclibc
+       #elif defined(__dietlibc__)
+       LIBC=dietlibc
+       #else
+       LIBC=gnu
+       #endif
+       EOF
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+       # If ldd exists, use it to detect musl libc.
+       if command -v ldd >/dev/null && \
+               ldd --version 2>&1 | grep -q ^musl
+       then
+           LIBC=musl
+       fi
+       ;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -153,21 +178,31 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # 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
+       UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+           "/sbin/$sysctl" 2>/dev/null || \
+           "/usr/sbin/$sysctl" 2>/dev/null || \
+           echo unknown)`
+       case "$UNAME_MACHINE_ARCH" in
            armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
            sh5el) machine=sh5le-unknown ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+           earmv*)
+               arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+               endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+               machine="${arch}${endian}"-unknown
+               ;;
+           *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
        esac
        # The Operating System including object format, if it has switched
-       # to ELF recently, or will in the future.
-       case "${UNAME_MACHINE_ARCH}" in
+       # to ELF recently (or will in the future) and ABI.
+       case "$UNAME_MACHINE_ARCH" in
+           earm*)
+               os=netbsdelf
+               ;;
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
+               set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep -q __ELF__
                then
@@ -182,40 +217,67 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                os=netbsd
                ;;
        esac
+       # Determine ABI tags.
+       case "$UNAME_MACHINE_ARCH" in
+           earm*)
+               expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+               abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+               ;;
+       esac
        # The OS release
        # Debian GNU/NetBSD machines have a different userland, and
        # thus, need a distinct triplet. However, they do not need
        # kernel version information, so it can be replaced with a
        # suitable tag, in the style of linux-gnu.
-       case "${UNAME_VERSION}" in
+       case "$UNAME_VERSION" in
            Debian*)
                release='-gnu'
                ;;
            *)
-               release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+               release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
                ;;
        esac
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "${machine}-${os}${release}"
+       echo "$machine-${os}${release}${abi-}"
+       exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
        exit ;;
     *:OpenBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+       exit ;;
+    *:LibertyBSD:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+       echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+       exit ;;
+    *:MidnightBSD:*:*)
+       echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
        exit ;;
     *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
        exit ;;
     *:SolidBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
        exit ;;
     macppc:MirBSD:*:*)
-       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:MirBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+       exit ;;
+    *:Sortix:*:*)
+       echo "$UNAME_MACHINE"-unknown-sortix
+       exit ;;
+    *:Redox:*:*)
+       echo "$UNAME_MACHINE"-unknown-redox
        exit ;;
+    mips:OSF1:*.*)
+        echo mips-dec-osf1
+        exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -232,63 +294,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        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" ;;
+               UNAME_MACHINE=alpha ;;
            "EV4.5 (21064)")
-               UNAME_MACHINE="alpha" ;;
+               UNAME_MACHINE=alpha ;;
            "LCA4 (21066/21068)")
-               UNAME_MACHINE="alpha" ;;
+               UNAME_MACHINE=alpha ;;
            "EV5 (21164)")
-               UNAME_MACHINE="alphaev5" ;;
+               UNAME_MACHINE=alphaev5 ;;
            "EV5.6 (21164A)")
-               UNAME_MACHINE="alphaev56" ;;
+               UNAME_MACHINE=alphaev56 ;;
            "EV5.6 (21164PC)")
-               UNAME_MACHINE="alphapca56" ;;
+               UNAME_MACHINE=alphapca56 ;;
            "EV5.7 (21164PC)")
-               UNAME_MACHINE="alphapca57" ;;
+               UNAME_MACHINE=alphapca57 ;;
            "EV6 (21264)")
-               UNAME_MACHINE="alphaev6" ;;
+               UNAME_MACHINE=alphaev6 ;;
            "EV6.7 (21264A)")
-               UNAME_MACHINE="alphaev67" ;;
+               UNAME_MACHINE=alphaev67 ;;
            "EV6.8CB (21264C)")
-               UNAME_MACHINE="alphaev68" ;;
+               UNAME_MACHINE=alphaev68 ;;
            "EV6.8AL (21264B)")
-               UNAME_MACHINE="alphaev68" ;;
+               UNAME_MACHINE=alphaev68 ;;
            "EV6.8CX (21264D)")
-               UNAME_MACHINE="alphaev68" ;;
+               UNAME_MACHINE=alphaev68 ;;
            "EV6.9A (21264/EV69A)")
-               UNAME_MACHINE="alphaev69" ;;
+               UNAME_MACHINE=alphaev69 ;;
            "EV7 (21364)")
-               UNAME_MACHINE="alphaev7" ;;
+               UNAME_MACHINE=alphaev7 ;;
            "EV7.9 (21364A)")
-               UNAME_MACHINE="alphaev79" ;;
+               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'`
+       echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
        exitcode=$?
        trap '' 0
        exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # Should we change UNAME_MACHINE based on the output of uname instead
-       # of the specific Alpha model?
-       echo alpha-pc-interix
-       exit ;;
-    21064:Windows_NT:50:3)
-       echo alpha-dec-winnt3.5
-       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
        exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-amigaos
+       echo "$UNAME_MACHINE"-unknown-amigaos
        exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-morphos
+       echo "$UNAME_MACHINE"-unknown-morphos
        exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
@@ -300,9 +353,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-       echo arm-acorn-riscix${UNAME_RELEASE}
+       echo arm-acorn-riscix"$UNAME_RELEASE"
        exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
        echo arm-unknown-riscos
        exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -327,38 +380,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     s390x:SunOS:*:*)
-       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
        exit ;;
     sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       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/[^.]*//'`
+       echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
        exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-       echo i386-pc-auroraux${UNAME_RELEASE}
+       echo i386-pc-auroraux"$UNAME_RELEASE"
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       eval $set_cc_for_build
-       SUN_ARCH="i386"
-       # If there is a compiler, see if it is configured for 64-bit objects.
-       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-       # This test works for both compilers.
-       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-               grep IS_64BIT_ARCH >/dev/null
-           then
-               SUN_ARCH="x86_64"
-           fi
-       fi
-       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+       case `isainfo -b` in
+           32)
+               echo i386-pc-solaris2"$UNAME_REL"
+               ;;
+           64)
+               echo x86_64-pc-solaris2"$UNAME_REL"
+               ;;
+       esac
        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/[^.]*//'`
+       echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
@@ -367,25 +415,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
        exit ;;
     sun3*:SunOS:*:*)
-       echo m68k-sun-sunos${UNAME_RELEASE}
+       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
+       test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
        case "`/bin/arch`" in
            sun3)
-               echo m68k-sun-sunos${UNAME_RELEASE}
+               echo m68k-sun-sunos"$UNAME_RELEASE"
                ;;
            sun4)
-               echo sparc-sun-sunos${UNAME_RELEASE}
+               echo sparc-sun-sunos"$UNAME_RELEASE"
                ;;
        esac
        exit ;;
     aushp:SunOS:*:*)
-       echo sparc-auspex-sunos${UNAME_RELEASE}
+       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
@@ -396,44 +444,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # 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}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-       echo m68k-milan-mint${UNAME_RELEASE}
+       echo m68k-milan-mint"$UNAME_RELEASE"
        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-       echo m68k-hades-mint${UNAME_RELEASE}
+       echo m68k-hades-mint"$UNAME_RELEASE"
        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-       echo m68k-unknown-mint${UNAME_RELEASE}
+       echo m68k-unknown-mint"$UNAME_RELEASE"
        exit ;;
     m68k:machten:*:*)
-       echo m68k-apple-machten${UNAME_RELEASE}
+       echo m68k-apple-machten"$UNAME_RELEASE"
        exit ;;
     powerpc:machten:*:*)
-       echo powerpc-apple-machten${UNAME_RELEASE}
+       echo powerpc-apple-machten"$UNAME_RELEASE"
        exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
        exit ;;
     RISC*:ULTRIX:*:*)
-       echo mips-dec-ultrix${UNAME_RELEASE}
+       echo mips-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     VAX*:ULTRIX*:*:*)
-       echo vax-dec-ultrix${UNAME_RELEASE}
+       echo vax-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-       echo clipper-intergraph-clix${UNAME_RELEASE}
+       echo clipper-intergraph-clix"$UNAME_RELEASE"
        exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
        int main (int argc, char *argv[]) {
@@ -442,23 +490,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 #endif
        #if defined (host_mips) && defined (MIPSEB)
        #if defined (SYSTYPE_SYSV)
-         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+         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);
+         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);
+         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` &&
+       $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}
+       echo mips-mips-riscos"$UNAME_RELEASE"
        exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
@@ -484,17 +532,17 @@ EOF
     AViiON:dgux:*:*)
        # DG/UX returns AViiON for all architectures
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
        then
-           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+              [ "$TARGET_BINARY_INTERFACE"x = x ]
            then
-               echo m88k-dg-dgux${UNAME_RELEASE}
+               echo m88k-dg-dgux"$UNAME_RELEASE"
            else
-               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+               echo m88k-dg-dguxbcs"$UNAME_RELEASE"
            fi
        else
-           echo i586-dg-dgux${UNAME_RELEASE}
+           echo i586-dg-dgux"$UNAME_RELEASE"
        fi
        exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
@@ -511,7 +559,7 @@ EOF
        echo m68k-tektronix-bsd
        exit ;;
     *:IRIX*:*:*)
-       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       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
@@ -523,14 +571,14 @@ EOF
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       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
+               set_cc_for_build
+               sed 's/^                //' << EOF > "$dummy.c"
                #include <sys/systemcfg.h>
 
                main()
@@ -541,7 +589,7 @@ EOF
                        exit(0);
                        }
 EOF
-               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
                then
                        echo "$SYSTEM_NAME"
                else
@@ -555,26 +603,27 @@ EOF
        exit ;;
     *:AIX:*:[4567])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+       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`
+       if [ -x /usr/bin/lslpp ] ; then
+               IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
        exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
        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
+       echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
        exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
@@ -589,28 +638,28 @@ EOF
        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 ;;
+       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
+                   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
+                       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
+               if [ "$HP_ARCH" = "" ]; then
+                   set_cc_for_build
+                   sed 's/^            //' << EOF > "$dummy.c"
 
                #define _HPUX_SOURCE
                #include <stdlib.h>
@@ -643,13 +692,13 @@ EOF
                    exit (0);
                }
 EOF
-                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   (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" ]
+       if [ "$HP_ARCH" = hppa2.0w ]
        then
-           eval $set_cc_for_build
+           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
@@ -660,23 +709,23 @@ EOF
            # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
            # => hppa64-hp-hpux11.23
 
-           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+           if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
                grep -q __LP64__
            then
-               HP_ARCH="hppa2.0w"
+               HP_ARCH=hppa2.0w
            else
-               HP_ARCH="hppa64"
+               HP_ARCH=hppa64
            fi
        fi
-       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       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}
+       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
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
        #include <unistd.h>
        int
        main ()
@@ -701,11 +750,11 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+       $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:*:* )
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
        echo hppa1.1-hp-bsd
        exit ;;
     9000/8??:4.3bsd:*:*)
@@ -714,7 +763,7 @@ EOF
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
        exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
        echo hppa1.1-hp-osf
        exit ;;
     hp8??:OSF1:*:*)
@@ -722,9 +771,9 @@ EOF
        exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-unknown-osf1mk
+           echo "$UNAME_MACHINE"-unknown-osf1mk
        else
-           echo ${UNAME_MACHINE}-unknown-osf1
+           echo "$UNAME_MACHINE"-unknown-osf1
        fi
        exit ;;
     parisc*:Lites*:*:*)
@@ -749,124 +798,120 @@ EOF
        echo c4-convex-bsd
        exit ;;
     CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*[A-Z]90:*:*:*)
-       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       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/'
+       echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*T3E:*:*:*)
-       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*SV1:*:*:*)
-       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     *:UNICOS/mp:*:*)
-       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       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/ /_/'`
+       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/ /_/'`
+       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}
+       echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
        exit ;;
     sparc*:BSD/OS:*:*)
-       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       echo sparc-unknown-bsdi"$UNAME_RELEASE"
        exit ;;
     *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+       exit ;;
+    arm:FreeBSD:*:*)
+       UNAME_PROCESSOR=`uname -p`
+       set_cc_for_build
+       if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_PCS_VFP
+       then
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+       else
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+       fi
        exit ;;
     *:FreeBSD:*:*)
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       case ${UNAME_PROCESSOR} in
+       case "$UNAME_PROCESSOR" in
            amd64)
-               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-           *)
-               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               UNAME_PROCESSOR=x86_64 ;;
+           i386)
+               UNAME_PROCESSOR=i586 ;;
        esac
+       echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
        exit ;;
     i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
+       echo "$UNAME_MACHINE"-pc-cygwin
        exit ;;
-    *:MINGW*:*)
-       echo ${UNAME_MACHINE}-pc-mingw32
+    *:MINGW64*:*)
+       echo "$UNAME_MACHINE"-pc-mingw64
        exit ;;
-    i*:MSYS*:*)
-       echo ${UNAME_MACHINE}-pc-msys
+    *:MINGW*:*)
+       echo "$UNAME_MACHINE"-pc-mingw32
        exit ;;
-    i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
+    *:MSYS*:*)
+       echo "$UNAME_MACHINE"-pc-msys
        exit ;;
     i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
+       echo "$UNAME_MACHINE"-pc-pw32
        exit ;;
     *:Interix*:*)
-       case ${UNAME_MACHINE} in
+       case "$UNAME_MACHINE" in
            x86)
-               echo i586-pc-interix${UNAME_RELEASE}
+               echo i586-pc-interix"$UNAME_RELEASE"
                exit ;;
            authenticamd | genuineintel | EM64T)
-               echo x86_64-unknown-interix${UNAME_RELEASE}
+               echo x86_64-unknown-interix"$UNAME_RELEASE"
                exit ;;
            IA64)
-               echo ia64-unknown-interix${UNAME_RELEASE}
+               echo ia64-unknown-interix"$UNAME_RELEASE"
                exit ;;
        esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-       echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
-    8664:Windows_NT:*)
-       echo x86_64-pc-mks
-       exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-       # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i586-pc-interix
-       exit ;;
     i*:UWIN*:*)
-       echo ${UNAME_MACHINE}-pc-uwin
+       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/[^.]*//'`
+       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,/.*$,,'`
+       echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+       echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
        exit ;;
-    i*86:Minix:*:*)
-       echo ${UNAME_MACHINE}-pc-minix
+    *:Minix:*:*)
+       echo "$UNAME_MACHINE"-unknown-minix
        exit ;;
     aarch64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     aarch64_be:Linux:*:*)
        UNAME_MACHINE=aarch64_be
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,63 +924,64 @@ EOF
          EV68*) UNAME_MACHINE=alphaev68 ;;
        esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arm*:Linux:*:*)
-       eval $set_cc_for_build
+       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
+           echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        else
            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                | grep -q __ARM_PCS_VFP
            then
-               echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
            else
-               echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
            fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     cris:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-gnu
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     crisv32:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-gnu
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+       exit ;;
+    e2k:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     frv:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     hexagon:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:Linux:*:*)
-       LIBC=gnu
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #ifdef __dietlibc__
-       LIBC=dietlibc
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    k1om:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
        #undef CPU
        #undef ${UNAME_MACHINE}
        #undef ${UNAME_MACHINE}el
@@ -949,55 +995,70 @@ EOF
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+       test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
        ;;
-    or32:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+    mips64el:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    openrisc*:Linux:*:*)
+       echo or1k-unknown-linux-"$LIBC"
+       exit ;;
+    or32:Linux:*:* | or1k*:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     padre:Linux:*:*)
-       echo sparc-unknown-linux-gnu
+       echo sparc-unknown-linux-"$LIBC"
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
+       echo hppa64-unknown-linux-"$LIBC"
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
+         PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+         PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+         *)    echo hppa-unknown-linux-"$LIBC" ;;
        esac
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
+       echo powerpc64-unknown-linux-"$LIBC"
        exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
+       echo powerpc-unknown-linux-"$LIBC"
+       exit ;;
+    ppc64le:Linux:*:*)
+       echo powerpc64le-unknown-linux-"$LIBC"
+       exit ;;
+    ppcle:Linux:*:*)
+       echo powerpcle-unknown-linux-"$LIBC"
+       exit ;;
+    riscv32:Linux:*:* | riscv64:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux
+       echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     tile*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-gnu
+       echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
        exit ;;
     x86_64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1011,34 +1072,34 @@ EOF
        # 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}
+       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
+       echo "$UNAME_MACHINE"-pc-os2-emx
        exit ;;
     i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-unknown-stop
+       echo "$UNAME_MACHINE"-unknown-stop
        exit ;;
     i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-unknown-atheos
+       echo "$UNAME_MACHINE"-unknown-atheos
        exit ;;
     i*86:syllable:*:*)
-       echo ${UNAME_MACHINE}-pc-syllable
+       echo "$UNAME_MACHINE"-pc-syllable
        exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
+       echo i386-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       echo "$UNAME_MACHINE"-pc-msdosdjgpp
        exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+    i*86:*: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}
+               echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
        fi
        exit ;;
     i*86:*:5:[678]*)
@@ -1048,12 +1109,12 @@ EOF
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
-       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       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
+               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
@@ -1063,9 +1124,9 @@ EOF
                        && UNAME_MACHINE=i686
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
                        && UNAME_MACHINE=i686
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+               echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv32
+               echo "$UNAME_MACHINE"-pc-sysv32
        fi
        exit ;;
     pc:*:*:*)
@@ -1073,7 +1134,7 @@ EOF
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
        # the processor, so we play safe by assuming i586.
        # Note: whatever this is, it MUST be the same as what config.sub
-       # prints for the "djgpp" host, or else GDB configury will decide that
+       # prints for the "djgpp" host, or else GDB configure will decide that
        # this is a cross-build.
        echo i586-pc-msdosdjgpp
        exit ;;
@@ -1085,9 +1146,9 @@ EOF
        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
+         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
+         echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
        fi
        exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1107,9 +1168,9 @@ EOF
        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; }
+         && { 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; } ;;
+         && { 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; } ;;
@@ -1118,28 +1179,28 @@ EOF
        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; }
+           && { 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; }
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       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}
+       echo sparc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     rs6000:LynxOS:2.*:*)
-       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       echo rs6000-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       echo powerpc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
-       echo mips-dde-sysv${UNAME_RELEASE}
+       echo mips-dde-sysv"$UNAME_RELEASE"
        exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
@@ -1150,7 +1211,7 @@ EOF
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
-               echo ${UNAME_MACHINE}-sni-sysv4
+               echo "$UNAME_MACHINE"-sni-sysv4
        else
                echo ns32k-sni-sysv
        fi
@@ -1170,23 +1231,23 @@ EOF
        exit ;;
     i*86:VOS:*:*)
        # From Paul.Green@stratus.com.
-       echo ${UNAME_MACHINE}-stratus-vos
+       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}
+       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}
+               echo mips-nec-sysv"$UNAME_RELEASE"
        else
-               echo mips-unknown-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv"$UNAME_RELEASE"
        fi
        exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
@@ -1201,66 +1262,97 @@ EOF
     BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
        echo i586-pc-haiku
        exit ;;
+    x86_64:Haiku:*:*)
+       echo x86_64-unknown-haiku
+       exit ;;
     SX-4:SUPER-UX:*:*)
-       echo sx4-nec-superux${UNAME_RELEASE}
+       echo sx4-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-5:SUPER-UX:*:*)
-       echo sx5-nec-superux${UNAME_RELEASE}
+       echo sx5-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-6:SUPER-UX:*:*)
-       echo sx6-nec-superux${UNAME_RELEASE}
+       echo sx6-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-7:SUPER-UX:*:*)
-       echo sx7-nec-superux${UNAME_RELEASE}
+       echo sx7-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8:SUPER-UX:*:*)
-       echo sx8-nec-superux${UNAME_RELEASE}
+       echo sx8-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8R:SUPER-UX:*:*)
-       echo sx8r-nec-superux${UNAME_RELEASE}
+       echo sx8r-nec-superux"$UNAME_RELEASE"
+       exit ;;
+    SX-ACE:SUPER-UX:*:*)
+       echo sxace-nec-superux"$UNAME_RELEASE"
        exit ;;
     Power*:Rhapsody:*:*)
-       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       echo powerpc-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Rhapsody:*:*)
-       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       case $UNAME_PROCESSOR in
-           i386)
-               eval $set_cc_for_build
-               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-                     grep IS_64BIT_ARCH >/dev/null
-                 then
-                     UNAME_PROCESSOR="x86_64"
-                 fi
-               fi ;;
-           unknown) UNAME_PROCESSOR=powerpc ;;
-       esac
-       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       set_cc_for_build
+       if test "$UNAME_PROCESSOR" = unknown ; then
+           UNAME_PROCESSOR=powerpc
+       fi
+       if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
+           if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+               if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                      (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                      grep IS_64BIT_ARCH >/dev/null
+               then
+                   case $UNAME_PROCESSOR in
+                       i386) UNAME_PROCESSOR=x86_64 ;;
+                       powerpc) UNAME_PROCESSOR=powerpc64 ;;
+                   esac
+               fi
+               # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+               if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+                      (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                      grep IS_PPC >/dev/null
+               then
+                   UNAME_PROCESSOR=powerpc
+               fi
+           fi
+       elif test "$UNAME_PROCESSOR" = i386 ; then
+           # Avoid executing cc on OS X 10.9, as it ships with a stub
+           # that puts up a graphical alert prompting to install
+           # developer tools.  Any system running Mac OS X 10.7 or
+           # later (Darwin 11 and later) is required to have a 64-bit
+           # processor. This is not true of the ARM version of Darwin
+           # that Apple uses in portable devices.
+           UNAME_PROCESSOR=x86_64
+       fi
+       echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
-       if test "$UNAME_PROCESSOR" = "x86"; then
+       if test "$UNAME_PROCESSOR" = x86; then
                UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
        fi
-       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
        exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-       echo neo-tandem-nsk${UNAME_RELEASE}
+    NEO-*:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-       echo nse-tandem-nsk${UNAME_RELEASE}
+       echo nse-tandem-nsk"$UNAME_RELEASE"
        exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-       echo nsr-tandem-nsk${UNAME_RELEASE}
+    NSR-*:NONSTOP_KERNEL:*:*)
+       echo nsr-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    NSV-*:NONSTOP_KERNEL:*:*)
+       echo nsv-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    NSX-*:NONSTOP_KERNEL:*:*)
+       echo nsx-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
@@ -1269,18 +1361,19 @@ EOF
        echo bs2000-siemens-sysv
        exit ;;
     DS/*:UNIX_System_V:*:*)
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       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
+       # shellcheck disable=SC2154
+       if test "$cputype" = 386; then
            UNAME_MACHINE=i386
        else
            UNAME_MACHINE="$cputype"
        fi
-       echo ${UNAME_MACHINE}-unknown-plan9
+       echo "$UNAME_MACHINE"-unknown-plan9
        exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
@@ -1301,14 +1394,14 @@ EOF
        echo pdp10-unknown-its
        exit ;;
     SEI:*:*:SEIUX)
-       echo mips-sei-seiux${UNAME_RELEASE}
+       echo mips-sei-seiux"$UNAME_RELEASE"
        exit ;;
     *:DragonFly:*:*)
-       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
        exit ;;
     *:*VMS:*:*)
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
-       case "${UNAME_MACHINE}" in
+       case "$UNAME_MACHINE" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
            V*) echo vax-dec-vms ; exit ;;
@@ -1317,185 +1410,48 @@ EOF
        echo i386-pc-xenix
        exit ;;
     i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+       echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
        exit ;;
     i*86:rdos:*:*)
-       echo ${UNAME_MACHINE}-pc-rdos
+       echo "$UNAME_MACHINE"-pc-rdos
        exit ;;
     i*86:AROS:*:*)
-       echo ${UNAME_MACHINE}-pc-aros
+       echo "$UNAME_MACHINE"-pc-aros
        exit ;;
     x86_64:VMkernel:*:*)
-       echo ${UNAME_MACHINE}-unknown-esx
+       echo "$UNAME_MACHINE"-unknown-esx
+       exit ;;
+    amd64:Isilon\ OneFS:*:*)
+       echo x86_64-unknown-onefs
        exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+echo "$0: unable to guess system type" >&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
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+    mips:Linux | mips64:Linux)
+       # If we got here on MIPS GNU/Linux, output extra information.
+       cat >&2 <<EOF
 
-#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);
-}
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
 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
+       ;;
+esac
 
 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
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
-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.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
 
 config.guess timestamp = $timestamp
 
@@ -1514,16 +1470,16 @@ hostinfo               = `(hostinfo) 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}
+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)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index 17298f2..5a55c3e 100755 (executable)
@@ -1,8 +1,8 @@
-#! /bin/sh
+#!/usr/bin/sh
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2010 Free Software Foundation, Inc.
+#   Copyright 1996-2020 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
@@ -25,7 +25,7 @@
 #   known workaround is to choose shorter directory names for the build
 #   directory and/or the installation directory.
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 shrext=.so
@@ -57,13 +57,6 @@ else
     aix*)
       wl='-Wl,'
       ;;
-    darwin*)
-      case $cc_basename in
-        xlc*)
-          wl='-Wl,'
-          ;;
-      esac
-      ;;
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       ;;
     hpux9* | hpux10* | hpux11*)
@@ -72,9 +65,7 @@ else
     irix5* | irix6* | nonstopux*)
       wl='-Wl,'
       ;;
-    newsos6)
-      ;;
-    linux* | k*bsd*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
       case $cc_basename in
         ecc*)
           wl='-Wl,'
@@ -85,17 +76,26 @@ else
         lf95*)
           wl='-Wl,'
           ;;
-        pgcc | pgf77 | pgf90)
+        nagfor*)
+          wl='-Wl,-Wl,,'
+          ;;
+        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
           wl='-Wl,'
           ;;
         ccc*)
           wl='-Wl,'
           ;;
+        xl* | bgxl* | bgf* | mpixl*)
+          wl='-Wl,'
+          ;;
         como)
           wl='-lopt='
           ;;
         *)
           case `$CC -V 2>&1 | sed 5q` in
+            *Sun\ F* | *Sun*Fortran*)
+              wl=
+              ;;
             *Sun\ C*)
               wl='-Wl,'
               ;;
@@ -103,13 +103,24 @@ else
           ;;
       esac
       ;;
+    newsos6)
+      ;;
+    *nto* | *qnx*)
+      ;;
     osf3* | osf4* | osf5*)
       wl='-Wl,'
       ;;
     rdos*)
       ;;
     solaris*)
-      wl='-Wl,'
+      case $cc_basename in
+        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+          wl='-Qoption ld '
+          ;;
+        *)
+          wl='-Wl,'
+          ;;
+      esac
       ;;
     sunos4*)
       wl='-Qoption ld '
@@ -171,15 +182,14 @@ if test "$with_gnu_ld" = yes; then
       fi
       ;;
     amigaos*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we cannot use
-      # them.
-      ld_shlibs=no
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
       ;;
     beos*)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
@@ -198,11 +208,13 @@ if test "$with_gnu_ld" = yes; then
         ld_shlibs=no
       fi
       ;;
+    haiku*)
+      ;;
     interix[3-9]*)
       hardcode_direct=no
       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
       ;;
-    gnu* | linux* | k*bsd*-gnu)
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         :
       else
@@ -325,10 +337,14 @@ else
       fi
       ;;
     amigaos*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs=no
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
       ;;
     bsdi[45]*)
       ;;
@@ -342,29 +358,16 @@ else
       ;;
     darwin* | rhapsody*)
       hardcode_direct=no
-      if test "$GCC" = yes ; then
+      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
         :
       else
-        case $cc_basename in
-          xlc*)
-            ;;
-          *)
-            ld_shlibs=no
-            ;;
-        esac
+        ld_shlibs=no
       fi
       ;;
     dgux*)
       hardcode_libdir_flag_spec='-L$libdir'
       ;;
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-    freebsd2.2*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      ;;
-    freebsd2*)
+    freebsd2.[01]*)
       hardcode_direct=yes
       hardcode_minus_L=yes
       ;;
@@ -420,6 +423,8 @@ else
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       ;;
+    *nto* | *qnx*)
+      ;;
     openbsd*)
       if test -f /usr/libexec/ld.so; then
         hardcode_direct=yes
@@ -515,7 +520,12 @@ case "$host_os" in
     library_names_spec='$libname$shrext'
     ;;
   amigaos*)
-    library_names_spec='$libname.a'
+    case "$host_cpu" in
+      powerpc*)
+        library_names_spec='$libname$shrext' ;;
+      m68k)
+        library_names_spec='$libname.a' ;;
+    esac
     ;;
   beos*)
     library_names_spec='$libname$shrext'
@@ -534,19 +544,18 @@ case "$host_os" in
   dgux*)
     library_names_spec='$libname$shrext'
     ;;
-  freebsd1*)
+  freebsd[23].*)
+    library_names_spec='$libname$shrext$versuffix'
     ;;
   freebsd* | dragonfly*)
-    case "$host_os" in
-      freebsd[123]*)
-        library_names_spec='$libname$shrext$versuffix' ;;
-      *)
-        library_names_spec='$libname$shrext' ;;
-    esac
+    library_names_spec='$libname$shrext'
     ;;
   gnu*)
     library_names_spec='$libname$shrext'
     ;;
+  haiku*)
+    library_names_spec='$libname$shrext'
+    ;;
   hpux9* | hpux10* | hpux11*)
     case $host_cpu in
       ia64*)
@@ -582,7 +591,7 @@ case "$host_os" in
     ;;
   linux*oldld* | linux*aout* | linux*coff*)
     ;;
-  linux* | k*bsd*-gnu)
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
     library_names_spec='$libname$shrext'
     ;;
   knetbsd*-gnu)
@@ -594,7 +603,7 @@ case "$host_os" in
   newsos6)
     library_names_spec='$libname$shrext'
     ;;
-  nto-qnx*)
+  *nto* | *qnx*)
     library_names_spec='$libname$shrext'
     ;;
   openbsd*)
@@ -625,6 +634,9 @@ case "$host_os" in
   sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
     library_names_spec='$libname$shrext'
     ;;
+  tpf*)
+    library_names_spec='$libname$shrext'
+    ;;
   uts4*)
     library_names_spec='$libname$shrext'
     ;;
index 6205f84..b51fb8c 100755 (executable)
@@ -1,36 +1,31 @@
 #! /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, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2012-04-18'
+timestamp='2018-08-29'
 
-# 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
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches to <config-patches@gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -38,7 +33,7 @@ timestamp='2012-04-18'
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -58,12 +53,11 @@ timestamp='2012-04-18'
 me=`echo "$0" | sed -e 's,.*/,,'`
 
 usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
-       $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
 
 Canonicalize a configuration name.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -73,9 +67,7 @@ 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, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2018 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."
@@ -102,7 +94,7 @@ while test $# -gt 0 ; do
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -118,1196 +110,1159 @@ case $# in
     exit 1;;
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
-  kopensolaris*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
+# Split fields of configuration type
+IFS="-" read -r field1 field2 field3 field4 <<EOF
+$1
+EOF
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-       -sun*os*)
-               # Prevent following clause from handling this invalid input.
-               ;;
-       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray | -microblaze)
-               os=
-               basic_machine=$1
-               ;;
-       -bluegene*)
-               os=-cnk
-               ;;
-       -sim | -cisco | -oki | -wec | -winbond)
-               os=
-               basic_machine=$1
-               ;;
-       -scout)
-               ;;
-       -wrs)
-               os=-vxworks
-               basic_machine=$1
-               ;;
-       -chorusos*)
-               os=-chorusos
-               basic_machine=$1
-               ;;
-       -chorusrdb)
-               os=-chorusrdb
-               basic_machine=$1
-               ;;
-       -hiux*)
-               os=-hiuxwe2
-               ;;
-       -sco6)
-               os=-sco5v6
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5)
-               os=-sco3.2v5
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco4)
-               os=-sco3.2v4
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2.[4-9]*)
-               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2v[4-9]*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5v6*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco*)
-               os=-sco3.2v2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -udk*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -isc)
-               os=-isc2.2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -clix*)
-               basic_machine=clipper-intergraph
-               ;;
-       -isc*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -lynx*178)
-               os=-lynxos178
-               ;;
-       -lynx*5)
-               os=-lynxos5
-               ;;
-       -lynx*)
-               os=-lynxos
+# Separate into logical components for further validation
+case $1 in
+       *-*-*-*-*)
+               echo Invalid configuration \`"$1"\': more than four components >&2
+               exit 1
                ;;
-       -ptx*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+       *-*-*-*)
+               basic_machine=$field1-$field2
+               os=$field3-$field4
                ;;
-       -windowsnt*)
-               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+       *-*-*)
+               # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+               # parts
+               maybe_os=$field2-$field3
+               case $maybe_os in
+                       nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+                       | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+                       | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+                       | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+                       | storm-chaos* | os2-emx* | rtmk-nova*)
+                               basic_machine=$field1
+                               os=$maybe_os
+                               ;;
+                       android-linux)
+                               basic_machine=$field1-unknown
+                               os=linux-android
+                               ;;
+                       *)
+                               basic_machine=$field1-$field2
+                               os=$field3
+                               ;;
+               esac
                ;;
-       -psos*)
-               os=-psos
+       *-*)
+               # A lone config we happen to match not fitting any patern
+               case $field1-$field2 in
+                       decstation-3100)
+                               basic_machine=mips-dec
+                               os=
+                               ;;
+                       *-*)
+                               # Second component is usually, but not always the OS
+                               case $field2 in
+                                       # Prevent following clause from handling this valid os
+                                       sun*os*)
+                                               basic_machine=$field1
+                                               os=$field2
+                                               ;;
+                                       # Manufacturers
+                                       dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+                                       | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+                                       | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+                                       | convergent* | ncr* | news | 32* | 3600* | 3100* \
+                                       | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+                                       | ultra | tti* | harris | dolphin | highlevel | gould \
+                                       | cbm | ns | masscomp | apple | axis | knuth | cray \
+                                       | microblaze* | sim | cisco \
+                                       | oki | wec | wrs | winbond)
+                                               basic_machine=$field1-$field2
+                                               os=
+                                               ;;
+                                       *)
+                                               basic_machine=$field1
+                                               os=$field2
+                                               ;;
+                               esac
+                       ;;
+               esac
                ;;
-       -mint | -mint[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
+       *)
+               # Convert single-component short-hands not valid as part of
+               # multi-component configurations.
+               case $field1 in
+                       386bsd)
+                               basic_machine=i386-pc
+                               os=bsd
+                               ;;
+                       a29khif)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       adobe68k)
+                               basic_machine=m68010-adobe
+                               os=scout
+                               ;;
+                       alliant)
+                               basic_machine=fx80-alliant
+                               os=
+                               ;;
+                       altos | altos3068)
+                               basic_machine=m68k-altos
+                               os=
+                               ;;
+                       am29k)
+                               basic_machine=a29k-none
+                               os=bsd
+                               ;;
+                       amdahl)
+                               basic_machine=580-amdahl
+                               os=sysv
+                               ;;
+                       amiga)
+                               basic_machine=m68k-unknown
+                               os=
+                               ;;
+                       amigaos | amigados)
+                               basic_machine=m68k-unknown
+                               os=amigaos
+                               ;;
+                       amigaunix | amix)
+                               basic_machine=m68k-unknown
+                               os=sysv4
+                               ;;
+                       apollo68)
+                               basic_machine=m68k-apollo
+                               os=sysv
+                               ;;
+                       apollo68bsd)
+                               basic_machine=m68k-apollo
+                               os=bsd
+                               ;;
+                       aros)
+                               basic_machine=i386-pc
+                               os=aros
+                               ;;
+                       aux)
+                               basic_machine=m68k-apple
+                               os=aux
+                               ;;
+                       balance)
+                               basic_machine=ns32k-sequent
+                               os=dynix
+                               ;;
+                       blackfin)
+                               basic_machine=bfin-unknown
+                               os=linux
+                               ;;
+                       cegcc)
+                               basic_machine=arm-unknown
+                               os=cegcc
+                               ;;
+                       convex-c1)
+                               basic_machine=c1-convex
+                               os=bsd
+                               ;;
+                       convex-c2)
+                               basic_machine=c2-convex
+                               os=bsd
+                               ;;
+                       convex-c32)
+                               basic_machine=c32-convex
+                               os=bsd
+                               ;;
+                       convex-c34)
+                               basic_machine=c34-convex
+                               os=bsd
+                               ;;
+                       convex-c38)
+                               basic_machine=c38-convex
+                               os=bsd
+                               ;;
+                       cray)
+                               basic_machine=j90-cray
+                               os=unicos
+                               ;;
+                       crds | unos)
+                               basic_machine=m68k-crds
+                               os=
+                               ;;
+                       da30)
+                               basic_machine=m68k-da30
+                               os=
+                               ;;
+                       decstation | pmax | pmin | dec3100 | decstatn)
+                               basic_machine=mips-dec
+                               os=
+                               ;;
+                       delta88)
+                               basic_machine=m88k-motorola
+                               os=sysv3
+                               ;;
+                       dicos)
+                               basic_machine=i686-pc
+                               os=dicos
+                               ;;
+                       djgpp)
+                               basic_machine=i586-pc
+                               os=msdosdjgpp
+                               ;;
+                       ebmon29k)
+                               basic_machine=a29k-amd
+                               os=ebmon
+                               ;;
+                       es1800 | OSE68k | ose68k | ose | OSE)
+                               basic_machine=m68k-ericsson
+                               os=ose
+                               ;;
+                       gmicro)
+                               basic_machine=tron-gmicro
+                               os=sysv
+                               ;;
+                       go32)
+                               basic_machine=i386-pc
+                               os=go32
+                               ;;
+                       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
+                               ;;
+                       hppaosf)
+                               basic_machine=hppa1.1-hp
+                               os=osf
+                               ;;
+                       hppro)
+                               basic_machine=hppa1.1-hp
+                               os=proelf
+                               ;;
+                       i386mach)
+                               basic_machine=i386-mach
+                               os=mach
+                               ;;
+                       vsta)
+                               basic_machine=i386-pc
+                               os=vsta
+                               ;;
+                       isi68 | isi)
+                               basic_machine=m68k-isi
+                               os=sysv
+                               ;;
+                       m68knommu)
+                               basic_machine=m68k-unknown
+                               os=linux
+                               ;;
+                       magnum | m3230)
+                               basic_machine=mips-mips
+                               os=sysv
+                               ;;
+                       merlin)
+                               basic_machine=ns32k-utek
+                               os=sysv
+                               ;;
+                       mingw64)
+                               basic_machine=x86_64-pc
+                               os=mingw64
+                               ;;
+                       mingw32)
+                               basic_machine=i686-pc
+                               os=mingw32
+                               ;;
+                       mingw32ce)
+                               basic_machine=arm-unknown
+                               os=mingw32ce
+                               ;;
+                       monitor)
+                               basic_machine=m68k-rom68k
+                               os=coff
+                               ;;
+                       morphos)
+                               basic_machine=powerpc-unknown
+                               os=morphos
+                               ;;
+                       moxiebox)
+                               basic_machine=moxie-unknown
+                               os=moxiebox
+                               ;;
+                       msdos)
+                               basic_machine=i386-pc
+                               os=msdos
+                               ;;
+                       msys)
+                               basic_machine=i686-pc
+                               os=msys
+                               ;;
+                       mvs)
+                               basic_machine=i370-ibm
+                               os=mvs
+                               ;;
+                       nacl)
+                               basic_machine=le32-unknown
+                               os=nacl
+                               ;;
+                       ncr3000)
+                               basic_machine=i486-ncr
+                               os=sysv4
+                               ;;
+                       netbsd386)
+                               basic_machine=i386-pc
+                               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
+                               ;;
+                       necv70)
+                               basic_machine=v70-nec
+                               os=sysv
+                               ;;
+                       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
+                               ;;
+                       os400)
+                               basic_machine=powerpc-ibm
+                               os=os400
+                               ;;
+                       OSE68000 | ose68000)
+                               basic_machine=m68000-ericsson
+                               os=ose
+                               ;;
+                       os68k)
+                               basic_machine=m68k-none
+                               os=os68k
+                               ;;
+                       paragon)
+                               basic_machine=i860-intel
+                               os=osf
+                               ;;
+                       parisc)
+                               basic_machine=hppa-unknown
+                               os=linux
+                               ;;
+                       pw32)
+                               basic_machine=i586-unknown
+                               os=pw32
+                               ;;
+                       rdos | rdos64)
+                               basic_machine=x86_64-pc
+                               os=rdos
+                               ;;
+                       rdos32)
+                               basic_machine=i386-pc
+                               os=rdos
+                               ;;
+                       rom68k)
+                               basic_machine=m68k-rom68k
+                               os=coff
+                               ;;
+                       sa29200)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       sei)
+                               basic_machine=mips-sei
+                               os=seiux
+                               ;;
+                       sequent)
+                               basic_machine=i386-sequent
+                               os=
+                               ;;
+                       sps7)
+                               basic_machine=m68k-bull
+                               os=sysv2
+                               ;;
+                       st2000)
+                               basic_machine=m68k-tandem
+                               os=
+                               ;;
+                       stratus)
+                               basic_machine=i860-stratus
+                               os=sysv4
+                               ;;
+                       sun2)
+                               basic_machine=m68000-sun
+                               os=
+                               ;;
+                       sun2os3)
+                               basic_machine=m68000-sun
+                               os=sunos3
+                               ;;
+                       sun2os4)
+                               basic_machine=m68000-sun
+                               os=sunos4
+                               ;;
+                       sun3)
+                               basic_machine=m68k-sun
+                               os=
+                               ;;
+                       sun3os3)
+                               basic_machine=m68k-sun
+                               os=sunos3
+                               ;;
+                       sun3os4)
+                               basic_machine=m68k-sun
+                               os=sunos4
+                               ;;
+                       sun4)
+                               basic_machine=sparc-sun
+                               os=
+                               ;;
+                       sun4os3)
+                               basic_machine=sparc-sun
+                               os=sunos3
+                               ;;
+                       sun4os4)
+                               basic_machine=sparc-sun
+                               os=sunos4
+                               ;;
+                       sun4sol2)
+                               basic_machine=sparc-sun
+                               os=solaris2
+                               ;;
+                       sun386 | sun386i | roadrunner)
+                               basic_machine=i386-sun
+                               os=
+                               ;;
+                       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
+                               ;;
+                       toad1)
+                               basic_machine=pdp10-xkl
+                               os=tops20
+                               ;;
+                       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
+                               ;;
+                       vxworks960)
+                               basic_machine=i960-wrs
+                               os=vxworks
+                               ;;
+                       vxworks68)
+                               basic_machine=m68k-wrs
+                               os=vxworks
+                               ;;
+                       vxworks29k)
+                               basic_machine=a29k-wrs
+                               os=vxworks
+                               ;;
+                       xbox)
+                               basic_machine=i686-pc
+                               os=mingw32
+                               ;;
+                       ymp)
+                               basic_machine=ymp-cray
+                               os=unicos
+                               ;;
+                       *)
+                               basic_machine=$1
+                               os=
+                               ;;
+               esac
                ;;
 esac
 
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-       # Recognize the basic CPU types without company name.
-       # Some are omitted here because they have special meanings below.
-       1750a | 580 \
-       | a29k \
-       | aarch64 | aarch64_be \
-       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-       | am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
-       | bfin \
-       | c4x | clipper \
-       | d10v | d30v | dlx | dsp16xx \
-       | epiphany \
-       | fido | fr30 | frv \
-       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-       | hexagon \
-       | i370 | i860 | i960 | ia64 \
-       | ip2k | iq2000 \
-       | le32 | le64 \
-       | lm32 \
-       | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore | mep | metag \
-       | mips | mipsbe | mipseb | mipsel | mipsle \
-       | mips16 \
-       | mips64 | mips64el \
-       | mips64octeon | mips64octeonel \
-       | mips64orion | mips64orionel \
-       | mips64r5900 | mips64r5900el \
-       | mips64vr | mips64vrel \
-       | mips64vr4100 | mips64vr4100el \
-       | mips64vr4300 | mips64vr4300el \
-       | mips64vr5000 | mips64vr5000el \
-       | mips64vr5900 | mips64vr5900el \
-       | mipsisa32 | mipsisa32el \
-       | mipsisa32r2 | mipsisa32r2el \
-       | mipsisa64 | mipsisa64el \
-       | mipsisa64r2 | mipsisa64r2el \
-       | mipsisa64sb1 | mipsisa64sb1el \
-       | mipsisa64sr71k | mipsisa64sr71kel \
-       | mipstx39 | mipstx39el \
-       | mn10200 | mn10300 \
-       | moxie \
-       | mt \
-       | msp430 \
-       | nds32 | nds32le | nds32be \
-       | nios | nios2 \
-       | ns16k | ns32k \
-       | open8 \
-       | or32 \
-       | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle \
-       | pyramid \
-       | rl78 | rx \
-       | score \
-       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-       | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu \
-       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-       | ubicom32 \
-       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-       | we32k \
-       | x86 | xc16x | xstormy16 | xtensa \
-       | z8k | z80)
-               basic_machine=$basic_machine-unknown
-               ;;
-       c54x)
-               basic_machine=tic54x-unknown
-               ;;
-       c55x)
-               basic_machine=tic55x-unknown
-               ;;
-       c6x)
-               basic_machine=tic6x-unknown
-               ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
-               basic_machine=$basic_machine-unknown
-               os=-none
-               ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
-               ;;
-       ms1)
-               basic_machine=mt-unknown
+       # 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)
+               cpu=hppa1.1
+               vendor=winbond
                ;;
-
-       strongarm | thumb | xscale)
-               basic_machine=arm-unknown
+       op50n)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-       xgate)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       op60c)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-       xscaleeb)
-               basic_machine=armeb-unknown
+       ibm*)
+               cpu=i370
+               vendor=ibm
                ;;
-
-       xscaleel)
-               basic_machine=armel-unknown
+       orion105)
+               cpu=clipper
+               vendor=highlevel
                ;;
-
-       # 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
+       mac | mpw | mac-mpw)
+               cpu=m68k
+               vendor=apple
                ;;
-       # Recognize the basic CPU types with company name.
-       580-* \
-       | a29k-* \
-       | aarch64-* | aarch64_be-* \
-       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
-       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* | avr32-* \
-       | be32-* | be64-* \
-       | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* \
-       | 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-* \
-       | hexagon-* \
-       | i*86-* | i860-* | i960-* | ia64-* \
-       | ip2k-* | iq2000-* \
-       | le32-* | le64-* \
-       | lm32-* \
-       | m32c-* | m32r-* | m32rle-* \
-       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
-       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-       | mips16-* \
-       | mips64-* | mips64el-* \
-       | mips64octeon-* | mips64octeonel-* \
-       | mips64orion-* | mips64orionel-* \
-       | mips64r5900-* | mips64r5900el-* \
-       | mips64vr-* | mips64vrel-* \
-       | mips64vr4100-* | mips64vr4100el-* \
-       | mips64vr4300-* | mips64vr4300el-* \
-       | mips64vr5000-* | mips64vr5000el-* \
-       | mips64vr5900-* | mips64vr5900el-* \
-       | mipsisa32-* | mipsisa32el-* \
-       | mipsisa32r2-* | mipsisa32r2el-* \
-       | mipsisa64-* | mipsisa64el-* \
-       | mipsisa64r2-* | mipsisa64r2el-* \
-       | mipsisa64sb1-* | mipsisa64sb1el-* \
-       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
-       | mipstx39-* | mipstx39el-* \
-       | mmix-* \
-       | mt-* \
-       | msp430-* \
-       | nds32-* | nds32le-* | nds32be-* \
-       | nios-* | nios2-* \
-       | none-* | np1-* | ns16k-* | ns32k-* \
-       | open8-* \
-       | orion-* \
-       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-       | pyramid-* \
-       | rl78-* | romp-* | rs6000-* | rx-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-       | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
-       | tahoe-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-       | tile*-* \
-       | tron-* \
-       | ubicom32-* \
-       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-       | vax-* \
-       | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* \
-       | xstormy16-* | xtensa*-* \
-       | ymp-* \
-       | z8k-* | z80-*)
-               ;;
-       # Recognize the basic CPU types without company name, with glob match.
-       xtensa*)
-               basic_machine=$basic_machine-unknown
+       pmac | pmac-mpw)
+               cpu=powerpc
+               vendor=apple
                ;;
+
        # 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
+               cpu=m68000
+               vendor=att
                ;;
        3b*)
-               basic_machine=we32k-att
-               ;;
-       a29khif)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       abacus)
-               basic_machine=abacus-unknown
-               ;;
-       adobe68k)
-               basic_machine=m68010-adobe
-               os=-scout
-               ;;
-       alliant | fx80)
-               basic_machine=fx80-alliant
-               ;;
-       altos | altos3068)
-               basic_machine=m68k-altos
-               ;;
-       am29k)
-               basic_machine=a29k-none
-               os=-bsd
-               ;;
-       amd64)
-               basic_machine=x86_64-pc
-               ;;
-       amd64-*)
-               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       amdahl)
-               basic_machine=580-amdahl
-               os=-sysv
-               ;;
-       amiga | amiga-*)
-               basic_machine=m68k-unknown
-               ;;
-       amigaos | amigados)
-               basic_machine=m68k-unknown
-               os=-amigaos
-               ;;
-       amigaunix | amix)
-               basic_machine=m68k-unknown
-               os=-sysv4
-               ;;
-       apollo68)
-               basic_machine=m68k-apollo
-               os=-sysv
-               ;;
-       apollo68bsd)
-               basic_machine=m68k-apollo
-               os=-bsd
-               ;;
-       aros)
-               basic_machine=i386-pc
-               os=-aros
-               ;;
-       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
+               cpu=we32k
+               vendor=att
                ;;
        bluegene*)
-               basic_machine=powerpc-ibm
-               os=-cnk
-               ;;
-       c54x-*)
-               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c55x-*)
-               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c6x-*)
-               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c90)
-               basic_machine=c90-cray
-               os=-unicos
-               ;;
-       cegcc)
-               basic_machine=arm-unknown
-               os=-cegcc
-               ;;
-       convex-c1)
-               basic_machine=c1-convex
-               os=-bsd
-               ;;
-       convex-c2)
-               basic_machine=c2-convex
-               os=-bsd
-               ;;
-       convex-c32)
-               basic_machine=c32-convex
-               os=-bsd
-               ;;
-       convex-c34)
-               basic_machine=c34-convex
-               os=-bsd
-               ;;
-       convex-c38)
-               basic_machine=c38-convex
-               os=-bsd
-               ;;
-       cray | j90)
-               basic_machine=j90-cray
-               os=-unicos
-               ;;
-       craynv)
-               basic_machine=craynv-cray
-               os=-unicosmp
-               ;;
-       cr16 | cr16-*)
-               basic_machine=cr16-unknown
-               os=-elf
-               ;;
-       crds | unos)
-               basic_machine=m68k-crds
-               ;;
-       crisv32 | crisv32-* | etraxfs*)
-               basic_machine=crisv32-axis
-               ;;
-       cris | cris-* | etrax*)
-               basic_machine=cris-axis
-               ;;
-       crx)
-               basic_machine=crx-unknown
-               os=-elf
-               ;;
-       da30 | da30-*)
-               basic_machine=m68k-da30
-               ;;
-       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-               basic_machine=mips-dec
+               cpu=powerpc
+               vendor=ibm
+               os=cnk
                ;;
        decsystem10* | dec10*)
-               basic_machine=pdp10-dec
-               os=-tops10
+               cpu=pdp10
+               vendor=dec
+               os=tops10
                ;;
        decsystem20* | dec20*)
-               basic_machine=pdp10-dec
-               os=-tops20
+               cpu=pdp10
+               vendor=dec
+               os=tops20
                ;;
        delta | 3300 | motorola-3300 | motorola-delta \
              | 3300-motorola | delta-motorola)
-               basic_machine=m68k-motorola
-               ;;
-       delta88)
-               basic_machine=m88k-motorola
-               os=-sysv3
+               cpu=m68k
+               vendor=motorola
                ;;
-       dicos)
-               basic_machine=i686-pc
-               os=-dicos
-               ;;
-       djgpp)
-               basic_machine=i586-pc
-               os=-msdosdjgpp
-               ;;
-       dpx20 | dpx20-*)
-               basic_machine=rs6000-bull
-               os=-bosx
-               ;;
-       dpx2* | dpx2*-bull)
-               basic_machine=m68k-bull
-               os=-sysv3
-               ;;
-       ebmon29k)
-               basic_machine=a29k-amd
-               os=-ebmon
-               ;;
-       elxsi)
-               basic_machine=elxsi-elxsi
-               os=-bsd
+       dpx2*)
+               cpu=m68k
+               vendor=bull
+               os=sysv3
                ;;
        encore | umax | mmax)
-               basic_machine=ns32k-encore
+               cpu=ns32k
+               vendor=encore
                ;;
-       es1800 | OSE68k | ose68k | ose | OSE)
-               basic_machine=m68k-ericsson
-               os=-ose
+       elxsi)
+               cpu=elxsi
+               vendor=elxsi
+               os=${os:-bsd}
                ;;
        fx2800)
-               basic_machine=i860-alliant
+               cpu=i860
+               vendor=alliant
                ;;
        genix)
-               basic_machine=ns32k-ns
-               ;;
-       gmicro)
-               basic_machine=tron-gmicro
-               os=-sysv
-               ;;
-       go32)
-               basic_machine=i386-pc
-               os=-go32
+               cpu=ns32k
+               vendor=ns
                ;;
        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
+               cpu=hppa1.1
+               vendor=hitachi
+               os=hiuxwe2
                ;;
        hp3k9[0-9][0-9] | hp9[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k2[0-9][0-9] | hp9k31[0-9])
-               basic_machine=m68000-hp
+               cpu=m68000
+               vendor=hp
                ;;
        hp9k3[2-9][0-9])
-               basic_machine=m68k-hp
+               cpu=m68k
+               vendor=hp
                ;;
        hp9k6[0-9][0-9] | hp6[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k7[0-79][0-9] | hp7[0-79][0-9])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k78[0-9] | hp78[0-9])
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=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
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][13679] | hp8[0-9][13679])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=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
+               cpu=hppa1.0
+               vendor=hp
                ;;
        i*86v32)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv32
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv32
                ;;
        i*86v4*)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv4
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv4
                ;;
        i*86v)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv
                ;;
        i*86sol2)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-solaris2
-               ;;
-       i386mach)
-               basic_machine=i386-mach
-               os=-mach
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=solaris2
                ;;
-       i386-vsta | vsta)
-               basic_machine=i386-unknown
-               os=-vsta
+       j90 | j90-cray)
+               cpu=j90
+               vendor=cray
+               os=${os:-unicos}
                ;;
        iris | iris4d)
-               basic_machine=mips-sgi
+               cpu=mips
+               vendor=sgi
                case $os in
-                   -irix*)
+                   irix*)
                        ;;
                    *)
-                       os=-irix4
+                       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
-               ;;
-       microblaze)
-               basic_machine=microblaze-xilinx
-               ;;
-       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-/'`
-               ;;
-       msys)
-               basic_machine=i386-pc
-               os=-msys
-               ;;
-       mvs)
-               basic_machine=i370-ibm
-               os=-mvs
-               ;;
-       nacl)
-               basic_machine=le32-unknown
-               os=-nacl
-               ;;
-       ncr3000)
-               basic_machine=i486-ncr
-               os=-sysv4
+               cpu=m68000
+               vendor=convergent
                ;;
-       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
+       *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               cpu=m68k
+               vendor=atari
+               os=mint
                ;;
        news-3600 | risc-news)
-               basic_machine=mips-sony
-               os=-newsos
-               ;;
-       necv70)
-               basic_machine=v70-nec
-               os=-sysv
+               cpu=mips
+               vendor=sony
+               os=newsos
                ;;
-       next | m*-next )
-               basic_machine=m68k-next
+       next | m*-next)
+               cpu=m68k
+               vendor=next
                case $os in
-                   -nextstep* )
+                   nextstep* )
                        ;;
-                   -ns2*)
-                     os=-nextstep2
+                   ns2*)
+                     os=nextstep2
                        ;;
                    *)
-                     os=-nextstep3
+                     os=nextstep3
                        ;;
                esac
                ;;
-       nh3000)
-               basic_machine=m68k-harris
-               os=-cxux
-               ;;
-       nh[45]000)
-               basic_machine=m88k-harris
-               os=-cxux
-               ;;
-       nindy960)
-               basic_machine=i960-intel
-               os=-nindy
-               ;;
-       mon960)
-               basic_machine=i960-intel
-               os=-mon960
-               ;;
-       nonstopux)
-               basic_machine=mips-compaq
-               os=-nonstopux
-               ;;
        np1)
-               basic_machine=np1-gould
-               ;;
-       neo-tandem)
-               basic_machine=neo-tandem
-               ;;
-       nse-tandem)
-               basic_machine=nse-tandem
-               ;;
-       nsr-tandem)
-               basic_machine=nsr-tandem
+               cpu=np1
+               vendor=gould
                ;;
        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
+               cpu=hppa1.1
+               vendor=oki
+               os=proelf
                ;;
        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
+               cpu=hppa1.1
+               vendor=hitachi
+               os=hiuxwe2
                ;;
        pbd)
-               basic_machine=sparc-tti
+               cpu=sparc
+               vendor=tti
                ;;
        pbb)
-               basic_machine=m68k-tti
+               cpu=m68k
+               vendor=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/^[^-]*-//'`
+       pc532)
+               cpu=ns32k
+               vendor=pc532
                ;;
        pn)
-               basic_machine=pn-gould
-               ;;
-       power)  basic_machine=power-ibm
+               cpu=pn
+               vendor=gould
                ;;
-       ppc | ppcbe)    basic_machine=powerpc-unknown
-               ;;
-       ppc-* | ppcbe-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppcle | powerpclittle | ppc-le | powerpc-little)
-               basic_machine=powerpcle-unknown
-               ;;
-       ppcle-* | powerpclittle-*)
-               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64)  basic_machine=powerpc64-unknown
-               ;;
-       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-               basic_machine=powerpc64le-unknown
-               ;;
-       ppc64le-* | powerpc64little-*)
-               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+       power)
+               cpu=power
+               vendor=ibm
                ;;
        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
+               cpu=i386
+               vendor=ibm
                ;;
        rm[46]00)
-               basic_machine=mips-siemens
+               cpu=mips
+               vendor=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
+               cpu=romp
+               vendor=ibm
                ;;
-       sb1)
-               basic_machine=mipsisa64sb1-unknown
+       sde)
+               cpu=mipsisa32
+               vendor=sde
+               os=${os:-elf}
                ;;
-       sb1el)
-               basic_machine=mipsisa64sb1el-unknown
+       simso-wrs)
+               cpu=sparclite
+               vendor=wrs
+               os=vxworks
                ;;
-       sde)
-               basic_machine=mipsisa32-sde
-               os=-elf
+       tower | tower-32)
+               cpu=m68k
+               vendor=ncr
                ;;
-       sei)
-               basic_machine=mips-sei
-               os=-seiux
+       vpp*|vx|vx-*)
+               cpu=f301
+               vendor=fujitsu
                ;;
-       sequent)
-               basic_machine=i386-sequent
+       w65)
+               cpu=w65
+               vendor=wdc
                ;;
-       sh)
-               basic_machine=sh-hitachi
-               os=-hms
+       w89k-*)
+               cpu=hppa1.1
+               vendor=winbond
+               os=proelf
                ;;
-       sh5el)
-               basic_machine=sh5le-unknown
+       none)
+               cpu=none
+               vendor=none
                ;;
-       sh64)
-               basic_machine=sh64-unknown
+       leon|leon[3-9])
+               cpu=sparc
+               vendor=$basic_machine
                ;;
-       sparclite-wrs | simso-wrs)
-               basic_machine=sparclite-wrs
-               os=-vxworks
+       leon-*|leon[3-9]-*)
+               cpu=sparc
+               vendor=`echo "$basic_machine" | sed 's/-.*//'`
                ;;
-       sps7)
-               basic_machine=m68k-bull
-               os=-sysv2
+
+       *-*)
+               IFS="-" read -r cpu vendor <<EOF
+$basic_machine
+EOF
                ;;
-       spur)
-               basic_machine=spur-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)
+               cpu=$basic_machine
+               vendor=pc
                ;;
-       st2000)
-               basic_machine=m68k-tandem
+       # These rules are duplicated from below for sake of the special case above;
+       # i.e. things that normalized to x86 arches should also default to "pc"
+       pc98)
+               cpu=i386
+               vendor=pc
                ;;
-       stratus)
-               basic_machine=i860-stratus
-               os=-sysv4
+       x64 | amd64)
+               cpu=x86_64
+               vendor=pc
                ;;
-       strongarm-* | thumb-*)
-               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+       # Recognize the basic CPU types without company name.
+       *)
+               cpu=$basic_machine
+               vendor=unknown
                ;;
-       sun2)
-               basic_machine=m68000-sun
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+       # Here we handle the default manufacturer of certain CPU types in cannonical form. It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       craynv-unknown)
+               vendor=cray
+               os=${os:-unicosmp}
                ;;
-       sun2os3)
-               basic_machine=m68000-sun
-               os=-sunos3
+       c90-unknown | c90-cray)
+               vendor=cray
+               os=${os:-unicos}
                ;;
-       sun2os4)
-               basic_machine=m68000-sun
-               os=-sunos4
+       fx80-unknown)
+               vendor=alliant
                ;;
-       sun3os3)
-               basic_machine=m68k-sun
-               os=-sunos3
+       romp-unknown)
+               vendor=ibm
                ;;
-       sun3os4)
-               basic_machine=m68k-sun
-               os=-sunos4
+       mmix-unknown)
+               vendor=knuth
                ;;
-       sun4os3)
-               basic_machine=sparc-sun
-               os=-sunos3
+       microblaze-unknown | microblazeel-unknown)
+               vendor=xilinx
                ;;
-       sun4os4)
-               basic_machine=sparc-sun
-               os=-sunos4
+       rs6000-unknown)
+               vendor=ibm
                ;;
-       sun4sol2)
-               basic_machine=sparc-sun
-               os=-solaris2
+       vax-unknown)
+               vendor=dec
                ;;
-       sun3 | sun3-*)
-               basic_machine=m68k-sun
+       pdp11-unknown)
+               vendor=dec
                ;;
-       sun4)
-               basic_machine=sparc-sun
+       we32k-unknown)
+               vendor=att
                ;;
-       sun386 | sun386i | roadrunner)
-               basic_machine=i386-sun
+       cydra-unknown)
+               vendor=cydrome
                ;;
-       sv1)
-               basic_machine=sv1-cray
-               os=-unicos
+       i370-ibm*)
+               vendor=ibm
                ;;
-       symmetry)
-               basic_machine=i386-sequent
-               os=-dynix
+       orion-unknown)
+               vendor=highlevel
                ;;
-       t3e)
-               basic_machine=alphaev5-cray
-               os=-unicos
+       xps-unknown | xps100-unknown)
+               cpu=xps100
+               vendor=honeywell
                ;;
-       t90)
-               basic_machine=t90-cray
-               os=-unicos
+
+       # Here we normalize CPU types with a missing or matching vendor
+       dpx20-unknown | dpx20-bull)
+               cpu=rs6000
+               vendor=bull
+               os=${os:-bosx}
                ;;
-       tile*)
-               basic_machine=$basic_machine-unknown
-               os=-linux-gnu
+
+       # Here we normalize CPU types irrespective of the vendor
+       amd64-*)
+               cpu=x86_64
                ;;
-       tx39)
-               basic_machine=mipstx39-unknown
+       blackfin-*)
+               cpu=bfin
+               os=linux
                ;;
-       tx39el)
-               basic_machine=mipstx39el-unknown
+       c54x-*)
+               cpu=tic54x
                ;;
-       toad1)
-               basic_machine=pdp10-xkl
-               os=-tops20
+       c55x-*)
+               cpu=tic55x
                ;;
-       tower | tower-32)
-               basic_machine=m68k-ncr
+       c6x-*)
+               cpu=tic6x
                ;;
-       tpf)
-               basic_machine=s390x-ibm
-               os=-tpf
+       e500v[12]-*)
+               cpu=powerpc
+               os=$os"spe"
                ;;
-       udi29k)
-               basic_machine=a29k-amd
-               os=-udi
+       mips3*-*)
+               cpu=mips64
                ;;
-       ultra3)
-               basic_machine=a29k-nyu
-               os=-sym1
+       ms1-*)
+               cpu=mt
                ;;
-       v810 | necv810)
-               basic_machine=v810-nec
-               os=-none
+       m68knommu-*)
+               cpu=m68k
+               os=linux
                ;;
-       vaxv)
-               basic_machine=vax-dec
-               os=-sysv
+       m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+               cpu=s12z
                ;;
-       vms)
-               basic_machine=vax-dec
-               os=-vms
+       openrisc-*)
+               cpu=or32
                ;;
-       vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
+       parisc-*)
+               cpu=hppa
+               os=linux
                ;;
-       vxworks960)
-               basic_machine=i960-wrs
-               os=-vxworks
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               cpu=i586
                ;;
-       vxworks68)
-               basic_machine=m68k-wrs
-               os=-vxworks
+       pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+               cpu=i686
                ;;
-       vxworks29k)
-               basic_machine=a29k-wrs
-               os=-vxworks
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               cpu=i686
                ;;
-       w65*)
-               basic_machine=w65-wdc
-               os=-none
+       pentium4-*)
+               cpu=i786
                ;;
-       w89k-*)
-               basic_machine=hppa1.1-winbond
-               os=-proelf
+       pc98-*)
+               cpu=i386
                ;;
-       xbox)
-               basic_machine=i686-pc
-               os=-mingw32
+       ppc-* | ppcbe-*)
+               cpu=powerpc
                ;;
-       xps | xps100)
-               basic_machine=xps100-honeywell
+       ppcle-* | powerpclittle-*)
+               cpu=powerpcle
                ;;
-       xscale-* | xscalee[bl]-*)
-               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+       ppc64-*)
+               cpu=powerpc64
                ;;
-       ymp)
-               basic_machine=ymp-cray
-               os=-unicos
+       ppc64le-* | powerpc64little-*)
+               cpu=powerpc64le
                ;;
-       z8k-*-coff)
-               basic_machine=z8k-unknown
-               os=-sim
+       sb1-*)
+               cpu=mipsisa64sb1
                ;;
-       z80-*-coff)
-               basic_machine=z80-unknown
-               os=-sim
+       sb1el-*)
+               cpu=mipsisa64sb1el
                ;;
-       none)
-               basic_machine=none-none
-               os=-none
+       sh5e[lb]-*)
+               cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
                ;;
-
-# 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
+       spur-*)
+               cpu=spur
                ;;
-       op50n)
-               basic_machine=hppa1.1-oki
+       strongarm-* | thumb-*)
+               cpu=arm
                ;;
-       op60c)
-               basic_machine=hppa1.1-oki
+       tx39-*)
+               cpu=mipstx39
                ;;
-       romp)
-               basic_machine=romp-ibm
+       tx39el-*)
+               cpu=mipstx39el
                ;;
-       mmix)
-               basic_machine=mmix-knuth
+       x64-*)
+               cpu=x86_64
                ;;
-       rs6000)
-               basic_machine=rs6000-ibm
+       xscale-* | xscalee[bl]-*)
+               cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
                ;;
-       vax)
-               basic_machine=vax-dec
+
+       # Recognize the cannonical CPU Types that limit and/or modify the
+       # company names they are paired with.
+       cr16-*)
+               os=${os:-elf}
                ;;
-       pdp10)
-               # there are many clones, so DEC is not a safe bet
-               basic_machine=pdp10-unknown
+       crisv32-* | etraxfs*-*)
+               cpu=crisv32
+               vendor=axis
                ;;
-       pdp11)
-               basic_machine=pdp11-dec
+       cris-* | etrax*-*)
+               cpu=cris
+               vendor=axis
                ;;
-       we32k)
-               basic_machine=we32k-att
+       crx-*)
+               os=${os:-elf}
                ;;
-       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-               basic_machine=sh-unknown
+       neo-tandem)
+               cpu=neo
+               vendor=tandem
                ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-               basic_machine=sparc-sun
+       nse-tandem)
+               cpu=nse
+               vendor=tandem
                ;;
-       cydra)
-               basic_machine=cydra-cydrome
+       nsr-tandem)
+               cpu=nsr
+               vendor=tandem
                ;;
-       orion)
-               basic_machine=orion-highlevel
+       nsv-tandem)
+               cpu=nsv
+               vendor=tandem
                ;;
-       orion105)
-               basic_machine=clipper-highlevel
+       nsx-tandem)
+               cpu=nsx
+               vendor=tandem
                ;;
-       mac | mpw | mac-mpw)
-               basic_machine=m68k-apple
+       s390-*)
+               cpu=s390
+               vendor=ibm
                ;;
-       pmac | pmac-mpw)
-               basic_machine=powerpc-apple
+       s390x-*)
+               cpu=s390x
+               vendor=ibm
                ;;
-       *-unknown)
-               # Make sure to match an already-canonicalized machine name.
+       tile*-*)
+               os=${os:-linux-gnu}
                ;;
+
        *)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
+               # Recognize the cannonical CPU types that are allowed with any
+               # company name.
+               case $cpu in
+                       1750a | 580 \
+                       | a29k \
+                       | aarch64 | aarch64_be \
+                       | abacus \
+                       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+                       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+                       | alphapca5[67] | alpha64pca5[67] \
+                       | am33_2.0 \
+                       | arc | arceb \
+                       | arm  | arm[lb]e | arme[lb] | armv* \
+                       | avr | avr32 \
+                       | asmjs \
+                       | ba \
+                       | be32 | be64 \
+                       | bfin | bs2000 \
+                       | c[123]* | c30 | [cjt]90 | c4x \
+                       | c8051 | clipper | craynv | csky | cydra \
+                       | d10v | d30v | dlx | dsp16xx \
+                       | e2k | elxsi | epiphany \
+                       | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+                       | h8300 | h8500 \
+                       | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+                       | hexagon \
+                       | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+                       | ip2k | iq2000 \
+                       | k1om \
+                       | le32 | le64 \
+                       | lm32 \
+                       | m32c | m32r | m32rle \
+                       | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
+                       | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
+                       | m88110 | m88k | maxq | mb | mcore | mep | metag \
+                       | microblaze | microblazeel \
+                       | mips | mipsbe | mipseb | mipsel | mipsle \
+                       | mips16 \
+                       | mips64 | mips64el \
+                       | mips64octeon | mips64octeonel \
+                       | mips64orion | mips64orionel \
+                       | mips64r5900 | mips64r5900el \
+                       | mips64vr | mips64vrel \
+                       | mips64vr4100 | mips64vr4100el \
+                       | mips64vr4300 | mips64vr4300el \
+                       | mips64vr5000 | mips64vr5000el \
+                       | mips64vr5900 | mips64vr5900el \
+                       | mipsisa32 | mipsisa32el \
+                       | mipsisa32r2 | mipsisa32r2el \
+                       | mipsisa32r6 | mipsisa32r6el \
+                       | mipsisa64 | mipsisa64el \
+                       | mipsisa64r2 | mipsisa64r2el \
+                       | mipsisa64r6 | mipsisa64r6el \
+                       | mipsisa64sb1 | mipsisa64sb1el \
+                       | mipsisa64sr71k | mipsisa64sr71kel \
+                       | mipsr5900 | mipsr5900el \
+                       | mipstx39 | mipstx39el \
+                       | mmix \
+                       | mn10200 | mn10300 \
+                       | moxie \
+                       | mt \
+                       | msp430 \
+                       | nds32 | nds32le | nds32be \
+                       | nfp \
+                       | nios | nios2 | nios2eb | nios2el \
+                       | none | np1 | ns16k | ns32k \
+                       | open8 \
+                       | or1k* \
+                       | or32 \
+                       | orion \
+                       | pdp10 | pdp11 | pj | pjl | pn | power \
+                       | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+                       | pru \
+                       | pyramid \
+                       | riscv | riscv32 | riscv64 \
+                       | rl78 | romp | rs6000 | rx \
+                       | score \
+                       | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+                       | sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+                       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+                       | sparclite \
+                       | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+                       | spu \
+                       | tahoe \
+                       | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+                       | tron \
+                       | ubicom32 \
+                       | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+                       | vax \
+                       | visium \
+                       | wasm32 \
+                       | we32k \
+                       | x86 | x86_64 | xc16x | xgate | xps100 \
+                       | xstormy16 | xtensa* \
+                       | ymp \
+                       | z8k | z80)
+                               ;;
+
+                       *)
+                               echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+                               exit 1
+                               ;;
+               esac
                ;;
 esac
 
 # Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-       *-digital*)
-               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+       digital*)
+               vendor=dec
                ;;
-       *-commodore*)
-               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+       commodore*)
+               vendor=cbm
                ;;
        *)
                ;;
@@ -1315,200 +1270,246 @@ esac
 
 # Decode manufacturer-specific aliases for certain operating systems.
 
-if [ x"$os" != x"" ]
+if [ x$os != x ]
 then
 case $os in
-       # First match some system type aliases
-       # that might get confused with valid system types.
-       # -solaris* is a basic system type, with this one exception.
-       -auroraux)
-               os=-auroraux
+       # First match some system type aliases that might get confused
+       # with valid system types.
+       # solaris* is a basic system type, with this one exception.
+       auroraux)
+               os=auroraux
                ;;
-       -solaris1 | -solaris1.*)
-               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+       bluegene*)
+               os=cnk
                ;;
-       -solaris)
-               os=-solaris2
+       solaris1 | solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
-       -svr4*)
-               os=-sysv4
+       solaris)
+               os=solaris2
                ;;
-       -unixware*)
-               os=-sysv4.2uw
+       unixware*)
+               os=sysv4.2uw
                ;;
-       -gnu/linux*)
+       gnu/linux*)
                os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
                ;;
-       # First accept the basic system types.
+       # es1800 is here to avoid being matched by es* (a different OS)
+       es1800*)
+               os=ose
+               ;;
+       # Some version numbers need modification
+       chorusos*)
+               os=chorusos
+               ;;
+       isc)
+               os=isc2.2
+               ;;
+       sco6)
+               os=sco5v6
+               ;;
+       sco5)
+               os=sco3.2v5
+               ;;
+       sco4)
+               os=sco3.2v4
+               ;;
+       sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               ;;
+       sco3.2v[4-9]* | sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               ;;
+       scout)
+               # Don't match below
+               ;;
+       sco*)
+               os=sco3.2v2
+               ;;
+       psos*)
+               os=psos
+               ;;
+       # Now accept the basic system types.
        # The portable systems comes first.
-       # Each alternative MUST END IN A *, to match a version number.
-       # -sysv* is not here because it comes later, after sysvr4.
-       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-             | -sym* | -kopensolaris* \
-             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* | -aros* \
-             | -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* | -cegcc* \
-             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-android* \
-             | -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* | -es*)
+       # 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* | esix* | aix* | cnk* | sunos | sunos[34]*\
+            | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+            | sym* | kopensolaris* | plan9* \
+            | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+            | aos* | aros* | cloudabi* | sortix* \
+            | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+            | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+            | knetbsd* | mirbsd* | netbsd* \
+            | bitrig* | openbsd* | solidbsd* | libertybsd* \
+            | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+            | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+            | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+            | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+            | chorusrdb* | cegcc* | glidix* \
+            | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+            | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+            | linux-newlib* | linux-musl* | linux-uclibc* \
+            | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+            | interix* | uwin* | mks* | rhapsody* | darwin* \
+            | openstep* | oskit* | conix* | pw32* | nonstopux* \
+            | storm-chaos* | tops10* | tenex* | tops20* | its* \
+            | os2* | vos* | palmos* | uclinux* | nucleus* \
+            | morphos* | superux* | rtmk* | windiss* \
+            | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+            | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+            | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+            | midnightbsd*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
-       -qnx*)
-               case $basic_machine in
-                   x86-* | i*86-*)
+       qnx*)
+               case $cpu in
+                   x86 | i*86)
                        ;;
                    *)
-                       os=-nto$os
+                       os=nto-$os
                        ;;
                esac
                ;;
-       -nto-qnx*)
+       hiux*)
+               os=hiuxwe2
                ;;
-       -nto*)
-               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+       nto-qnx*)
                ;;
-       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+       nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
-       -mac*)
-               os=`echo $os | sed -e 's|mac|macos|'`
+       sim | xray | os68k* | v88r* \
+           | windows* | osx | abug | netware* | os9* \
+           | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
                ;;
-       -linux-dietlibc)
-               os=-linux-dietlibc
+       linux-dietlibc)
+               os=linux-dietlibc
                ;;
-       -linux*)
+       linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
-       -sunos5*)
-               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+       lynx*178)
+               os=lynxos178
+               ;;
+       lynx*5)
+               os=lynxos5
                ;;
-       -sunos6*)
-               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+       lynx*)
+               os=lynxos
                ;;
-       -opened*)
-               os=-openedition
+       mac*)
+               os=`echo "$os" | sed -e 's|mac|macos|'`
                ;;
-       -os400*)
-               os=-os400
+       opened*)
+               os=openedition
                ;;
-       -wince*)
-               os=-wince
+       os400*)
+               os=os400
                ;;
-       -osfrose*)
-               os=-osfrose
+       sunos5*)
+               os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
                ;;
-       -osf*)
-               os=-osf
+       sunos6*)
+               os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
                ;;
-       -utek*)
-               os=-bsd
+       wince*)
+               os=wince
                ;;
-       -dynix*)
-               os=-bsd
+       utek*)
+               os=bsd
                ;;
-       -acis*)
-               os=-aos
+       dynix*)
+               os=bsd
                ;;
-       -atheos*)
-               os=-atheos
+       acis*)
+               os=aos
                ;;
-       -syllable*)
-               os=-syllable
+       atheos*)
+               os=atheos
                ;;
-       -386bsd)
-               os=-bsd
+       syllable*)
+               os=syllable
                ;;
-       -ctix* | -uts*)
-               os=-sysv
+       386bsd)
+               os=bsd
                ;;
-       -nova*)
-               os=-rtmk-nova
+       ctix* | uts*)
+               os=sysv
                ;;
-       -ns2 )
-               os=-nextstep2
+       nova*)
+               os=rtmk-nova
                ;;
-       -nsk*)
-               os=-nsk
+       ns2)
+               os=nextstep2
+               ;;
+       nsk*)
+               os=nsk
                ;;
        # Preserve the version number of sinix5.
-       -sinix5.*)
+       sinix5.*)
                os=`echo $os | sed -e 's|sinix|sysv|'`
                ;;
-       -sinix*)
-               os=-sysv4
-               ;;
-       -tpf*)
-               os=-tpf
+       sinix*)
+               os=sysv4
                ;;
-       -triton*)
-               os=-sysv3
+       tpf*)
+               os=tpf
                ;;
-       -oss*)
-               os=-sysv3
+       triton*)
+               os=sysv3
                ;;
-       -svr4)
-               os=-sysv4
+       oss*)
+               os=sysv3
                ;;
-       -svr3)
-               os=-sysv3
+       svr4*)
+               os=sysv4
                ;;
-       -sysvr4)
-               os=-sysv4
+       svr3)
+               os=sysv3
                ;;
-       # This must come after -sysvr4.
-       -sysv*)
+       sysvr4)
+               os=sysv4
                ;;
-       -ose*)
-               os=-ose
+       # This must come after sysvr4.
+       sysv*)
                ;;
-       -es1800*)
-               os=-ose
+       ose*)
+               os=ose
                ;;
-       -xenix)
-               os=-xenix
+       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+               os=mint
                ;;
-       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
+       zvmoe)
+               os=zvmoe
                ;;
-       -aros*)
-               os=-aros
+       dicos*)
+               os=dicos
                ;;
-       -kaos*)
-               os=-kaos
+       pikeos*)
+               # Until real need of OS specific support for
+               # particular features comes up, bare metal
+               # configurations are quite functional.
+               case $cpu in
+                   arm*)
+                       os=eabi
+                       ;;
+                   *)
+                       os=elf
+                       ;;
+               esac
                ;;
-       -zvmoe)
-               os=-zvmoe
+       nacl*)
                ;;
-       -dicos*)
-               os=-dicos
+       ios)
                ;;
-       -nacl*)
+       none)
                ;;
-       -none)
+       *-eabi)
                ;;
        *)
-               # Get rid of the `-' at the beginning of $os.
-               os=`echo $os | sed 's/[^-]*-//'`
-               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
                exit 1
                ;;
 esac
@@ -1524,258 +1525,265 @@ else
 # will signal an error saying that MANUFACTURER isn't an operating
 # system, and we'll never get to this point.
 
-case $basic_machine in
+case $cpu-$vendor in
        score-*)
-               os=-elf
+               os=elf
                ;;
        spu-*)
-               os=-elf
+               os=elf
                ;;
        *-acorn)
-               os=-riscix1.2
+               os=riscix1.2
                ;;
        arm*-rebel)
-               os=-linux
+               os=linux
                ;;
        arm*-semi)
-               os=-aout
+               os=aout
                ;;
        c4x-* | tic4x-*)
-               os=-coff
+               os=coff
+               ;;
+       c8051-*)
+               os=elf
+               ;;
+       clipper-intergraph)
+               os=clix
                ;;
        hexagon-*)
-               os=-elf
+               os=elf
                ;;
        tic54x-*)
-               os=-coff
+               os=coff
                ;;
        tic55x-*)
-               os=-coff
+               os=coff
                ;;
        tic6x-*)
-               os=-coff
+               os=coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
-               os=-tops20
+               os=tops20
                ;;
        pdp11-*)
-               os=-none
+               os=none
                ;;
        *-dec | vax-*)
-               os=-ultrix4.2
+               os=ultrix4.2
                ;;
        m68*-apollo)
-               os=-domain
+               os=domain
                ;;
        i386-sun)
-               os=-sunos4.0.2
+               os=sunos4.0.2
                ;;
        m68000-sun)
-               os=-sunos3
+               os=sunos3
                ;;
        m68*-cisco)
-               os=-aout
+               os=aout
                ;;
        mep-*)
-               os=-elf
+               os=elf
                ;;
        mips*-cisco)
-               os=-elf
+               os=elf
                ;;
        mips*-*)
-               os=-elf
+               os=elf
                ;;
        or32-*)
-               os=-coff
+               os=coff
                ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
-               os=-sysv3
+               os=sysv3
                ;;
        sparc-* | *-sun)
-               os=-sunos4.1.1
+               os=sunos4.1.1
                ;;
-       *-be)
-               os=-beos
+       pru-*)
+               os=elf
                ;;
-       *-haiku)
-               os=-haiku
+       *-be)
+               os=beos
                ;;
        *-ibm)
-               os=-aix
+               os=aix
                ;;
        *-knuth)
-               os=-mmixware
+               os=mmixware
                ;;
        *-wec)
-               os=-proelf
+               os=proelf
                ;;
        *-winbond)
-               os=-proelf
+               os=proelf
                ;;
        *-oki)
-               os=-proelf
+               os=proelf
                ;;
        *-hp)
-               os=-hpux
+               os=hpux
                ;;
        *-hitachi)
-               os=-hiux
+               os=hiux
                ;;
        i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-               os=-sysv
+               os=sysv
                ;;
        *-cbm)
-               os=-amigaos
+               os=amigaos
                ;;
        *-dg)
-               os=-dgux
+               os=dgux
                ;;
        *-dolphin)
-               os=-sysv3
+               os=sysv3
                ;;
        m68k-ccur)
-               os=-rtu
+               os=rtu
                ;;
        m88k-omron*)
-               os=-luna
+               os=luna
                ;;
-       *-next )
-               os=-nextstep
+       *-next)
+               os=nextstep
                ;;
        *-sequent)
-               os=-ptx
+               os=ptx
                ;;
        *-crds)
-               os=-unos
+               os=unos
                ;;
        *-ns)
-               os=-genix
+               os=genix
                ;;
        i370-*)
-               os=-mvs
-               ;;
-       *-next)
-               os=-nextstep3
+               os=mvs
                ;;
        *-gould)
-               os=-sysv
+               os=sysv
                ;;
        *-highlevel)
-               os=-bsd
+               os=bsd
                ;;
        *-encore)
-               os=-bsd
+               os=bsd
                ;;
        *-sgi)
-               os=-irix
+               os=irix
                ;;
        *-siemens)
-               os=-sysv4
+               os=sysv4
                ;;
        *-masscomp)
-               os=-rtu
+               os=rtu
                ;;
        f30[01]-fujitsu | f700-fujitsu)
-               os=-uxpv
+               os=uxpv
                ;;
        *-rom68k)
-               os=-coff
+               os=coff
                ;;
        *-*bug)
-               os=-coff
+               os=coff
                ;;
        *-apple)
-               os=-macos
+               os=macos
                ;;
        *-atari*)
-               os=-mint
+               os=mint
+               ;;
+       *-wrs)
+               os=vxworks
                ;;
        *)
-               os=-none
+               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 $vendor in
+       unknown)
                case $os in
-                       -riscix*)
+                       riscix*)
                                vendor=acorn
                                ;;
-                       -sunos*)
+                       sunos*)
                                vendor=sun
                                ;;
-                       -cnk*|-aix*)
+                       cnk*|-aix*)
                                vendor=ibm
                                ;;
-                       -beos*)
+                       beos*)
                                vendor=be
                                ;;
-                       -hpux*)
+                       hpux*)
                                vendor=hp
                                ;;
-                       -mpeix*)
+                       mpeix*)
                                vendor=hp
                                ;;
-                       -hiux*)
+                       hiux*)
                                vendor=hitachi
                                ;;
-                       -unos*)
+                       unos*)
                                vendor=crds
                                ;;
-                       -dgux*)
+                       dgux*)
                                vendor=dg
                                ;;
-                       -luna*)
+                       luna*)
                                vendor=omron
                                ;;
-                       -genix*)
+                       genix*)
                                vendor=ns
                                ;;
-                       -mvs* | -opened*)
+                       clix*)
+                               vendor=intergraph
+                               ;;
+                       mvs* | opened*)
                                vendor=ibm
                                ;;
-                       -os400*)
+                       os400*)
                                vendor=ibm
                                ;;
-                       -ptx*)
+                       ptx*)
                                vendor=sequent
                                ;;
-                       -tpf*)
+                       tpf*)
                                vendor=ibm
                                ;;
-                       -vxsim* | -vxworks* | -windiss*)
+                       vxsim* | vxworks* | windiss*)
                                vendor=wrs
                                ;;
-                       -aux*)
+                       aux*)
                                vendor=apple
                                ;;
-                       -hms*)
+                       hms*)
                                vendor=hitachi
                                ;;
-                       -mpw* | -macos*)
+                       mpw* | macos*)
                                vendor=apple
                                ;;
-                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
                                vendor=atari
                                ;;
-                       -vos*)
+                       vos*)
                                vendor=stratus
                                ;;
                esac
-               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
 esac
 
-echo $basic_machine$os
+echo "$cpu-$vendor-$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index baa78df..b00670b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for alsa-utils 1.0.29.
+# Generated by GNU Autoconf 2.69 for alsa-utils 1.2.12.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -196,7 +196,15 @@ test -x / || exit 1"
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
+test \$(( 1 + 1 )) = 2 || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
   if (eval "$as_required") 2>/dev/null; then :
   as_have_required=yes
 else
@@ -553,6 +561,8 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 # Sed expression to map a string onto a valid variable name.
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
+SHELL=${CONFIG_SHELL-/bin/sh}
+
 
 test -n "$DJDIR" || exec 7<&0 </dev/null
 exec 6>&1
@@ -577,8 +587,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='alsa-utils'
 PACKAGE_TARNAME='alsa-utils'
-PACKAGE_VERSION='1.0.29'
-PACKAGE_STRING='alsa-utils 1.0.29'
+PACKAGE_VERSION='1.2.12'
+PACKAGE_STRING='alsa-utils 1.2.12'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -625,6 +635,7 @@ ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+ALSA_TOPOLOGY_PLUGIN_DIR
 ALSACTL_DAEMONSWITCH
 ALSACTL_PIDFILE_DIR
 ASOUND_LOCK_DIR
@@ -632,6 +643,8 @@ ASOUND_STATE_DIR
 HAVE_SYSTEMD_FALSE
 HAVE_SYSTEMD_TRUE
 systemdsystemunitdir
+SYSTEMD_LIBS
+SYSTEMD_CFLAGS
 LIBRT
 SND_UTIL_SUBMINOR
 SND_UTIL_MINOR
@@ -649,17 +662,35 @@ ncursesw5_config
 NCURSESW_LIBS
 NCURSESW_CFLAGS
 udevrulesdir
+USE_RST2MAN_FALSE
+USE_RST2MAN_TRUE
+rst2man_available
 USE_XMLTO_FALSE
 USE_XMLTO_TRUE
-xmlto
+xmlto_available
+NHLT_FALSE
+NHLT_TRUE
 ALSALOOP_FALSE
 ALSALOOP_TRUE
 ALSACONF_FALSE
 ALSACONF_TRUE
 ALSAMIXER_FALSE
 ALSAMIXER_TRUE
+HAVE_LIBTINYALSA_FALSE
+HAVE_LIBTINYALSA_TRUE
+HAVE_LIBFFTW3_FALSE
+HAVE_LIBFFTW3_TRUE
+FFTW_CFLAGS
+FFTW_LIB
+FFTW_INC
+BAT_FALSE
+BAT_TRUE
+HAVE_FFADO_FALSE
+HAVE_FFADO_TRUE
 HAVE_SAMPLERATE_FALSE
 HAVE_SAMPLERATE_TRUE
+HAVE_TOPOLOGY_FALSE
+HAVE_TOPOLOGY_TRUE
 HAVE_UCM_FALSE
 HAVE_UCM_TRUE
 HAVE_SEQ_FALSE
@@ -670,12 +701,30 @@ HAVE_MIXER_FALSE
 HAVE_MIXER_TRUE
 HAVE_PCM_FALSE
 HAVE_PCM_TRUE
+ALSA_TOPOLOGY_LIBS
 ALSA_LIBS
 ALSA_CFLAGS
 PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
-SED
+LT_SYS_LIBRARY_PATH
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+LIBTOOL
 LN_S
 POSUB
 LTLIBINTL
@@ -702,7 +751,6 @@ am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
-am__quote
 am__include
 DEPDIR
 OBJEXT
@@ -713,18 +761,23 @@ LDFLAGS
 CFLAGS
 CC
 XGETTEXT_EXTRA_OPTIONS
+MSGMERGE_FOR_MSGFMT_OPTION
 MSGMERGE
 XGETTEXT_015
 XGETTEXT
 GMSGFMT_015
-MSGFMT_015
 GMSGFMT
 MSGFMT
 GETTEXT_MACRO_VERSION
 USE_NLS
+SED
 MAINT
 MAINTAINER_MODE_FALSE
 MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -767,6 +820,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -785,10 +839,12 @@ PACKAGE_VERSION
 PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_silent_rules
 enable_maintainer_mode
 enable_nls
 enable_dependency_tracking
@@ -796,14 +852,26 @@ with_gnu_ld
 enable_rpath
 with_libiconv_prefix
 with_libintl_prefix
+enable_static
+enable_shared
+with_pic
+enable_fast_install
+with_aix_soname
+with_sysroot
+enable_libtool_lock
 with_alsa_prefix
 with_alsa_inc_prefix
+enable_alsa_topology
 enable_alsatest
+enable_alsabat_backend_tiny
+enable_bat
 with_librt
 enable_alsamixer
 enable_alsaconf
 enable_alsaloop
+enable_nhlt
 enable_xmlto
+enable_rst2man
 with_udev_rules_dir
 with_curses
 with_testsound
@@ -813,6 +881,7 @@ with_asound_state_dir
 with_alsactl_lock_dir
 with_alsactl_pidfile_dir
 with_alsactl_daemonswitch
+with_plugindir
 '
       ac_precious_vars='build_alias
 host_alias
@@ -823,13 +892,16 @@ LDFLAGS
 LIBS
 CPPFLAGS
 CPP
+LT_SYS_LIBRARY_PATH
 PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
 NCURSESW_CFLAGS
 NCURSESW_LIBS
 NCURSES_CFLAGS
-NCURSES_LIBS'
+NCURSES_LIBS
+SYSTEMD_CFLAGS
+SYSTEMD_LIBS'
 
 
 # Initialize some variables set by options.
@@ -868,6 +940,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1120,6 +1193,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1257,7 +1339,7 @@ fi
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir
+               libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1370,7 +1452,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures alsa-utils 1.0.29 to adapt to many kinds of systems.
+\`configure' configures alsa-utils 1.2.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1410,6 +1492,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1440,7 +1523,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of alsa-utils 1.0.29:";;
+     short | recursive ) echo "Configuration of alsa-utils 1.2.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1448,6 +1531,8 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
   --disable-maintainer-mode
                           disable make rules and dependencies not useful (and
                           sometimes confusing) to the casual installer
@@ -1457,23 +1542,43 @@ Optional Features:
   --disable-dependency-tracking
                           speeds up one-time build
   --disable-rpath         do not hardcode runtime library paths
+  --enable-static[=PKGS]  build static libraries [default=no]
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-alsatopology   Force to use the Alsa topology library
   --disable-alsatest      Do not try to compile and run a test Alsa program
+  --enable-alsabat-backend-tiny
+                          Use tinyalsa for alsabat backend
+  --disable-bat           Disable bat compilation
   --disable-alsamixer     Disable alsamixer compilation
   --disable-alsaconf      Disable alsaconf packaging
   --disable-alsaloop      Disable alsaloop packaging
+  --disable-nhlt          Disable nhlt packaging
   --disable-xmlto         Disable man page creation via xmlto
+  --disable-rst2man       Disable man page creation via rst2man
   --disable-largefile     omit support for large files
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-gnu-ld           assume the C compiler uses GNU ld default=no
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
   --without-libintl-prefix     don't search for libintl in includedir and libdir
+  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-aix-soname=aix|svr4|both
+                          shared library versioning (aka "SONAME") variant to
+                          provide on AIX, [default=aix].
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
+                          compiler's sysroot if not specified).
   --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)
-  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)
+  --with-alsa-inc-prefix=PFX
+                          Prefix where include libraries are (optional)
   --with-librt            Use librt for monotonic clock (default = yes)
   --with-udev-rules-dir=DIR
                           Directory where to install udev rules to
@@ -1490,6 +1595,7 @@ Optional Packages:
                           Directory to place alsactl.pid file in
   --with-alsactl-daemonswitch=FILE
                           File to test for the daemon mode
+  --with-plugindir=dir    path where pre-process plugin files are stored
 
 Some influential environment variables:
   CC          C compiler command
@@ -1500,6 +1606,8 @@ Some influential environment variables:
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  LT_SYS_LIBRARY_PATH
+              User-defined run-time library search path.
   PKG_CONFIG  path to pkg-config utility
   PKG_CONFIG_PATH
               directories to add to pkg-config's search path
@@ -1513,6 +1621,10 @@ Some influential environment variables:
               C compiler flags for NCURSES, overriding pkg-config
   NCURSES_LIBS
               linker flags for NCURSES, overriding pkg-config
+  SYSTEMD_CFLAGS
+              C compiler flags for SYSTEMD, overriding pkg-config
+  SYSTEMD_LIBS
+              linker flags for SYSTEMD, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1580,7 +1692,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-alsa-utils configure 1.0.29
+alsa-utils configure 1.2.12
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1757,6 +1869,37 @@ fi
 
 } # ac_fn_c_try_run
 
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
 # ac_fn_c_check_func LINENO FUNC VAR
 # ----------------------------------
 # Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -1824,37 +1967,6 @@ $as_echo "$ac_res" >&6; }
 
 } # ac_fn_c_check_func
 
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
 # -------------------------------------------------------
 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
@@ -1945,7 +2057,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by alsa-utils $as_me 1.0.29, which was
+It was created by alsa-utils $as_me 1.2.12, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2296,7 +2408,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-am__api_version='1.12'
+am__api_version='1.16'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2497,8 +2609,8 @@ test "$program_suffix" != NONE &&
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 if test x"${MISSING+set}" != xset; then
   case $am_aux_dir in
@@ -2509,15 +2621,15 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\    *)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -2750,6 +2862,45 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
@@ -2772,7 +2923,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='alsa-utils'
- VERSION='1.0.29'
+ VERSION='1.2.12'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2802,16 +2953,20 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
 
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
 am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
@@ -2819,6 +2974,49 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
+
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
@@ -2843,13 +3041,75 @@ fi
 
 
 
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
 $as_echo_n "checking whether NLS is requested... " >&6; }
@@ -2866,7 +3126,7 @@ $as_echo "$USE_NLS" >&6; }
 
 
 
-      GETTEXT_MACRO_VERSION=0.18
+      GETTEXT_MACRO_VERSION=0.20
 
 
 
@@ -2874,15 +3134,14 @@ $as_echo "$USE_NLS" >&6; }
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
 
 # Find out how to test for executable files. Don't use a zero-byte file,
@@ -2982,12 +3241,7 @@ fi
 
 
 
-    case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
-    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
-    *) MSGFMT_015=$MSGFMT ;;
-  esac
-
-  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
     *) GMSGFMT_015=$GMSGFMT ;;
   esac
@@ -2997,15 +3251,14 @@ fi
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
 
 # Find out how to test for executable files. Don't use a zero-byte file,
@@ -3075,15 +3328,14 @@ fi
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
 
 # Find out how to test for executable files. Don't use a zero-byte file,
@@ -3141,7 +3393,15 @@ $as_echo "no" >&6; }
 fi
 
 
-        test -n "$localedir" || localedir='${datadir}/locale'
+    if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
+    MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
+  else
+        if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
+      MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
+    else
+                        MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
+    fi
+  fi
 
 
     test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
@@ -3170,45 +3430,45 @@ DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
      ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
 
 # Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then :
@@ -4018,6 +4278,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
@@ -4218,6 +4537,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
+
+
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
@@ -4228,48 +4549,22 @@ fi
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
-$as_echo_n "checking for ld used by GCC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | [A-Za-z]:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
+
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld" >&5
+$as_echo_n "checking for ld... " >&6; }
+elif test "$GCC" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
 elif test "$with_gnu_ld" = yes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
@@ -4277,52 +4572,142 @@ else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
 $as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-if ${acl_cv_path_LD+:} false; then :
+if test -n "$LD"; then
+  # Let the user override the test with a path.
+  :
+else
+  if ${acl_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
-      *GNU* | *'with BFD'*)
-        test "$with_gnu_ld" != no && break ;;
-      *)
-        test "$with_gnu_ld" != yes && break ;;
+
+    acl_cv_path_LD= # Final result of this test
+    ac_prog=ld # Program to search in $PATH
+    if test "$GCC" = yes; then
+      # Check if gcc -print-prog-name=ld gives a path.
+      case $host in
+        *-*-mingw*)
+          # gcc leaves a trailing carriage return which upsets mingw
+          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+        *)
+          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+      esac
+      case $acl_output in
+        # Accept absolute paths.
+        [\\/]* | ?:[\\/]*)
+          re_direlt='/[^/][^/]*/\.\./'
+          # Canonicalize the pathname of ld
+          acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+          while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+            acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+          done
+          # Got the pathname. No search in PATH is needed.
+          acl_cv_path_LD="$acl_output"
+          ac_prog=
+          ;;
+        "")
+          # If it fails, then pretend we aren't using GCC.
+          ;;
+        *)
+          # If it is relative, then search for the first ld in PATH.
+          with_gnu_ld=unknown
+          ;;
       esac
     fi
-  done
-  IFS="$ac_save_ifs"
+    if test -n "$ac_prog"; then
+      # Search for $ac_prog in $PATH.
+      acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+      for ac_dir in $PATH; do
+        IFS="$acl_save_ifs"
+        test -z "$ac_dir" && ac_dir=.
+        if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+          acl_cv_path_LD="$ac_dir/$ac_prog"
+          # Check to see if the program is GNU ld.  I'd rather use --version,
+          # but apparently some variants of GNU ld only accept -v.
+          # Break only if it was the GNU/non-GNU ld that we prefer.
+          case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+            *GNU* | *'with BFD'*)
+              test "$with_gnu_ld" != no && break
+              ;;
+            *)
+              test "$with_gnu_ld" != yes && break
+              ;;
+          esac
+        fi
+      done
+      IFS="$acl_save_ifs"
+    fi
+    case $host in
+      *-*-aix*)
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __powerpc64__ || defined _ARCH_PPC64
+                int ok;
+               #else
+                error fail
+               #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # The compiler produces 64-bit code. Add option '-b64' so that the
+           # linker groks 64-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -b64 "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+           esac
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        ;;
+      sparc64-*-netbsd*)
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __sparcv9 || defined __arch64__
+                int ok;
+               #else
+                error fail
+               #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
 else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+  # The compiler produces 32-bit code. Add option '-m elf32_sparc'
+           # so that the linker groks 32-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -m elf32_sparc "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+           esac
+
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        ;;
+    esac
+
 fi
 
-LD="$acl_cv_path_LD"
+  LD="$acl_cv_path_LD"
+fi
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+  as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
 fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
 if ${acl_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
-  acl_cv_prog_gnu_ld=yes ;;
+  acl_cv_prog_gnu_ld=yes
+  ;;
 *)
-  acl_cv_prog_gnu_ld=no ;;
+  acl_cv_prog_gnu_ld=no
+  ;;
 esac
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
@@ -4365,6 +4750,265 @@ fi
 
 
 
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5
+$as_echo_n "checking 32-bit host C ABI... " >&6; }
+if ${gl_cv_host_cpu_c_abi_32bit+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$gl_cv_host_cpu_c_abi"; then
+       case "$gl_cv_host_cpu_c_abi" in
+         i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+           gl_cv_host_cpu_c_abi_32bit=yes ;;
+         x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+           gl_cv_host_cpu_c_abi_32bit=no ;;
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown ;;
+       esac
+     else
+       case "$host_cpu" in
+
+         # CPUs that only support a 32-bit ABI.
+         arc \
+         | bfin \
+         | cris* \
+         | csky \
+         | epiphany \
+         | ft32 \
+         | h8300 \
+         | m68k \
+         | microblaze | microblazeel \
+         | nds32 | nds32le | nds32be \
+         | nios2 | nios2eb | nios2el \
+         | or1k* \
+         | or32 \
+         | sh | sh1234 | sh1234elb \
+         | tic6x \
+         | xtensa* )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         # CPUs that only support a 64-bit ABI.
+         alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+         | mmix )
+           gl_cv_host_cpu_c_abi_32bit=no
+           ;;
+
+         i[34567]86 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         x86_64 )
+           # On x86_64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+           # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+           #   with native Windows (mingw, MSVC).
+           # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if (defined __x86_64__ || defined __amd64__ \
+                       || defined _M_X64 || defined _M_AMD64) \
+                      && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         arm* | aarch64 )
+           # Assume arm with EABI.
+           # On arm64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+           # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+           # On hppa, the C compiler may be generating 32-bit code or 64-bit
+           # code. In the latter case, it defines _LP64 and __LP64__.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         ia64* )
+           # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+           # 32-bit code. In the latter case, it defines _ILP32.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=yes
+else
+  gl_cv_host_cpu_c_abi_32bit=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         mips* )
+           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+           # at 32.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         powerpc* )
+           # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+           # No need to distinguish them here; the caller may distinguish
+           # them based on the OS.
+           # On powerpc64 systems, the C compiler may still be generating
+           # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+           # be generating 64-bit code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __powerpc64__ || defined _ARCH_PPC64
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         rs6000 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         riscv32 | riscv64 )
+           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+           # Size of 'long' and 'void *':
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         s390* )
+           # On s390x, the C compiler may be generating 64-bit (= s390x) code
+           # or 31-bit (= s390) code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__ || defined __s390x__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         sparc | sparc64 )
+           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+           # C compiler still generates 32-bit code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __sparcv9 || defined __arch64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown
+           ;;
+       esac
+     fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5
+$as_echo "$gl_cv_host_cpu_c_abi_32bit" >&6; }
+
+  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4635,67 +5279,152 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 
 
-  acl_libdirstem=lib
-  acl_libdirstem2=
-  case "$host_os" in
-    solaris*)
-                                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
-$as_echo_n "checking for 64-bit host... " >&6; }
-if ${gl_cv_solaris_64bit+:} false; then :
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5
+$as_echo_n "checking for ELF binary format... " >&6; }
+if ${gl_cv_elf+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#ifdef _LP64
-sixtyfour bits
-#endif
+#ifdef __ELF__
+        Extensible Linking Format
+        #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "sixtyfour bits" >/dev/null 2>&1; then :
-  gl_cv_solaris_64bit=yes
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
+  gl_cv_elf=yes
 else
-  gl_cv_solaris_64bit=no
+  gl_cv_elf=no
 fi
 rm -f conftest*
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
-$as_echo "$gl_cv_solaris_64bit" >&6; }
-      if test $gl_cv_solaris_64bit = yes; then
-        acl_libdirstem=lib/64
-        case "$host_cpu" in
-          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
-          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
-        esac
-      fi
-      ;;
-    *)
-      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
-      if test -n "$searchpath"; then
-        acl_save_IFS="${IFS=   }"; IFS=":"
-        for searchdir in $searchpath; do
-          if test -d "$searchdir"; then
-            case "$searchdir" in
-              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
-              */../ | */.. )
-                # Better ignore directories of this form. They are misleading.
-                ;;
-              *) searchdir=`cd "$searchdir" && pwd`
-                 case "$searchdir" in
-                   */lib64 ) acl_libdirstem=lib64 ;;
-                 esac ;;
-            esac
-          fi
-        done
-        IFS="$acl_save_IFS"
-      fi
-      ;;
-  esac
-  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5
+$as_echo "$gl_cv_elf" >&6; }
+  if test $gl_cv_elf; then
+    # Extract the ELF class of a file (5th byte) in decimal.
+    # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+    if od -A x < /dev/null >/dev/null 2>/dev/null; then
+      # Use POSIX od.
+      func_elfclass ()
+      {
+        od -A n -t d1 -j 4 -N 1
+      }
+    else
+      # Use BSD hexdump.
+      func_elfclass ()
+      {
+        dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+        echo
+      }
+    fi
+    case $HOST_CPU_C_ABI_32BIT in
+      yes)
+        # 32-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          test "`func_elfclass | sed -e 's/[   ]//g'`" = 1
+        }
+        ;;
+      no)
+        # 64-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          test "`func_elfclass | sed -e 's/[   ]//g'`" = 2
+        }
+        ;;
+      *)
+        # Unknown.
+        acl_is_expected_elfclass ()
+        {
+          :
+        }
+        ;;
+    esac
+  else
+    acl_is_expected_elfclass ()
+    {
+      :
+    }
+  fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5
+$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; }
+if ${acl_cv_libdirstems+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            acl_libdirstem=lib
+     acl_libdirstem2=
+     acl_libdirstem3=
+     case "$host_os" in
+       solaris*)
+                                                      if test $HOST_CPU_C_ABI_32BIT = no; then
+           acl_libdirstem2=lib/64
+           case "$host_cpu" in
+             sparc*)        acl_libdirstem3=lib/sparcv9 ;;
+             i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+           esac
+         fi
+         ;;
+       *)
+                                                                                 searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+                     | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+         if test $HOST_CPU_C_ABI_32BIT != no; then
+           # 32-bit or unknown ABI.
+           if test -d /usr/lib32; then
+             acl_libdirstem2=lib32
+           fi
+         fi
+         if test $HOST_CPU_C_ABI_32BIT != yes; then
+           # 64-bit or unknown ABI.
+           if test -d /usr/lib64; then
+             acl_libdirstem3=lib64
+           fi
+         fi
+         if test -n "$searchpath"; then
+           acl_save_IFS="${IFS=        }"; IFS=":"
+           for searchdir in $searchpath; do
+             if test -d "$searchdir"; then
+               case "$searchdir" in
+                 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+                 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+                 */../ | */.. )
+                   # Better ignore directories of this form. They are misleading.
+                   ;;
+                 *) searchdir=`cd "$searchdir" && pwd`
+                    case "$searchdir" in
+                      */lib32 ) acl_libdirstem2=lib32 ;;
+                      */lib64 ) acl_libdirstem3=lib64 ;;
+                    esac ;;
+               esac
+             fi
+           done
+           IFS="$acl_save_IFS"
+           if test $HOST_CPU_C_ABI_32BIT = yes; then
+             # 32-bit ABI.
+             acl_libdirstem3=
+           fi
+           if test $HOST_CPU_C_ABI_32BIT = no; then
+             # 64-bit ABI.
+             acl_libdirstem2=
+           fi
+         fi
+         ;;
+     esac
+     test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+     test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+     acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5
+$as_echo "$acl_cv_libdirstems" >&6; }
+      acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+  acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+  acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
 
 
 
@@ -4716,6 +5445,8 @@ $as_echo "$gl_cv_solaris_64bit" >&6; }
 
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
@@ -4736,6 +5467,8 @@ if test "${with_libiconv_prefix+set}" = set; then :
 
           eval additional_includedir=\"$includedir\"
           eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
@@ -4743,15 +5476,19 @@ if test "${with_libiconv_prefix+set}" = set; then :
       else
         additional_includedir="$withval/include"
         additional_libdir="$withval/$acl_libdirstem"
-        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
-          additional_libdir="$withval/$acl_libdirstem2"
-        fi
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
       fi
     fi
 
 fi
 
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
       LIBICONV=
   LTLIBICONV=
   INCICONV=
@@ -4774,7 +5511,7 @@ fi
       done
       if test -z "$already_handled"; then
         names_already_handled="$names_already_handled $name"
-                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
         eval value=\"\$HAVE_LIB$uppername\"
         if test -n "$value"; then
           if test "$value" = yes; then
@@ -4797,45 +5534,51 @@ fi
             shrext=
           fi
           if test $use_additional = yes; then
-            dir="$additional_libdir"
-                                    if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                                                      if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
                   fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
+                      found_a="$dir/$libname.$acl_libext"
                     fi
-                  done
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                 fi
               fi
-            fi
-                        if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
-              fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
-              fi
-            fi
+            done
           fi
           if test "X$found_dir" = "X"; then
             for x in $LDFLAGS $LTLIBICONV; do
@@ -4852,7 +5595,7 @@ fi
                 -L*)
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
                                     if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
                       found_so="$dir/$libname$shrext"
                     else
@@ -4862,14 +5605,14 @@ fi
                               | sed -e "s,^$libname$shrext\\\\.,," \
                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
                               | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
                           found_dir="$dir"
                           found_so="$dir/$libname$shrext.$ver"
                         fi
                       else
                         eval library_names=\"$acl_library_names_spec\"
                         for f in $library_names; do
-                          if test -f "$dir/$f"; then
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
                             found_dir="$dir"
                             found_so="$dir/$f"
                             break
@@ -4879,7 +5622,7 @@ fi
                     fi
                   fi
                                     if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
                       found_a="$dir/$libname.$acl_libext"
                     fi
@@ -4901,7 +5644,8 @@ fi
             if test "X$found_so" != "X"; then
                                                         if test "$enable_rpath" = no \
                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
                                 LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
               else
                                                                                 haveit=
@@ -4980,6 +5724,13 @@ fi
                 fi
                 additional_includedir="$basedir/include"
                 ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = 'iconv'; then
+                  LIBICONV_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
             esac
             if test "X$additional_includedir" != "X"; then
                                                                                                                 if test "X$additional_includedir" != "X/usr/include"; then
@@ -5025,12 +5776,14 @@ fi
                             for dep in $dependency_libs; do
                 case "$dep" in
                   -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
                         if test -n "$GCC"; then
                           case $host_os in
                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -5049,14 +5802,14 @@ fi
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_libdir"
                           fi
                         fi
                         haveit=
@@ -5070,14 +5823,14 @@ fi
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_libdir"
                           fi
                         fi
                       fi
@@ -5184,8 +5937,6 @@ fi
 
 
 
-
-
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
 if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then :
@@ -5220,9 +5971,9 @@ $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
 $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
 
   fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5
-$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; }
-if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then :
+                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5
+$as_echo_n "checking for CFLocaleCopyPreferredLanguages... " >&6; }
+if ${gt_cv_func_CFLocaleCopyPreferredLanguages+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   gt_save_LIBS="$LIBS"
@@ -5233,29 +5984,30 @@ else
 int
 main ()
 {
-CFLocaleCopyCurrent();
+CFLocaleCopyPreferredLanguages();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_func_CFLocaleCopyCurrent=yes
+  gt_cv_func_CFLocaleCopyPreferredLanguages=yes
 else
-  gt_cv_func_CFLocaleCopyCurrent=no
+  gt_cv_func_CFLocaleCopyPreferredLanguages=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
      LIBS="$gt_save_LIBS"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
-$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
-  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5
+$as_echo "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; }
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
 
-$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
+$as_echo "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h
 
   fi
   INTL_MACOSX_LIBS=
-  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
     INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
   fi
 
@@ -5303,15 +6055,24 @@ if eval \${$gt_func_gnugettext_libc+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <libintl.h>
-$gt_revision_test_code
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern int *_nl_domain_bindings;
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
 int
 main ()
 {
+
 bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
   ;
   return 0;
 }
@@ -5369,14 +6130,16 @@ else
     am_cv_lib_iconv=no
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdlib.h>
 #include <iconv.h>
+
 int
 main ()
 {
 iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);
   ;
   return 0;
 }
@@ -5391,14 +6154,16 @@ rm -f core conftest.err conftest.$ac_objext \
       LIBS="$LIBS $LIBICONV"
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdlib.h>
 #include <iconv.h>
+
 int
 main ()
 {
 iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);
   ;
   return 0;
 }
@@ -5422,40 +6187,50 @@ if ${am_cv_func_iconv_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-            am_save_LIBS="$LIBS"
+                  am_save_LIBS="$LIBS"
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
       fi
-      if test "$cross_compiling" = yes; then :
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        if test "$cross_compiling" = yes; then :
   case "$host_os" in
-           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
-           *)            am_cv_func_iconv_works="guessing yes" ;;
-         esac
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <iconv.h>
 #include <string.h>
-int main ()
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main ()
 {
+int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
     if (cd_utf8_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\342\202\254"; /* EURO SIGN */
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_utf8_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
       }
   }
   /* Test against Solaris 10 bug: Failures are not distinguishable from
@@ -5464,17 +6239,37 @@ int main ()
     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
     if (cd_ascii_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\263";
+        static ICONV_CONST char input[] = "\263";
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_ascii_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #if 0 /* This bug could be worked around by the caller.  */
@@ -5483,43 +6278,59 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
         char buf[50];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
-          return 1;
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #endif
   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
      provided.  */
-  if (/* Try standardized names.  */
-      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
-      /* Try IRIX, OSF/1 names.  */
-      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
-      /* Try AIX names.  */
-      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
-      /* Try HP-UX names.  */
-      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+
+  ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   am_cv_func_iconv_works=yes
-else
-  am_cv_func_iconv_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+        test "$am_cv_func_iconv_works" = no || break
+      done
       LIBS="$am_save_LIBS"
 
 fi
@@ -5557,7 +6368,6 @@ $as_echo "$LIBICONV" >&6; }
 
 
 
-
     use_additional=yes
 
   acl_save_prefix="$prefix"
@@ -5567,6 +6377,8 @@ $as_echo "$LIBICONV" >&6; }
 
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
@@ -5587,6 +6399,8 @@ if test "${with_libintl_prefix+set}" = set; then :
 
           eval additional_includedir=\"$includedir\"
           eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
@@ -5594,15 +6408,19 @@ if test "${with_libintl_prefix+set}" = set; then :
       else
         additional_includedir="$withval/include"
         additional_libdir="$withval/$acl_libdirstem"
-        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
-          additional_libdir="$withval/$acl_libdirstem2"
-        fi
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
       fi
     fi
 
 fi
 
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
       LIBINTL=
   LTLIBINTL=
   INCINTL=
@@ -5625,7 +6443,7 @@ fi
       done
       if test -z "$already_handled"; then
         names_already_handled="$names_already_handled $name"
-                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
         eval value=\"\$HAVE_LIB$uppername\"
         if test -n "$value"; then
           if test "$value" = yes; then
@@ -5648,45 +6466,51 @@ fi
             shrext=
           fi
           if test $use_additional = yes; then
-            dir="$additional_libdir"
-                                    if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
-                  fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                                                      if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
-                    fi
-                  done
-                fi
-              fi
-            fi
-                        if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
-              fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
-              fi
-            fi
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                fi
+              fi
+            done
           fi
           if test "X$found_dir" = "X"; then
             for x in $LDFLAGS $LTLIBINTL; do
@@ -5703,7 +6527,7 @@ fi
                 -L*)
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
                                     if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
                       found_so="$dir/$libname$shrext"
                     else
@@ -5713,14 +6537,14 @@ fi
                               | sed -e "s,^$libname$shrext\\\\.,," \
                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
                               | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
                           found_dir="$dir"
                           found_so="$dir/$libname$shrext.$ver"
                         fi
                       else
                         eval library_names=\"$acl_library_names_spec\"
                         for f in $library_names; do
-                          if test -f "$dir/$f"; then
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
                             found_dir="$dir"
                             found_so="$dir/$f"
                             break
@@ -5730,7 +6554,7 @@ fi
                     fi
                   fi
                                     if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
                       found_a="$dir/$libname.$acl_libext"
                     fi
@@ -5752,7 +6576,8 @@ fi
             if test "X$found_so" != "X"; then
                                                         if test "$enable_rpath" = no \
                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
                                 LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
               else
                                                                                 haveit=
@@ -5831,6 +6656,13 @@ fi
                 fi
                 additional_includedir="$basedir/include"
                 ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = 'intl'; then
+                  LIBINTL_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
             esac
             if test "X$additional_includedir" != "X"; then
                                                                                                                 if test "X$additional_includedir" != "X/usr/include"; then
@@ -5876,12 +6708,14 @@ fi
                             for dep in $dependency_libs; do
                 case "$dep" in
                   -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
                         if test -n "$GCC"; then
                           case $host_os in
                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -5900,14 +6734,14 @@ fi
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_libdir"
                           fi
                         fi
                         haveit=
@@ -5921,14 +6755,14 @@ fi
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_libdir"
                           fi
                         fi
                       fi
@@ -6011,7 +6845,6 @@ fi
 
 
 
-
           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5
 $as_echo_n "checking for GNU gettext in libintl... " >&6; }
 if eval \${$gt_func_gnugettext_libintl+:} false; then :
@@ -6023,19 +6856,28 @@ else
             LIBS="$LIBS $LIBINTL"
                         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <libintl.h>
-$gt_revision_test_code
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
 const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
 int
 main ()
 {
+
 bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
   ;
   return 0;
 }
@@ -6051,27 +6893,36 @@ rm -f core conftest.err conftest.$ac_objext \
               LIBS="$LIBS $LIBICONV"
               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <libintl.h>
-$gt_revision_test_code
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
 const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
 int
 main ()
 {
+
 bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   LIBINTL="$LIBINTL $LIBICONV"
-                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
-                eval "$gt_func_gnugettext_libintl=yes"
+                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                 eval "$gt_func_gnugettext_libintl=yes"
 
 fi
 rm -f core conftest.err conftest.$ac_objext \
@@ -6192,21 +7043,6 @@ $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h
 
 
 
-if test "x$target" != "x$host" -a -z "`echo $CC | grep -e '-gcc'`";
-then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compiler" >&5
-$as_echo_n "checking for cross-compiler... " >&6; }
-
-  which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
-  which ${target_cpu}-${target_os}-gcc >/dev/null 2>&1 \
-  && CC=${target_cpu}-${target-os}-gcc
-  which ${target_cpu}-${target_vendor}-${target_os}-gcc >/dev/null 2>&1 \
-  && CC=${target_cpu}-${target_vendor}-${target_os}-gcc
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-fi
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -6746,6 +7582,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
@@ -6956,268 +7851,8592 @@ $as_echo "$ac_cv_path_SED" >&6; }
  SED="$ac_cv_path_SED"
   rm -f conftest.sed
 
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+       IFS=$lt_save_ifs
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac
+else
+  enable_static=no
+fi
 
 
 
 
 
 
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-       if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-  ;;
+
+
+case `pwd` in
+  *\ * | *\    *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
 esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+macro_version='2.4.6'
+macro_revision='2.4.6'
 
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
 
-fi
-if test -n "$PKG_CONFIG"; then
-       _pkg_min_version=0.9.0
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-               PKG_CONFIG=""
-       fi
-fi
-alsa_save_CFLAGS="$CFLAGS"
-alsa_save_LDFLAGS="$LDFLAGS"
-alsa_save_LIBS="$LIBS"
-alsa_found=yes
 
 
-# Check whether --with-alsa-prefix was given.
-if test "${with_alsa_prefix+set}" = set; then :
-  withval=$with_alsa_prefix; alsa_prefix="$withval"
-else
-  alsa_prefix=""
-fi
 
 
 
-# Check whether --with-alsa-inc-prefix was given.
-if test "${with_alsa_inc_prefix+set}" = set; then :
-  withval=$with_alsa_inc_prefix; alsa_inc_prefix="$withval"
-else
-  alsa_inc_prefix=""
-fi
 
 
-# Check whether --enable-alsatest was given.
-if test "${enable_alsatest+set}" = set; then :
-  enableval=$enable_alsatest; enable_alsatest="$enableval"
-else
-  enable_alsatest=yes
-fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA CFLAGS" >&5
-$as_echo_n "checking for ALSA CFLAGS... " >&6; }
-if test "$alsa_inc_prefix" != "" ; then
-       ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
-       CFLAGS="$CFLAGS -I$alsa_inc_prefix"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_CFLAGS" >&5
-$as_echo "$ALSA_CFLAGS" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA LDFLAGS" >&5
-$as_echo_n "checking for ALSA LDFLAGS... " >&6; }
-if test "$alsa_prefix" != "" ; then
-       ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
-       LDFLAGS="$LDFLAGS $ALSA_LIBS"
-fi
 
-ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
-LIBS="$ALSA_LIBS $LIBS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5
-$as_echo "$ALSA_LIBS" >&6; }
+ltmain=$ac_aux_dir/ltmain.sh
 
-if test "x$enable_alsatest" = "xyes"; then
-min_alsa_version=1.0.27
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libasound headers version >= $min_alsa_version" >&5
-$as_echo_n "checking for libasound headers version >= $min_alsa_version... " >&6; }
-no_alsa=""
-    alsa_min_major_version=`echo $min_alsa_version | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case $ECHO in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test yes = "$GCC"; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return, which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD=$ac_prog
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test yes = "$with_gnu_ld"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD=$ac_dir/$ac_prog
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test no != "$with_gnu_ld" && break
+       ;;
+      *)
+       test yes != "$with_gnu_ld" && break
+       ;;
+      esac
+    fi
+  done
+  IFS=$lt_save_ifs
+else
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi
+fi
+
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM=$NM
+else
+  lt_nm_to_check=${ac_tool_prefix}nm
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS=$lt_save_ifs
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+       case $build_os in
+       mingw*) lt_bad_file=conftest.nm/nofile ;;
+       *) lt_bad_file=/dev/null ;;
+       esac
+       case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+       *$lt_bad_file* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break 2
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break 2
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS=$lt_save_ifs
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols -headers"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring=ABCD
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test 17 != "$i" # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test yes != "$GCC"; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test 0 -eq "$ac_status"; then
+       # Ensure the archiver fails upon bogus file names.
+       rm -f conftest.$ac_objext libconftest.a
+       { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+       if test 0 -ne "$ac_status"; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test no = "$lt_cv_ar_at_file"; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  bitrig* | openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test ia64 = "$host_cpu"; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can'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
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_globsym_save_LIBS=$LIBS
+         lt_globsym_save_CFLAGS=$CFLAGS
+         LIBS=conftstm.$ac_objext
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+           pipe_works=yes
+         fi
+         LIBS=$lt_globsym_save_LIBS
+         CFLAGS=$lt_globsym_save_CFLAGS
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test yes = "$pipe_works"; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
+else
+  with_sysroot=no
+fi
+
+
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+   if test yes = "$GCC"; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+  ac_path_lt_DD_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in dd; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi
+      $ac_path_lt_DD_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_lt_DD"; then
+    :
+  fi
+else
+  ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE=32
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE=64
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+       emul="${emul}32"
+       ;;
+      *64-bit*)
+       emul="${emul}64"
+       ;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+       emul="${emul}btsmip"
+       ;;
+      *LSB*)
+       emul="${emul}ltsmip"
+       ;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+       emul="${emul}n32"
+       ;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
+           ;;
+         powerpc64le-*linux*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc64-*linux*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         powerpcle-*linux*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*linux*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test yes != "$lt_cv_cc_needs_belf"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS=$SAVE_CFLAGS
+  fi
+  ;;
+*-*solaris*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*)
+        case $host in
+        i?86-*-solaris*|x86_64-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD=${LD-ld}_sol2
+        fi
+        ;;
+      *)
+       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks=$enable_libtool_lock
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+  fi
+else
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test yes != "$lt_cv_path_mainfest_tool"; then
+  MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "$LT_MULTI_MODULE"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       # If there is a non-empty error log, and "single_module"
+       # appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+         cat conftest.err >&5
+       # Otherwise, if the output was created with a 0 exit code from
+       # the compiler, it worked.
+       elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+         lt_cv_apple_cc_single_mod=yes
+       else
+         cat conftest.err >&5
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+       cat conftest.err >&5
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+       lt_cv_ld_force_load=yes
+      else
+       cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+         _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+       10.[012][,.]*)
+         _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+    fi
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+       IFS=$lt_save_ifs
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for lt_pkg in $withval; do
+       IFS=$lt_save_ifs
+       if test "X$lt_pkg" = "X$lt_p"; then
+         pic_mode=yes
+       fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac
+else
+  pic_mode=default
+fi
+
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+       IFS=$lt_save_ifs
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+  shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+  withval=$with_aix_soname; case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname
+else
+  if ${lt_cv_with_aix_soname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_with_aix_soname=aix
+fi
+
+    with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test set != "${COLLECT_NAMES+set}"; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/${ac_tool_prefix}file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
+  ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
+  ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC=$CC
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test yes = "$GCC"; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+  if test yes = "$GCC"; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+       lt_prog_compiler_static='$wl-static'
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test ia64 = "$host_cpu"; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl='-Wl,-Wl,,'
+        lt_prog_compiler_pic='-PIC'
+        lt_prog_compiler_static='-Bstatic'
+        ;;
+      esac
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+       lt_prog_compiler_static='$wl-static'
+       ;;
+      esac
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='$wl-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64, which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='--shared'
+       lt_prog_compiler_static='--static'
+       ;;
+      nagfor*)
+       # NAG Fortran compiler
+       lt_prog_compiler_wl='-Wl,-Wl,,'
+       lt_prog_compiler_pic='-PIC'
+       lt_prog_compiler_static='-Bstatic'
+       ;;
+      tcc*)
+       # Fabrice Bellard et al's Tiny C Compiler
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fPIC'
+       lt_prog_compiler_static='-static'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-qpic'
+       lt_prog_compiler_static='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl=''
+         ;;
+       *Sun\ F* | *Sun*Fortran*)
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Qoption ld '
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+        *Intel*\ [CF]*Compiler*)
+         lt_prog_compiler_wl='-Wl,'
+         lt_prog_compiler_pic='-fPIC'
+         lt_prog_compiler_static='-static'
+         ;;
+       *Portland\ Group*)
+         lt_prog_compiler_wl='-Wl,'
+         lt_prog_compiler_pic='-fpic'
+         lt_prog_compiler_static='-Bstatic'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms that do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works"; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test yes != "$GCC"; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd* | bitrig*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test yes = "$with_gnu_ld"; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test yes = "$lt_use_gnu_ld_interface"; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='$wl'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec='$wl--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test ia64 != "$host_cpu"; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='$wl--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file, use it as
+       # is; otherwise, prepend EXPORTS...
+       archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[   ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([     ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+       $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+       $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+       $ECHO EXPORTS >> $output_objdir/$libname.def~
+       emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+       $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+       emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+       $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+       $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+       $ECHO EXPORTS >> $output_objdir/$libname.def~
+       prefix_cmds="$SED"~
+       if test EXPORTS = "`$SED 1q $export_symbols`"; then
+         prefix_cmds="$prefix_cmds -e 1d";
+       fi~
+       prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+       cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+       $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+       emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+      export_dynamic_flag_spec='$wl-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test linux-dietlibc = "$host_os"; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test no = "$tmp_diet"
+      then
+       tmp_addflag=' $pic_flag'
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec=
+         tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+         compiler_needs_object=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+         compiler_needs_object=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+        if test yes = "$supports_anon_versioning"; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       tcc*)
+         export_dynamic_flag_spec='-rdynamic'
+         ;;
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+         hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+         archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+         if test yes = "$supports_anon_versioning"; then
+           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test no = "$ld_shlibs"; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test ia64 = "$host_cpu"; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+       # Without the "-l" option, or with the "-B" option, AIX nm treats
+       # weak defined symbols like other global defined symbols, whereas
+       # GNU nm marks them as "W".
+       # While the 'weak' keyword is ignored in the Export File, we need
+       # it in the Import File for the 'aix-soname' feature, so we have
+       # to replace the "-B" option with "-P" for AIX nm.
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # have runtime linking enabled, and use it for executables.
+       # For shared libraries, we enable/disable runtime linking
+       # depending on the kind of the shared library created -
+       # when "with_aix_soname,aix_use_runtimelinking" is:
+       # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+       # "aix,yes"  lib.so          shared, rtl:yes, for executables
+       #            lib.a           static archive
+       # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+       #            lib.a(lib.so.V) shared, rtl:no,  for executables
+       # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+       #            lib.a(lib.so.V) shared, rtl:no
+       # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+       #            lib.a           static archive
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+           # With aix-soname=svr4, we create the lib.so.V shared archives only,
+           # so we don't have lib.a shared libs to link our executables.
+           # We have to force runtime linking in this case.
+           aix_use_runtimelinking=yes
+           LDFLAGS="$LDFLAGS -Wl,-brtl"
+         fi
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+       # The Import File defines what to hardcode.
+       hardcode_direct=no
+       hardcode_direct_absolute=no
+       ;;
+      esac
+
+      if test yes = "$GCC"; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`$CC -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test yes = "$aix_use_runtimelinking"; then
+         shared_flag="$shared_flag "'$wl-G'
+       fi
+       # Need to ensure runtime linking is disabled for the traditional
+       # shared library, or the linker may eventually find shared libraries
+       # /with/ Import File - we do not want to mix them.
+       shared_flag_aix='-shared'
+       shared_flag_svr4='-shared $wl-G'
+      else
+       # not using gcc
+       if test ia64 = "$host_cpu"; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test yes = "$aix_use_runtimelinking"; then
+           shared_flag='$wl-G'
+         else
+           shared_flag='$wl-bM:SRE'
+         fi
+         shared_flag_aix='$wl-bM:SRE'
+         shared_flag_svr4='$wl-G'
+       fi
+      fi
+
+      export_dynamic_flag_spec='$wl-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+      else
+       if test ia64 = "$host_cpu"; then
+         hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=/usr/lib:/lib
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' $wl-bernotok'
+         allow_undefined_flag=' $wl-berok'
+         if test yes = "$with_gnu_ld"; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec='$convenience'
+         fi
+         archive_cmds_need_lc=yes
+         archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+         # -brtl affects multiple linker settings, -berok does not and is overridden later
+         compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+         if test svr4 != "$with_aix_soname"; then
+           # This is similar to how AIX traditionally builds its shared libraries.
+           archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+         fi
+         if test aix != "$with_aix_soname"; then
+           archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+         else
+           # used by -dlpreopen to get the symbols
+           archive_expsym_cmds="$archive_expsym_cmds"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+         fi
+         archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       hardcode_libdir_flag_spec=' '
+       allow_undefined_flag=unsupported
+       always_export_symbols=yes
+       file_list_spec='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=.dll
+       # FIXME: Setting linknames here is a bad hack.
+       archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+       archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[   ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([     ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
+       # The linker will not automatically build a static lib if we build a DLL.
+       # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+       enable_shared_with_static_runtimes=yes
+       exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+       export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+       # Don't use ranlib
+       old_postinstall_cmds='chmod 644 $oldlib'
+       postlink_cmds='lt_outputfile="@OUTPUT@"~
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       hardcode_libdir_flag_spec=' '
+       allow_undefined_flag=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=.dll
+       # FIXME: Setting linknames here is a bad hack.
+       archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       old_archive_from_new_cmds='true'
+       # FIXME: Should let the user specify the lib program.
+       old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       enable_shared_with_static_runtimes=yes
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec=''
+  fi
+  link_all_deplibs=yes
+  allow_undefined_flag=$_lt_dar_allow_undefined
+  case $cc_basename in
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test yes = "$_lt_dar_can_shared"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test yes = "$GCC"; then
+       archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='$wl-E'
+      ;;
+
+    hpux10*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+       archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test no = "$with_gnu_ld"; then
+       hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+       hardcode_libdir_separator=:
+       hardcode_direct=yes
+       hardcode_direct_absolute=yes
+       export_dynamic_flag_spec='$wl-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test yes = "$lt_cv_prog_compiler__b"; then
+    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+         ;;
+       esac
+      fi
+      if test no = "$with_gnu_ld"; then
+       hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+       hardcode_libdir_separator=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       *)
+         hardcode_direct=yes
+         hardcode_direct_absolute=yes
+         export_dynamic_flag_spec='$wl-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test yes = "$GCC"; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+       # This should be the same for all languages, so no per-tag cache variable.
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS=$LDFLAGS
+          LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS=$save_LDFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+       if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+       fi
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    linux*)
+      case $cc_basename in
+      tcc*)
+       # Fabrice Bellard et al's Tiny C Compiler
+       ld_shlibs=yes
+       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+      esac
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd* | bitrig*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+       hardcode_direct_absolute=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+         export_dynamic_flag_spec='$wl-E'
+       else
+         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+       fi
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+       $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+       $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+       $ECHO EXPORTS >> $output_objdir/$libname.def~
+       emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+       $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+       emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+       $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+       $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+       $ECHO EXPORTS >> $output_objdir/$libname.def~
+       prefix_cmds="$SED"~
+       if test EXPORTS = "`$SED 1q $export_symbols`"; then
+         prefix_cmds="$prefix_cmds -e 1d";
+       fi~
+       prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+       cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+       $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+       emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    osf3*)
+      if test yes = "$GCC"; then
+       allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+       archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test yes = "$GCC"; then
+       allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+       archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+       hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test yes = "$GCC"; then
+       wlarc='$wl'
+       archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='$wl'
+         archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands '-z linker_flag'.  GCC discards it without '$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test yes = "$GCC"; then
+         whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test sequent = "$host_vendor"; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='$wl-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+       archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We CANNOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='$wl-z,text'
+      allow_undefined_flag='$wl-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='$wl-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='$wl-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+       archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test sni = "$host_vendor"; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec='$wl-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test no = "$ld_shlibs" && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test yes,yes = "$GCC,$enable_shared"; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl
+         pic_flag=$lt_prog_compiler_pic
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag
+         allow_undefined_flag=
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+         then
+           lt_cv_archive_cmds_need_lc=no
+         else
+           lt_cv_archive_cmds_need_lc=yes
+         fi
+         allow_undefined_flag=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test yes = "$GCC"; then
+  case $host_os in
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary...
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo = "/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='$libname$release$shared_ext$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test ia64 = "$host_cpu"; then
+    # AIX 5 supports IA64
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a(lib.so.V)'
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='$libname$shared_ext'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec=$LIB
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+    fi
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test yes = "$lt_cv_prog_gnu_ld"; then
+               version_type=linux # correct to gnu/linux during the next big refactor
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec='-L$libdir'
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Add ABI-specific directories to the system library path.
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd* | bitrig*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec=/usr/lib
+  need_lib_prefix=no
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+os2*)
+  libname_spec='$name'
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test yes = "$with_gnu_ld"; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec; then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=sco
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test yes = "$with_gnu_ld"; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test yes = "$hardcode_automatic"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$hardcode_direct" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+     test no != "$hardcode_minus_L"; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test relink = "$hardcode_action" ||
+   test yes = "$inherit_rpath"; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test yes != "$enable_dlopen"; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen=load_add_on
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen=LoadLibrary
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+    # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+
+    lt_cv_dlopen=dyld
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen=shl_load
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen=dlopen
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test no = "$lt_cv_dlopen"; then
+    enable_dlopen=no
+  else
+    enable_dlopen=yes
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS=$LDFLAGS
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS=$LIBS
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test yes = "$cross_compiling"; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test yes = "$lt_cv_dlopen_self"; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test yes = "$cross_compiling"; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP"; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report what library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test no = "$can_build_shared" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test yes = "$enable_shared" && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;                  # shared object as lib.so file only
+      yes,svr4,*) ;;                   # shared object as lib.so archive member only
+      yes,*) enable_static=no ;;       # shared object in lib.a archive as well
+      esac
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test yes = "$enable_shared" || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+fi
+alsa_save_CFLAGS="$CFLAGS"
+alsa_save_LDFLAGS="$LDFLAGS"
+alsa_save_LIBS="$LIBS"
+alsa_found=yes
+alsa_topology_found=no
+
+
+# Check whether --with-alsa-prefix was given.
+if test "${with_alsa_prefix+set}" = set; then :
+  withval=$with_alsa_prefix; alsa_prefix="$withval"
+else
+  alsa_prefix=""
+fi
+
+
+
+# Check whether --with-alsa-inc-prefix was given.
+if test "${with_alsa_inc_prefix+set}" = set; then :
+  withval=$with_alsa_inc_prefix; alsa_inc_prefix="$withval"
+else
+  alsa_inc_prefix=""
+fi
+
+
+# Check whether --enable-alsa-topology was given.
+if test "${enable_alsa_topology+set}" = set; then :
+  enableval=$enable_alsa_topology; enable_atopology="$enableval"
+else
+  enable_atopology=no
+fi
+
+
+# Check whether --enable-alsatest was given.
+if test "${enable_alsatest+set}" = set; then :
+  enableval=$enable_alsatest; enable_alsatest="$enableval"
+else
+  enable_alsatest=yes
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA CFLAGS" >&5
+$as_echo_n "checking for ALSA CFLAGS... " >&6; }
+if test "$alsa_inc_prefix" != "" ; then
+       ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
+       CFLAGS="$CFLAGS -I$alsa_inc_prefix"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_CFLAGS" >&5
+$as_echo "$ALSA_CFLAGS" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lc" >&5
+$as_echo_n "checking for dlopen in -lc... " >&6; }
+if ${ac_cv_lib_c_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_dlopen=yes
+else
+  ac_cv_lib_c_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_dlopen" >&5
+$as_echo "$ac_cv_lib_c_dlopen" >&6; }
+if test "x$ac_cv_lib_c_dlopen" = xyes; then :
+  LIBDL=""
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  LIBDL="-ldl"
+fi
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA LDFLAGS" >&5
+$as_echo_n "checking for ALSA LDFLAGS... " >&6; }
+if test "$alsa_prefix" != "" ; then
+       ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
+       LDFLAGS="$LDFLAGS $ALSA_LIBS"
+fi
+
+ALSA_LIBS="$ALSA_LIBS -lasound -lm $LIBDL -lpthread"
+LIBS="$ALSA_LIBS $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5
+$as_echo "$ALSA_LIBS" >&6; }
+
+if test "x$enable_alsatest" = "xyes"; then
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking required libasound headers version" >&5
+$as_echo_n "checking required libasound headers version... " >&6; }
+min_alsa_version=1.2.5
+no_alsa=""
+    alsa_min_major_version=`echo $min_alsa_version | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
     alsa_min_minor_version=`echo $min_alsa_version | \
            sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
     alsa_min_micro_version=`echo $min_alsa_version | \
            sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $alsa_min_major_version.$alsa_min_minor_version.$alsa_min_micro_version" >&5
+$as_echo "$alsa_min_major_version.$alsa_min_minor_version.$alsa_min_micro_version" >&6; }
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libasound headers version >= $alsa_min_major_version.$alsa_min_minor_version.$alsa_min_micro_version ($min_alsa_version)" >&5
+$as_echo_n "checking for libasound headers version >= $alsa_min_major_version.$alsa_min_minor_version.$alsa_min_micro_version ($min_alsa_version)... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <alsa/asoundlib.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+
+/* ensure backward compatibility */
+#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
+#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
+#endif
+#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
+#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
+#endif
+#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
+#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
+#endif
+
+#  if(SND_LIB_MAJOR > $alsa_min_major_version)
+  exit(0);
+#  else
+#    if(SND_LIB_MAJOR < $alsa_min_major_version)
+#       error not present
+#    endif
+
+#   if(SND_LIB_MINOR > $alsa_min_minor_version)
+  exit(0);
+#   else
+#     if(SND_LIB_MINOR < $alsa_min_minor_version)
+#          error not present
+#      endif
+
+#      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
+#        error not present
+#      endif
+#    endif
+#  endif
+exit(0);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5
+$as_echo "found." >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present." >&5
+$as_echo "not present." >&6; }
+   as_fn_error $? "Sufficiently new version of libasound not found." "$LINENO" 5
+   alsa_found=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libatopology (sound headers version > 1.1.9)" >&5
+$as_echo_n "checking for libatopology (sound headers version > 1.1.9)... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <alsa/asoundlib.h>
+#include <alsa/topology.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+
+/* ensure backward compatibility */
+#if !defined(SND_LIB_VERSION)
+#define SND_LIB_VERSION 0
+#endif
+#if SND_LIB_VERSION > 0x00010109
+  exit(0);
+#else
+# error not present
+#endif
+exit(0);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+   enable_atopology="yes"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+
+if test "x$enable_alsatest" = "xyes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_ctl_open in -lasound" >&5
+$as_echo_n "checking for snd_ctl_open in -lasound... " >&6; }
+if ${ac_cv_lib_asound_snd_ctl_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lasound  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snd_ctl_open ();
+int
+main ()
+{
+return snd_ctl_open ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_asound_snd_ctl_open=yes
+else
+  ac_cv_lib_asound_snd_ctl_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_ctl_open" >&5
+$as_echo "$ac_cv_lib_asound_snd_ctl_open" >&6; }
+if test "x$ac_cv_lib_asound_snd_ctl_open" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBASOUND 1
+_ACEOF
+
+  LIBS="-lasound $LIBS"
+
+else
+  as_fn_error $? "No linkable libasound was found." "$LINENO" 5
+        alsa_found=no
+
+fi
+
+if test "x$enable_atopology" = "xyes"; then
+alsa_topology_found=yes
+alsa_save_LIBS2="$LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_tplg_new in -latopology" >&5
+$as_echo_n "checking for snd_tplg_new in -latopology... " >&6; }
+if ${ac_cv_lib_atopology_snd_tplg_new+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-latopology  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snd_tplg_new ();
+int
+main ()
+{
+return snd_tplg_new ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_atopology_snd_tplg_new=yes
+else
+  ac_cv_lib_atopology_snd_tplg_new=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atopology_snd_tplg_new" >&5
+$as_echo "$ac_cv_lib_atopology_snd_tplg_new" >&6; }
+if test "x$ac_cv_lib_atopology_snd_tplg_new" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBATOPOLOGY 1
+_ACEOF
+
+  LIBS="-latopology $LIBS"
+
+else
+  as_fn_error $? "No linkable libatopology was found." "$LINENO" 5
+        alsa_topology_found=no,
+
+
+fi
+
+LIBS="$alsa_save_LIBS2"
+fi
+else
+if test "x$enable_atopology" = "xyes"; then
+  alsa_topology_found=yes
+fi
+fi
+
+if test "x$alsa_found" = "xyes" ; then
+   :
+   LIBS=`echo $LIBS | sed 's/-lasound//g'`
+   LIBS=`echo $LIBS | sed 's/  //'`
+   LIBS="-lasound $LIBS"
+fi
+if test "x$alsa_found" = "xno" ; then
+   :
+   CFLAGS="$alsa_save_CFLAGS"
+   LDFLAGS="$alsa_save_LDFLAGS"
+   LIBS="$alsa_save_LIBS"
+   ALSA_CFLAGS=""
+   ALSA_LIBS=""
+   ALSA_TOPOLOGY_LIBS=""
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA topology LDFLAGS" >&5
+$as_echo_n "checking for ALSA topology LDFLAGS... " >&6; }
+if test "x$alsa_topology_found" = "xyes"; then
+  ALSA_TOPOLOGY_LIBS="$ALSA_TOPOLOGY_LIBS -latopology"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_TOPOLOGY_LIBS" >&5
+$as_echo "$ALSA_TOPOLOGY_LIBS" >&6; }
+
+
+
+
+
+if test "x$enable_alsatest" = "xyes"; then
+ac_fn_c_check_func "$LINENO" "snd_ctl_elem_add_enumerated" "ac_cv_func_snd_ctl_elem_add_enumerated"
+if test "x$ac_cv_func_snd_ctl_elem_add_enumerated" = xyes; then :
+
+else
+  as_fn_error $? "No user enum control support in alsa-lib" "$LINENO" 5
+fi
+
+fi
+
+
+for ac_header in dlfcn.h malloc.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in alsa/pcm.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "alsa/pcm.h" "ac_cv_header_alsa_pcm_h" "#include <alsa/asoundlib.h>
+"
+if test "x$ac_cv_header_alsa_pcm_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ALSA_PCM_H 1
+_ACEOF
+ have_pcm="yes"
+else
+  have_pcm="no"
+fi
+
+done
+
+for ac_header in alsa/mixer.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "alsa/mixer.h" "ac_cv_header_alsa_mixer_h" "#include <alsa/asoundlib.h>
+"
+if test "x$ac_cv_header_alsa_mixer_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ALSA_MIXER_H 1
+_ACEOF
+ have_mixer="yes"
+else
+  have_mixer="no"
+fi
+
+done
+
+for ac_header in alsa/rawmidi.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "alsa/rawmidi.h" "ac_cv_header_alsa_rawmidi_h" "#include <alsa/asoundlib.h>
+"
+if test "x$ac_cv_header_alsa_rawmidi_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ALSA_RAWMIDI_H 1
+_ACEOF
+ have_rawmidi="yes"
+else
+  have_rawmidi="no"
+fi
+
+done
+
+for ac_header in alsa/seq.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "alsa/seq.h" "ac_cv_header_alsa_seq_h" "#include <alsa/asoundlib.h>
+"
+if test "x$ac_cv_header_alsa_seq_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ALSA_SEQ_H 1
+_ACEOF
+ have_seq="yes"
+else
+  have_seq="no"
+fi
+
+done
+
+for ac_header in alsa/use-case.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "alsa/use-case.h" "ac_cv_header_alsa_use_case_h" "#include <alsa/asoundlib.h>
+"
+if test "x$ac_cv_header_alsa_use_case_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ALSA_USE_CASE_H 1
+_ACEOF
+ have_ucm="yes"
+else
+  have_ucm="no"
+fi
+
+done
+
+for ac_header in alsa/topology.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "alsa/topology.h" "ac_cv_header_alsa_topology_h" "#include <alsa/asoundlib.h>
+"
+if test "x$ac_cv_header_alsa_topology_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ALSA_TOPOLOGY_H 1
+_ACEOF
+ have_topology="yes"
+else
+  have_topology="no"
+fi
+
+done
+
+for ac_header in samplerate.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "samplerate.h" "ac_cv_header_samplerate_h" "#include <samplerate.h>
+"
+if test "x$ac_cv_header_samplerate_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SAMPLERATE_H 1
+_ACEOF
+ have_samplerate="yes"
+else
+  have_samplerate="no"
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_seq_client_info_get_card in -lasound" >&5
+$as_echo_n "checking for snd_seq_client_info_get_card in -lasound... " >&6; }
+if ${ac_cv_lib_asound_snd_seq_client_info_get_card+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lasound  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snd_seq_client_info_get_card ();
+int
+main ()
+{
+return snd_seq_client_info_get_card ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_asound_snd_seq_client_info_get_card=yes
+else
+  ac_cv_lib_asound_snd_seq_client_info_get_card=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_seq_client_info_get_card" >&5
+$as_echo "$ac_cv_lib_asound_snd_seq_client_info_get_card" >&6; }
+if test "x$ac_cv_lib_asound_snd_seq_client_info_get_card" = xyes; then :
+  HAVE_SEQ_CLIENT_INFO_GET_CARD="yes"
+fi
+
+if test "$HAVE_SEQ_CLIENT_INFO_GET_CARD" = "yes" ; then
+
+$as_echo "#define HAVE_SEQ_CLIENT_INFO_GET_CARD 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_seq_client_info_get_pid in -lasound" >&5
+$as_echo_n "checking for snd_seq_client_info_get_pid in -lasound... " >&6; }
+if ${ac_cv_lib_asound_snd_seq_client_info_get_pid+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lasound  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snd_seq_client_info_get_pid ();
+int
+main ()
+{
+return snd_seq_client_info_get_pid ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_asound_snd_seq_client_info_get_pid=yes
+else
+  ac_cv_lib_asound_snd_seq_client_info_get_pid=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_seq_client_info_get_pid" >&5
+$as_echo "$ac_cv_lib_asound_snd_seq_client_info_get_pid" >&6; }
+if test "x$ac_cv_lib_asound_snd_seq_client_info_get_pid" = xyes; then :
+  HAVE_SEQ_CLIENT_INFO_GET_PID="yes"
+fi
 
+if test "$HAVE_SEQ_CLIENT_INFO_GET_PID" = "yes" ; then
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+$as_echo "#define HAVE_SEQ_CLIENT_INFO_GET_PID 1" >>confdefs.h
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_seq_client_info_get_midi_version in -lasound" >&5
+$as_echo_n "checking for snd_seq_client_info_get_midi_version in -lasound... " >&6; }
+if ${ac_cv_lib_asound_snd_seq_client_info_get_midi_version+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lasound  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <alsa/asoundlib.h>
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snd_seq_client_info_get_midi_version ();
 int
 main ()
 {
+return snd_seq_client_info_get_midi_version ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_asound_snd_seq_client_info_get_midi_version=yes
+else
+  ac_cv_lib_asound_snd_seq_client_info_get_midi_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_seq_client_info_get_midi_version" >&5
+$as_echo "$ac_cv_lib_asound_snd_seq_client_info_get_midi_version" >&6; }
+if test "x$ac_cv_lib_asound_snd_seq_client_info_get_midi_version" = xyes; then :
+  HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION="yes"
+fi
 
-/* ensure backward compatibility */
-#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
-#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
-#endif
-#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
-#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
-#endif
-#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
-#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
-#endif
-
-#  if(SND_LIB_MAJOR > $alsa_min_major_version)
-  exit(0);
-#  else
-#    if(SND_LIB_MAJOR < $alsa_min_major_version)
-#       error not present
-#    endif
+if test "$HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION" = "yes" -a "$have_rawmidi" = "yes"; then
 
-#   if(SND_LIB_MINOR > $alsa_min_minor_version)
-  exit(0);
-#   else
-#     if(SND_LIB_MINOR < $alsa_min_minor_version)
-#          error not present
-#      endif
+$as_echo "#define HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION 1" >>confdefs.h
 
-#      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
-#        error not present
-#      endif
-#    endif
-#  endif
-exit(0);
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_tplg_save in -latopology" >&5
+$as_echo_n "checking for snd_tplg_save in -latopology... " >&6; }
+if ${ac_cv_lib_atopology_snd_tplg_save+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-latopology  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char snd_tplg_save ();
+int
+main ()
+{
+return snd_tplg_save ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5
-$as_echo "found." >&6; }
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_atopology_snd_tplg_save=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present." >&5
-$as_echo "not present." >&6; }
-   as_fn_error $? "Sufficiently new version of libasound not found." "$LINENO" 5
-   alsa_found=no
-
+  ac_cv_lib_atopology_snd_tplg_save=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atopology_snd_tplg_save" >&5
+$as_echo "$ac_cv_lib_atopology_snd_tplg_save" >&6; }
+if test "x$ac_cv_lib_atopology_snd_tplg_save" = xyes; then :
+  have_topology="yes"
+else
+  have_topology="no"
 fi
 
-if test "x$enable_alsatest" = "xyes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_ctl_open in -lasound" >&5
-$as_echo_n "checking for snd_ctl_open in -lasound... " >&6; }
-if ${ac_cv_lib_asound_snd_ctl_open+:} false; then :
+
+#
+# NOTE: The library 'libffado' (at least v2.4.1) executes ctor/dtor of instances
+# for some objects in startup/finish routines of C runtime. As a result, it
+# outputs some superfluos messages. Furthermore, it brings much memory leak
+# internally. Totally, libffado support is not recommended at all in usual
+# purposes except for technical preview.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffado_streaming_init in -lffado" >&5
+$as_echo_n "checking for ffado_streaming_init in -lffado... " >&6; }
+if ${ac_cv_lib_ffado_ffado_streaming_init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lasound  $LIBS"
+LIBS="-lffado  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -7227,206 +16446,378 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char snd_ctl_open ();
+char ffado_streaming_init ();
 int
 main ()
 {
-return snd_ctl_open ();
+return ffado_streaming_init ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_asound_snd_ctl_open=yes
+  ac_cv_lib_ffado_ffado_streaming_init=yes
 else
-  ac_cv_lib_asound_snd_ctl_open=no
+  ac_cv_lib_ffado_ffado_streaming_init=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_ctl_open" >&5
-$as_echo "$ac_cv_lib_asound_snd_ctl_open" >&6; }
-if test "x$ac_cv_lib_asound_snd_ctl_open" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBASOUND 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffado_ffado_streaming_init" >&5
+$as_echo "$ac_cv_lib_ffado_ffado_streaming_init" >&6; }
+if test "x$ac_cv_lib_ffado_ffado_streaming_init" = xyes; then :
+  have_ffado="yes"
+else
+  have_ffado="no"
+fi
 
-  LIBS="-lasound $LIBS"
+if test x"$have_ffado" = xyes; then :
 
-else
-  as_fn_error $? "No linkable libasound was found." "$LINENO" 5
-        alsa_found=no
+$as_echo "#define WITH_FFADO 1" >>confdefs.h
 
 fi
 
+# Test programs for axfer use shm by memfd_create(2). If not supported, open(2) is used alternatively.
+ac_fn_c_check_func "$LINENO" "memfd_create" "ac_cv_func_memfd_create"
+if test "x$ac_cv_func_memfd_create" = xyes; then :
+  have_memfd_create="yes"
+else
+  have_memfd_create="no"
 fi
 
-if test "x$alsa_found" = "xyes" ; then
-   :
-   LIBS=`echo $LIBS | sed 's/-lasound//g'`
-   LIBS=`echo $LIBS | sed 's/  //'`
-   LIBS="-lasound $LIBS"
+if test x$have_memfd_create = xyes; then :
+
+$as_echo "#define HAVE_MEMFD_CREATE 1" >>confdefs.h
+
 fi
-if test "x$alsa_found" = "xno" ; then
-   :
-   CFLAGS="$alsa_save_CFLAGS"
-   LDFLAGS="$alsa_save_LDFLAGS"
-   LIBS="$alsa_save_LIBS"
-   ALSA_CFLAGS=""
-   ALSA_LIBS=""
+
+ if test "$have_pcm" = "yes"; then
+  HAVE_PCM_TRUE=
+  HAVE_PCM_FALSE='#'
+else
+  HAVE_PCM_TRUE='#'
+  HAVE_PCM_FALSE=
 fi
 
+ if test "$have_mixer" = "yes"; then
+  HAVE_MIXER_TRUE=
+  HAVE_MIXER_FALSE='#'
+else
+  HAVE_MIXER_TRUE='#'
+  HAVE_MIXER_FALSE=
+fi
 
+ if test "$have_rawmidi" = "yes"; then
+  HAVE_RAWMIDI_TRUE=
+  HAVE_RAWMIDI_FALSE='#'
+else
+  HAVE_RAWMIDI_TRUE='#'
+  HAVE_RAWMIDI_FALSE=
+fi
 
+ if test "$have_seq" = "yes"; then
+  HAVE_SEQ_TRUE=
+  HAVE_SEQ_FALSE='#'
+else
+  HAVE_SEQ_TRUE='#'
+  HAVE_SEQ_FALSE=
+fi
 
-if test "x$enable_alsatest" = "xyes"; then
-ac_fn_c_check_func "$LINENO" "snd_ctl_elem_add_enumerated" "ac_cv_func_snd_ctl_elem_add_enumerated"
-if test "x$ac_cv_func_snd_ctl_elem_add_enumerated" = xyes; then :
+ if test "$have_ucm" = "yes"; then
+  HAVE_UCM_TRUE=
+  HAVE_UCM_FALSE='#'
+else
+  HAVE_UCM_TRUE='#'
+  HAVE_UCM_FALSE=
+fi
 
+ if test "$have_topology" = "yes" -a "$ac_cv_header_dlfcn_h" = "yes"; then
+  HAVE_TOPOLOGY_TRUE=
+  HAVE_TOPOLOGY_FALSE='#'
 else
-  as_fn_error $? "No user enum control support in alsa-lib" "$LINENO" 5
+  HAVE_TOPOLOGY_TRUE='#'
+  HAVE_TOPOLOGY_FALSE=
+fi
+
+ if test "$have_samplerate" = "yes"; then
+  HAVE_SAMPLERATE_TRUE=
+  HAVE_SAMPLERATE_FALSE='#'
+else
+  HAVE_SAMPLERATE_TRUE='#'
+  HAVE_SAMPLERATE_FALSE=
 fi
 
+ if test "$have_ffado" = "yes"; then
+  HAVE_FFADO_TRUE=
+  HAVE_FFADO_FALSE='#'
+else
+  HAVE_FFADO_TRUE='#'
+  HAVE_FFADO_FALSE=
 fi
 
-for ac_header in alsa/pcm.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "alsa/pcm.h" "ac_cv_header_alsa_pcm_h" "#include <alsa/asoundlib.h>
-"
-if test "x$ac_cv_header_alsa_pcm_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ALSA_PCM_H 1
-_ACEOF
- have_pcm="yes"
+
+alsabat_backend_tiny=
+# Check whether --enable-alsabat_backend_tiny was given.
+if test "${enable_alsabat_backend_tiny+set}" = set; then :
+  enableval=$enable_alsabat_backend_tiny; case "${enableval}" in
+      yes) alsabat_backend_tiny=true ;;
+      no) alsabat_backend_tiny=false ;;
+      *) as_fn_error $? "bad value ${enableval} for --enable-alsabat-backend-tiny" "$LINENO" 5 ;;
+    esac
 else
-  have_pcm="no"
+  alsabat_backend_tiny=false
 fi
 
-done
 
-for ac_header in alsa/mixer.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "alsa/mixer.h" "ac_cv_header_alsa_mixer_h" "#include <alsa/asoundlib.h>
-"
-if test "x$ac_cv_header_alsa_mixer_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ALSA_MIXER_H 1
-_ACEOF
- have_mixer="yes"
+bat=
+if test "$have_pcm" = "yes"; then
+# Check whether --enable-bat was given.
+if test "${enable_bat+set}" = set; then :
+  enableval=$enable_bat; case "${enableval}" in
+       yes) bat=true ;;
+       no)  bat=false ;;
+       *) as_fn_error $? "bad value ${enableval} for --enable-bat" "$LINENO" 5 ;;
+     esac
 else
-  have_mixer="no"
+  bat=true
 fi
 
-done
+fi
+ if test x$bat = xtrue; then
+  BAT_TRUE=
+  BAT_FALSE='#'
+else
+  BAT_TRUE='#'
+  BAT_FALSE=
+fi
 
-for ac_header in alsa/rawmidi.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "alsa/rawmidi.h" "ac_cv_header_alsa_rawmidi_h" "#include <alsa/asoundlib.h>
-"
-if test "x$ac_cv_header_alsa_rawmidi_h" = xyes; then :
+
+if test x$bat = xtrue; then
+
+  saved_CFLAGS="$CFLAGS"
+  saved_LDFLAGS="$LDFLAGS"
+  saved_LIBS="$LIBS"
+  FFTW_INC=""
+  FFTW_LIB=""
+  FFTW_CFLAGS=""
+    have_libfftw3="yes"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftwf_malloc in -lfftw3f" >&5
+$as_echo_n "checking for fftwf_malloc in -lfftw3f... " >&6; }
+if ${ac_cv_lib_fftw3f_fftwf_malloc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfftw3f  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fftwf_malloc ();
+int
+main ()
+{
+return fftwf_malloc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_fftw3f_fftwf_malloc=yes
+else
+  ac_cv_lib_fftw3f_fftwf_malloc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3f_fftwf_malloc" >&5
+$as_echo "$ac_cv_lib_fftw3f_fftwf_malloc" >&6; }
+if test "x$ac_cv_lib_fftw3f_fftwf_malloc" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_ALSA_RAWMIDI_H 1
+#define HAVE_LIBFFTW3F 1
 _ACEOF
- have_rawmidi="yes"
+
+  LIBS="-lfftw3f $LIBS"
+
 else
-  have_rawmidi="no"
+  have_libfftw3="no"
 fi
 
-done
+    have_libtinyalsa=
+  if test x$alsabat_backend_tiny = xtrue; then
+    have_libtinyalsa="yes"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcm_open in -ltinyalsa" >&5
+$as_echo_n "checking for pcm_open in -ltinyalsa... " >&6; }
+if ${ac_cv_lib_tinyalsa_pcm_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltinyalsa  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-for ac_header in alsa/seq.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "alsa/seq.h" "ac_cv_header_alsa_seq_h" "#include <alsa/asoundlib.h>
-"
-if test "x$ac_cv_header_alsa_seq_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ALSA_SEQ_H 1
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pcm_open ();
+int
+main ()
+{
+return pcm_open ();
+  ;
+  return 0;
+}
 _ACEOF
- have_seq="yes"
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_tinyalsa_pcm_open=yes
 else
-  have_seq="no"
+  ac_cv_lib_tinyalsa_pcm_open=no
 fi
-
-done
-
-for ac_header in alsa/use-case.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "alsa/use-case.h" "ac_cv_header_alsa_use_case_h" "#include <alsa/asoundlib.h>
-"
-if test "x$ac_cv_header_alsa_use_case_h" = xyes; then :
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinyalsa_pcm_open" >&5
+$as_echo "$ac_cv_lib_tinyalsa_pcm_open" >&6; }
+if test "x$ac_cv_lib_tinyalsa_pcm_open" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_ALSA_USE_CASE_H 1
+#define HAVE_LIBTINYALSA 1
 _ACEOF
- have_ucm="yes"
+
+  LIBS="-ltinyalsa $LIBS"
+
 else
-  have_ucm="no"
+  have_libtinyalsa="no"
 fi
 
-done
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtf in -lm" >&5
+$as_echo_n "checking for sqrtf in -lm... " >&6; }
+if ${ac_cv_lib_m_sqrtf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-for ac_header in samplerate.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "samplerate.h" "ac_cv_header_samplerate_h" "#include <samplerate.h>
-"
-if test "x$ac_cv_header_samplerate_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SAMPLERATE_H 1
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sqrtf ();
+int
+main ()
+{
+return sqrtf ();
+  ;
+  return 0;
+}
 _ACEOF
- have_samplerate="yes"
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sqrtf=yes
 else
-  have_samplerate="no"
+  ac_cv_lib_m_sqrtf=no
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrtf" >&5
+$as_echo "$ac_cv_lib_m_sqrtf" >&6; }
+if test "x$ac_cv_lib_m_sqrtf" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
 
-done
-
+  LIBS="-lm $LIBS"
 
- if test "$have_pcm" = "yes"; then
-  HAVE_PCM_TRUE=
-  HAVE_PCM_FALSE='#'
 else
-  HAVE_PCM_TRUE='#'
-  HAVE_PCM_FALSE=
+  as_fn_error $? "Error: Need sqrtf" "$LINENO" 5
 fi
 
- if test "$have_mixer" = "yes"; then
-  HAVE_MIXER_TRUE=
-  HAVE_MIXER_FALSE='#'
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  HAVE_MIXER_TRUE='#'
-  HAVE_MIXER_FALSE=
-fi
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
- if test "$have_rawmidi" = "yes"; then
-  HAVE_RAWMIDI_TRUE=
-  HAVE_RAWMIDI_FALSE='#'
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_create=yes
 else
-  HAVE_RAWMIDI_TRUE='#'
-  HAVE_RAWMIDI_FALSE=
+  ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+  LIBS="-lpthread $LIBS"
 
- if test "$have_seq" = "yes"; then
-  HAVE_SEQ_TRUE=
-  HAVE_SEQ_FALSE='#'
 else
-  HAVE_SEQ_TRUE='#'
-  HAVE_SEQ_FALSE=
+  as_fn_error $? "Error: need PTHREAD library" "$LINENO" 5
 fi
 
- if test "$have_ucm" = "yes"; then
-  HAVE_UCM_TRUE=
-  HAVE_UCM_FALSE='#'
+  FFTW_CFLAGS="$CFLAGS"
+  FFTW_LIB="$LIBS"
+  CFLAGS="$saved_CFLAGS"
+  LDFLAGS="$saved_LDFLAGS"
+  LIBS="$saved_LIBS"
+
+
+
+
+fi
+ if test "$have_libfftw3" = "yes"; then
+  HAVE_LIBFFTW3_TRUE=
+  HAVE_LIBFFTW3_FALSE='#'
 else
-  HAVE_UCM_TRUE='#'
-  HAVE_UCM_FALSE=
+  HAVE_LIBFFTW3_TRUE='#'
+  HAVE_LIBFFTW3_FALSE=
 fi
 
- if test "$have_samplerate" = "yes"; then
-  HAVE_SAMPLERATE_TRUE=
-  HAVE_SAMPLERATE_FALSE='#'
+ if test "$have_libtinyalsa" = "yes"; then
+  HAVE_LIBTINYALSA_TRUE=
+  HAVE_LIBTINYALSA_FALSE='#'
 else
-  HAVE_SAMPLERATE_TRUE='#'
-  HAVE_SAMPLERATE_FALSE=
+  HAVE_LIBTINYALSA_TRUE='#'
+  HAVE_LIBTINYALSA_FALSE=
 fi
 
 
@@ -7562,7 +16953,27 @@ else
 fi
 
 
-xmlto=""
+# Check whether --enable-nhlt was given.
+if test "${enable_nhlt+set}" = set; then :
+  enableval=$enable_nhlt; case "${enableval}" in
+       yes) nhlt=true ;;
+       no)  nhlt=false ;;
+       *) as_fn_error $? "bad value ${enableval} for --enable-nhlt" "$LINENO" 5 ;;
+     esac
+else
+  nhlt=true
+fi
+
+ if test x$nhlt = xtrue; then
+  NHLT_TRUE=
+  NHLT_FALSE='#'
+else
+  NHLT_TRUE='#'
+  NHLT_FALSE=
+fi
+
+
+xmlto_available=""
 # Check whether --enable-xmlto was given.
 if test "${enable_xmlto+set}" = set; then :
   enableval=$enable_xmlto; xmlto="$enableval"
@@ -7575,11 +16986,11 @@ if test "$xmlto" = "yes"; then
 set dummy xmlto; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_xmlto+:} false; then :
+if ${ac_cv_prog_xmlto_available+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$xmlto"; then
-  ac_cv_prog_xmlto="$xmlto" # Let the user override the test.
+  if test -n "$xmlto_available"; then
+  ac_cv_prog_xmlto_available="$xmlto_available" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -7588,7 +16999,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_xmlto="yes"
+    ac_cv_prog_xmlto_available="yes"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -7598,10 +17009,10 @@ IFS=$as_save_IFS
 
 fi
 fi
-xmlto=$ac_cv_prog_xmlto
-if test -n "$xmlto"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xmlto" >&5
-$as_echo "$xmlto" >&6; }
+xmlto_available=$ac_cv_prog_xmlto_available
+if test -n "$xmlto_available"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xmlto_available" >&5
+$as_echo "$xmlto_available" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -7609,7 +17020,7 @@ fi
 
 
 fi
- if test x"$xmlto" = xyes; then
+ if test x"$xmlto_available" = xyes; then
   USE_XMLTO_TRUE=
   USE_XMLTO_FALSE='#'
 else
@@ -7618,6 +17029,62 @@ else
 fi
 
 
+rst2man_available=""
+# Check whether --enable-rst2man was given.
+if test "${enable_rst2man+set}" = set; then :
+  enableval=$enable_rst2man; rst2man="$enableval"
+else
+  rst2man="yes"
+fi
+
+if test "$rst2man" = "yes"; then
+  # Extract the first word of "rst2man", so it can be a program name with args.
+set dummy rst2man; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_rst2man_available+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$rst2man_available"; then
+  ac_cv_prog_rst2man_available="$rst2man_available" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_rst2man_available="yes"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+rst2man_available=$ac_cv_prog_rst2man_available
+if test -n "$rst2man_available"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rst2man_available" >&5
+$as_echo "$rst2man_available" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+ if test x"$rst2man_available" = xyes; then
+  USE_RST2MAN_TRUE=
+  USE_RST2MAN_FALSE='#'
+else
+  USE_RST2MAN_TRUE='#'
+  USE_RST2MAN_FALSE=
+fi
+
+
 
 # Check whether --with-udev-rules-dir was given.
 if test "${with_udev_rules_dir+set}" = set; then :
@@ -7773,6 +17240,7 @@ if test -n "$NCURSESW_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_NCURSESW_CFLAGS=`$PKG_CONFIG --cflags "ncursesw" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -7789,6 +17257,7 @@ if test -n "$NCURSESW_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_NCURSESW_LIBS=`$PKG_CONFIG --libs "ncursesw" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -7808,9 +17277,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               NCURSESW_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "ncursesw" 2>&1`
+               NCURSESW_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ncursesw" 2>&1`
         else
-               NCURSESW_PKG_ERRORS=`$PKG_CONFIG --print-errors "ncursesw" 2>&1`
+               NCURSESW_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ncursesw" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$NCURSESW_PKG_ERRORS" >&5
@@ -8026,6 +17495,7 @@ if test -n "$NCURSES_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_NCURSES_CFLAGS=`$PKG_CONFIG --cflags "ncurses" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -8042,6 +17512,7 @@ if test -n "$NCURSES_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_NCURSES_LIBS=`$PKG_CONFIG --libs "ncurses" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -8061,9 +17532,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               NCURSES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "ncurses" 2>&1`
+               NCURSES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ncurses" 2>&1`
         else
-               NCURSES_PKG_ERRORS=`$PKG_CONFIG --print-errors "ncurses" 2>&1`
+               NCURSES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ncurses" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$NCURSES_PKG_ERRORS" >&5
@@ -8392,24 +17863,7 @@ $as_echo "#define ENABLE_NLS_IN_CURSES 1" >>confdefs.h
     fi
   fi
 
-  # On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in panel.h menu.h form.h
+  for ac_header in panel.h menu.h form.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -8576,6 +18030,7 @@ fi
 
 
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
 eval dir="$datadir"
 case "$dir" in
@@ -9034,6 +18489,77 @@ SND_UTIL_SUBMINOR=`echo $VERSION | cut -d . -f 3 | sed -e 's/pre[0-9]*//g'`
 
 
 
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+    pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= 18\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "systemd >= 18") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "systemd >= 18" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+    pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= 18\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "systemd >= 18") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "systemd >= 18" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "systemd >= 18" 2>&1`
+        else
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "systemd >= 18" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$SYSTEMD_PKG_ERRORS" >&5
+
+       have_min_systemd="no"
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       have_min_systemd="no"
+else
+       SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+       SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       have_min_systemd="yes"
+fi
+
 # Check whether --with-systemdsystemunitdir was given.
 if test "${with_systemdsystemunitdir+set}" = set; then :
   withval=$with_systemdsystemunitdir;
@@ -9045,7 +18571,8 @@ if test "x$with_systemdsystemunitdir" != xno; then
         systemdsystemunitdir=$with_systemdsystemunitdir
 
 fi
- if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then
+ if test "$have_min_systemd" = "yes" \
+        -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then
   HAVE_SYSTEMD_TRUE=
   HAVE_SYSTEMD_FALSE='#'
 else
@@ -9094,7 +18621,34 @@ fi
 
 
 
-ac_config_files="$ac_config_files Makefile alsactl/Makefile alsactl/init/Makefile alsamixer/Makefile amidi/Makefile amixer/Makefile m4/Makefile po/Makefile.in alsaconf/alsaconf alsaconf/Makefile alsaconf/po/Makefile alsaucm/Makefile aplay/Makefile include/Makefile iecset/Makefile utils/Makefile utils/alsa-utils.spec seq/Makefile seq/aconnect/Makefile seq/aplaymidi/Makefile seq/aseqdump/Makefile seq/aseqnet/Makefile speaker-test/Makefile speaker-test/samples/Makefile alsaloop/Makefile alsa-info/Makefile"
+
+# Check whether --with-plugindir was given.
+if test "${with_plugindir+set}" = set; then :
+  withval=$with_plugindir; plugindir="$withval"
+else
+  plugindir=""
+fi
+
+if test -z "$plugindir"; then
+    eval dir="$libdir"
+    echo ${exec_prefix}
+    echo $libdir
+    echo $dir
+    case "$dir" in
+    /*) ;;
+    *) dir="$dir"
+    esac
+    plugindir="$dir/alsa-topology"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define ALSA_TOPOLOGY_PLUGIN_DIR "$plugindir"
+_ACEOF
+
+ALSA_TOPOLOGY_PLUGIN_DIR="$plugindir"
+
+
+ac_config_files="$ac_config_files Makefile alsactl/Makefile alsactl/init/Makefile alsamixer/Makefile amidi/Makefile amixer/Makefile m4/Makefile po/Makefile.in alsaconf/alsaconf alsaconf/Makefile alsaconf/po/Makefile alsaucm/Makefile topology/Makefile topology/nhlt/Makefile bat/Makefile bat/tests/Makefile bat/tests/asound_state/Makefile aplay/Makefile include/Makefile iecset/Makefile utils/Makefile utils/alsa-utils.spec seq/Makefile seq/aconnect/Makefile seq/aplaymidi/Makefile seq/aseqdump/Makefile seq/aseqnet/Makefile seq/aseqsend/Makefile speaker-test/Makefile speaker-test/samples/Makefile alsaloop/Makefile alsa-info/Makefile axfer/Makefile axfer/test/Makefile nhlt/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -9257,10 +18811,30 @@ if test -z "${HAVE_UCM_TRUE}" && test -z "${HAVE_UCM_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_UCM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_TOPOLOGY_TRUE}" && test -z "${HAVE_TOPOLOGY_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_TOPOLOGY\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_SAMPLERATE_TRUE}" && test -z "${HAVE_SAMPLERATE_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_SAMPLERATE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_FFADO_TRUE}" && test -z "${HAVE_FFADO_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_FFADO\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BAT_TRUE}" && test -z "${BAT_FALSE}"; then
+  as_fn_error $? "conditional \"BAT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LIBFFTW3_TRUE}" && test -z "${HAVE_LIBFFTW3_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_LIBFFTW3\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LIBTINYALSA_TRUE}" && test -z "${HAVE_LIBTINYALSA_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_LIBTINYALSA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${ALSAMIXER_TRUE}" && test -z "${ALSAMIXER_FALSE}"; then
   as_fn_error $? "conditional \"ALSAMIXER\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -9273,10 +18847,18 @@ if test -z "${ALSALOOP_TRUE}" && test -z "${ALSALOOP_FALSE}"; then
   as_fn_error $? "conditional \"ALSALOOP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${NHLT_TRUE}" && test -z "${NHLT_FALSE}"; then
+  as_fn_error $? "conditional \"NHLT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${USE_XMLTO_TRUE}" && test -z "${USE_XMLTO_FALSE}"; then
   as_fn_error $? "conditional \"USE_XMLTO\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${USE_RST2MAN_TRUE}" && test -z "${USE_RST2MAN_FALSE}"; then
+  as_fn_error $? "conditional \"USE_RST2MAN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_SYSTEMD_TRUE}" && test -z "${HAVE_SYSTEMD_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -9678,7 +19260,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by alsa-utils $as_me 1.0.29, which was
+This file was extended by alsa-utils $as_me 1.2.12, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -9744,7 +19326,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-alsa-utils config.status 1.0.29
+alsa-utils config.status 1.2.12
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -9864,13 +19446,295 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # INIT-COMMANDS
 #
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
-    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
-    # from automake < 1.5.
-    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
+    OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
     # Capture the value of LINGUAS because we need it to compute CATALOGS.
     LINGUAS="${LINGUAS-%UNSET%}"
 
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
+nm_file_list_spec \
+lt_cv_truncate_bin \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
 
 _ACEOF
 
@@ -9882,6 +19746,7 @@ do
   case $ac_config_target in
     "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "include/aconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS include/aconfig.h" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "alsactl/Makefile") CONFIG_FILES="$CONFIG_FILES alsactl/Makefile" ;;
@@ -9895,6 +19760,11 @@ do
     "alsaconf/Makefile") CONFIG_FILES="$CONFIG_FILES alsaconf/Makefile" ;;
     "alsaconf/po/Makefile") CONFIG_FILES="$CONFIG_FILES alsaconf/po/Makefile" ;;
     "alsaucm/Makefile") CONFIG_FILES="$CONFIG_FILES alsaucm/Makefile" ;;
+    "topology/Makefile") CONFIG_FILES="$CONFIG_FILES topology/Makefile" ;;
+    "topology/nhlt/Makefile") CONFIG_FILES="$CONFIG_FILES topology/nhlt/Makefile" ;;
+    "bat/Makefile") CONFIG_FILES="$CONFIG_FILES bat/Makefile" ;;
+    "bat/tests/Makefile") CONFIG_FILES="$CONFIG_FILES bat/tests/Makefile" ;;
+    "bat/tests/asound_state/Makefile") CONFIG_FILES="$CONFIG_FILES bat/tests/asound_state/Makefile" ;;
     "aplay/Makefile") CONFIG_FILES="$CONFIG_FILES aplay/Makefile" ;;
     "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
     "iecset/Makefile") CONFIG_FILES="$CONFIG_FILES iecset/Makefile" ;;
     "seq/aplaymidi/Makefile") CONFIG_FILES="$CONFIG_FILES seq/aplaymidi/Makefile" ;;
     "seq/aseqdump/Makefile") CONFIG_FILES="$CONFIG_FILES seq/aseqdump/Makefile" ;;
     "seq/aseqnet/Makefile") CONFIG_FILES="$CONFIG_FILES seq/aseqnet/Makefile" ;;
+    "seq/aseqsend/Makefile") CONFIG_FILES="$CONFIG_FILES seq/aseqsend/Makefile" ;;
     "speaker-test/Makefile") CONFIG_FILES="$CONFIG_FILES speaker-test/Makefile" ;;
     "speaker-test/samples/Makefile") CONFIG_FILES="$CONFIG_FILES speaker-test/samples/Makefile" ;;
     "alsaloop/Makefile") CONFIG_FILES="$CONFIG_FILES alsaloop/Makefile" ;;
     "alsa-info/Makefile") CONFIG_FILES="$CONFIG_FILES alsa-info/Makefile" ;;
+    "axfer/Makefile") CONFIG_FILES="$CONFIG_FILES axfer/Makefile" ;;
+    "axfer/test/Makefile") CONFIG_FILES="$CONFIG_FILES axfer/test/Makefile" ;;
+    "nhlt/Makefile") CONFIG_FILES="$CONFIG_FILES nhlt/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
@@ -10514,7 +20388,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
       case "$ac_file" in */Makefile.in)
         # Adjust a relative srcdir.
         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
         # In autoconf-2.13 it is called $ac_given_srcdir.
         # In autoconf-2.50 it is called $srcdir.
@@ -10530,7 +20404,8 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
           rm -f "$ac_dir/POTFILES"
           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
-          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          gt_tab=`printf '\t'`
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
           POMAKEFILEDEPS="POTFILES.in"
           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
           # on $ac_dir but don't depend on user-specified configuration
@@ -10540,14 +20415,11 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
             if test -n "$OBSOLETE_ALL_LINGUAS"; then
               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
             fi
-            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
-            # Hide the ALL_LINGUAS assigment from automake < 1.5.
-            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
           else
             # The set of available languages was given in configure.in.
-            # Hide the ALL_LINGUAS assigment from automake < 1.5.
-            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+            ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
           fi
           # Compute POFILES
           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
@@ -10618,32 +20490,38 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
       esac
     done ;;
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$am_mf" : 'X\(//\)[^/]' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -10661,54 +20539,594 @@ $as_echo X"$mf" |
            q
          }
          s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
          }
-         /^X\(\/\/\)$/{
+         /^X\/\(\/\/\)$/{
            s//\1/
            q
          }
-         /^X\(\/\).*/{
+         /^X\/\(\/\).*/{
            s//\1/
            q
          }
          s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  If GNU make was not used, consider
+    re-running the configure script with MAKE=\"gmake\" (or whatever is
+    necessary).  You can also try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options that allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}"; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile=${ofile}T
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 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 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=''
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and where our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 }
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
  ;;
 
   esac
index f09aa54..173b9ed 100644 (file)
@@ -1,44 +1,35 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.59)
-AC_INIT(alsa-utils, 1.0.29)
+AC_INIT(alsa-utils, 1.2.12)
 AC_CONFIG_SRCDIR([aplay/aplay.c])
 AC_PREFIX_DEFAULT(/usr)
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
 
 AM_MAINTAINER_MODE([enable])
 
 AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.15])
+AM_GNU_GETTEXT_VERSION([0.19.8])
 
 dnl Checks for programs.
 
-dnl try to gues cross-compiler if not set
-if test "x$target" != "x$host" -a -z "`echo $CC | grep -e '-gcc'`";
-then
-  AC_MSG_CHECKING(for cross-compiler)
-
-  which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
-  which ${target_cpu}-${target_os}-gcc >/dev/null 2>&1 \
-  && CC=${target_cpu}-${target-os}-gcc
-  which ${target_cpu}-${target_vendor}-${target_os}-gcc >/dev/null 2>&1 \
-  && CC=${target_cpu}-${target_vendor}-${target_os}-gcc
-
-  AC_MSG_RESULT($CC)
-fi
-
 AC_PROG_CC
 dnl AC_PROG_CXX
 AC_PROG_INSTALL
 AC_PROG_MKDIR_P
 AC_PROG_LN_S
 AC_PROG_SED
+AC_DISABLE_STATIC
+AM_PROG_LIBTOOL
 PKG_PROG_PKG_CONFIG
-AM_PATH_ALSA(1.0.27)
+AM_PATH_ALSA(1.2.5)
 if test "x$enable_alsatest" = "xyes"; then
 AC_CHECK_FUNC([snd_ctl_elem_add_enumerated],
              , [AC_ERROR([No user enum control support in alsa-lib])])
 fi
 
+
+AC_CHECK_HEADERS([dlfcn.h malloc.h])
+
 dnl Check components
 AC_CHECK_HEADERS([alsa/pcm.h], [have_pcm="yes"], [have_pcm="no"],
   [#include <alsa/asoundlib.h>])
@@ -50,15 +41,104 @@ AC_CHECK_HEADERS([alsa/seq.h], [have_seq="yes"], [have_seq="no"],
   [#include <alsa/asoundlib.h>])
 AC_CHECK_HEADERS([alsa/use-case.h], [have_ucm="yes"], [have_ucm="no"],
   [#include <alsa/asoundlib.h>])
+AC_CHECK_HEADERS([alsa/topology.h], [have_topology="yes"], [have_topology="no"],
+  [#include <alsa/asoundlib.h>])
 AC_CHECK_HEADERS([samplerate.h], [have_samplerate="yes"], [have_samplerate="no"],
   [#include <samplerate.h>])
 
+AC_CHECK_LIB([asound], [snd_seq_client_info_get_card], [HAVE_SEQ_CLIENT_INFO_GET_CARD="yes"])
+if test "$HAVE_SEQ_CLIENT_INFO_GET_CARD" = "yes" ; then
+    AC_DEFINE([HAVE_SEQ_CLIENT_INFO_GET_CARD], 1, [alsa-lib supports snd_seq_client_info_get_card])
+fi
+AC_CHECK_LIB([asound], [snd_seq_client_info_get_pid], [HAVE_SEQ_CLIENT_INFO_GET_PID="yes"])
+if test "$HAVE_SEQ_CLIENT_INFO_GET_PID" = "yes" ; then
+    AC_DEFINE([HAVE_SEQ_CLIENT_INFO_GET_PID], 1, [alsa-lib supports snd_seq_client_info_get_pid])
+fi
+AC_CHECK_LIB([asound], [snd_seq_client_info_get_midi_version], [HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION="yes"])
+if test "$HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION" = "yes" -a "$have_rawmidi" = "yes"; then
+    AC_DEFINE([HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION], 1, [alsa-lib supports snd_seq_client_info_get_midi_version])
+fi
+AC_CHECK_LIB([atopology], [snd_tplg_save], [have_topology="yes"], [have_topology="no"])
+
+#
+# NOTE: The library 'libffado' (at least v2.4.1) executes ctor/dtor of instances
+# for some objects in startup/finish routines of C runtime. As a result, it
+# outputs some superfluos messages. Furthermore, it brings much memory leak
+# internally. Totally, libffado support is not recommended at all in usual
+# purposes except for technical preview.
+#
+AC_CHECK_LIB([ffado], [ffado_streaming_init], [have_ffado="yes"], [have_ffado="no"])
+AS_IF([test x"$have_ffado" = xyes],
+      [AC_DEFINE([WITH_FFADO], [1], [Define if FFADO library is available])])
+
+# Test programs for axfer use shm by memfd_create(2). If not supported, open(2) is used alternatively.
+AC_CHECK_FUNC([memfd_create], [have_memfd_create="yes"], [have_memfd_create="no"])
+AS_IF([test x$have_memfd_create = xyes],
+      [AC_DEFINE([HAVE_MEMFD_CREATE], [1], [Define if Linux kernel supports memfd_create system call])])
+
 AM_CONDITIONAL(HAVE_PCM, test "$have_pcm" = "yes")
 AM_CONDITIONAL(HAVE_MIXER, test "$have_mixer" = "yes")
 AM_CONDITIONAL(HAVE_RAWMIDI, test "$have_rawmidi" = "yes")
 AM_CONDITIONAL(HAVE_SEQ, test "$have_seq" = "yes")
 AM_CONDITIONAL(HAVE_UCM, test "$have_ucm" = "yes")
+AM_CONDITIONAL(HAVE_TOPOLOGY, test "$have_topology" = "yes" -a "$ac_cv_header_dlfcn_h" = "yes")
 AM_CONDITIONAL(HAVE_SAMPLERATE, test "$have_samplerate" = "yes")
+AM_CONDITIONAL(HAVE_FFADO, test "$have_ffado" = "yes")
+
+dnl Use tinyalsa
+alsabat_backend_tiny=
+AC_ARG_ENABLE(alsabat_backend_tiny,
+    AS_HELP_STRING([--enable-alsabat-backend-tiny], [Use tinyalsa for alsabat backend]),
+    [case "${enableval}" in
+      yes) alsabat_backend_tiny=true ;;
+      no) alsabat_backend_tiny=false ;;
+      *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsabat-backend-tiny) ;;
+    esac],[alsabat_backend_tiny=false])
+
+dnl Disable bat
+bat=
+if test "$have_pcm" = "yes"; then
+AC_ARG_ENABLE(bat,
+     AS_HELP_STRING([--disable-bat], [Disable bat compilation]),
+     [case "${enableval}" in
+       yes) bat=true ;;
+       no)  bat=false ;;
+       *) AC_MSG_ERROR(bad value ${enableval} for --enable-bat) ;;
+     esac],[bat=true])
+fi
+AM_CONDITIONAL(BAT, test x$bat = xtrue)
+
+if test x$bat = xtrue; then
+
+  saved_CFLAGS="$CFLAGS"
+  saved_LDFLAGS="$LDFLAGS"
+  saved_LIBS="$LIBS"
+  FFTW_INC=""
+  FFTW_LIB=""
+  FFTW_CFLAGS=""
+  dnl Check for libfftw3
+  have_libfftw3="yes"
+  AC_CHECK_LIB([fftw3f], [fftwf_malloc], , [have_libfftw3="no"])
+  dnl Check for libtinyalsa
+  have_libtinyalsa=
+  if test x$alsabat_backend_tiny = xtrue; then
+    have_libtinyalsa="yes"
+    AC_CHECK_LIB([tinyalsa], [pcm_open], , [have_libtinyalsa="no"])
+  fi
+  AC_CHECK_LIB([m], [sqrtf], , [AC_MSG_ERROR([Error: Need sqrtf])])
+  AC_CHECK_LIB([pthread], [pthread_create], , [AC_MSG_ERROR([Error: need PTHREAD library])])
+  FFTW_CFLAGS="$CFLAGS"
+  FFTW_LIB="$LIBS"
+  CFLAGS="$saved_CFLAGS"
+  LDFLAGS="$saved_LDFLAGS"
+  LIBS="$saved_LIBS"
+  AC_SUBST(FFTW_INC)
+  AC_SUBST(FFTW_LIB)
+  AC_SUBST(FFTW_CFLAGS)
+
+fi
+AM_CONDITIONAL(HAVE_LIBFFTW3, test "$have_libfftw3" = "yes")
+AM_CONDITIONAL(HAVE_LIBTINYALSA, test "$have_libtinyalsa" = "yes")
 
 dnl Check for librt
 LIBRT=""
@@ -113,14 +193,33 @@ AC_ARG_ENABLE(alsaloop,
      esac],[alsaloop=true])
 AM_CONDITIONAL(ALSALOOP, test x$alsaloop = xtrue)
 
-xmlto=""
+dnl Disable nhlt
+AC_ARG_ENABLE(nhlt,
+     AS_HELP_STRING([--disable-nhlt], [Disable nhlt packaging]),
+     [case "${enableval}" in
+       yes) nhlt=true ;;
+       no)  nhlt=false ;;
+       *) AC_MSG_ERROR(bad value ${enableval} for --enable-nhlt) ;;
+     esac],[nhlt=true])
+AM_CONDITIONAL(NHLT, test x$nhlt = xtrue)
+
+xmlto_available=""
 AC_ARG_ENABLE(xmlto,
  AS_HELP_STRING([--disable-xmlto], [Disable man page creation via xmlto]),
  xmlto="$enableval", xmlto="yes")
 if test "$xmlto" = "yes"; then
-  AC_CHECK_PROG([xmlto], [xmlto], [yes])
+  AC_CHECK_PROG([xmlto_available], [xmlto], [yes])
 fi
-AM_CONDITIONAL(USE_XMLTO, test x"$xmlto" = xyes)
+AM_CONDITIONAL(USE_XMLTO, test x"$xmlto_available" = xyes)
+
+rst2man_available=""
+AC_ARG_ENABLE(rst2man,
+ AS_HELP_STRING([--disable-rst2man], [Disable man page creation via rst2man]),
+ rst2man="$enableval", rst2man="yes")
+if test "$rst2man" = "yes"; then
+  AC_CHECK_PROG([rst2man_available], [rst2man], [yes])
+fi
+AM_CONDITIONAL(USE_RST2MAN, test x"$rst2man_available" = xyes)
 
 AC_ARG_WITH(
         [udev-rules-dir],
@@ -283,6 +382,7 @@ AC_SUBST(CURSESLIB)
 AC_SUBST(CURSES_CFLAGS)
 
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
 eval dir="$datadir"
 case "$dir" in
@@ -321,13 +421,17 @@ SAVE_UTIL_VERSION
 AC_SUBST(LIBRT)
 
 dnl Check for systemd
+PKG_CHECK_MODULES(SYSTEMD, [systemd >= 18],
+        [have_min_systemd="yes"],
+        [have_min_systemd="no"])
 AC_ARG_WITH([systemdsystemunitdir],
         AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
         [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
 if test "x$with_systemdsystemunitdir" != xno; then
         AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
 fi
-AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test "$have_min_systemd" = "yes" \
+        -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
 
 AC_ARG_WITH([asound-state-dir],
         AS_HELP_STRING([--with-asound-state-dir=DIR], [Directory to place asound.state file in]),
@@ -353,14 +457,37 @@ AC_ARG_WITH([alsactl-daemonswitch],
         [ALSACTL_DAEMONSWITCH="/etc/alsa/state-daemon.conf"])
 AC_SUBST(ALSACTL_DAEMONSWITCH)
 
+dnl pre-process plugin directory
+AC_ARG_WITH(plugindir,
+    AS_HELP_STRING([--with-plugindir=dir],
+       [path where pre-process plugin files are stored]),
+    plugindir="$withval", plugindir="")
+if test -z "$plugindir"; then
+    eval dir="$libdir"
+    echo ${exec_prefix}
+    echo $libdir
+    echo $dir
+    case "$dir" in
+    /*) ;;
+    *) dir="$dir"
+    esac
+    plugindir="$dir/alsa-topology"
+fi
+AC_DEFINE_UNQUOTED(ALSA_TOPOLOGY_PLUGIN_DIR, "$plugindir", [directory containing ALSA topology pre-process plugins])
+ALSA_TOPOLOGY_PLUGIN_DIR="$plugindir"
+AC_SUBST(ALSA_TOPOLOGY_PLUGIN_DIR)
+
 AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \
          alsamixer/Makefile amidi/Makefile amixer/Makefile \
          m4/Makefile po/Makefile.in \
          alsaconf/alsaconf alsaconf/Makefile \
          alsaconf/po/Makefile \
-         alsaucm/Makefile \
+         alsaucm/Makefile topology/Makefile topology/nhlt/Makefile \
+         bat/Makefile bat/tests/Makefile bat/tests/asound_state/Makefile \
          aplay/Makefile include/Makefile iecset/Makefile utils/Makefile \
          utils/alsa-utils.spec seq/Makefile seq/aconnect/Makefile \
          seq/aplaymidi/Makefile seq/aseqdump/Makefile seq/aseqnet/Makefile \
-         speaker-test/Makefile speaker-test/samples/Makefile \
-         alsaloop/Makefile alsa-info/Makefile)
+         seq/aseqsend/Makefile speaker-test/Makefile speaker-test/samples/Makefile \
+         alsaloop/Makefile alsa-info/Makefile \
+         axfer/Makefile axfer/test/Makefile \
+         nhlt/Makefile)
diff --git a/depcomp b/depcomp
index debb6ff..6b39162 100755 (executable)
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2012-03-27.16; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 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
@@ -16,7 +16,7 @@ scriptversion=2012-03-27.16; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -27,9 +27,9 @@ scriptversion=2012-03-27.16; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
   -h | --h*)
     cat <<\EOF
 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -56,11 +56,65 @@ EOF
     ;;
 esac
 
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
 # A tabulation character.
 tab='  '
 # A newline character.
 nl='
 '
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
 
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
@@ -74,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
 rm -f "$tmpdepfile"
 
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
 # Some modes work just like other modes, but use different flags.  We
 # parameterize here, but still list the modes in the big case below,
 # to make depend.m4 easier to write.  Note that we *cannot* use a case
@@ -85,32 +142,32 @@ if test "$depmode" = hp; then
 fi
 
 if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
 fi
 
 cygpath_u="cygpath -u -f -"
 if test "$depmode" = msvcmsys; then
-   # This is just like msvisualcpp but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u='sed s,\\\\,/,g'
-   depmode=msvisualcpp
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
 fi
 
 if test "$depmode" = msvc7msys; then
-   # This is just like msvc7 but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u='sed s,\\\\,/,g'
-   depmode=msvc7
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
 fi
 
 if test "$depmode" = xlc; then
-   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
-   gccflag=-qmakedep=gcc,-MF
-   depmode=gcc
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
 fi
 
 case "$depmode" in
@@ -133,8 +190,7 @@ gcc3)
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -142,13 +198,17 @@ gcc3)
   ;;
 
 gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
 ## There are various ways to get dependency output from gcc.  Here's
 ## why we pick this rather obscure method:
 ## - Don't want to use -MD because we'd like the dependencies to end
 ##   up in a subdir.  Having to rename by hand is ugly.
 ##   (We might end up doing this anyway to support other compilers.)
 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
 ## - Using -M directly means running the compiler twice (even worse
 ##   than renaming).
   if test -z "$gccflag"; then
@@ -156,15 +216,14 @@ gcc)
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     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.
+  # 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.
@@ -173,15 +232,15 @@ gcc)
 ## 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 ' ' "$nl" < "$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.  hp depmode also adds that space, but also prefixes the VPATH
 ## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
-      | sed -e 's/$/ :/' >> "$depfile"
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -199,8 +258,7 @@ sgi)
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -208,7 +266,6 @@ sgi)
 
   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
@@ -216,19 +273,15 @@ sgi)
     # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
     tr ' ' "$nl" < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr "$nl" ' ' >> "$depfile"
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
-
     # The second pass generates a dummy entry for each header file.
     tr ' ' "$nl" < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
+      | 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"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile"
   ;;
@@ -246,9 +299,8 @@ aix)
   # 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.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.u
     tmpdepfile2=$base.u
@@ -261,9 +313,7 @@ aix)
     "$@" -M
   fi
   stat=$?
-
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -272,65 +322,113 @@ aix)
   do
     test -f "$tmpdepfile" && break
   done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form 'foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # '$object: dependent.h' and one to simply 'dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$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"
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
   fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
-icc)
-  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
-  # However on
-  #    $CC -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
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using '\':
+  # and will wrap long lines using '\' :
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
-  # tcc 0.9.26 (FIXME still under development at the moment of writing)
-  # will emit a similar output, but also prepend the continuation lines
-  # with horizontal tabulation characters.
-  "$@" -MD -MF "$tmpdepfile"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
+
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form 'foo.o: dependent.h',
-  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
+  # 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 -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
-    < "$tmpdepfile" > "$depfile"
-  sed '
-    s/[ '"$tab"'][ '"$tab"']*/ /g
-    s/^ *//
-    s/ *\\*$//
-    s/^[^:]*: *//
-    /^$/d
-    /:$/d
-    s/$/ :/
-  ' < "$tmpdepfile" >> "$depfile"
+  # `$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"
   ;;
 
@@ -341,9 +439,8 @@ hp2)
   # 'foo.d', which lands next to the object file, wherever that
   # happens to be.
   # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from  "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.d
     tmpdepfile2=$dir.libs/$base.d
@@ -354,8 +451,7 @@ hp2)
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -365,76 +461,61 @@ hp2)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
     # Add 'dependent.h:' lines.
     sed -ne '2,${
-              s/^ *//
-              s/ \\*$//
-              s/$/:/
-              p
-            }' "$tmpdepfile" >> "$depfile"
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
 
 tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in 'foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
-
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
-
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
 
 msvc7)
   if test "$libtool" = yes; then
@@ -445,8 +526,7 @@ msvc7)
   "$@" $showIncludes > "$tmpdepfile"
   stat=$?
   grep -v '^Note: including file: ' "$tmpdepfile"
-  if test "$stat" = 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -472,6 +552,7 @@ $ {
   G
   p
 }' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
   rm -f "$tmpdepfile"
   ;;
 
@@ -523,13 +604,14 @@ dashmstdout)
   # in the target name.  This is to cope with DOS-style filenames:
   # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' "$nl" < "$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"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -582,10 +664,12 @@ makedepend)
   # makedepend may prepend the VPATH from the source file name to the object.
   # No need to regex-escape $object, excess matching of '.' is harmless.
   sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
-## 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"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile" "$tmpdepfile".bak
   ;;
 
@@ -621,10 +705,10 @@ cpp)
     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"
+  "$@" -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"
@@ -656,15 +740,15 @@ msvisualcpp)
       shift
       ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-       set fnord "$@"
-       shift
-       shift
-       ;;
+        set fnord "$@"
+        shift
+        shift
+        ;;
     *)
-       set fnord "$@" "$arg"
-       shift
-       shift
-       ;;
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
     esac
   done
   "$@" -E 2>/dev/null |
@@ -699,9 +783,9 @@ exit 0
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
index ce293cc..93c21a7 100755 (executable)
@@ -11,11 +11,14 @@ gettextize -c -f --no-changelog
 echo "EXTRA_DIST = gettext.m4" > m4/Makefile.am
 cp Makefile.am.ok Makefile.am
 cp configure.ac.ok configure.ac
+touch ltconfig
+libtoolize --force --copy --automake
+aclocal $ACLOCAL_FLAGS
 autoheader
 automake --foreign --copy --add-missing
 touch depcomp          # for older automake
 autoconf
-export CFLAGS='-O2 -Wall -pipe -g'
+export CFLAGS='-O2 -Wall -W -Wunused-const-variable=0 -pipe -g'
 echo "CFLAGS=$CFLAGS"
 echo "./configure $@"
 ./configure $@ || exit 1
index 14dba73..0217485 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,17 +90,19 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = iecset$(EXEEXT)
 subdir = iecset
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -73,14 +113,45 @@ am_iecset_OBJECTS = iecset.$(OBJEXT) iecbits.$(OBJEXT)
 iecset_OBJECTS = $(am_iecset_OBJECTS)
 iecset_LDADD = $(LDADD)
 iecset_DEPENDENCIES =
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/iecbits.Po ./$(DEPDIR)/iecset.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(iecset_SOURCES)
 DIST_SOURCES = $(iecset_SOURCES)
 am__can_run_installinfo = \
@@ -118,15 +189,37 @@ am__uninstall_files_from_dir = { \
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -144,11 +237,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -160,27 +260,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -193,6 +303,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -201,6 +312,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -211,7 +324,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -252,6 +367,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -262,7 +379,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 LDADD = -lm
 iecset_SOURCES = iecset.c iecbits.c
@@ -271,7 +388,7 @@ EXTRA_DIST = iecset.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -284,14 +401,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign iecset/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign iecset/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -311,10 +427,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -325,8 +443,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -335,16 +453,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 iecset$(EXEEXT): $(iecset_OBJECTS) $(iecset_DEPENDENCIES) $(EXTRA_iecset_DEPENDENCIES) 
        @rm -f iecset$(EXEEXT)
-       $(LINK) $(iecset_OBJECTS) $(iecset_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(iecset_OBJECTS) $(iecset_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -352,22 +478,44 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iecbits.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iecset.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iecbits.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iecset.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -412,26 +560,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -443,15 +580,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -460,9 +593,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -478,20 +612,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -560,10 +684,11 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/iecbits.Po
+       -rm -f ./$(DEPDIR)/iecset.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -609,13 +734,15 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/iecbits.Po
+       -rm -f ./$(DEPDIR)/iecset.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -631,9 +758,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -641,9 +769,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 13e8947..4a768a6 100644 (file)
@@ -14,7 +14,7 @@
    
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include <stdio.h>
index 92a93e8..65e9425 100644 (file)
    
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <ctype.h>
 #include <alsa/asoundlib.h>
@@ -379,7 +380,7 @@ int main(int argc, char **argv)
        for (cidx = 0; cidx < controls; cidx++) {
                if (!strcmp(snd_ctl_elem_list_get_name(clist, cidx), spdif_str))
                        if (spdif_index < 0 ||
-                           snd_ctl_elem_list_get_index(clist, cidx) == spdif_index)
+                           (int)snd_ctl_elem_list_get_index(clist, cidx) == spdif_index)
                                break;
        }
        if (cidx >= controls) {
index b447abf..3c73568 100644 (file)
@@ -1,4 +1,4 @@
-noinst_HEADERS=version.h gettext.h gettext_curses.h
+noinst_HEADERS=version.h gettext.h gettext_curses.h bswap.h os_compat.h
 
 version.h: stamp-vh
        @:
index f66449c..d57a2d6 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,21 +89,36 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = include
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/aconfig.h.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = aconfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -74,15 +127,38 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 HEADERS = $(noinst_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+       aconfig.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/aconfig.h.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -100,11 +176,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -116,27 +199,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -149,6 +242,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -157,6 +251,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -167,7 +263,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -208,6 +306,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -218,8 +318,8 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
-noinst_HEADERS = version.h gettext.h gettext_curses.h
+xmlto_available = @xmlto_available@
+noinst_HEADERS = version.h gettext.h gettext_curses.h bswap.h os_compat.h
 AM_CPPFLAGS = -I$(top_srcdir)/include
 all: aconfig.h
        $(MAKE) $(AM_MAKEFLAGS) all-am
@@ -237,14 +337,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign include/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -257,8 +356,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 aconfig.h: stamp-h1
-       @if test ! -f $@; then rm -f stamp-h1; else :; fi
-       @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+       @test -f $@ || rm -f stamp-h1
+       @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
 
 stamp-h1: $(srcdir)/aconfig.h.in $(top_builddir)/config.status
        @rm -f stamp-h1
@@ -271,26 +370,21 @@ $(srcdir)/aconfig.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 distclean-hdr:
        -rm -f aconfig.h stamp-h1
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES) aconfig.h.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS) aconfig.h.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -302,15 +396,11 @@ TAGS:  $(HEADERS) $(SOURCES) aconfig.h.in $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES) aconfig.h.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS) aconfig.h.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -319,9 +409,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -337,7 +428,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -403,7 +497,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
@@ -455,7 +549,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -469,8 +563,9 @@ uninstall-am:
 
 .MAKE: all install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-       cscopelist ctags distclean distclean-generic distclean-hdr \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool cscopelist-am ctags ctags-am distclean \
+       distclean-generic distclean-hdr distclean-libtool \
        distclean-tags distdir dvi dvi-am html html-am info info-am \
        install install-am install-data install-data-am install-dvi \
        install-dvi-am install-exec install-exec-am install-html \
@@ -478,8 +573,10 @@ uninstall-am:
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
-       uninstall-am
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
 
 
 version.h: stamp-vh
index 3fe05b7..d257e0c 100644 (file)
@@ -1,5 +1,8 @@
 /* include/aconfig.h.in.  Generated from configure.ac by autoheader.  */
 
+/* directory containing ALSA topology pre-process plugins */
+#undef ALSA_TOPOLOGY_PLUGIN_DIR
+
 /* directory containing alsa configuration */
 #undef DATADIR
 
 /* Define to 1 if you have the <alsa/seq.h> header file. */
 #undef HAVE_ALSA_SEQ_H
 
+/* Define to 1 if you have the <alsa/topology.h> header file. */
+#undef HAVE_ALSA_TOPOLOGY_H
+
 /* Define to 1 if you have the <alsa/use-case.h> header file. */
 #undef HAVE_ALSA_USE_CASE_H
 
-/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
-   CoreFoundation framework. */
-#undef HAVE_CFLOCALECOPYCURRENT
+/* Define to 1 if you have the Mac OS X function
+   CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
 
-/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
    the CoreFoundation framework. */
 #undef HAVE_CFPREFERENCESCOPYAPPVALUE
 
@@ -43,6 +49,9 @@
    */
 #undef HAVE_DCGETTEXT
 
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
 /* Define to 1 if you have the <form.h> header file. */
 #undef HAVE_FORM_H
 
 /* Define to 1 if you have the `asound' library (-lasound). */
 #undef HAVE_LIBASOUND
 
+/* Define to 1 if you have the `atopology' library (-latopology). */
+#undef HAVE_LIBATOPOLOGY
+
+/* Define to 1 if you have the `fftw3f' library (-lfftw3f). */
+#undef HAVE_LIBFFTW3F
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
 /* Have librt */
 #undef HAVE_LIBRT
 
+/* Define to 1 if you have the `tinyalsa' library (-ltinyalsa). */
+#undef HAVE_LIBTINYALSA
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if Linux kernel supports memfd_create system call */
+#undef HAVE_MEMFD_CREATE
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
 /* Define to 1 if you have the <samplerate.h> header file. */
 #undef HAVE_SAMPLERATE_H
 
+/* alsa-lib supports snd_seq_client_info_get_card */
+#undef HAVE_SEQ_CLIENT_INFO_GET_CARD
+
+/* alsa-lib supports snd_seq_client_info_get_midi_version */
+#undef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+
+/* alsa-lib supports snd_seq_client_info_get_pid */
+#undef HAVE_SEQ_CLIENT_INFO_GET_PID
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#undef LT_OBJDIR
+
 /* Name of package */
 #undef PACKAGE
 
 /* ALSA util version */
 #undef VERSION
 
+/* Define if FFADO library is available */
+#undef WITH_FFADO
+
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE
 # define _DARWIN_USE_64_BIT_INODE 1
diff --git a/include/bswap.h b/include/bswap.h
new file mode 100644 (file)
index 0000000..e590124
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ *  ALSA lib - compatibility header for providing byte swapping macros
+ *  Copyright (c) 2016 by  Thomas Klausner <wiz@NetBSD.org>
+ *
+ *
+ *   This library is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Lesser General Public License as
+ *   published by the Free Software Foundation; either version 2.1 of
+ *   the License, or (at your option) any later version.
+ *
+ *   This 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 Lesser General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Lesser General Public
+ *   License along with this library; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef __BSWAP_H
+#define __BSWAP_H
+
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
+#include <sys/endian.h>
+#define bswap_16 bswap16
+#define bswap_32 bswap32
+#define bswap_64 bswap64
+#elif defined(__OpenBSD__)
+#include <sys/endian.h>
+#define bswap_16 swap16
+#define bswap_32 swap32
+#define bswap_64 swap64
+#elif defined (__sun)
+#include <sys/byteorder.h>
+#define bswap_16 BSWAP_16
+#define bswap_32 BSWAP_32
+#define bswap_64 BSWAP_64
+#else
+#include <byteswap.h>
+#endif
+
+#endif
diff --git a/include/os_compat.h b/include/os_compat.h
new file mode 100644 (file)
index 0000000..8d4f041
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * ALSA lib - compatibility header for supporting various OSes
+ * Copyright (C) 2022 by Takayoshi SASANO <uaa@cvs.openbsd.org>
+ *
+ *
+ *   This library is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Lesser General Public License as
+ *   published by the Free Software Foundation; either version 2.1 of
+ *   the License, or (at your option) any later version.
+ *
+ *   This 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 Lesser General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Lesser General Public
+ *   License along with this library; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef __OS_COMPAT_H
+#define __OS_COMPAT_H
+
+#ifndef ESTRPIPE
+#define ESTRPIPE ESPIPE
+#endif
+
+#ifndef ERESTART
+#define ERESTART EINTR
+#endif
+
+#ifndef SCHED_IDLE
+#define SCHED_IDLE SCHED_OTHER
+#endif
+
+#if defined(__OpenBSD__)
+/* these functions in <sched.h> are not implemented */
+#define sched_getparam(pid, param) (-1)
+#define sched_setscheduler(pid, policy, param) (-1)
+#endif
+
+#endif
index a68e20f..88dfb2b 100644 (file)
@@ -3,10 +3,10 @@
  */
 
 #define SND_UTIL_MAJOR         1
-#define SND_UTIL_MINOR         0
-#define SND_UTIL_SUBMINOR      29
+#define SND_UTIL_MINOR         2
+#define SND_UTIL_SUBMINOR      12
 #define SND_UTIL_VERSION               ((SND_UTIL_MAJOR<<16)|\
                                 (SND_UTIL_MINOR<<8)|\
                                  SND_UTIL_SUBMINOR)
-#define SND_UTIL_VERSION_STR   "1.0.29"
+#define SND_UTIL_VERSION_STR   "1.2.12"
 
index 377bb86..20d8b2e 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2018-03-11.20; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
 # This script is compatible with the BSD install script, but was written
 # from scratch.
 
+tab='  '
 nl='
 '
-IFS=" ""       $nl"
+IFS=" $tab$nl"
 
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
 
-# Don't use :- since 4.3BSD and earlier shells don't like it.
 doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
 
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
 rmprog=${RMPROG-rm}
 stripprog=${STRIPPROG-strip}
 
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
 posix_mkdir=
 
 # Desired mode of installed file.
@@ -97,7 +82,7 @@ dir_arg=
 dst_arg=
 
 copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
 
 usage="\
 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -137,46 +122,57 @@ while test $# -ne 0; do
     -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-       shift;;
+        shift;;
 
     --help) echo "$usage"; exit $?;;
 
     -m) mode=$2
-       case $mode in
-         *' '* | *'    '* | *'
-'*       | *'*'* | *'?'* | *'['*)
-           echo "$0: invalid mode: $mode" >&2
-           exit 1;;
-       esac
-       shift;;
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
 
     -o) chowncmd="$chownprog $2"
-       shift;;
+        shift;;
 
     -s) stripcmd=$stripprog;;
 
-    -t) dst_arg=$2
-       # Protect names problematic for 'test' and other utilities.
-       case $dst_arg in
-         -* | [=\(\)!]) dst_arg=./$dst_arg;;
-       esac
-       shift;;
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
 
-    -T) no_target_directory=true;;
+    -T) is_target_a_directory=never;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    --)        shift
-       break;;
+    --) shift
+        break;;
 
-    -*)        echo "$0: invalid option: $1" >&2
-       exit 1;;
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
 
     *)  break;;
   esac
   shift
 done
 
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
@@ -208,6 +204,15 @@ if test $# -eq 0; then
 fi
 
 if test -z "$dir_arg"; then
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
   do_exit='(exit $ret); exit $ret'
   trap "ret=129; $do_exit" 1
   trap "ret=130; $do_exit" 2
@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then
 
     *[0-7])
       if test -z "$stripcmd"; then
-       u_plus_rw=
+        u_plus_rw=
       else
-       u_plus_rw='% 200'
+        u_plus_rw='% 200'
       fi
       cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
     *)
       if test -z "$stripcmd"; then
-       u_plus_rw=
+        u_plus_rw=
       else
-       u_plus_rw=,u+rw
+        u_plus_rw=,u+rw
       fi
       cp_umask=$mode$u_plus_rw;;
   esac
@@ -266,122 +271,113 @@ do
     fi
     dst=$dst_arg
 
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
+    # If destination is a directory, append the input filename.
     if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-       echo "$0: $dst_arg: Is a directory" >&2
-       exit 1
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
       fi
       dstdir=$dst
-      dst=$dstdir/`basename "$src"`
+      dstbase=`basename "$src"`
+      case $dst in
+       */) dst=$dst$dstbase;;
+       *)  dst=$dst/$dstbase;;
+      esac
       dstdir_status=0
     else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-       (dirname "$dst") 2>/dev/null ||
-       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-            X"$dst" : 'X\(//\)[^/]' \| \
-            X"$dst" : 'X\(//\)$' \| \
-            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-       echo X"$dst" |
-           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-                  s//\1/
-                  q
-                }
-                /^X\(\/\/\)[^/].*/{
-                  s//\1/
-                  q
-                }
-                /^X\(\/\/\)$/{
-                  s//\1/
-                  q
-                }
-                /^X\(\/\).*/{
-                  s//\1/
-                  q
-                }
-                s/.*/./; q'
-      `
-
+      dstdir=`dirname "$dst"`
       test -d "$dstdir"
       dstdir_status=$?
     fi
   fi
 
+  case $dstdir in
+    */) dstdirslash=$dstdir;;
+    *)  dstdirslash=$dstdir/;;
+  esac
+
   obsolete_mkdir_used=false
 
   if test $dstdir_status != 0; then
     case $posix_mkdir in
       '')
-       # Create intermediate dirs using mode 755 as modified by the umask.
-       # This is like FreeBSD 'install' as of 1997-10-28.
-       umask=`umask`
-       case $stripcmd.$umask in
-         # Optimize common cases.
-         *[2367][2367]) mkdir_umask=$umask;;
-         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-         *[0-7])
-           mkdir_umask=`expr $umask + 22 \
-             - $umask % 100 % 40 + $umask % 20 \
-             - $umask % 10 % 4 + $umask % 2
-           `;;
-         *) mkdir_umask=$umask,go-w;;
-       esac
-
-       # With -d, create the new directory with the user-specified mode.
-       # Otherwise, rely on $mkdir_umask.
-       if test -n "$dir_arg"; then
-         mkdir_mode=-m$mode
-       else
-         mkdir_mode=
-       fi
-
-       posix_mkdir=false
-       case $umask in
-         *[123567][0-7][0-7])
-           # POSIX mkdir -p sets u+wx bits regardless of umask, which
-           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-           ;;
-         *)
-           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-           if (umask $mkdir_umask &&
-               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-           then
-             if test -z "$dir_arg" || {
-                  # Check for POSIX incompatibilities with -m.
-                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-                  # other-writable bit of parent directory when it shouldn't.
-                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
-                  case $ls_ld_tmpdir in
-                    d????-?r-*) different_mode=700;;
-                    d????-?--*) different_mode=755;;
-                    *) false;;
-                  esac &&
-                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-                  }
-                }
-             then posix_mkdir=:
-             fi
-             rmdir "$tmpdir/d" "$tmpdir"
-           else
-             # Remove any dirs left behind by ancient mkdir implementations.
-             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-           fi
-           trap '' 0;;
-       esac;;
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            # Note that $RANDOM variable is not portable (e.g. dash);  Use it
+            # here however when possible just to lower collision chance.
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            # Because "mkdir -p" follows existing symlinks and we likely work
+            # directly in world-writeable /tmp, make sure that the '$tmpdir'
+            # directory is successfully created first before we actually test
+            # 'mkdir -p' feature.
+            if (umask $mkdir_umask &&
+                $mkdirprog $mkdir_mode "$tmpdir" &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   test_tmpdir="$tmpdir/a"
+                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
     esac
 
     if
       $posix_mkdir && (
-       umask $mkdir_umask &&
-       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
       )
     then :
     else
@@ -391,53 +387,51 @@ do
       # directory the slow way, step by step, checking for races as we go.
 
       case $dstdir in
-       /*) prefix='/';;
-       [-=\(\)!]*) prefix='./';;
-       *)  prefix='';;
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
       esac
 
-      eval "$initialize_posix_glob"
-
       oIFS=$IFS
       IFS=/
-      $posix_glob set -f
+      set -f
       set fnord $dstdir
       shift
-      $posix_glob set +f
+      set +f
       IFS=$oIFS
 
       prefixes=
 
       for d
       do
-       test X"$d" = X && continue
-
-       prefix=$prefix$d
-       if test -d "$prefix"; then
-         prefixes=
-       else
-         if $posix_mkdir; then
-           (umask=$mkdir_umask &&
-            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-           # Don't fail if two instances are running concurrently.
-           test -d "$prefix" || exit 1
-         else
-           case $prefix in
-             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-             *) qprefix=$prefix;;
-           esac
-           prefixes="$prefixes '$qprefix'"
-         fi
-       fi
-       prefix=$prefix/
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
       done
 
       if test -n "$prefixes"; then
-       # Don't fail if two instances are running concurrently.
-       (umask $mkdir_umask &&
-        eval "\$doit_exec \$mkdirprog $prefixes") ||
-         test -d "$dstdir" || exit 1
-       obsolete_mkdir_used=true
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
       fi
     fi
   fi
@@ -450,14 +444,25 @@ do
   else
 
     # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
+    dsttmp=${dstdirslash}_inst.$$_
+    rmtmp=${dstdirslash}_rm.$$_
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
 
     # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+    (umask $cp_umask &&
+     { test -z "$stripcmd" || {
+        # Create $dsttmp read-write so that cp doesn't create it read-only,
+        # which would cause strip to fail.
+        if test -z "$doit"; then
+          : >"$dsttmp" # No need to fork-exec 'touch'.
+        else
+          $doit touch "$dsttmp"
+        fi
+       }
+     } &&
+     $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -472,15 +477,12 @@ do
 
     # If -C, don't bother to copy if it wouldn't change the file.
     if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
        set X $old && old=:$2:$4:$5:$6 &&
        set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
+       set +f &&
        test "$old" = "$new" &&
        $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
     then
@@ -493,24 +495,24 @@ do
       # to itself, or perhaps because mv is so ancient that it does not
       # support -f.
       {
-       # Now remove or move aside any old file at destination location.
-       # We try this two ways since rm can't unlink itself on some
-       # systems and the destination file might be busy for other
-       # reasons.  In this case, the final cleanup might fail but the new
-       # file should still install successfully.
-       {
-         test ! -f "$dst" ||
-         $doit $rmcmd -f "$dst" 2>/dev/null ||
-         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-         } ||
-         { echo "$0: cannot unlink or rename $dst" >&2
-           (exit 1); exit 1
-         }
-       } &&
-
-       # Now rename the file to the real destination.
-       $doit $mvcmd "$dsttmp" "$dst"
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
       }
     fi || exit 1
 
@@ -519,9 +521,9 @@ do
 done
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/ltconfig b/ltconfig
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ltmain.sh b/ltmain.sh
new file mode 100644 (file)
index 0000000..7f3523d
--- /dev/null
+++ b/ltmain.sh
@@ -0,0 +1,11149 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+##               by inline-source v2014-01-03.01
+
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996-2015 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.6
+package_revision=2.4.6
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 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.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
+fi
+
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+         export $_G_var
+         _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+         _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
+       fi"
+done
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp       $nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+    test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+    _G_progs_list=$1
+    _G_check_func=$2
+    _G_PATH=${3-"$PATH"}
+
+    _G_path_prog_max=0
+    _G_path_prog_found=false
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+    for _G_dir in $_G_PATH; do
+      IFS=$_G_save_IFS
+      test -z "$_G_dir" && _G_dir=.
+      for _G_prog_name in $_G_progs_list; do
+        for _exeext in '' .EXE; do
+          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+          func_executable_p "$_G_path_prog" || continue
+          case `"$_G_path_prog" --version 2>&1` in
+            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+            *)     $_G_check_func $_G_path_prog
+                  func_path_progs_result=$func_check_prog_result
+                  ;;
+          esac
+          $_G_path_prog_found && break 3
+        done
+      done
+    done
+    IFS=$_G_save_IFS
+    test -z "$func_path_progs_result" && {
+      echo "no acceptable sed could be found in \$PATH" >&2
+      exit 1
+    }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+  for _G_i in 1 2 3 4 5 6 7; do
+    _G_sed_script=$_G_sed_script$nl$_G_sed_script
+  done
+  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+  _G_sed_script=
+
+  func_check_prog_sed ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo '' >> conftest.nl
+      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  rm -f conftest.sed
+  SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+  func_check_prog_grep ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    _G_path_prog_max=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo 'GREP' >> conftest.nl
+      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
+
+: ${CP="cp -f"}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+
+
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
+
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+
+# Same as above, but do not quote variable references.
+sed_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
+# that contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_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 '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+  s/$_G_bs4/&\\
+/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+  s/\n//g"
+
+
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
+
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
+
+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.
+
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
+
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
+
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
+
+# Make sure we have an absolute progpath for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
+     progdir=`cd "$progdir" && pwd`
+     progpath=$progdir/$progname
+     ;;
+  *)
+     _G_IFS=$IFS
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS=$_G_IFS
+       test -x "$progdir/$progname" && break
+     done
+     IFS=$_G_IFS
+     test -n "$progdir" || progdir=`pwd`
+     progpath=$progdir/$progname
+     ;;
+esac
+
+
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
+
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
+
+opt_dry_run=false
+opt_quiet=false
+opt_verbose=false
+
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
+
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
+
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
+{
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset='\e[0m'
+        tc_bold='\e[1m';   tc_standout='\e[7m'
+        tc_red='\e[31m';   tc_green='\e[32m'
+        tc_blue='\e[34m';  tc_cyan='\e[36m'
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
+
+    require_term_colors=:
+}
+
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+    $debug_cmd
+
+    eval _G_current_value='`$ECHO $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+    $debug_cmd
+
+    '"$_d"'
+}'
+
+
+# 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"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $debug_cmd
+
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    $debug_cmd
+
+    _G_directory_path=$1
+    _G_dir_list=
+
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$_G_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+       # list incase some portion of path contains whitespace.
+        _G_dir_list=$_G_directory_path:$_G_dir_list
+
+        # If the last portion added has no slash in it, the list is done
+        case $_G_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
+      done
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
+
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+       IFS=$func_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 "$_G_dir" 2>/dev/null || :
+      done
+      IFS=$func_mkdir_p_IFS
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
+    fi
+}
+
+
+# func_mktempdir [BASENAME]
+# -------------------------
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, BASENAME is the basename for that directory.
+func_mktempdir ()
+{
+    $debug_cmd
+
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
+
+    if test : = "$opt_dry_run"; then
+      # Return a directory name, but don't create it in dry-run mode
+      _G_tmpdir=$_G_template-$$
+    else
+
+      # If mktemp works, use that first and foremost
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$_G_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
+
+        func_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+    fi
+
+    $ECHO "$_G_tmpdir"
+}
+
+
+# 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.
+func_normal_abspath ()
+{
+    $debug_cmd
+
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+               s|/\./|/|g
+               t dotsl
+               s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # 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 "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_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 "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_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_append 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_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+    $debug_cmd
+
+    $opt_quiet || 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_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+    $debug_cmd
+
+    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 -z "$func_relative_path_tlibdir"; 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 -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
+    fi
+
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
+    fi
+
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
+    :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
+func_quote_for_eval ()
+{
+    $debug_cmd
+
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+         _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+       func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \  ]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+         ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+       func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
+}
+
+
+# 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 ()
+{
+    $debug_cmd
+
+    case $1 in
+      *[\\\`\"]*)
+       _G_arg=`$ECHO "$1" | $SED \
+           -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        _G_arg=$1 ;;
+    esac
+
+    case $_G_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.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        _G_arg=\"$_G_arg\"
+        ;;
+    esac
+
+    func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# 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).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet 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 ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+       eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet 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 ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    $opt_dry_run || {
+      eval "$_G_user_locale
+           $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+       eval "(exit $_G_status); $_G_fail_exp"
+      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 ()
+{
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $debug_cmd
+
+    $opt_verbose && func_echo "$*"
+
+    :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    printf '%s\n%s\n' "$1" "$2" \
+      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false.  Use it like this:
+#
+#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+    $debug_cmd
+
+    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 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.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next 'cmd' execution.
+      eval _G_hook_result=\$${_G_hook}_result
+      eval set dummy "$_G_hook_result"; shift
+    done
+
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_options_prep_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_silent_option_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_option_validation_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+    $debug_cmd
+
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
+
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
+
+    # save modified positional parameters for caller
+    func_options_result=$func_run_hooks_result
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
+{
+    $debug_cmd
+
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
+
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+    $debug_cmd
+
+    func_parse_options_result=
+
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
+
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy "$func_run_hooks_result"; shift
+
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
+
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+                     ;;
+
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+       # Separate optargs to long options (plugins may need this):
+       --*=*)        func_split_equals "$_G_opt"
+                     set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+    $debug_cmd
+
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+    func_run_hooks func_validate_options ${1+"$@"}
+
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
+}
+
+
+
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    $debug_cmd
+
+    eval \$ECHO \""Usage: $usage"\"
+    eval \$ECHO \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message"
+    exit 0
+}
+
+
+# func_missing_arg ARGNAME
+# ------------------------
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $debug_cmd
+
+    func_error "Missing argument for '$1'."
+    exit_cmd=exit
+}
+
+
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# 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.
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
+
+
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
+{
+    $debug_cmd
+
+    eval \$ECHO \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+       h
+       /^Written by/q' < "$progpath"
+    echo
+    eval \$ECHO \""$usage_message"\"
+}
+
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
+
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
+
+    exit $?
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
+
+
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+    $debug_cmd
+
+    $warning_func ${1+"$@"}
+}
+
+
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --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
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_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)
+       version:        $progname (GNU libtool) 2.4.6
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+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/>."
+    exit 0
+}
+
+
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
+    func_xform_result=${1%.*}.lo
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
+
+
+# func_fatal_configuration ARG...
+# -------------------------------
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "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 yes = "$build_libtool_libs"; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test yes = "$build_old_libs"; 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
+}
+
+
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+    $debug_mode
+
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
+
+    nonopt=
+    preserve_args=
+
+    # 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
+
+    # Pass back the list of options.
+    func_quote_for_eval ${1+"$@"}
+    libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
+
+
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
+{
+    $debug_cmd
+
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+       # An option not handled by this hook function:
+        *)             set dummy "$_G_opt" ${1+"$@"};  shift; break  ;;
+      esac
+    done
+
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
+
+
+
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
+    fi
+
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
+
+    case $host in
+      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+        # 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
+
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
+
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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."
+    }
+
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_validate_options libtool_validate_options
+
+
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+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=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# 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 | func_generated_by_libtool_p
+}
+
+# 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 yes = "$lalib_p"
+}
+
+# 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 ()
+{
+    test -f "$1" &&
+      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
+}
+
+# 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 ()
+{
+    $debug_cmd
+
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$sp$nl
+      eval cmd=\"$cmd\"
+      IFS=$save_ifs
+      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 ()
+{
+    $debug_cmd
+
+    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 ()
+{
+    $debug_cmd
+
+    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 yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
+    else
+      write_lobj=none
+    fi
+
+    if test yes = "$build_old_libs"; 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) $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 ()
+{
+  $debug_cmd
+
+  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 "$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 ()
+{
+  $debug_cmd
+
+  # 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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  $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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[    ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([      ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $debug_cmd
+
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+       # do not "continue".  Instead, add this to base_compile
+       lastarg=$arg
+       arg_mode=normal
+       ;;
+
+      target )
+       libobj=$arg
+       arg_mode=normal
+       continue
+       ;;
+
+      normal )
+       # Accept any command-line options.
+       case $arg in
+       -o)
+         test -n "$libobj" && \
+           func_fatal_error "you cannot specify '-o' more than once"
+         arg_mode=target
+         continue
+         ;;
+
+       -pie | -fpie | -fPIE)
+          func_append pie_flag " $arg"
+         continue
+         ;;
+
+       -shared | -static | -prefer-pic | -prefer-non-pic)
+         func_append later " $arg"
+         continue
+         ;;
+
+       -no-suppress)
+         suppress_opt=no
+         continue
+         ;;
+
+       -Xcompiler)
+         arg_mode=arg  #  the next one goes into the "base_compile" arg list
+         continue      #  The current "srcfile" will either be retained or
+         ;;            #  replaced later.  I would guess that would be a bug.
+
+       -Wc,*)
+         func_stripname '-Wc,' '' "$arg"
+         args=$func_stripname_result
+         lastarg=
+         save_ifs=$IFS; IFS=,
+         for arg in $args; do
+           IFS=$save_ifs
+           func_append_quoted lastarg "$arg"
+         done
+         IFS=$save_ifs
+         func_stripname ' ' '' "$lastarg"
+         lastarg=$func_stripname_result
+
+         # Add the arguments to base_compile.
+         func_append base_compile " $lastarg"
+         continue
+         ;;
+
+       *)
+         # Accept the current argument as the source file.
+         # The previous "srcfile" becomes the current argument.
+         #
+         lastarg=$srcfile
+         srcfile=$arg
+         ;;
+       esac  #  case $arg
+       ;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_append_quoted base_compile "$lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with '-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+       func_basename "$srcfile"
+       libobj=$func_basename_result
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from '$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+       test yes = "$build_libtool_libs" \
+         || func_fatal_configuration "cannot 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 yes = "$build_old_libs"; 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 no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; 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 yes = "$need_locks"; 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 warn = "$need_locks"; 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 yes = "$build_libtool_libs"; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test no != "$pic_mode"; 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 warn = "$need_locks" &&
+        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 yes = "$suppress_opt"; then
+       suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
+       # Don't build PIC code
+       command="$base_compile $qsrcfile$pie_flag"
+      else
+       command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test yes = "$compiler_c_o"; 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 warn = "$need_locks" &&
+        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 no != "$need_locks"; then
+       removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+  test compile = "$opt_mode" && 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
+  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
+  -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 ()
+{
+    $debug_cmd
+
+    # 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 $opt_dry_run; then
+      # 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
+    else
+      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
+    fi
+}
+
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $debug_cmd
+
+    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_quiet && 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 finish = "$opt_mode" && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $debug_cmd
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
+       # 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=false
+    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=: ;;
+      -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-m = "X$prev" && 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=:
+    if $isdir; 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
+           ;;
+         os2*)
+           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 yes = "$build_old_libs"; 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=:
+         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'`
+           if test -n "$libdir" && test ! -f "$libfile"; then
+             func_warning "'$lib' has not been installed in '$libdir'"
+             finalize=false
+           fi
+         done
+
+         relink_command=
+         func_source "$wrapper"
+
+         outputname=
+         if test no = "$fast_install" && test -n "$relink_command"; then
+           $opt_dry_run || {
+             if $finalize; 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_quiet || {
+                 func_quote_for_expand "$relink_command"
+                 eval "func_echo $func_quote_for_expand_result"
+               }
+               if eval "$relink_command"; then :
+                 else
+                 func_error "error: relink '$file' with the above command before installing it"
+                 $opt_dry_run || ${RM}r "$tmpdir"
+                 continue
+               fi
+               file=$outputname
+             else
+               func_warning "cannot relink '$file'"
+             fi
+           }
+         else
+           # Install the binary that we compiled earlier.
+           file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+         fi
+       fi
+
+       # remove .exe since cygwin /usr/bin/install will append another
+       # one anyway
+       case $install_prog,$host in
+       */usr/bin/install*,*cygwin*)
+         case $file:$destfile in
+         *.exe:*.exe)
+           # this is ok
+           ;;
+         *.exe:*)
+           destfile=$destfile.exe
+           ;;
+         *:*.exe)
+           func_stripname '' '.exe' "$destfile"
+           destfile=$func_stripname_result
+           ;;
+         esac
+         ;;
+       esac
+       func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+       $opt_dry_run || if test -n "$outputname"; then
+         ${RM}r "$tmpdir"
+       fi
+       ;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name=$func_basename_result
+
+      # Set up the ranlib parameters.
+      oldlib=$destdir/$name
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+       func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run '$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test install = "$opt_mode" && 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 ()
+{
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
+    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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) $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 can'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
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* External symbol declarations for the compiler. */\
+"
+
+       if test yes = "$dlself"; 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
+
+         func_show_eval '$RM "${nlist}I"'
+         if test -n "$global_symbol_to_import"; then
+           eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+         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[];\
+"
+
+         if test -s "$nlist"I; then
+           echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+           $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+           echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+         fi
+         echo >> "$output_objdir/$my_dlsyms" "\
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{ {\"$my_originator\", (void *) 0},"
+
+         if test -s "$nlist"I; then
+           echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+         fi
+
+         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"  ;;
+         *)
+           $my_pic_p && pic_flag_for_symtable=" $pic_flag"
+           ;;
+         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" "${nlist}I"'
+
+       # 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_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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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_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 ()
+{
+  $debug_cmd
+
+  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
+      case $nm_interface in
+      "MS dumpbin")
+       if func_cygming_ms_implib_p "$1" ||
+          func_cygming_gnu_implib_p "$1"
+       then
+         win32_nmres=import
+       else
+         win32_nmres=
+       fi
+       ;;
+      *)
+       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
+               }
+           }'`
+       ;;
+      esac
+      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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+  $debug_cmd
+
+  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 that possess that section. Heuristic: eliminate
+    # all those that 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_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 ()
+{
+  $debug_cmd
+
+  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 ()
+{
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; 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 yes = "$lock_old_archive_extraction"; 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 ()
+{
+    $debug_cmd
+
+    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`
+         func_basename "$darwin_archive"
+         darwin_base_archive=$func_basename_result
+         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 "$sed_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 where 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) $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/ that is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options that 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) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+       if test yes = "$fast_install"; 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 yes = "$shlibpath_overrides_runpath" && 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) $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>
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* 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_platform || defined ... */
+#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
+#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 (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
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+           if test yes = "$shlibpath_overrides_runpath" && 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 yes = "$fast_install"; 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;
+  int rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, (size_t) 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 (STREQ (argv[i], dumpscript_opt))
+       {
+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 (STREQ (argv[i], debug_opt))
+       {
+          lt_debug = 1;
+          continue;
+       }
+      if (STREQ (argv[i], ltwrapper_option_prefix))
+        {
+          /* 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) $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 = (int) _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];
+  size_t 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 = (size_t) (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 (STREQ (str, pat))
+       *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
+    size_t 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)
+    {
+      size_t orig_value_len = strlen (orig_value);
+      size_t 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 #' */
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[--len] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+           case $host_os in
+             mingw*)
+               cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+       new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+       {
+         int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+         size_t length;
+         unsigned int backslashes;
+         const char *s;
+         char *quoted_string;
+         char *p;
+
+         length = 0;
+         backslashes = 0;
+         if (quote_around)
+           length++;
+         for (s = string; *s != '\0'; s++)
+           {
+             char c = *s;
+             if (c == '"')
+               length += backslashes + 1;
+             length++;
+             if (c == '\\')
+               backslashes++;
+             else
+               backslashes = 0;
+           }
+         if (quote_around)
+           length += backslashes + 1;
+
+         quoted_string = XMALLOC (char, length + 1);
+
+         p = quoted_string;
+         backslashes = 0;
+         if (quote_around)
+           *p++ = '"';
+         for (s = string; *s != '\0'; s++)
+           {
+             char c = *s;
+             if (c == '"')
+               {
+                 unsigned int j;
+                 for (j = backslashes + 1; j > 0; j--)
+                   *p++ = '\\';
+               }
+             *p++ = c;
+             if (c == '\\')
+               backslashes++;
+             else
+               backslashes = 0;
+           }
+         if (quote_around)
+           {
+             unsigned int j;
+             for (j = backslashes; j > 0; j--)
+               *p++ = '\\';
+             *p++ = '"';
+           }
+         *p = '\0';
+
+         new_argv[i] = quoted_string;
+       }
+      else
+       new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+               ;;
+           esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+           func_emit_wrapper yes |
+             $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $debug_cmd
+
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $debug_cmd
+
+    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
+      # what 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 that 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=
+    os2dllname=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=false
+    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 yes != "$build_libtool_libs" \
+         && func_fatal_configuration "cannot build a shared library"
+       build_old_libs=no
+       break
+       ;;
+      -all-static | -static | -static-libtool-libs)
+       case $arg in
+       -all-static)
+         if test yes = "$build_libtool_libs" && 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)
+         $preload || {
+           # Add the symbol object into the linking commands.
+           func_append compile_command " @SYMFILE@"
+           func_append finalize_command " @SYMFILE@"
+           preload=:
+         }
+         case $arg in
+         *.la | *.lo) ;;  # We handle these cases below.
+         force)
+           if test no = "$dlself"; then
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         self)
+           if test dlprefiles = "$prev"; then
+             dlself=yes
+           elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
+             dlself=yes
+           else
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         *)
+           if test dlfiles = "$prev"; 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
+         ;;
+       mllvm)
+         # Clang does not use LLVM to link, so we can simply discard any
+         # '-mllvm $arg' options when doing the link step.
+         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 none = "$pic_object" &&
+                  test none = "$non_pic_object"; 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 none != "$pic_object"; then
+                 # Prepend the subdirectory the object is found in.
+                 pic_object=$xdir$pic_object
+
+                 if test dlfiles = "$prev"; then
+                   if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; 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 dlprefiles = "$prev"; 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 none != "$non_pic_object"; 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 none = "$pic_object"; 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
+         ;;
+       os2dllname)
+         os2dllname=$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 rpath = "$prev"; 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-export-symbols = "X$arg"; 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-lc = "X$arg" || test X-lm = "X$arg"; 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-lc = "X$arg" && continue
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+           # Do not include libc due to us having libc/libc_r.
+           test X-lc = "X$arg" && 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-lc = "X$arg" && continue
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           test X-lc = "X$arg" && continue
+           ;;
+         esac
+       elif test X-lc_r = "X$arg"; then
+        case $host in
+        *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+          # Do not include libc_r directly, use -pthread flag.
+          continue
+          ;;
+        esac
+       fi
+       func_append deplibs " $arg"
+       continue
+       ;;
+
+      -mllvm)
+       prev=mllvm
+       continue
+       ;;
+
+      -module)
+       module=yes
+       continue
+       ;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot|--sysroot)
+       func_append compiler_flags " $arg"
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+       prev=xcompiler
+       continue
+       ;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+       func_append compiler_flags " $arg"
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+       case "$new_inherited_linker_flags " in
+           *" $arg "*) ;;
+           * ) func_append new_inherited_linker_flags " $arg" ;;
+       esac
+       continue
+       ;;
+
+      -multi_module)
+       single_module=$wl-multi_module
+       continue
+       ;;
+
+      -no-fast-install)
+       fast_install=no
+       continue
+       ;;
+
+      -no-install)
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+         # The PATH hackery in wrapper scripts is required on Windows
+         # and Darwin in order for the loader to find any dlls it needs.
+         func_warning "'-no-install' is ignored for $host"
+         func_warning "assuming '-no-fast-install' instead"
+         fast_install=no
+         ;;
+       *) no_install=yes ;;
+       esac
+       continue
+       ;;
+
+      -no-undefined)
+       allow_undefined=no
+       continue
+       ;;
+
+      -objectlist)
+       prev=objectlist
+       continue
+       ;;
+
+      -os2dllname)
+       prev=os2dllname
+       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
+      # -fstack-protector*   stack protector flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -specs=*             GCC specs files
+      # -stdlib=*            select c++ std lib with clang
+      -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*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+      -specs=*)
+        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
+        ;;
+
+      -Z*)
+        if test os2 = "`expr $host : '.*\(os2\)'`"; then
+          # OS/2 uses -Zxxx to specify OS/2-specific options
+         compiler_flags="$compiler_flags $arg"
+         func_append compile_command " $arg"
+         func_append finalize_command " $arg"
+         case $arg in
+         -Zlinker | -Zstack)
+           prev=xcompiler
+           ;;
+         esac
+         continue
+        else
+         # Otherwise treat like 'Some other compiler flag' below
+         func_quote_for_eval "$arg"
+         arg=$func_quote_for_eval_result
+        fi
+       ;;
+
+      # 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 none = "$pic_object" &&
+            test none = "$non_pic_object"; then
+           func_fatal_error "cannot find name of object for '$arg'"
+         fi
+
+         # Extract subdirectory from the argument.
+         func_dirname "$arg" "/" ""
+         xdir=$func_dirname_result
+
+         test none = "$pic_object" || {
+           # Prepend the subdirectory the object is found in.
+           pic_object=$xdir$pic_object
+
+           if test dlfiles = "$prev"; then
+             if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; 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 dlprefiles = "$prev"; then
+             # Preload the old-style object.
+             func_append dlprefiles " $pic_object"
+             prev=
+           fi
+
+           # A PIC object.
+           func_append libobjs " $pic_object"
+           arg=$pic_object
+         }
+
+         # Non-PIC object.
+         if test none != "$non_pic_object"; 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 none = "$pic_object"; 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 dlfiles = "$prev"; then
+         # This library was specified with -dlopen.
+         func_append dlfiles " $func_resolve_sysroot_result"
+         prev=
+       elif test dlprefiles = "$prev"; 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 yes = "$export_dynamic" && 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\"
+
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
+    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 lib = "$linkmode"; 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=false
+       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 lib,link = "$linkmode,$pass"; 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 lib,link = "$linkmode,$pass" ||
+        test prog,scan = "$linkmode,$pass"; then
+       libs=$deplibs
+       deplibs=
+      fi
+      if test prog = "$linkmode"; then
+       case $pass in
+       dlopen) libs=$dlfiles ;;
+       dlpreopen) libs=$dlprefiles ;;
+       link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+       esac
+      fi
+      if test lib,dlpreopen = "$linkmode,$pass"; 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 dlopen = "$pass"; then
+       # Collect dlpreopened libraries
+       save_deplibs=$deplibs
+       deplibs=
+      fi
+
+      for deplib in $libs; do
+       lib=
+       found=false
+       case $deplib in
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+         if test prog,link = "$linkmode,$pass"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           func_append compiler_flags " $deplib"
+           if test lib = "$linkmode"; then
+               case "$new_inherited_linker_flags " in
+                   *" $deplib "*) ;;
+                   * ) func_append new_inherited_linker_flags " $deplib" ;;
+               esac
+           fi
+         fi
+         continue
+         ;;
+       -l*)
+         if test lib != "$linkmode" && test prog != "$linkmode"; then
+           func_warning "'-l' is ignored for archives/objects"
+           continue
+         fi
+         func_stripname '-l' '' "$deplib"
+         name=$func_stripname_result
+         if test lib = "$linkmode"; 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 .la = "$search_ext"; then
+                 found=:
+               else
+                 found=false
+               fi
+               break 2
+             fi
+           done
+         done
+         if $found; then
+           # 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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=false
+                   func_dirname "$lib" "" "."
+                   ladir=$func_dirname_result
+                   lib=$ladir/$old_library
+                   if test prog,link = "$linkmode,$pass"; then
+                     compile_deplibs="$deplib $compile_deplibs"
+                     finalize_deplibs="$deplib $finalize_deplibs"
+                   else
+                     deplibs="$deplib $deplibs"
+                     test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+                   fi
+                   continue
+                 fi
+               fi
+               ;;
+             *) ;;
+             esac
+           fi
+         else
+           # deplib doesn't seem to be a libtool library
+           if test prog,link = "$linkmode,$pass"; then
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             deplibs="$deplib $deplibs"
+             test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+           fi
+           continue
+         fi
+         ;; # -l
+       *.ltframework)
+         if test prog,link = "$linkmode,$pass"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           deplibs="$deplib $deplibs"
+           if test lib = "$linkmode"; 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 conv = "$pass" && 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 conv = "$pass"; then
+             deplibs="$deplib $deplibs"
+             continue
+           fi
+           if test scan = "$pass"; 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 link = "$pass"; 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 conv = "$pass"; 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=false
+             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=:
+                 fi
+               ;;
+               pass_all)
+                 valid_a_lib=:
+               ;;
+             esac
+             if $valid_a_lib; then
+               echo
+               $ECHO "*** Warning: Linking the shared library $output against the"
+               $ECHO "*** static library $deplib is not portable!"
+               deplibs="$deplib $deplibs"
+             else
+               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."
+             fi
+             ;;
+           esac
+           continue
+           ;;
+         prog)
+           if test link != "$pass"; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           continue
+           ;;
+         esac # linkmode
+         ;; # *.$libext
+       *.lo | *.$objext)
+         if test conv = "$pass"; then
+           deplibs="$deplib $deplibs"
+         elif test prog = "$linkmode"; then
+           if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; 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=:
+         continue
+         ;;
+       esac # case $deplib
+
+       $found || test -f "$lib" \
+         || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
+
+       # 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 lib,link = "$linkmode,$pass" ||
+          test prog,scan = "$linkmode,$pass" ||
+          { test prog != "$linkmode" && test lib != "$linkmode"; }; then
+         test -n "$dlopen" && func_append dlfiles " $dlopen"
+         test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+       fi
+
+       if test conv = "$pass"; 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"
+         elif test prog != "$linkmode" && test lib != "$linkmode"; then
+           func_fatal_error "'$lib' is not a convenience library"
+         fi
+         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
+         continue
+       fi # $pass = conv
+
+
+       # Get the name of the library we link against.
+       linklib=
+       if test -n "$old_library" &&
+          { test yes = "$prefer_static_libs" ||
+            test built,no = "$prefer_static_libs,$installed"; }; 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 dlopen = "$pass"; then
+         test -z "$libdir" \
+           && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
+         if test -z "$dlname" ||
+            test yes != "$dlopen_support" ||
+            test no = "$build_libtool_libs"
+         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 yes = "$installed"; 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 yes = "$hardcode_automatic" && 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 dlpreopen = "$pass"; then
+         if test -z "$libdir" && test prog = "$linkmode"; 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 lib = "$linkmode"; then
+           deplibs="$dir/$old_library $deplibs"
+         elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then
+         func_append newlib_search_path " $ladir"
+         deplibs="$lib $deplibs"
+
+         linkalldeplibs=false
+         if test no != "$link_all_deplibs" || test -z "$library_names" ||
+            test no = "$build_libtool_libs"; then
+           linkalldeplibs=:
+         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 $linkalldeplibs; 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 prog,link = "$linkmode,$pass"; then
+         if test -n "$library_names" &&
+            { { test no = "$prefer_static_libs" ||
+                test built,yes = "$prefer_static_libs,$installed"; } ||
+              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 $alldeplibs &&
+            { test pass_all = "$deplibs_check_method" ||
+              { test yes = "$build_libtool_libs" &&
+                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 built = "$use_static_libs" && test yes = "$installed"; then
+         use_static_libs=no
+       fi
+       if test -n "$library_names" &&
+          { test no = "$use_static_libs" || test -z "$old_library"; }; then
+         case $host in
+         *cygwin* | *mingw* | *cegcc* | *os2*)
+             # No point in relinking DLLs because paths are not encoded
+             func_append notinst_deplibs " $lib"
+             need_relink=no
+           ;;
+         *)
+           if test no = "$installed"; 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 yes = "$shouldnotlink" && test link = "$pass"; then
+           echo
+           if test prog = "$linkmode"; 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 lib = "$linkmode" &&
+            test yes = "$hardcode_into_libs"; 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* | *os2*)
+               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 prog = "$linkmode" || test relink != "$opt_mode"; then
+           add_shlibpath=
+           add_dir=
+           add=
+           lib_linked=yes
+           case $hardcode_action in
+           immediate | unsupported)
+             if test no = "$hardcode_direct"; 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 cannot
+                   # 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 no = "$hardcode_minus_L"; then
+               case $host in
+               *-*-sunos*) add_shlibpath=$dir ;;
+               esac
+               add_dir=-L$dir
+               add=-l$name
+             elif test no = "$hardcode_shlibpath_var"; then
+               add_shlibpath=$dir
+               add=-l$name
+             else
+               lib_linked=no
+             fi
+             ;;
+           relink)
+             if test yes = "$hardcode_direct" &&
+                test no = "$hardcode_direct_absolute"; then
+               add=$dir/$linklib
+             elif test yes = "$hardcode_minus_L"; then
+               add_dir=-L$absdir
+               # Try looking first in the location we're being installed to.
+               if test -n "$inst_prefix_dir"; then
+                 case $libdir in
+                   [\\/]*)
+                     func_append add_dir " -L$inst_prefix_dir$libdir"
+                     ;;
+                 esac
+               fi
+               add=-l$name
+             elif test yes = "$hardcode_shlibpath_var"; then
+               add_shlibpath=$dir
+               add=-l$name
+             else
+               lib_linked=no
+             fi
+             ;;
+           *) lib_linked=no ;;
+           esac
+
+           if test yes != "$lib_linked"; 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 prog = "$linkmode"; 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 yes != "$hardcode_direct" &&
+                test yes != "$hardcode_minus_L" &&
+                test yes = "$hardcode_shlibpath_var"; then
+               case :$finalize_shlibpath: in
+               *":$libdir:"*) ;;
+               *) func_append finalize_shlibpath "$libdir:" ;;
+               esac
+             fi
+           fi
+         fi
+
+         if test prog = "$linkmode" || test relink = "$opt_mode"; then
+           add_shlibpath=
+           add_dir=
+           add=
+           # Finalize command for both is simple: just hardcode it.
+           if test yes = "$hardcode_direct" &&
+              test no = "$hardcode_direct_absolute"; then
+             add=$libdir/$linklib
+           elif test yes = "$hardcode_minus_L"; then
+             add_dir=-L$libdir
+             add=-l$name
+           elif test yes = "$hardcode_shlibpath_var"; then
+             case :$finalize_shlibpath: in
+             *":$libdir:"*) ;;
+             *) func_append finalize_shlibpath "$libdir:" ;;
+             esac
+             add=-l$name
+           elif test yes = "$hardcode_automatic"; 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 prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then
+         # Not a shared library
+         if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then
+         if test -n "$dependency_libs" &&
+            { test yes != "$hardcode_into_libs" ||
+              test yes = "$build_old_libs" ||
+              test yes = "$link_static"; }; 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 no = "$link_static" && 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 no != "$link_all_deplibs"; 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 link = "$pass"; then
+       if test prog = "$linkmode"; 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 dlpreopen = "$pass"; then
+       # Link the dlpreopened libraries before other libraries
+       for deplib in $save_deplibs; do
+         deplibs="$deplib $deplibs"
+       done
+      fi
+      if test dlopen != "$pass"; then
+       test conv = "$pass" || {
+         # 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=
+       }
+
+       if test prog,link = "$linkmode,$pass"; then
+         vars="compile_deplibs finalize_deplibs"
+       else
+         vars=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
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
+      # 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 prog = "$linkmode"; then
+      dlfiles=$newdlfiles
+    fi
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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 no = "$module" \
+         && func_fatal_help "libtool library '$output' must begin with 'lib'"
+
+       if test no != "$need_lib_prefix"; 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 pass_all != "$deplibs_check_method"; 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 no = "$dlself" \
+       || func_warning "'-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test 1 -lt "$#" \
+       && func_warning "ignoring multiple '-rpath's for a libtool library"
+
+      install_libdir=$1
+
+      oldlibs=
+      if test -z "$rpath"; then
+       if test yes = "$build_libtool_libs"; 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
+         # that has an extra 1 added just for fun
+         #
+         case $version_type in
+         # correct linux to gnu/linux during the next big refactor
+         darwin|freebsd-elf|linux|osf|windows|none)
+           func_arith $number_major + $number_minor
+           current=$func_arith_result
+           age=$number_minor
+           revision=$number_revision
+           ;;
+         freebsd-aout|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
+           ;;
+         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"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
+         ;;
+
+       freebsd-aout)
+         major=.$current
+         versuffix=.$current.$revision
+         ;;
+
+       freebsd-elf)
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix=$major.$age.$revision
+         ;;
+
+       irix | nonstopux)
+         if test no = "$lt_irix_increment"; 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 0 -ne "$loop"; do
+           func_arith $revision - $loop
+           iface=$func_arith_result
+           func_arith $loop - 1
+           loop=$func_arith_result
+           verstring=$verstring_prefix$major.$iface:$verstring
+         done
+
+         # Before this point, $major must not contain '.'.
+         major=.$major
+         versuffix=$major.$revision
+         ;;
+
+       linux) # correct to gnu/linux during the next big refactor
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix=$major.$age.$revision
+         ;;
+
+       osf)
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix=.$current.$age.$revision
+         verstring=$current.$age.$revision
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$age
+         while test 0 -ne "$loop"; 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
+         ;;
+
+       sco)
+         major=.$current
+         versuffix=.$current
+         ;;
+
+       sunos)
+         major=.$current
+         versuffix=.$current.$revision
+         ;;
+
+       windows)
+         # Use '-' rather than '.', since we only want one
+         # extension on DOS 8.3 file systems.
+         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 no = "$need_version"; then
+           versuffix=
+         else
+           versuffix=.0.0
+         fi
+       fi
+
+       # Remove version info from name if versioning should be avoided
+       if test yes,no = "$avoid_version,$need_version"; then
+         major=
+         versuffix=
+         verstring=
+       fi
+
+       # Check to see if the archive will have undefined symbols.
+       if test yes = "$allow_undefined"; then
+         if test unsupported = "$allow_undefined_flag"; then
+           if test yes = "$build_old_libs"; then
+             func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+             build_libtool_libs=no
+           else
+             func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+           fi
+         fi
+       else
+         # Don't allow undefined symbols.
+         allow_undefined_flag=$no_undefined_flag
+       fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" :
+      func_append libobjs " $symfileobj"
+      test " " = "$libobjs" && libobjs=
+
+      if test relink != "$opt_mode"; 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 -n "$precious_files_regex"; 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 yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; 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 yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 yes = "$build_libtool_libs"; 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 yes = "$build_libtool_need_lc"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 if test yes = "$want_nocaseglob"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 none = "$deplibs_check_method"; 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 yes = "$droppeddeps"; then
+         if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 yes = "$build_libtool_libs"; then
+       # Remove $wl instances when linking with ld.
+       # FIXME: should test the right _cmds variable.
+       case $archive_cmds in
+         *\$LD\ *) wl= ;;
+        esac
+       if test yes = "$hardcode_into_libs"; then
+         # Hardcode the library paths
+         hardcode_libdirs=
+         dep_rpath=
+         rpath=$finalize_rpath
+         test relink = "$opt_mode" || rpath=$compile_rpath$rpath
+         for libdir in $rpath; do
+           if test -n "$hardcode_libdir_flag_spec"; then
+             if test -n "$hardcode_libdir_separator"; then
+               func_replace_sysroot "$libdir"
+               libdir=$func_replace_sysroot_result
+               if test -z "$hardcode_libdirs"; then
+                 hardcode_libdirs=$libdir
+               else
+                 # Just accumulate the unique libdirs.
+                 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+                 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+                   ;;
+                 *)
+                   func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+                   ;;
+                 esac
+               fi
+             else
+               eval flag=\"$hardcode_libdir_flag_spec\"
+               func_append dep_rpath " $flag"
+             fi
+           elif test -n "$runpath_var"; then
+             case "$perm_rpath " in
+             *" $libdir "*) ;;
+             *) func_append perm_rpath " $libdir" ;;
+             esac
+           fi
+         done
+         # Substitute the hardcoded libdirs into the rpath.
+         if test -n "$hardcode_libdir_separator" &&
+            test -n "$hardcode_libdirs"; then
+           libdir=$hardcode_libdirs
+           eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+         fi
+         if test -n "$runpath_var" && test -n "$perm_rpath"; then
+           # We should set the runpath_var.
+           rpath=
+           for dir in $perm_rpath; do
+             func_append rpath "$dir:"
+           done
+           eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+         fi
+         test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+       fi
+
+       shlibpath=$finalize_shlibpath
+       test relink = "$opt_mode" || 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
+           func_dll_def_p "$export_symbols" || {
+             # 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
+         ;;
+       esac
+
+       # Prepare the list of exported symbols
+       if test -z "$export_symbols"; then
+         if test yes = "$always_export_symbols" || 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 yes = "$try_normal_branch" \
+                && { 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 : != "$skipped_export"; 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 : != "$skipped_export" && 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 yes = "$compiler_needs_object" &&
+           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 yes = "$thread_safe" && 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 relink = "$opt_mode"; 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 yes = "$module" && 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 : != "$skipped_export" &&
+          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 : != "$skipped_export" && test yes = "$with_gnu_ld"; 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 : != "$skipped_export" && test -n "$file_list_spec"; then
+           output=$output_objdir/$output_la.lnk
+           func_verbose "creating linker input file list: $output"
+           : > $output
+           set x $save_libobjs
+           shift
+           firstobj=
+           if test yes = "$compiler_needs_object"; 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 -z "$objlist" ||
+                  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 1 -eq "$k"; 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
+
+           ${skipped_export-false} && {
+             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
+           }
+
+           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_quiet || {
+                 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 relink = "$opt_mode"; 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
+
+          ${skipped_export-false} && {
+           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
+         }
+
+         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 yes = "$module" && 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=$sp$nl
+         eval cmd=\"$cmd\"
+         IFS=$save_ifs
+         $opt_quiet || {
+           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 relink = "$opt_mode"; 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 relink = "$opt_mode"; 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 yes = "$module" || test yes = "$export_dynamic"; then
+         # On all known operating systems, these are identical.
+         dlname=$soname
+       fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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=
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD[\ \$]*) wl= ;;
+      esac
+      if test -n "$convenience"; then
+       if test -n "$whole_archive_flag_spec"; then
+         eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+         test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+         reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
+       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 yes = "$build_libtool_libs" || 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
+
+      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
+
+      test yes = "$build_libtool_libs" || {
+       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
+      }
+
+      if test -n "$pic_flag" || test default != "$pic_mode"; 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"
+
+      $preload \
+       && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+       && 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 CXX = "$tagname"; 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 yes = "$build_old_libs"; 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@" false
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+       func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=:
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=false
+        ;;
+      *cygwin* | *mingw* )
+        test yes = "$build_libtool_libs" || wrappers_required=false
+        ;;
+      *)
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
+        fi
+        ;;
+      esac
+      $wrappers_required || {
+       # 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
+      }
+
+      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 yes = "$no_install"; 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
+
+      case $hardcode_action,$fast_install in
+        relink,*)
+         # 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"
+         ;;
+        *,yes)
+         link_command=$finalize_var$compile_command$finalize_rpath
+         relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+       *,no)
+         link_command=$compile_var$compile_command$compile_rpath
+         relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+       *,needless)
+         link_command=$finalize_var$compile_command$finalize_rpath
+         relink_command=
+          ;;
+      esac
+
+      # 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
+
+      case $build_libtool_libs in
+        convenience)
+         oldobjs="$libobjs_save $symfileobj"
+         addlibs=$convenience
+         build_libtool_libs=no
+         ;;
+       module)
+         oldobjs=$libobjs_save
+         addlibs=$old_convenience
+         build_libtool_libs=no
+          ;;
+       *)
+         oldobjs="$old_deplibs $non_pic_objects"
+         $preload && test -f "$symfileobj" \
+           && func_append oldobjs " $symfileobj"
+         addlibs=$old_convenience
+         ;;
+      esac
+
+      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 yes = "$build_libtool_libs"; then
+       cmds=$old_archive_from_new_cmds
+      else
+
+       # Add any objects from preloaded convenience libraries
+       if test -n "$dlprefiles"; then
+         gentop=$output_objdir/${outputname}x
+         func_append generated " $gentop"
+
+         func_extract_archives $gentop $dlprefiles
+         func_append oldobjs " $func_extract_archives_result"
+       fi
+
+       # POSIX demands no paths to be encoded in archives.  We have
+       # to avoid creating archives with duplicate basenames if we
+       # might have to extract them afterwards, e.g., when creating a
+       # static archive out of a convenience library, or when linking
+       # the entirety of a libtool archive into another (currently
+       # not supported by libtool).
+       if (for obj in $oldobjs
+           do
+             func_basename "$obj"
+             $ECHO "$func_basename_result"
+           done | sort | sort -uc >/dev/null 2>&1); then
+         :
+       else
+         echo "copying selected object files to avoid basename conflicts..."
+         gentop=$output_objdir/${outputname}x
+         func_append generated " $gentop"
+         func_mkdir_p "$gentop"
+         save_oldobjs=$oldobjs
+         oldobjs=
+         counter=1
+         for obj in $save_oldobjs
+         do
+           func_basename "$obj"
+           objbase=$func_basename_result
+           case " $oldobjs " in
+           " ") oldobjs=$obj ;;
+           *[\ /]"$objbase "*)
+             while :; do
+               # Make sure we don't pick an alternate name that also
+               # overlaps.
+               newobj=lt$counter-$objbase
+               func_arith $counter + 1
+               counter=$func_arith_result
+               case " $oldobjs " in
+               *[\ /]"$newobj "*) ;;
+               *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+               esac
+             done
+             func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+             func_append oldobjs " $gentop/$newobj"
+             ;;
+           *) func_append oldobjs " $obj" ;;
+           esac
+         done
+       fi
+       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+       tool_oldlib=$func_to_tool_file_result
+       eval cmds=\"$old_archive_cmds\"
+
+       func_len " $cmds"
+       len=$func_len_result
+       if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         cmds=$old_archive_cmds
+       elif test -n "$archiver_list_spec"; then
+         func_verbose "using command file archive linking..."
+         for obj in $oldobjs
+         do
+           func_to_tool_file "$obj"
+           $ECHO "$func_to_tool_file_result"
+         done > $output_objdir/$libname.libcmd
+         func_to_tool_file "$output_objdir/$libname.libcmd"
+         oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+         cmds=$old_archive_cmds
+       else
+         # the command line is too long to link in one step, link in parts
+         func_verbose "using piecewise archive linking..."
+         save_RANLIB=$RANLIB
+         RANLIB=:
+         objlist=
+         concat_cmds=
+         save_oldobjs=$oldobjs
+         oldobjs=
+         # Is there a better way of finding the last object in the list?
+         for obj in $save_oldobjs
+         do
+           last_oldobj=$obj
+         done
+         eval test_cmds=\"$old_archive_cmds\"
+         func_len " $test_cmds"
+         len0=$func_len_result
+         len=$len0
+         for obj in $save_oldobjs
+         do
+           func_len " $obj"
+           func_arith $len + $func_len_result
+           len=$func_arith_result
+           func_append objlist " $obj"
+           if test "$len" -lt "$max_cmd_len"; then
+             :
+           else
+             # the above command should be used before it gets too long
+             oldobjs=$objlist
+             if test "$obj" = "$last_oldobj"; then
+               RANLIB=$save_RANLIB
+             fi
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
+             objlist=
+             len=$len0
+           fi
+         done
+         RANLIB=$save_RANLIB
+         oldobjs=$objlist
+         if test -z "$oldobjs"; 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 yes = "$build_old_libs" && 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 yes = "$hardcode_automatic"; then
+       relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+       for installed in no yes; do
+         if test yes = "$installed"; then
+           if test -z "$install_libdir"; then
+             break
+           fi
+           output=$output_objdir/${outputname}i
+           # Replace all uninstalled libtool libraries with the installed ones
+           newdependency_libs=
+           for deplib in $dependency_libs; do
+             case $deplib in
+             *.la)
+               func_basename "$deplib"
+               name=$func_basename_result
+               func_resolve_sysroot "$deplib"
+               eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+               test -z "$libdir" && \
+                 func_fatal_error "'$deplib' is not a valid libtool archive"
+               func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+               ;;
+             -L*)
+               func_stripname -L '' "$deplib"
+               func_replace_sysroot "$func_stripname_result"
+               func_append newdependency_libs " -L$func_replace_sysroot_result"
+               ;;
+             -R*)
+               func_stripname -R '' "$deplib"
+               func_replace_sysroot "$func_stripname_result"
+               func_append newdependency_libs " -R$func_replace_sysroot_result"
+               ;;
+             *) func_append newdependency_libs " $deplib" ;;
+             esac
+           done
+           dependency_libs=$newdependency_libs
+           newdlfiles=
+
+           for lib in $dlfiles; do
+             case $lib in
+             *.la)
+               func_basename "$lib"
+               name=$func_basename_result
+               eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+               test -z "$libdir" && \
+                 func_fatal_error "'$lib' is not a valid libtool archive"
+               func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+               ;;
+             *) func_append newdlfiles " $lib" ;;
+             esac
+           done
+           dlfiles=$newdlfiles
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+             *.la)
+               # Only pass preopened files to the pseudo-archive (for
+               # eventual linking with the app. that links it) if we
+               # didn't already link the preopened objects directly into
+               # the library:
+               func_basename "$lib"
+               name=$func_basename_result
+               eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+               test -z "$libdir" && \
+                 func_fatal_error "'$lib' is not a valid libtool archive"
+               func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+               ;;
+             esac
+           done
+           dlprefiles=$newdlprefiles
+         else
+           newdlfiles=
+           for lib in $dlfiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             func_append newdlfiles " $abs"
+           done
+           dlfiles=$newdlfiles
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             func_append newdlprefiles " $abs"
+           done
+           dlprefiles=$newdlprefiles
+         fi
+         $RM $output
+         # place dlname in correct position for cygwin
+         # In fact, it would be nice if we could use this code for all target
+         # systems that can't hard-code library paths into their executables
+         # and that have no shared library path variable independent of PATH,
+         # but it turns out we can't easily determine that from inspecting
+         # libtool variables, so we have to hard-code the OSs to which it
+         # applies here; at the moment, that means platforms that use the PE
+         # object format with DLL files.  See the long comment at the top of
+         # tests/bindir.at for full details.
+         tdlname=$dlname
+         case $host,$output,$installed,$module,$dlname in
+           *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+             # If a -bindir argument was supplied, place the dll there.
+             if test -n "$bindir"; 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) $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 cannot 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 no,yes = "$installed,$need_relink"; 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
+}
+
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $debug_cmd
+
+    RM=$nonopt
+    files=
+    rmforce=false
+    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=: ;;
+      -*) 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 . = "$dir"; then
+       odir=$objdir
+      else
+       odir=$dir/$objdir
+      fi
+      func_basename "$file"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
+
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test clean = "$opt_mode"; 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 $rmforce; 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" '$rmforce || exit_status=1'
+           fi
+
+           if test -n "$old_library"; then
+             # Do each command in the old_postuninstall commands.
+             func_execute_cmds "$old_postuninstall_cmds" '$rmforce || 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 none != "$pic_object"; 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 none != "$non_pic_object"; then
+           func_append rmfiles " $dir/$non_pic_object"
+         fi
+       fi
+       ;;
+
+      *)
+       if test clean = "$opt_mode"; 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 yes = "$fast_install" && 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
+}
+
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
+
+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
+# where 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:
index f759917..64e2443 100644 (file)
@@ -1 +1 @@
-EXTRA_DIST = gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 gettext.m4
+EXTRA_DIST = gettext.m4 host-cpu-c-abi.m4 iconv.m4 intlmacosx.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 gettext.m4
index 99a1edd..f1c4dd5 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -50,20 +88,35 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = m4
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -71,13 +124,19 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -95,11 +154,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -111,27 +177,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -144,6 +220,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -152,6 +229,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -162,7 +241,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -203,6 +284,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -213,8 +296,8 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
-EXTRA_DIST = gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 gettext.m4
+xmlto_available = @xmlto_available@
+EXTRA_DIST = gettext.m4 host-cpu-c-abi.m4 iconv.m4 intlmacosx.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 gettext.m4
 all: all-am
 
 .SUFFIXES:
@@ -230,14 +313,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign m4/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign m4/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -248,16 +330,23 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-tags: TAGS
-TAGS:
 
-ctags: CTAGS
-CTAGS:
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
 
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -323,7 +412,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
@@ -375,7 +464,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -389,15 +478,19 @@ uninstall-am:
 
 .MAKE: install-am install-strip
 
-.PHONY: all all-am check check-am clean clean-generic distclean \
-       distclean-generic distdir dvi dvi-am html html-am info info-am \
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       cscopelist-am ctags-am distclean distclean-generic \
+       distclean-libtool distdir dvi dvi-am html html-am info info-am \
        install install-am install-data install-data-am install-dvi \
        install-dvi-am install-exec install-exec-am install-html \
        install-html-am install-info install-info-am install-man \
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index f84e6a5..4f25a27 100644 (file)
@@ -1,16 +1,16 @@
-# gettext.m4 serial 63 (gettext-0.18)
-dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
+# gettext.m4 serial 71 (gettext-0.20.2)
+dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
@@ -20,22 +20,20 @@ dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
 dnl Macro to add for using GNU gettext.
 
 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
-dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
-dnl    default (if it is not specified or empty) is 'no-libtool'.
-dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
-dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
+dnl    INTLSYMBOL should be 'external' for packages other than GNU gettext, and
+dnl    'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
-dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
-dnl    $(top_builddir)/intl/libintl.a will be created.
+dnl    AM-DISABLE-SHARED).
 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
 dnl    implementations (in libc or libintl) without the ngettext() function
 dnl    will be ignored.  If NEEDSYMBOL is specified and is
 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
 dnl INTLDIR is used to find the intl libraries.  If empty,
-dnl    the value `$(top_builddir)/intl/' is used.
+dnl    the value '$(top_builddir)/intl/' is used.
 dnl
 dnl The result of the configuration is one of three cases:
 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
@@ -57,19 +55,17 @@ dnl
 AC_DEFUN([AM_GNU_GETTEXT],
 [
   dnl Argument checking.
-  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
-])])])])])
+])])])])
   ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
-    [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
+    [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
+])])
   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 ])])])])
   define([gt_included_intl],
-    ifelse([$1], [external],
-      ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
-      [yes]))
-  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+    ifelse([$1], [external], [no], [yes]))
   gt_NEEDS_INIT
   AM_GNU_GETTEXT_NEED([$2])
 
@@ -91,13 +87,12 @@ AC_DEFUN([AM_GNU_GETTEXT],
   dnl again, outside any 'if'. There are two solutions:
   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
-  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
-  dnl documented, we avoid it.
+  dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
   ifelse(gt_included_intl, yes, , [
     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
   ])
 
-  dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+  dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
   gt_INTL_MACOSX
 
   dnl Set USE_NLS.
@@ -157,12 +152,23 @@ changequote([,])dnl
         fi
 
         AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
-         [AC_TRY_LINK([#include <libintl.h>
-$gt_revision_test_code
+         [AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
-extern int *_nl_domain_bindings;],
-            [bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
+extern int *_nl_domain_bindings;
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+               ]],
+               [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+               ]])],
             [eval "$gt_func_gnugettext_libc=yes"],
             [eval "$gt_func_gnugettext_libc=no"])])
 
@@ -183,35 +189,57 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b
             gt_save_LIBS="$LIBS"
             LIBS="$LIBS $LIBINTL"
             dnl Now see whether libintl exists and does not depend on libiconv.
-            AC_TRY_LINK([#include <libintl.h>
-$gt_revision_test_code
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM(
+                 [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias (const char *);],
-              [bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+                 ]],
+                 [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+                 ]])],
               [eval "$gt_func_gnugettext_libintl=yes"],
               [eval "$gt_func_gnugettext_libintl=no"])
             dnl Now see whether libintl exists and depends on libiconv.
             if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
               LIBS="$LIBS $LIBICONV"
-              AC_TRY_LINK([#include <libintl.h>
-$gt_revision_test_code
+              AC_LINK_IFELSE(
+                [AC_LANG_PROGRAM(
+                   [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias (const char *);],
-                [bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
-               [LIBINTL="$LIBINTL $LIBICONV"
-                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
-                eval "$gt_func_gnugettext_libintl=yes"
-               ])
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+                   ]],
+                   [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+                   ]])],
+                [LIBINTL="$LIBINTL $LIBICONV"
+                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                 eval "$gt_func_gnugettext_libintl=yes"
+                ])
             fi
             CPPFLAGS="$gt_save_CPPFLAGS"
             LIBS="$gt_save_LIBS"])
@@ -245,8 +273,8 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
         dnl Mark actions used to generate GNU NLS library.
         BUILD_INCLUDED_LIBINTL=yes
         USE_INCLUDED_LIBINTL=yes
-        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
-        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
+        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
+        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
       fi
 
@@ -314,43 +342,14 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
   fi
 
   ifelse(gt_included_intl, yes, [
-    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
-    dnl to 'yes' because some of the testsuite requires it.
-    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
-      BUILD_INCLUDED_LIBINTL=yes
-    fi
+    dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
+    dnl because some of the testsuite requires it.
+    BUILD_INCLUDED_LIBINTL=yes
 
     dnl Make all variables we use known to autoconf.
     AC_SUBST([BUILD_INCLUDED_LIBINTL])
     AC_SUBST([USE_INCLUDED_LIBINTL])
     AC_SUBST([CATOBJEXT])
-
-    dnl For backward compatibility. Some configure.ins may be using this.
-    nls_cv_header_intl=
-    nls_cv_header_libgt=
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    DATADIRNAME=share
-    AC_SUBST([DATADIRNAME])
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    INSTOBJEXT=.mo
-    AC_SUBST([INSTOBJEXT])
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    GENCAT=gencat
-    AC_SUBST([GENCAT])
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    INTLOBJS=
-    if test "$USE_INCLUDED_LIBINTL" = yes; then
-      INTLOBJS="\$(GETTOBJS)"
-    fi
-    AC_SUBST([INTLOBJS])
-
-    dnl Enable libtool support if the surrounding package wishes it.
-    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
-    AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
   ])
 
   dnl For backward compatibility. Some Makefiles may be using this.
@@ -381,3 +380,7 @@ AC_DEFUN([AM_GNU_GETTEXT_NEED],
 
 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
+
+
+dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
new file mode 100644 (file)
index 0000000..6db2aa2
--- /dev/null
@@ -0,0 +1,675 @@
+# host-cpu-c-abi.m4 serial 13
+dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible and Sam Steingold.
+
+dnl Sets the HOST_CPU variable to the canonical name of the CPU.
+dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
+dnl C language ABI (application binary interface).
+dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
+dnl config.h.
+dnl
+dnl This canonical name can be used to select a particular assembly language
+dnl source file that will interoperate with C code on the given host.
+dnl
+dnl For example:
+dnl * 'i386' and 'sparc' are different canonical names, because code for i386
+dnl   will not run on SPARC CPUs and vice versa. They have different
+dnl   instruction sets.
+dnl * 'sparc' and 'sparc64' are different canonical names, because code for
+dnl   'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
+dnl   contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
+dnl   instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
+dnl   mode, but not both.
+dnl * 'mips' and 'mipsn32' are different canonical names, because they use
+dnl   different argument passing and return conventions for C functions, and
+dnl   although the instruction set of 'mips' is a large subset of the
+dnl   instruction set of 'mipsn32'.
+dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
+dnl   different sizes for the C types like 'int' and 'void *', and although
+dnl   the instruction sets of 'mipsn32' and 'mips64' are the same.
+dnl * The same canonical name is used for different endiannesses. You can
+dnl   determine the endianness through preprocessor symbols:
+dnl   - 'arm': test __ARMEL__.
+dnl   - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
+dnl   - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
+dnl   (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
+dnl   - Instructions that do not exist on all of these CPUs (cmpxchg,
+dnl     MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
+dnl     assembly language source files use such instructions, you will
+dnl     need to make the distinction.
+dnl   - Speed of execution of the common instruction set is reasonable across
+dnl     the entire family of CPUs. If you have assembly language source files
+dnl     that are optimized for particular CPU types (like GNU gmp has), you
+dnl     will need to make the distinction.
+dnl   See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
+AC_DEFUN([gl_HOST_CPU_C_ABI],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_C_ASM])
+  AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
+    [case "$host_cpu" in
+
+changequote(,)dnl
+       i[34567]86 )
+changequote([,])dnl
+         gl_cv_host_cpu_c_abi=i386
+         ;;
+
+       x86_64 )
+         # On x86_64 systems, the C compiler may be generating code in one of
+         # these ABIs:
+         # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+         # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+         #   with native Windows (mingw, MSVC).
+         # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if (defined __x86_64__ || defined __amd64__ \
+                     || defined _M_X64 || defined _M_AMD64)
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined __ILP32__ || defined _ILP32
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=x86_64-x32],
+              [gl_cv_host_cpu_c_abi=x86_64])],
+           [gl_cv_host_cpu_c_abi=i386])
+         ;;
+
+changequote(,)dnl
+       alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+changequote([,])dnl
+         gl_cv_host_cpu_c_abi=alpha
+         ;;
+
+       arm* | aarch64 )
+         # Assume arm with EABI.
+         # On arm64 systems, the C compiler may be generating code in one of
+         # these ABIs:
+         # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+         # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef __aarch64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                [[#if defined __ILP32__ || defined _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+              [gl_cv_host_cpu_c_abi=arm64-ilp32],
+              [gl_cv_host_cpu_c_abi=arm64])],
+           [# Don't distinguish little-endian and big-endian arm, since they
+            # don't require different machine code for simple operations and
+            # since the user can distinguish them through the preprocessor
+            # defines __ARMEL__ vs. __ARMEB__.
+            # But distinguish arm which passes floating-point arguments and
+            # return values in integer registers (r0, r1, ...) - this is
+            # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
+            # passes them in float registers (s0, s1, ...) and double registers
+            # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
+            # sets the preprocessor defines __ARM_PCS (for the first case) and
+            # __ARM_PCS_VFP (for the second case), but older GCC does not.
+            echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
+            # Look for a reference to the register d0 in the .s file.
+            AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+            if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
+              gl_cv_host_cpu_c_abi=armhf
+            else
+              gl_cv_host_cpu_c_abi=arm
+            fi
+            rm -f conftest*
+           ])
+         ;;
+
+       hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+         # On hppa, the C compiler may be generating 32-bit code or 64-bit
+         # code. In the latter case, it defines _LP64 and __LP64__.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef __LP64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=hppa64],
+           [gl_cv_host_cpu_c_abi=hppa])
+         ;;
+
+       ia64* )
+         # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+         # 32-bit code. In the latter case, it defines _ILP32.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef _ILP32
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=ia64-ilp32],
+           [gl_cv_host_cpu_c_abi=ia64])
+         ;;
+
+       mips* )
+         # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+         # at 32.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=mips64],
+           [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
+            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
+            # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
+            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
+            AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if (_MIPS_SIM == _ABIN32)
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=mipsn32],
+              [gl_cv_host_cpu_c_abi=mips])])
+         ;;
+
+       powerpc* )
+         # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+         # No need to distinguish them here; the caller may distinguish
+         # them based on the OS.
+         # On powerpc64 systems, the C compiler may still be generating
+         # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+         # be generating 64-bit code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __powerpc64__ || defined _ARCH_PPC64
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [# On powerpc64, there are two ABIs on Linux: The AIX compatible
+            # one and the ELFv2 one. The latter defines _CALL_ELF=2.
+            AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined _CALL_ELF && _CALL_ELF == 2
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
+              [gl_cv_host_cpu_c_abi=powerpc64])
+           ],
+           [gl_cv_host_cpu_c_abi=powerpc])
+         ;;
+
+       rs6000 )
+         gl_cv_host_cpu_c_abi=powerpc
+         ;;
+
+       riscv32 | riscv64 )
+         # There are 2 architectures (with variants): rv32* and rv64*.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if __riscv_xlen == 64
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [cpu=riscv64],
+           [cpu=riscv32])
+         # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+         # Size of 'long' and 'void *':
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __LP64__
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [main_abi=lp64],
+           [main_abi=ilp32])
+         # Float ABIs:
+         # __riscv_float_abi_double:
+         #   'float' and 'double' are passed in floating-point registers.
+         # __riscv_float_abi_single:
+         #   'float' are passed in floating-point registers.
+         # __riscv_float_abi_soft:
+         #   No values are passed in floating-point registers.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __riscv_float_abi_double
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [float_abi=d],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined __riscv_float_abi_single
+                     int ok;
+                   #else
+                     error fail
+                   #endif
+                 ]])],
+              [float_abi=f],
+              [float_abi=''])
+           ])
+         gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+         ;;
+
+       s390* )
+         # On s390x, the C compiler may be generating 64-bit (= s390x) code
+         # or 31-bit (= s390) code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __LP64__ || defined __s390x__
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=s390x],
+           [gl_cv_host_cpu_c_abi=s390])
+         ;;
+
+       sparc | sparc64 )
+         # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+         # C compiler still generates 32-bit code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __sparcv9 || defined __arch64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=sparc64],
+           [gl_cv_host_cpu_c_abi=sparc])
+         ;;
+
+       *)
+         gl_cv_host_cpu_c_abi="$host_cpu"
+         ;;
+     esac
+    ])
+
+  dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
+  HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
+  HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
+  AC_SUBST([HOST_CPU])
+  AC_SUBST([HOST_CPU_C_ABI])
+
+  # This was
+  #   AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
+  #   AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
+  # earlier, but KAI C++ 3.2d doesn't like this.
+  sed -e 's/-/_/g' >> confdefs.h <<EOF
+#ifndef __${HOST_CPU}__
+#define __${HOST_CPU}__ 1
+#endif
+#ifndef __${HOST_CPU_C_ABI}__
+#define __${HOST_CPU_C_ABI}__ 1
+#endif
+EOF
+  AH_TOP([/* CPU and C ABI indicator */
+#ifndef __i386__
+#undef __i386__
+#endif
+#ifndef __x86_64_x32__
+#undef __x86_64_x32__
+#endif
+#ifndef __x86_64__
+#undef __x86_64__
+#endif
+#ifndef __alpha__
+#undef __alpha__
+#endif
+#ifndef __arm__
+#undef __arm__
+#endif
+#ifndef __armhf__
+#undef __armhf__
+#endif
+#ifndef __arm64_ilp32__
+#undef __arm64_ilp32__
+#endif
+#ifndef __arm64__
+#undef __arm64__
+#endif
+#ifndef __hppa__
+#undef __hppa__
+#endif
+#ifndef __hppa64__
+#undef __hppa64__
+#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
+#ifndef __ia64__
+#undef __ia64__
+#endif
+#ifndef __m68k__
+#undef __m68k__
+#endif
+#ifndef __mips__
+#undef __mips__
+#endif
+#ifndef __mipsn32__
+#undef __mipsn32__
+#endif
+#ifndef __mips64__
+#undef __mips64__
+#endif
+#ifndef __powerpc__
+#undef __powerpc__
+#endif
+#ifndef __powerpc64__
+#undef __powerpc64__
+#endif
+#ifndef __powerpc64_elfv2__
+#undef __powerpc64_elfv2__
+#endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
+#ifndef __s390__
+#undef __s390__
+#endif
+#ifndef __s390x__
+#undef __s390x__
+#endif
+#ifndef __sh__
+#undef __sh__
+#endif
+#ifndef __sparc__
+#undef __sparc__
+#endif
+#ifndef __sparc64__
+#undef __sparc64__
+#endif
+])
+
+])
+
+
+dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
+dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
+dnl one, or to 'unknown' if unknown.
+dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+    [if test -n "$gl_cv_host_cpu_c_abi"; then
+       case "$gl_cv_host_cpu_c_abi" in
+         i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+           gl_cv_host_cpu_c_abi_32bit=yes ;;
+         x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+           gl_cv_host_cpu_c_abi_32bit=no ;;
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown ;;
+       esac
+     else
+       case "$host_cpu" in
+
+         # CPUs that only support a 32-bit ABI.
+         arc \
+         | bfin \
+         | cris* \
+         | csky \
+         | epiphany \
+         | ft32 \
+         | h8300 \
+         | m68k \
+         | microblaze | microblazeel \
+         | nds32 | nds32le | nds32be \
+         | nios2 | nios2eb | nios2el \
+         | or1k* \
+         | or32 \
+         | sh | sh[1234] | sh[1234]e[lb] \
+         | tic6x \
+         | xtensa* )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         # CPUs that only support a 64-bit ABI.
+changequote(,)dnl
+         alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+         | mmix )
+changequote([,])dnl
+           gl_cv_host_cpu_c_abi_32bit=no
+           ;;
+
+changequote(,)dnl
+         i[34567]86 )
+changequote([,])dnl
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         x86_64 )
+           # On x86_64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+           # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+           #   with native Windows (mingw, MSVC).
+           # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if (defined __x86_64__ || defined __amd64__ \
+                       || defined _M_X64 || defined _M_AMD64) \
+                      && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         arm* | aarch64 )
+           # Assume arm with EABI.
+           # On arm64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+           # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+           # On hppa, the C compiler may be generating 32-bit code or 64-bit
+           # code. In the latter case, it defines _LP64 and __LP64__.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#ifdef __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         ia64* )
+           # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+           # 32-bit code. In the latter case, it defines _ILP32.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#ifdef _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=yes],
+             [gl_cv_host_cpu_c_abi_32bit=no])
+           ;;
+
+         mips* )
+           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+           # at 32.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         powerpc* )
+           # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+           # No need to distinguish them here; the caller may distinguish
+           # them based on the OS.
+           # On powerpc64 systems, the C compiler may still be generating
+           # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+           # be generating 64-bit code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __powerpc64__ || defined _ARCH_PPC64
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         rs6000 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         riscv32 | riscv64 )
+           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+           # Size of 'long' and 'void *':
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __LP64__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         s390* )
+           # On s390x, the C compiler may be generating 64-bit (= s390x) code
+           # or 31-bit (= s390) code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __LP64__ || defined __s390x__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         sparc | sparc64 )
+           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+           # C compiler still generates 32-bit code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __sparcv9 || defined __arch64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown
+           ;;
+       esac
+     fi
+    ])
+
+  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
index e2041b9..e593b72 100644 (file)
@@ -1,5 +1,6 @@
-# iconv.m4 serial 11 (gettext-0.18.1)
-dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
+# iconv.m4 serial 21
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -30,27 +31,35 @@ AC_DEFUN([AM_ICONV_LINK],
   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
   dnl because if the user has installed libiconv and not disabled its use
   dnl via --without-libiconv-prefix, he wants to use it. The first
-  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+  dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
   am_save_CPPFLAGS="$CPPFLAGS"
   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
   AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
-    AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-      [iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);],
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[
+#include <stdlib.h>
+#include <iconv.h>
+         ]],
+         [[iconv_t cd = iconv_open("","");
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);]])],
       [am_cv_func_iconv=yes])
     if test "$am_cv_func_iconv" != yes; then
       am_save_LIBS="$LIBS"
       LIBS="$LIBS $LIBICONV"
-      AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-        [iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
+#include <stdlib.h>
+#include <iconv.h>
+           ]],
+           [[iconv_t cd = iconv_open("","");
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);]])],
         [am_cv_lib_iconv=yes]
         [am_cv_func_iconv=yes])
       LIBS="$am_save_LIBS"
@@ -58,33 +67,43 @@ AC_DEFUN([AM_ICONV_LINK],
   ])
   if test "$am_cv_func_iconv" = yes; then
     AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
-      dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
+      dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
+      dnl Solaris 10.
       am_save_LIBS="$LIBS"
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
       fi
-      AC_TRY_RUN([
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
 #include <iconv.h>
 #include <string.h>
-int main ()
-{
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+             ]],
+             [[int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
     if (cd_utf8_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\342\202\254"; /* EURO SIGN */
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_utf8_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
       }
   }
   /* Test against Solaris 10 bug: Failures are not distinguishable from
@@ -93,17 +112,37 @@ int main ()
     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
     if (cd_ascii_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\263";
+        static ICONV_CONST char input[] = "\263";
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_ascii_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #if 0 /* This bug could be worked around by the caller.  */
@@ -112,37 +151,53 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
         char buf[50];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
-          return 1;
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #endif
   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
      provided.  */
-  if (/* Try standardized names.  */
-      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
-      /* Try IRIX, OSF/1 names.  */
-      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
-      /* Try AIX names.  */
-      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
-      /* Try HP-UX names.  */
-      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
-  return 0;
-}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
-        [case "$host_os" in
-           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
-           *)            am_cv_func_iconv_works="guessing yes" ;;
-         esac])
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+]])],
+          [am_cv_func_iconv_works=yes], ,
+          [case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac])
+        test "$am_cv_func_iconv_works" = no || break
+      done
       LIBS="$am_save_LIBS"
     ])
     case "$am_cv_func_iconv_works" in
@@ -183,32 +238,51 @@ m4_define([gl_iconv_AC_DEFUN],
   m4_version_prereq([2.64],
     [[AC_DEFUN_ONCE(
         [$1], [$2])]],
-    [[AC_DEFUN(
-        [$1], [$2])]]))
+    [m4_ifdef([gl_00GNULIB],
+       [[AC_DEFUN_ONCE(
+           [$1], [$2])]],
+       [[AC_DEFUN(
+           [$1], [$2])]])]))
 gl_iconv_AC_DEFUN([AM_ICONV],
 [
   AM_ICONV_LINK
   if test "$am_cv_func_iconv" = yes; then
     AC_MSG_CHECKING([for iconv declaration])
     AC_CACHE_VAL([am_cv_proto_iconv], [
-      AC_TRY_COMPILE([
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
 #include <stdlib.h>
 #include <iconv.h>
 extern
 #ifdef __cplusplus
 "C"
 #endif
-#if defined(__STDC__) || defined(__cplusplus)
+#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 #else
 size_t iconv();
 #endif
-], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
+           ]],
+           [[]])],
+        [am_cv_proto_iconv_arg1=""],
+        [am_cv_proto_iconv_arg1="const"])
       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
     AC_MSG_RESULT([
          $am_cv_proto_iconv])
-    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
-      [Define as const if the declaration of iconv() needs const.])
+  else
+    dnl When compiling GNU libiconv on a system that does not have iconv yet,
+    dnl pick the POSIX compliant declaration without 'const'.
+    am_cv_proto_iconv_arg1=""
   fi
+  AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+    [Define as const if the declaration of iconv() needs const.])
+  dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+  m4_ifdef([gl_ICONV_H_DEFAULTS],
+    [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+     if test -n "$am_cv_proto_iconv_arg1"; then
+       ICONV_CONST="const"
+     fi
+    ])
 ])
diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4
new file mode 100644 (file)
index 0000000..ebd9937
--- /dev/null
@@ -0,0 +1,65 @@
+# intlmacosx.m4 serial 8 (gettext-0.20.2)
+dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Checks for special options needed on Mac OS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
+[
+  dnl Check for API introduced in Mac OS X 10.4.
+  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+    [gt_cv_func_CFPreferencesCopyAppValue],
+    [gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <CoreFoundation/CFPreferences.h>]],
+          [[CFPreferencesCopyAppValue(NULL, NULL)]])],
+       [gt_cv_func_CFPreferencesCopyAppValue=yes],
+       [gt_cv_func_CFPreferencesCopyAppValue=no])
+     LIBS="$gt_save_LIBS"])
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
+      [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+  fi
+  dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
+  dnl because in macOS 10.13.4 it has the following behaviour:
+  dnl When two or more languages are specified in the
+  dnl "System Preferences > Language & Region > Preferred Languages" panel,
+  dnl it returns en_CC where CC is the territory (even when English is not among
+  dnl the preferred languages!).  What we want instead is what
+  dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
+  dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
+  dnl first among the preferred languages and CC is the territory.
+  AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
+    [gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <CoreFoundation/CFLocale.h>]],
+          [[CFLocaleCopyPreferredLanguages();]])],
+       [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
+       [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
+     LIBS="$gt_save_LIBS"])
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
+      [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
+  fi
+  INTL_MACOSX_LIBS=
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+  fi
+  AC_SUBST([INTL_MACOSX_LIBS])
+])
index ebb3052..98c348f 100644 (file)
-# lib-ld.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
+# lib-ld.m4 serial 9
+dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Subroutines of libtool.m4,
-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-dnl with libtool.m4.
+dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
+dnl collision with libtool.m4.
 
-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
 AC_DEFUN([AC_LIB_PROG_LD_GNU],
 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
-  acl_cv_prog_gnu_ld=yes ;;
+  acl_cv_prog_gnu_ld=yes
+  ;;
 *)
-  acl_cv_prog_gnu_ld=no ;;
+  acl_cv_prog_gnu_ld=no
+  ;;
 esac])
 with_gnu_ld=$acl_cv_prog_gnu_ld
 ])
 
-dnl From libtool-1.4. Sets the variable LD.
+dnl From libtool-2.4. Sets the variable LD.
 AC_DEFUN([AC_LIB_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
+[AC_REQUIRE([AC_PROG_CC])dnl
 AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+        [assume the C compiler uses GNU ld [default=no]])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by GCC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]* | [A-Za-z]:[\\/]*)]
-      [re_direlt='/[^/][^/]*/\.\./']
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
+
+if test -n "$LD"; then
+  AC_MSG_CHECKING([for ld])
+elif test "$GCC" = yes; then
+  AC_MSG_CHECKING([for ld used by $CC])
 elif test "$with_gnu_ld" = yes; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
-AC_CACHE_VAL([acl_cv_path_LD],
-[if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
-      *GNU* | *'with BFD'*)
-        test "$with_gnu_ld" != no && break ;;
-      *)
-        test "$with_gnu_ld" != yes && break ;;
+if test -n "$LD"; then
+  # Let the user override the test with a path.
+  :
+else
+  AC_CACHE_VAL([acl_cv_path_LD],
+  [
+    acl_cv_path_LD= # Final result of this test
+    ac_prog=ld # Program to search in $PATH
+    if test "$GCC" = yes; then
+      # Check if gcc -print-prog-name=ld gives a path.
+      case $host in
+        *-*-mingw*)
+          # gcc leaves a trailing carriage return which upsets mingw
+          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+        *)
+          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+      esac
+      case $acl_output in
+        # Accept absolute paths.
+        [[\\/]]* | ?:[[\\/]]*)
+          re_direlt='/[[^/]][[^/]]*/\.\./'
+          # Canonicalize the pathname of ld
+          acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+          while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+            acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+          done
+          # Got the pathname. No search in PATH is needed.
+          acl_cv_path_LD="$acl_output"
+          ac_prog=
+          ;;
+        "")
+          # If it fails, then pretend we aren't using GCC.
+          ;;
+        *)
+          # If it is relative, then search for the first ld in PATH.
+          with_gnu_ld=unknown
+          ;;
       esac
     fi
-  done
-  IFS="$ac_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
+    if test -n "$ac_prog"; then
+      # Search for $ac_prog in $PATH.
+      acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+      for ac_dir in $PATH; do
+        IFS="$acl_save_ifs"
+        test -z "$ac_dir" && ac_dir=.
+        if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+          acl_cv_path_LD="$ac_dir/$ac_prog"
+          # Check to see if the program is GNU ld.  I'd rather use --version,
+          # but apparently some variants of GNU ld only accept -v.
+          # Break only if it was the GNU/non-GNU ld that we prefer.
+          case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+            *GNU* | *'with BFD'*)
+              test "$with_gnu_ld" != no && break
+              ;;
+            *)
+              test "$with_gnu_ld" != yes && break
+              ;;
+          esac
+        fi
+      done
+      IFS="$acl_save_ifs"
+    fi
+    case $host in
+      *-*-aix*)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_SOURCE(
+             [[#if defined __powerpc64__ || defined _ARCH_PPC64
+                int ok;
+               #else
+                error fail
+               #endif
+             ]])],
+          [# The compiler produces 64-bit code. Add option '-b64' so that the
+           # linker groks 64-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -b64 "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+           esac
+          ], [])
+        ;;
+      sparc64-*-netbsd*)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_SOURCE(
+             [[#if defined __sparcv9 || defined __arch64__
+                int ok;
+               #else
+                error fail
+               #endif
+             ]])],
+          [],
+          [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
+           # so that the linker groks 32-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -m elf32_sparc "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+           esac
+          ])
+        ;;
+    esac
+  ])
+  LD="$acl_cv_path_LD"
+fi
 if test -n "$LD"; then
   AC_MSG_RESULT([$LD])
 else
   AC_MSG_RESULT([no])
+  AC_MSG_ERROR([no acceptable ld found in \$PATH])
 fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 AC_LIB_PROG_LD_GNU
 ])
index c73bd8e..eecf70e 100644 (file)
@@ -1,12 +1,12 @@
-# lib-link.m4 serial 21 (gettext-0.18)
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+# lib-link.m4 serial 31
+dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
-AC_PREREQ([2.54])
+AC_PREREQ([2.61])
 
 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
@@ -18,9 +18,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   AC_REQUIRE([AC_LIB_RPATH])
-  pushdef([Name],[translit([$1],[./-], [___])])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([Name],[m4_translit([$1],[./+-], [____])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
     AC_LIB_LINKFLAGS_BODY([$1], [$2])
     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
@@ -58,9 +58,9 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   AC_REQUIRE([AC_LIB_RPATH])
-  pushdef([Name],[translit([$1],[./-], [___])])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([Name],[m4_translit([$1],[./+-], [____])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
 
   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
   dnl accordingly.
@@ -85,7 +85,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
       *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
       *)       LIBS="$LIB[]NAME $LIBS" ;;
     esac
-    AC_TRY_LINK([$3], [$4],
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM([[$3]], [[$4]])],
       [ac_cv_lib[]Name=yes],
       [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
     LIBS="$ac_save_LIBS"
@@ -115,14 +116,16 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 dnl Determine the platform dependent parameters needed to use rpath:
 dnl   acl_libext,
 dnl   acl_shlibext,
+dnl   acl_libname_spec,
+dnl   acl_library_names_spec,
 dnl   acl_hardcode_libdir_flag_spec,
 dnl   acl_hardcode_libdir_separator,
 dnl   acl_hardcode_direct,
 dnl   acl_hardcode_minus_L.
 AC_DEFUN([AC_LIB_RPATH],
 [
-  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
-  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+  dnl Complain if config.rpath is missing.
+  AC_REQUIRE_AUX_FILE([config.rpath])
   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
@@ -157,15 +160,15 @@ dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
 dnl macro call that searches for libname.
 AC_DEFUN([AC_LIB_FROMPACKAGE],
 [
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   define([acl_frompackage_]NAME, [$2])
   popdef([NAME])
   pushdef([PACK],[$2])
-  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
-                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   define([acl_libsinpackage_]PACKUP,
-    m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
+    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
   popdef([PACKUP])
   popdef([PACK])
 ])
@@ -178,23 +181,23 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 [
   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
-  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
-  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
-                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
-  dnl Autoconf >= 2.61 supports dots in --with options.
-  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
   dnl By default, look in $includedir and $libdir.
   use_additional=yes
   AC_LIB_WITH_FINAL_PREFIX([
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
   ])
-  AC_ARG_WITH(P_A_C_K[-prefix],
-[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
-  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
+  AC_ARG_WITH(PACK[-prefix],
+[[  --with-]]PACK[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
+  --without-]]PACK[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
 [
     if test "X$withval" = "Xno"; then
       use_additional=no
@@ -203,17 +206,23 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
         AC_LIB_WITH_FINAL_PREFIX([
           eval additional_includedir=\"$includedir\"
           eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
         ])
       else
         additional_includedir="$withval/include"
         additional_libdir="$withval/$acl_libdirstem"
-        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
-          additional_libdir="$withval/$acl_libdirstem2"
-        fi
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
       fi
     fi
 ])
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
   dnl Search the library and its dependencies in $additional_libdir and
   dnl $LDFLAGS. Using breadth-first-seach.
   LIB[]NAME=
@@ -242,7 +251,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
         names_already_handled="$names_already_handled $name"
         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
         dnl or AC_LIB_HAVE_LINKFLAGS call.
-        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
         eval value=\"\$HAVE_LIB$uppername\"
         if test -n "$value"; then
           if test "$value" = yes; then
@@ -269,48 +278,54 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
             shrext=
           fi
           if test $use_additional = yes; then
-            dir="$additional_libdir"
-            dnl The same code as in the loop below:
-            dnl First look for a shared library.
-            if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                  dnl The same code as in the loop below:
+                  dnl First look for a shared library.
+                  if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
                   fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
+                  dnl Then look for a static library.
+                  if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
+                      found_a="$dir/$libname.$acl_libext"
                     fi
-                  done
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                 fi
               fi
-            fi
-            dnl Then look for a static library.
-            if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
-              fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
-              fi
-            fi
+            done
           fi
           if test "X$found_dir" = "X"; then
             for x in $LDFLAGS $LTLIB[]NAME; do
@@ -320,7 +335,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
                   dnl First look for a shared library.
                   if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
                       found_so="$dir/$libname$shrext"
                     else
@@ -330,14 +345,14 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                               | sed -e "s,^$libname$shrext\\\\.,," \
                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
                               | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
                           found_dir="$dir"
                           found_so="$dir/$libname$shrext.$ver"
                         fi
                       else
                         eval library_names=\"$acl_library_names_spec\"
                         for f in $library_names; do
-                          if test -f "$dir/$f"; then
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
                             found_dir="$dir"
                             found_so="$dir/$f"
                             break
@@ -348,7 +363,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                   fi
                   dnl Then look for a static library.
                   if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
                       found_a="$dir/$libname.$acl_libext"
                     fi
@@ -374,7 +389,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
               dnl standard /usr/lib.
               if test "$enable_rpath" = no \
                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
                 dnl No hardcoding is needed.
                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
               else
@@ -474,6 +490,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                 fi
                 additional_includedir="$basedir/include"
                 ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = '$1'; then
+                  LIB[]NAME[]_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
             esac
             if test "X$additional_includedir" != "X"; then
               dnl Potentially add $additional_includedir to $INCNAME.
@@ -524,19 +547,21 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
               for dep in $dependency_libs; do
                 case "$dep" in
                   -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
                     dnl But don't add it
                     dnl   1. if it's the standard /usr/lib,
                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
                     dnl   3. if it's already present in $LDFLAGS or the already
                     dnl      constructed $LIBNAME,
                     dnl   4. if it doesn't exist as a directory.
-                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                    if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
                         if test -n "$GCC"; then
                           case $host_os in
                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -547,29 +572,29 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                         haveit=
                         for x in $LDFLAGS $LIB[]NAME; do
                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LIBNAME.
-                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                            dnl Really add $dependency_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
                           fi
                         fi
                         haveit=
                         for x in $LDFLAGS $LTLIB[]NAME; do
                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LTLIBNAME.
-                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                            dnl Really add $dependency_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
                           fi
                         fi
                       fi
@@ -667,7 +692,6 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
     done
   fi
-  popdef([P_A_C_K])
   popdef([PACKLIBS])
   popdef([PACKUP])
   popdef([PACK])
@@ -718,7 +742,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
           dir="$next"
           dnl No need to hardcode the standard /usr/lib.
           if test "X$dir" != "X/usr/$acl_libdirstem" \
-             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+             && test "X$dir" != "X/usr/$acl_libdirstem2" \
+             && test "X$dir" != "X/usr/$acl_libdirstem3"; then
             rpathdirs="$rpathdirs $dir"
           fi
           next=
@@ -728,7 +753,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
             -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
                  dnl No need to hardcode the standard /usr/lib.
                  if test "X$dir" != "X/usr/$acl_libdirstem" \
-                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+                    && test "X$dir" != "X/usr/$acl_libdirstem2" \
+                    && test "X$dir" != "X/usr/$acl_libdirstem3"; then
                    rpathdirs="$rpathdirs $dir"
                  fi
                  next= ;;
index 1601cea..c8a0b46 100644 (file)
@@ -1,18 +1,11 @@
-# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 17
+dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 dnl to access previously installed libraries. The basic assumption is that
 dnl a user will want packages to use other packages he previously installed
@@ -32,9 +25,9 @@ AC_DEFUN([AC_LIB_PREFIX],
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
   ])
-  AC_LIB_ARG_WITH([lib-prefix],
-[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
-  --without-lib-prefix    don't search for libraries in includedir and libdir],
+  AC_ARG_WITH([lib-prefix],
+[[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir]],
 [
     if test "X$withval" = "Xno"; then
       use_additional=no
@@ -154,71 +147,174 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
 ])
 
 dnl AC_LIB_PREPARE_MULTILIB creates
-dnl - a variable acl_libdirstem, containing the basename of the libdir, either
-dnl   "lib" or "lib64" or "lib/64",
-dnl - a variable acl_libdirstem2, as a secondary possible value for
-dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
-dnl   "lib/amd64".
+dnl - a function acl_is_expected_elfclass, that tests whether standard input
+dn;   has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
+dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
+dnl   the basename of the libdir to try in turn, either "lib" or "lib64" or
+dnl   "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
 [
-  dnl There is no formal standard regarding lib and lib64.
-  dnl On glibc systems, the current practice is that on a system supporting
+  dnl There is no formal standard regarding lib, lib32, and lib64.
+  dnl On most glibc systems, the current practice is that on a system supporting
   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
-  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
-  dnl the compiler's default mode by looking at the compiler's library search
-  dnl path. If at least one of its elements ends in /lib64 or points to a
-  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
-  dnl Otherwise we use the default, namely "lib".
+  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
+  dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
+  dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
+  dnl We determine the compiler's default mode by looking at the compiler's
+  dnl library search path. If at least one of its elements ends in /lib64 or
+  dnl points to a directory whose absolute pathname ends in /lib64, we use that
+  dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
+  dnl namely "lib".
   dnl On Solaris systems, the current practice is that on a system supporting
   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
   dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
   dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
   AC_REQUIRE([AC_CANONICAL_HOST])
-  acl_libdirstem=lib
-  acl_libdirstem2=
-  case "$host_os" in
-    solaris*)
-      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
-      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
-      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
-      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
-      dnl symlink is missing, so we set acl_libdirstem2 too.
-      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
-        [AC_EGREP_CPP([sixtyfour bits], [
-#ifdef _LP64
-sixtyfour bits
-#endif
-           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
-        ])
-      if test $gl_cv_solaris_64bit = yes; then
-        acl_libdirstem=lib/64
-        case "$host_cpu" in
-          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
-          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
-        esac
-      fi
-      ;;
-    *)
-      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
-      if test -n "$searchpath"; then
-        acl_save_IFS="${IFS=   }"; IFS=":"
-        for searchdir in $searchpath; do
-          if test -d "$searchdir"; then
-            case "$searchdir" in
-              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
-              */../ | */.. )
-                # Better ignore directories of this form. They are misleading.
-                ;;
-              *) searchdir=`cd "$searchdir" && pwd`
-                 case "$searchdir" in
-                   */lib64 ) acl_libdirstem=lib64 ;;
-                 esac ;;
-            esac
-          fi
-        done
-        IFS="$acl_save_IFS"
-      fi
-      ;;
-  esac
-  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+  AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
+
+  AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
+    [AC_EGREP_CPP([Extensible Linking Format],
+       [#ifdef __ELF__
+        Extensible Linking Format
+        #endif
+       ],
+       [gl_cv_elf=yes],
+       [gl_cv_elf=no])
+     ])
+  if test $gl_cv_elf; then
+    # Extract the ELF class of a file (5th byte) in decimal.
+    # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+    if od -A x < /dev/null >/dev/null 2>/dev/null; then
+      # Use POSIX od.
+      func_elfclass ()
+      {
+        od -A n -t d1 -j 4 -N 1
+      }
+    else
+      # Use BSD hexdump.
+      func_elfclass ()
+      {
+        dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+        echo
+      }
+    fi
+changequote(,)dnl
+    case $HOST_CPU_C_ABI_32BIT in
+      yes)
+        # 32-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          test "`func_elfclass | sed -e 's/[   ]//g'`" = 1
+        }
+        ;;
+      no)
+        # 64-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          test "`func_elfclass | sed -e 's/[   ]//g'`" = 2
+        }
+        ;;
+      *)
+        # Unknown.
+        acl_is_expected_elfclass ()
+        {
+          :
+        }
+        ;;
+    esac
+changequote([,])dnl
+  else
+    acl_is_expected_elfclass ()
+    {
+      :
+    }
+  fi
+
+  dnl Allow the user to override the result by setting acl_cv_libdirstems.
+  AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
+    [acl_cv_libdirstems],
+    [dnl Try 'lib' first, because that's the default for libdir in GNU, see
+     dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
+     acl_libdirstem=lib
+     acl_libdirstem2=
+     acl_libdirstem3=
+     case "$host_os" in
+       solaris*)
+         dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+         dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
+         dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+         dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+         dnl symlink is missing, so we set acl_libdirstem2 too.
+         if test $HOST_CPU_C_ABI_32BIT = no; then
+           acl_libdirstem2=lib/64
+           case "$host_cpu" in
+             sparc*)        acl_libdirstem3=lib/sparcv9 ;;
+             i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+           esac
+         fi
+         ;;
+       *)
+         dnl If $CC generates code for a 32-bit ABI, the libraries are
+         dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
+         dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
+         dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
+         dnl Find the compiler's search path. However, non-system compilers
+         dnl sometimes have odd library search paths. But we can't simply invoke
+         dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
+         dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
+         searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+                     | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+         if test $HOST_CPU_C_ABI_32BIT != no; then
+           # 32-bit or unknown ABI.
+           if test -d /usr/lib32; then
+             acl_libdirstem2=lib32
+           fi
+         fi
+         if test $HOST_CPU_C_ABI_32BIT != yes; then
+           # 64-bit or unknown ABI.
+           if test -d /usr/lib64; then
+             acl_libdirstem3=lib64
+           fi
+         fi
+         if test -n "$searchpath"; then
+           acl_save_IFS="${IFS=        }"; IFS=":"
+           for searchdir in $searchpath; do
+             if test -d "$searchdir"; then
+               case "$searchdir" in
+                 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+                 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+                 */../ | */.. )
+                   # Better ignore directories of this form. They are misleading.
+                   ;;
+                 *) searchdir=`cd "$searchdir" && pwd`
+                    case "$searchdir" in
+                      */lib32 ) acl_libdirstem2=lib32 ;;
+                      */lib64 ) acl_libdirstem3=lib64 ;;
+                    esac ;;
+               esac
+             fi
+           done
+           IFS="$acl_save_IFS"
+           if test $HOST_CPU_C_ABI_32BIT = yes; then
+             # 32-bit ABI.
+             acl_libdirstem3=
+           fi
+           if test $HOST_CPU_C_ABI_32BIT = no; then
+             # 64-bit ABI.
+             acl_libdirstem2=
+           fi
+         fi
+         ;;
+     esac
+     test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+     test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+     acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
+    ])
+  dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
+  dnl acl_libdirstem3.
+changequote(,)dnl
+  acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+  acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+  acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+changequote([,])dnl
 ])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644 (file)
index 0000000..a644432
--- /dev/null
@@ -0,0 +1,8372 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 2014 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 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+])
+
+# serial 58 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+                  [m4_fatal([Libtool version $1 or higher is required],
+                            63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\    *)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in @S|@*""; do
+      case $cc_temp in
+        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
+m4_defun([_LT_CC_BASENAME],
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+m4_require([_LT_CMD_TRUNCATE])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}"; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test set != "${COLLECT_NAMES+set}"; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from 'configure', and 'config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain=$ac_aux_dir/ltmain.sh
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the 'libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+       [m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+       [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+       [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+          m4_quote(lt_decl_varnames),
+       m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+                       lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags='_LT_TAGS'dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+                                          [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+       dnl If the libtool generation code has been placed in $CONFIG_LT,
+       dnl instead of duplicating it all over again into config.status,
+       dnl then we will have config.status run $CONFIG_LT later, so it
+       dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# '#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+'$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test 0 != $[#]
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try '$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try '$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test yes = "$silent" &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options that allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}"; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile=${ofile}T
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],                 [_LT_LANG(C)],
+  [C++],               [_LT_LANG(CXX)],
+  [Go],                        [_LT_LANG(GO)],
+  [Java],              [_LT_LANG(GCJ)],
+  [Fortran 77],                [_LT_LANG(F77)],
+  [Fortran],           [_LT_LANG(FC)],
+  [Windows Resource],  [_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC],     [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+  fi
+fi
+if test -z "$GOC"; then
+  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+       [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+       [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+       [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+  [LT_LANG(GO)],
+  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "$LT_MULTI_MODULE"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       # If there is a non-empty error log, and "single_module"
+       # appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+         cat conftest.err >&AS_MESSAGE_LOG_FD
+       # Otherwise, if the output was created with a 0 exit code from
+       # the compiler, it worked.
+       elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+         lt_cv_apple_cc_single_mod=yes
+       else
+         cat conftest.err >&AS_MESSAGE_LOG_FD
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi])
+
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+       [lt_cv_ld_exported_symbols_list=yes],
+       [lt_cv_ld_exported_symbols_list=no])
+       LDFLAGS=$save_LDFLAGS
+    ])
+
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+       cat conftest.err >&AS_MESSAGE_LOG_FD
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+       lt_cv_ld_force_load=yes
+      else
+       cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+         _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+       10.[[012]][[,.]]*)
+         _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+    fi
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  if test yes = "$lt_cv_ld_force_load"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
+  case $cc_basename in
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test yes = "$_lt_dar_can_shared"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+    m4_if([$1], [CXX],
+[   if test yes != "$lt_cv_apple_cc_single_mod"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test set = "${lt_cv_aix_libpath+set}"; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+case $ECHO in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+  [Search for dependent libraries within DIR (or the compiler's sysroot
+   if not specified).])],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+   if test yes = "$GCC"; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([$with_sysroot])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and where our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE=32
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE=64
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+       emul="${emul}32"
+       ;;
+      *64-bit*)
+       emul="${emul}64"
+       ;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+       emul="${emul}btsmip"
+       ;;
+      *LSB*)
+       emul="${emul}ltsmip"
+       ;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+       emul="${emul}n32"
+       ;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
+           ;;
+         powerpc64le-*linux*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc64-*linux*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         powerpcle-*linux*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*linux*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test yes != "$lt_cv_cc_needs_belf"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS=$SAVE_CFLAGS
+  fi
+  ;;
+*-*solaris*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*)
+        case $host in
+        i?86-*-solaris*|x86_64-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD=${LD-ld}_sol2
+        fi
+        ;;
+      *)
+       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks=$enable_libtool_lock
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test 0 -eq "$ac_status"; then
+       # Ensure the archiver fails upon bogus file names.
+       rm -f conftest.$ac_objext libconftest.a
+       AC_TRY_EVAL([lt_ar_try])
+       if test 0 -ne "$ac_status"; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test no = "$lt_cv_ar_at_file"; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  bitrig* | openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test yes = "[$]$2"; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS=$LDFLAGS
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS=$save_LDFLAGS
+])
+
+if test yes = "[$]$2"; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring=ABCD
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[        ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test 17 != "$i" # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n "$lt_cv_sys_max_cmd_len"; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes = "$cross_compiling"; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes != "$enable_dlopen"; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen=load_add_on
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen=LoadLibrary
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+    # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+    lt_cv_dlopen=dyld
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+         [lt_cv_dlopen=shl_load],
+      [AC_CHECK_LIB([dld], [shl_load],
+           [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
+       [AC_CHECK_FUNC([dlopen],
+             [lt_cv_dlopen=dlopen],
+         [AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
+           [AC_CHECK_LIB([svld], [dlopen],
+                 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
+             [AC_CHECK_LIB([dld], [dld_link],
+                   [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  esac
+
+  if test no = "$lt_cv_dlopen"; then
+    enable_dlopen=no
+  else
+    enable_dlopen=yes
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS=$LDFLAGS
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS=$LIBS
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+         lt_cv_dlopen_self, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test yes = "$lt_cv_dlopen_self"; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+        [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+        [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+        [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+       [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test no = "$hard_links"; then
+    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+  [Define to the sub-directory where libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
+
+  # We can hardcode non-existent directories.
+  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP"; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x@S|@2 in
+    x)
+        ;;
+    *:)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+        ;;
+    x:*)
+        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+        ;;
+    *)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+       [], [
+if test yes = "$GCC"; then
+  case $host_os in
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary...
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo = "/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='$libname$release$shared_ext$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test ia64 = "$host_cpu"; then
+    # AIX 5 supports IA64
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='$libname$shared_ext'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec=$LIB
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[23]].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+    fi
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test yes = "$lt_cv_prog_gnu_ld"; then
+               version_type=linux # correct to gnu/linux during the next big refactor
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+        LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+        [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Add ABI-specific directories to the system library path.
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd* | bitrig*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec=/usr/lib
+  need_lib_prefix=no
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
+  else
+    need_version=yes
+  fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+os2*)
+  libname_spec='$name'
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
+  need_lib_prefix=no
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test yes = "$with_gnu_ld"; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec; then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=sco
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test yes = "$with_gnu_ld"; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+    [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program that can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$1"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
+  ;;
+esac])
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+        [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program that can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test no = "$withval" || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test yes = "$GCC"; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return, which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD=$ac_prog
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test yes = "$with_gnu_ld"; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS=$lt_save_ifs
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD=$ac_dir/$ac_prog
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test no != "$with_gnu_ld" && break
+       ;;
+      *)
+       test yes != "$with_gnu_ld" && break
+       ;;
+      esac
+    fi
+  done
+  IFS=$lt_save_ifs
+else
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi])
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test yes != "$GCC"; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_PATH_DD
+# -----------
+# find a working dd
+m4_defun([_LT_PATH_DD],
+[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
+[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi])
+rm -f conftest.i conftest2.i conftest.out])
+])# _LT_PATH_DD
+
+
+# _LT_CMD_TRUNCATE
+# ----------------
+# find command to truncate a binary pipe
+m4_defun([_LT_CMD_TRUNCATE],
+[m4_require([_LT_PATH_DD])
+AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
+_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
+  [Command to truncate a binary pipe])
+])# _LT_CMD_TRUNCATE
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM=$NM
+else
+  lt_nm_to_check=${ac_tool_prefix}nm
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS=$lt_save_ifs
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+       case $build_os in
+       mingw*) lt_bad_file=conftest.nm/nofile ;;
+       *) lt_bad_file=/dev/null ;;
+       esac
+       case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+       *$lt_bad_file* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break 2
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break 2
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS=$lt_save_ifs
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols -headers"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test yes != "$lt_cv_path_mainfest_tool"; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+  test DEF = "`$SED -n dnl
+    -e '\''s/^[[        ]]*//'\'' dnl Strip leading whitespace
+    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
+    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[  ]].*\)*$/DEF/p'\'' dnl
+    -e q dnl                          Only consider the first "real" line
+    $1`" dnl
+])# _LT_DLL_DEF_P
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM=-lm)
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test yes = "$GCC"; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+       [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test ia64 = "$host_cpu"; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[    ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t@_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data.  */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT@&t@_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_globsym_save_LIBS=$LIBS
+         lt_globsym_save_CFLAGS=$CFLAGS
+         LIBS=conftstm.$ac_objext
+         CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+         if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+           pipe_works=yes
+         fi
+         LIBS=$lt_globsym_save_LIBS
+         CFLAGS=$lt_globsym_save_CFLAGS
+       else
+         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test yes = "$pipe_works"; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+    [Transform the output of nm into a list of symbols to manually relocate])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+    [The name lister interface])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test yes = "$GXX"; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+       ;;
+      esac
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+       # All AIX code is PIC.
+       if test ia64 = "$host_cpu"; then
+         # AIX 5 now supports IA64 processor
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       else
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+       # This hack is so that the source file can tell whether it is being
+       # built for inclusion in a dll (and should export symbols for example).
+       m4_if([$1], [GCJ], [],
+         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+           if test ia64 != "$host_cpu"; then
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+           fi
+           ;;
+         aCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      interix*)
+       # This is c89, which is MS Visual C++ (no shared libs)
+       # Anyone wants to do a port?
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         ecpc* )
+           # old Intel C++ for x86_64, which still supported -KPIC.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         icpc* )
+           # Intel C++, used to be incompatible with GCC.
+           # ICC 10 doesn't accept -KPIC any more.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         pgCC* | pgcpp*)
+           # Portland Group C++ compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         cxx*)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+           # IBM XL 8.0, 9.0 on PPC and BlueGene
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      vxworks*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+       ;;
+    esac
+  fi
+],
+[
+  if test yes = "$GCC"; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test ia64 = "$host_cpu"; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test ia64 = "$host_cpu"; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      esac
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+       ;;
+      esac
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64, which still supported -KPIC.
+      ecc*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+       ;;
+      nagfor*)
+       # NAG Fortran compiler
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       ;;
+      tcc*)
+       # Fabrice Bellard et al's Tiny C Compiler
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+         ;;
+       *Sun\ F* | *Sun*Fortran*)
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+        *Intel*\ [[CF]]*Compiler*)
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+         ;;
+       *Portland\ Group*)
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms that do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+       [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+       [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+       [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+    # Without the "-l" option, or with the "-B" option, AIX nm treats
+    # weak defined symbols like other global defined symbols, whereas
+    # GNU nm marks them as "W".
+    # While the 'weak' keyword is ignored in the Export File, we need
+    # it in the Import File for the 'aix-soname' feature, so we have
+    # to replace the "-B" option with "-P" for AIX nm.
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*)
+      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+      ;;
+    esac
+    ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test yes != "$GCC"; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd* | bitrig*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test yes = "$with_gnu_ld"; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test yes = "$lt_use_gnu_ld_interface"; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='$wl'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test ia64 != "$host_cpu"; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file, use it as
+       # is; otherwise, prepend EXPORTS...
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+       $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+       $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+       $ECHO EXPORTS >> $output_objdir/$libname.def~
+       emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+       $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+       emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+       $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+       $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+       $ECHO EXPORTS >> $output_objdir/$libname.def~
+       prefix_cmds="$SED"~
+       if test EXPORTS = "`$SED 1q $export_symbols`"; then
+         prefix_cmds="$prefix_cmds -e 1d";
+       fi~
+       prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+       cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+       $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+       emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test linux-dietlibc = "$host_os"; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test no = "$tmp_diet"
+      then
+       tmp_addflag=' $pic_flag'
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         _LT_TAGVAR(whole_archive_flag_spec, $1)=
+         tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
+       xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+        if test yes = "$supports_anon_versioning"; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       tcc*)
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+         ;;
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+         _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+         if test yes = "$supports_anon_versioning"; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test ia64 = "$host_cpu"; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+       # Without the "-l" option, or with the "-B" option, AIX nm treats
+       # weak defined symbols like other global defined symbols, whereas
+       # GNU nm marks them as "W".
+       # While the 'weak' keyword is ignored in the Export File, we need
+       # it in the Import File for the 'aix-soname' feature, so we have
+       # to replace the "-B" option with "-P" for AIX nm.
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # have runtime linking enabled, and use it for executables.
+       # For shared libraries, we enable/disable runtime linking
+       # depending on the kind of the shared library created -
+       # when "with_aix_soname,aix_use_runtimelinking" is:
+       # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+       # "aix,yes"  lib.so          shared, rtl:yes, for executables
+       #            lib.a           static archive
+       # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+       #            lib.a(lib.so.V) shared, rtl:no,  for executables
+       # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+       #            lib.a(lib.so.V) shared, rtl:no
+       # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+       #            lib.a           static archive
+       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+         for ld_flag in $LDFLAGS; do
+         if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+           # With aix-soname=svr4, we create the lib.so.V shared archives only,
+           # so we don't have lib.a shared libs to link our executables.
+           # We have to force runtime linking in this case.
+           aix_use_runtimelinking=yes
+           LDFLAGS="$LDFLAGS -Wl,-brtl"
+         fi
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+       # The Import File defines what to hardcode.
+       _LT_TAGVAR(hardcode_direct, $1)=no
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+       ;;
+      esac
+
+      if test yes = "$GCC"; then
+       case $host_os in aix4.[[012]]|aix4.[[012]].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`$CC -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         _LT_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test yes = "$aix_use_runtimelinking"; then
+         shared_flag="$shared_flag "'$wl-G'
+       fi
+       # Need to ensure runtime linking is disabled for the traditional
+       # shared library, or the linker may eventually find shared libraries
+       # /with/ Import File - we do not want to mix them.
+       shared_flag_aix='-shared'
+       shared_flag_svr4='-shared $wl-G'
+      else
+       # not using gcc
+       if test ia64 = "$host_cpu"; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test yes = "$aix_use_runtimelinking"; then
+           shared_flag='$wl-G'
+         else
+           shared_flag='$wl-bM:SRE'
+         fi
+         shared_flag_aix='$wl-bM:SRE'
+         shared_flag_svr4='$wl-G'
+       fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+      else
+       if test ia64 = "$host_cpu"; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+         _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+         _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+         if test yes = "$with_gnu_ld"; then
+           # We only use this code for GNU lds that support --whole-archive.
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+         fi
+         _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+         # -brtl affects multiple linker settings, -berok does not and is overridden later
+         compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+         if test svr4 != "$with_aix_soname"; then
+           # This is similar to how AIX traditionally builds its shared libraries.
+           _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+         fi
+         if test aix != "$with_aix_soname"; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+         else
+           # used by -dlpreopen to get the symbols
+           _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+         fi
+         _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       _LT_TAGVAR(always_export_symbols, $1)=yes
+       _LT_TAGVAR(file_list_spec, $1)='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=.dll
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
+       # The linker will not automatically build a static lib if we build a DLL.
+       # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+       _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+       # Don't use ranlib
+       _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+       _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=.dll
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+       # FIXME: Should let the user specify the lib program.
+       _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test yes = "$GCC"; then
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+      ;;
+
+    hpux10*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test no = "$with_gnu_ld"; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+       m4_if($1, [], [
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         _LT_LINKER_OPTION([if $CC understands -b],
+           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+           [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+         [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+         ;;
+       esac
+      fi
+      if test no = "$with_gnu_ld"; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_TAGVAR(hardcode_direct, $1)=no
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       *)
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test yes = "$GCC"; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+       # This should be the same for all languages, so no per-tag cache variable.
+       AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+         [lt_cv_irix_exported_symbol],
+         [save_LDFLAGS=$LDFLAGS
+          LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+          AC_LINK_IFELSE(
+            [AC_LANG_SOURCE(
+               [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+                             [C++], [[int foo (void) { return 0; }]],
+                             [Fortran 77], [[
+      subroutine foo
+      end]],
+                             [Fortran], [[
+      subroutine foo
+      end]])])],
+             [lt_cv_irix_exported_symbol=yes],
+             [lt_cv_irix_exported_symbol=no])
+           LDFLAGS=$save_LDFLAGS])
+       if test yes = "$lt_cv_irix_exported_symbol"; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+       fi
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    linux*)
+      case $cc_basename in
+      tcc*)
+       # Fabrice Bellard et al's Tiny C Compiler
+       _LT_TAGVAR(ld_shlibs, $1)=yes
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+      esac
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd* | bitrig*)
+      if test -f /usr/libexec/ld.so; then
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+       else
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+       fi
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+       $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+       $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+       $ECHO EXPORTS >> $output_objdir/$libname.def~
+       emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+       $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+       emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+       $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+       $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+       $ECHO EXPORTS >> $output_objdir/$libname.def~
+       prefix_cmds="$SED"~
+       if test EXPORTS = "`$SED 1q $export_symbols`"; then
+         prefix_cmds="$prefix_cmds -e 1d";
+       fi~
+       prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+       cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+       $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+       emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    osf3*)
+      if test yes = "$GCC"; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test yes = "$GCC"; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test yes = "$GCC"; then
+       wlarc='$wl'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='$wl'
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands '-z linker_flag'.  GCC discards it without '$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test yes = "$GCC"; then
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+       else
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test sequent = "$host_vendor"; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We CANNOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test yes = "$GCC"; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test sni = "$host_vendor"; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test yes,yes = "$GCC,$enable_shared"; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+       [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+       [$RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+         pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+         _LT_TAGVAR(allow_undefined_flag, $1)=
+         if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+         then
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+         else
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         fi
+         _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+       ])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting $shlibpath_var if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC=$CC
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report what library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test no = "$can_build_shared" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test yes = "$enable_shared" && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;                  # shared object as lib.so file only
+      yes,svr4,*) ;;                   # shared object as lib.so archive member only
+      yes,*) enable_static=no ;;       # shared object in lib.a archive as well
+      esac
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test yes = "$enable_shared" || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC=$lt_save_CC
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_caught_CXX_error"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test yes = "$GXX"; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test yes = "$GXX"; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test yes = "$with_gnu_ld"; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='$wl'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+         $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test ia64 = "$host_cpu"; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # have runtime linking enabled, and use it for executables.
+          # For shared libraries, we enable/disable runtime linking
+          # depending on the kind of the shared library created -
+          # when "with_aix_soname,aix_use_runtimelinking" is:
+          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "aix,yes"  lib.so          shared, rtl:yes, for executables
+          #            lib.a           static archive
+          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+          #            lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a(lib.so.V) shared, rtl:no
+          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a           static archive
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+           for ld_flag in $LDFLAGS; do
+             case $ld_flag in
+             *-brtl*)
+               aix_use_runtimelinking=yes
+               break
+               ;;
+             esac
+           done
+           if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+             # With aix-soname=svr4, we create the lib.so.V shared archives only,
+             # so we don't have lib.a shared libs to link our executables.
+             # We have to force runtime linking in this case.
+             aix_use_runtimelinking=yes
+             LDFLAGS="$LDFLAGS -Wl,-brtl"
+           fi
+           ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+        case $with_aix_soname,$aix_use_runtimelinking in
+        aix,*) ;;      # no import file
+        svr4,* | *,yes) # use import file
+          # The Import File defines what to hardcode.
+          _LT_TAGVAR(hardcode_direct, $1)=no
+          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+          ;;
+        esac
+
+        if test yes = "$GXX"; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+         collect2name=`$CC -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+           # We have reworked collect2
+           :
+         else
+           # We have old collect2
+           _LT_TAGVAR(hardcode_direct, $1)=unsupported
+           # It fails to find uninstalled libraries when the uninstalled
+           # path is not listed in the libpath.  Setting hardcode_minus_L
+           # to unsupported forces relinking
+           _LT_TAGVAR(hardcode_minus_L, $1)=yes
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+          esac
+          shared_flag='-shared'
+         if test yes = "$aix_use_runtimelinking"; then
+           shared_flag=$shared_flag' $wl-G'
+         fi
+         # Need to ensure runtime linking is disabled for the traditional
+         # shared library, or the linker may eventually find shared libraries
+         # /with/ Import File - we do not want to mix them.
+         shared_flag_aix='-shared'
+         shared_flag_svr4='-shared $wl-G'
+        else
+          # not using gcc
+          if test ia64 = "$host_cpu"; then
+         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+         # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+          else
+           if test yes = "$aix_use_runtimelinking"; then
+             shared_flag='$wl-G'
+           else
+             shared_flag='$wl-bM:SRE'
+           fi
+           shared_flag_aix='$wl-bM:SRE'
+           shared_flag_svr4='$wl-G'
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+       # export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+       if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          # The "-G" linker flag allows undefined symbols.
+          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX([$1])
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+        else
+          if test ia64 = "$host_cpu"; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+          else
+           # Determine the default libpath from the value encoded in an
+           # empty executable.
+           _LT_SYS_MODULE_PATH_AIX([$1])
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+           # Warning - without using the other run time loading flags,
+           # -berok will link without error, but may produce a broken library.
+           _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+           _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+           if test yes = "$with_gnu_ld"; then
+             # We only use this code for GNU lds that support --whole-archive.
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+           else
+             # Exported symbols can be pulled into shared objects from archives
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+           fi
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+           # -brtl affects multiple linker settings, -berok does not and is overridden later
+           compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+           if test svr4 != "$with_aix_soname"; then
+             # This is similar to how AIX traditionally builds its shared
+             # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+             _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+           fi
+           if test aix != "$with_aix_soname"; then
+             _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+           else
+             # used by -dlpreopen to get the symbols
+             _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+           fi
+           _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+          fi
+        fi
+        ;;
+
+      beos*)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+         # support --undefined.  This deserves some investigation.  FIXME
+         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+         # FIXME: insert proper C++ library support
+         _LT_TAGVAR(ld_shlibs, $1)=no
+         ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+       case $GXX,$cc_basename in
+       ,cl* | no,cl*)
+         # Native MSVC
+         # hardcode_libdir_flag_spec is actually meaningless, as there is
+         # no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=yes
+         _LT_TAGVAR(file_list_spec, $1)='@'
+         # Tell ltmain to make .lib files, not .a files.
+         libext=lib
+         # Tell ltmain to make .dll files, not .so files.
+         shrext_cmds=.dll
+         # FIXME: Setting linknames here is a bad hack.
+         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+         _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
+         # The linker will not automatically build a static lib if we build a DLL.
+         # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+         # Don't use ranlib
+         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
+         ;;
+       *)
+         # g++
+         # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+         # as there is no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=no
+         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+         if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+           # If the export-symbols file already is a .def file, use it as
+           # is; otherwise, prepend EXPORTS...
+           _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+         ;;
+       esac
+       ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+       ;;
+
+      os2*)
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+       _LT_TAGVAR(hardcode_minus_L, $1)=yes
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       shrext_cmds=.dll
+       _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+         $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+         $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+         $ECHO EXPORTS >> $output_objdir/$libname.def~
+         emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+         $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+         emximp -o $lib $output_objdir/$libname.def'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+         $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+         $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+         $ECHO EXPORTS >> $output_objdir/$libname.def~
+         prefix_cmds="$SED"~
+         if test EXPORTS = "`$SED 1q $export_symbols`"; then
+           prefix_cmds="$prefix_cmds -e 1d";
+         fi~
+         prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+         cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+         $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+         emximp -o $lib $output_objdir/$libname.def'
+       _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       ;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          ghcx*)
+           # Green Hills C++ Compiler
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+       # switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                            # but as the default
+                                            # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test yes = "$GXX"; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test no = "$with_gnu_ld"; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+             _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                                # but as the default
+                                                # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          aCC*)
+           case $host_cpu in
+             hppa*64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             ia64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             *)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+           esac
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+          *)
+           if test yes = "$GXX"; then
+             if test no = "$with_gnu_ld"; then
+               case $host_cpu in
+                 hppa*64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 ia64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 *)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+               esac
+             fi
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+       _LT_TAGVAR(hardcode_direct, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+       # Instead, shared libraries are loaded at an image base (0x10000000 by
+       # default) and relocated if they conflict, which is a slow very memory
+       # consuming and fragmenting process.  To avoid this, we pick a random,
+       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       ;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+           # SGI C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+
+           # Archives containing C++ object files must be created using
+           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+           ;;
+          *)
+           if test yes = "$GXX"; then
+             if test no = "$with_gnu_ld"; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+             else
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+             fi
+           fi
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+           ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+           # Archives containing C++ object files must be created using
+           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+           ;;
+         icpc* | ecpc* )
+           # Intel C++
+           with_gnu_ld=yes
+           # version 8.0 and above of icpc choke on multiply defined symbols
+           # if we add $predep_objects and $postdep_objects, however 7.1 and
+           # earlier do not add the objects themselves.
+           case `$CC -V 2>&1` in
+             *"Version 7."*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+             *)  # Version 8.0 or newer
+               tmp_idyn=
+               case $host_cpu in
+                 ia64*) tmp_idyn=' -i_dynamic';;
+               esac
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+           esac
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+           ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+           case `$CC -V` in
+           *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+             _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+             _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
+             _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+             ;;
+           *) # Version 6 and above use weak symbols
+             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+             ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+            ;;
+         cxx*)
+           # Compaq C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
+
+           runpath_var=LD_RUN_PATH
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+           ;;
+         xl* | mpixl* | bgxl*)
+           # IBM XL 8.0 on PPC, with GNU ld
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+           if test yes = "$supports_anon_versioning"; then
+             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+           fi
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+             _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+             _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+             # Not sure whether something based on
+             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+             # would be better.
+             output_verbose_link_cmd='func_echo_all'
+
+             # Archives containing C++ object files must be created using
+             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+             # necessary to make sure instantiated templates are included
+             # in the archive.
+             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+         *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+       esac
+       ;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+         wlarc=
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       fi
+       # Workaround some broken pre-1.5 toolchains
+       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+       ;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+       ;;
+
+      openbsd* | bitrig*)
+       if test -f /usr/libexec/ld.so; then
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+         fi
+         output_verbose_link_cmd=func_echo_all
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Archives containing C++ object files must be created using
+           # the KAI C++ compiler.
+           case $host in
+             osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+             *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+           esac
+           ;;
+          RCC*)
+           # Rational C++ 2.4.1
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          cxx*)
+           case $host in
+             osf3*)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+               ;;
+             *)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+               ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+         *)
+           if test yes,no = "$GXX,$with_gnu_ld"; then
+             _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+             case $host in
+               osf3*)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+                 ;;
+               *)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+                 ;;
+             esac
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+             # Commands to make compiler produce verbose output that lists
+             # what "hidden" libraries, object files and flags are used when
+             # linking a shared library.
+             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+           # Sun C++ 4.x
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          lcc*)
+           # Lucid
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+           _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+           case $host_os in
+             solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+             *)
+               # The compiler driver will combine and reorder linker options,
+               # but understands '-z linker_flag'.
+               # Supported since Solaris 2.6 (maybe 2.5.1?)
+               _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+               ;;
+           esac
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+           output_verbose_link_cmd='func_echo_all'
+
+           # Archives containing C++ object files must be created using
+           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+           ;;
+          gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+
+           # The C++ compiler must be used to create the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+           ;;
+          *)
+           # GNU C++ compiler with Solaris linker
+           if test yes,no = "$GXX,$with_gnu_ld"; then
+             _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
+             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             else
+               # g++ 2.7 appears to require '-G' NOT '-shared' on this
+               # platform.
+               _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             fi
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
+             case $host_os in
+               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+               *)
+                 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+                 ;;
+             esac
+           fi
+           ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+       # Note: We CANNOT use -z defs as we might desire, because we do not
+       # link with -lc, and that would cause any symbols used from libc to
+       # always be unresolved, which means just about no library would
+       # ever link correctly.  If we're not using GNU ld we use -z text
+       # though, which does catch some bad symbols but isn't as heavy-handed
+       # as -z defs.
+       _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+       _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+       _LT_TAGVAR(link_all_deplibs, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+       runpath_var='LD_RUN_PATH'
+
+       case $cc_basename in
+          CC*)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+              '"$_LT_TAGVAR(old_archive_cmds, $1)"
+           _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+              '"$_LT_TAGVAR(reload_cmds, $1)"
+           ;;
+         *)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           ;;
+       esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+           # NonStop-UX NCC 3.20
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)=$GXX
+    _LT_TAGVAR(LD, $1)=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test yes != "$_lt_caught_CXX_error"
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case @S|@2 in
+  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $prev$p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
+        prev=$p
+        continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test no = "$pre_test_object_deps_done"; then
+        case $prev in
+        -L | -R)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
+          else
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+          _LT_TAGVAR(postdeps, $1)=$prev$p
+        else
+          _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
+        fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test no = "$pre_test_object_deps_done"; then
+        if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+          _LT_TAGVAR(predep_objects, $1)=$p
+        else
+          _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+          _LT_TAGVAR(postdep_objects, $1)=$p
+        else
+          _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test no = "$F77"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_F77"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test no = "$can_build_shared" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test yes = "$enable_shared" && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test ia64 != "$host_cpu"; then
+         case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+         yes,aix,yes) ;;               # shared object as lib.so file only
+         yes,svr4,*) ;;                # shared object as lib.so archive member only
+         yes,*) enable_static=no ;;    # shared object in lib.a archive as well
+         esac
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test yes = "$enable_shared" || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)=$G77
+    _LT_TAGVAR(LD, $1)=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test no = "$FC"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_FC"; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test no = "$can_build_shared" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test yes = "$enable_shared" && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test ia64 != "$host_cpu"; then
+         case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+         yes,aix,yes) ;;               # shared object as lib.so file only
+         yes,svr4,*) ;;                # shared object as lib.so archive member only
+         yes,*) enable_static=no ;;    # shared object in lib.a archive as well
+         esac
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test yes = "$enable_shared" || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+    _LT_TAGVAR(LD, $1)=$LD
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_FC"
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=$lt_simple_compile_test_code
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f "$lt_ac_sed" && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test 10 -lt "$lt_ac_count" && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test "$lt_ac_count" -gt "$lt_ac_max"; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine what file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644 (file)
index 0000000..94b0829
--- /dev/null
@@ -0,0 +1,437 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
+#   Foundation, Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 8 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option '$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+           [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+                     [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+                  [_LT_ENABLE_FAST_INSTALL])
+  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+                  [_LT_WITH_AIX_SONAME([aix])])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+       IFS=$lt_save_ifs
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+       [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+       IFS=$lt_save_ifs
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+       [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for pkg in $enableval; do
+       IFS=$lt_save_ifs
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+        [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+  AC_MSG_CHECKING([which variant of shared library versioning to provide])
+  AC_ARG_WITH([aix-soname],
+    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+    [case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname],
+    [AC_CACHE_VAL([lt_cv_with_aix_soname],
+      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+    with_aix_soname=$lt_cv_with_aix_soname])
+  AC_MSG_RESULT([$with_aix_soname])
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# LT_INIT options.
+# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+      for lt_pkg in $withval; do
+       IFS=$lt_save_ifs
+       if test "X$lt_pkg" = "X$lt_p"; then
+         pic_mode=yes
+       fi
+      done
+      IFS=$lt_save_ifs
+      ;;
+    esac],
+    [pic_mode=m4_default([$1], [default])])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+                [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+                [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+                [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+                [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+                [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644 (file)
index 0000000..48bc934
--- /dev/null
@@ -0,0 +1,124 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59, which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+          m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+            [m4_foreach([_Lt_suffix],
+               ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+       [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+         [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+                [lt_append([$1], [$2], [$3])$4],
+                [$5])],
+         [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+       m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+       [$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+                     [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644 (file)
index 0000000..fa04b52
--- /dev/null
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers                      -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 4179 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.6'
+macro_revision='2.4.6'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644 (file)
index 0000000..c6b26f8
--- /dev/null
@@ -0,0 +1,99 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
+#   Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],  [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],             [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],        [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],         [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],    [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],           [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],             [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],    [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],           [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],       [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],               [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],        [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],    [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],    [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],         [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],            [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],  [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],             [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],            [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],    [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],   [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],          [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],            [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],           [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],  [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],    [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],          [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],          [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],                [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],     [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],          [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],   [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],           [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],           [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],           [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],      [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],    [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],    [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],    [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],     [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],         [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],       [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],        [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],                [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],        [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],   [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],              [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],               [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])
index 003704c..5a506fc 100644 (file)
--- a/m4/nls.m4
+++ b/m4/nls.m4
@@ -1,17 +1,17 @@
-# nls.m4 serial 5 (gettext-0.18)
-dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
-dnl Inc.
+# nls.m4 serial 6 (gettext-0.20.2)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free
+dnl Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
index 47f36a4..3778fd7 100644 (file)
--- a/m4/po.m4
+++ b/m4/po.m4
@@ -1,35 +1,36 @@
-# po.m4 serial 17 (gettext-0.18)
-dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
+# po.m4 serial 31 (gettext-0.20.2)
+dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
-AC_PREREQ([2.50])
+AC_PREREQ([2.60])
 
 dnl Checks for all prerequisites of the po subdirectory.
 AC_DEFUN([AM_PO_SUBDIRS],
 [
   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
   AC_REQUIRE([AC_PROG_INSTALL])dnl
-  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+  AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+  AC_REQUIRE([AC_PROG_SED])dnl
   AC_REQUIRE([AM_NLS])dnl
 
   dnl Release version of the gettext macros. This is used to ensure that
   dnl the gettext macros and po/Makefile.in.in are in sync.
-  AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
+  AC_SUBST([GETTEXT_MACRO_VERSION], [0.20])
 
   dnl Perform the following tests also if --disable-nls has been given,
   dnl because they are needed for "make dist" to work.
@@ -45,13 +46,6 @@ AC_DEFUN([AM_PO_SUBDIRS],
 
   dnl Test whether it is GNU msgfmt >= 0.15.
 changequote(,)dnl
-  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
-    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
-    *) MSGFMT_015=$MSGFMT ;;
-  esac
-changequote([,])dnl
-  AC_SUBST([MSGFMT_015])
-changequote(,)dnl
   case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
     *) GMSGFMT_015=$GMSGFMT ;;
@@ -82,11 +76,21 @@ changequote([,])dnl
   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
     [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
-  dnl Installation directories.
-  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
-  dnl have to define it here, so that it can be used in po/Makefile.
-  test -n "$localedir" || localedir='${datadir}/locale'
-  AC_SUBST([localedir])
+  dnl Test whether it is GNU msgmerge >= 0.20.
+  if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
+    MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
+  else
+    dnl Test whether it is GNU msgmerge >= 0.12.
+    if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
+      MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
+    else
+      dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is
+      dnl slow. But this is not a big problem, as such old gettext versions are
+      dnl hardly in use any more.
+      MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
+    fi
+  fi
+  AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION])
 
   dnl Support for AM_XGETTEXT_OPTION.
   test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
@@ -102,7 +106,7 @@ changequote([,])dnl
       case "$ac_file" in */Makefile.in)
         # Adjust a relative srcdir.
         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
         # In autoconf-2.13 it is called $ac_given_srcdir.
         # In autoconf-2.50 it is called $srcdir.
@@ -118,7 +122,8 @@ changequote([,])dnl
         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
           rm -f "$ac_dir/POTFILES"
           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
-          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          gt_tab=`printf '\t'`
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
           POMAKEFILEDEPS="POTFILES.in"
           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
           # on $ac_dir but don't depend on user-specified configuration
@@ -128,14 +133,11 @@ changequote([,])dnl
             if test -n "$OBSOLETE_ALL_LINGUAS"; then
               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
             fi
-            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
-            # Hide the ALL_LINGUAS assigment from automake < 1.5.
-            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
           else
             # The set of available languages was given in configure.in.
-            # Hide the ALL_LINGUAS assigment from automake < 1.5.
-            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+            ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
           fi
           # Compute POFILES
           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
@@ -206,9 +208,8 @@ changequote([,])dnl
       esac
     done]],
    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
-    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
-    # from automake < 1.5.
-    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
+    OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
     # Capture the value of LINGUAS because we need it to compute CATALOGS.
     LINGUAS="${LINGUAS-%UNSET%}"
    ])
@@ -226,7 +227,7 @@ AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
 changequote(,)dnl
   # Adjust a relative srcdir.
   ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+  ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
   ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
   # In autoconf-2.13 it is called $ac_given_srcdir.
   # In autoconf-2.50 it is called $srcdir.
@@ -254,6 +255,7 @@ EOT
   fi
 
   # A sed script that extracts the value of VARIABLE from a Makefile.
+  tab=`printf '\t'`
   sed_x_variable='
 # Test if the hold space is empty.
 x
@@ -261,9 +263,9 @@ s/P/P/
 x
 ta
 # Yes it was empty. Look if we have the expected variable definition.
-/^[     ]*VARIABLE[     ]*=/{
+/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
   # Seen the first line of the variable definition.
-  s/^[  ]*VARIABLE[     ]*=//
+  s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
   ba
 }
 bd
@@ -308,15 +310,13 @@ changequote([,])dnl
   fi
   if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
     # The LINGUAS file contains the set of available languages.
-    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+    ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
     POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
   else
     # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
     sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
-    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+    ALL_LINGUAS=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
   fi
-  # Hide the ALL_LINGUAS assigment from automake < 1.5.
-  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
   # Compute POFILES
   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
   # Compute UPDATEPOFILES
@@ -326,9 +326,9 @@ changequote([,])dnl
   # Compute GMOFILES
   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
   # Compute PROPERTIESFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties)
   # Compute CLASSFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class)
   # Compute QMFILES
   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
   # Compute MSGFILES
@@ -353,8 +353,8 @@ changequote([,])dnl
     UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
     DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
-    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
-    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+    PROPERTIESFILES="$PROPERTIESFILES \$(srcdir)/\$(DOMAIN)_$lang.properties"
+    CLASSFILES="$CLASSFILES \$(srcdir)/\$(DOMAIN)_$lang.class"
     QMFILES="$QMFILES $srcdirpre$lang.qm"
     frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
     MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
@@ -405,14 +405,15 @@ changequote([,])dnl
   fi
 
   sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+  tab=`printf '\t'`
   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
     # Add dependencies that cannot be formulated as a simple suffix rule.
     for lang in $ALL_LINGUAS; do
       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
       cat >> "$ac_file.tmp" <<EOF
 $frobbedlang.msg: $lang.po
-       @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
-       \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 EOF
     done
   fi
@@ -422,8 +423,8 @@ EOF
       frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
       cat >> "$ac_file.tmp" <<EOF
 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
-       @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
-       \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 EOF
     done
   fi
index 2d804ac..f28010a 100644 (file)
@@ -1,16 +1,16 @@
-# progtest.m4 serial 6 (gettext-0.18)
-dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
+# progtest.m4 serial 8 (gettext-0.20.2)
+dnl Copyright (C) 1996-2003, 2005, 2008-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
@@ -27,15 +27,14 @@ AC_DEFUN([AM_PATH_PROG_WITH_TEST],
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
 
 # Find out how to test for executable files. Don't use a zero-byte file,
diff --git a/missing b/missing
index 9a55648..8d0eaad 100755 (executable)
--- a/missing
+++ b/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2012-01-06.18; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@ scriptversion=2012-01-06.18; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -29,61 +29,33 @@ if test $# -eq 0; then
   exit 1
 fi
 
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, 'missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
+case $1 in
 
-msg="missing on your system"
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
 
-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
-  ;;
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
 
   -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.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
 
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file 'aclocal.m4'
-  autoconf     touch file 'configure'
-  autoheader   touch file 'config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all 'Makefile.in' files
-  bison        create 'y.tab.[ch]', if possible, from existing .[ch]
-  flex         create 'lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create 'lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
 
 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
 'g' are ignored when checking the name.
@@ -98,233 +70,146 @@ Send bug reports to <bug-automake@gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown '$1' option"
+    echo 1>&2 "$0: unknown '$1' option"
     echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
-
-# 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).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
-    ;;
-
-  *)
-    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 $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'acinclude.m4' or '${configure_ac}'.  You might want
-         to install the Automake and Perl packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified '${configure_ac}'.  You might want to install the
-         Autoconf and GNU m4 packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'acconfig.h' or '${configure_ac}'.  You might want
-         to install the Autoconf and GNU m4 packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case $f in
-      *:*) touch_files="$touch_files "`echo "$f" |
-                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
-         You might want to install the Automake and Perl packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-          sed 's/\.am$/.in/' |
-          while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: '$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get '$1' as part of Autoconf from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-       touch $file
-    else
-       test -z "$file" || exec >$file
-       echo "#! /bin/sh"
-       echo "# Created by GNU Automake missing as a replacement of"
-       echo "#  $ $@"
-       echo "exit 0"
-       chmod +x $file
-       exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: '$1' $msg.  You should only need it if
-         you modified a '.y' file.  You may need the Bison package
-         in order for those modifications to take effect.  You can get
-         Bison from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG=\${$#}
-       case $LASTARG in
-       *.y)
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" y.tab.c
-           fi
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" y.tab.h
-           fi
-         ;;
-       esac
-    fi
-    if test ! -f y.tab.h; then
-       echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-       echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified a '.l' file.  You may need the Flex package
-         in order for those modifications to take effect.  You can get
-         Flex from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG=\${$#}
-       case $LASTARG in
-       *.l)
-           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" lex.yy.c
-           fi
-         ;;
-       esac
-    fi
-    if test ! -f lex.yy.c; then
-       echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-        you modified a dependency of a manual page.  You may need the
-        Help2man package in order for those modifications to take
-        effect.  You can get Help2man from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-       touch $file
-    else
-       test -z "$file" || exec >$file
-       echo ".ab help2man is required to generate this page"
-       exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: '$1' is $msg.  You should only need it if
-         you modified a '.texi' or '.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy 'make' (AIX,
-         DU, IRIX).  You might want to install the Texinfo package or
-         the GNU make package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-       /^@setfilename/{
-         s/.* \([^ ]*\) *$/\1/
-         p
-         q
-       }' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
 
-  *)
-    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
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'autom4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
     ;;
-esac
-
-exit 0
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/nhlt/Makefile.am b/nhlt/Makefile.am
new file mode 100644 (file)
index 0000000..5aadda7
--- /dev/null
@@ -0,0 +1,6 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+
+bin_PROGRAMS = nhlt-dmic-info
+nhlt_dmic_info_SOURCES = nhlt-dmic-info.c
+man_MANS = nhlt-dmic-info.1
+EXTRA_DIST = nhlt-dmic-info.1
diff --git a/nhlt/Makefile.in b/nhlt/Makefile.in
new file mode 100644 (file)
index 0000000..bc05513
--- /dev/null
@@ -0,0 +1,776 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = nhlt-dmic-info$(EXEEXT)
+subdir = nhlt
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_nhlt_dmic_info_OBJECTS = nhlt-dmic-info.$(OBJEXT)
+nhlt_dmic_info_OBJECTS = $(am_nhlt_dmic_info_OBJECTS)
+nhlt_dmic_info_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/nhlt-dmic-info.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(nhlt_dmic_info_SOURCES)
+DIST_SOURCES = $(nhlt_dmic_info_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+nhlt_dmic_info_SOURCES = nhlt-dmic-info.c
+man_MANS = nhlt-dmic-info.1
+EXTRA_DIST = nhlt-dmic-info.1
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign nhlt/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign nhlt/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
+nhlt-dmic-info$(EXEEXT): $(nhlt_dmic_info_OBJECTS) $(nhlt_dmic_info_DEPENDENCIES) $(EXTRA_nhlt_dmic_info_DEPENDENCIES) 
+       @rm -f nhlt-dmic-info$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(nhlt_dmic_info_OBJECTS) $(nhlt_dmic_info_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nhlt-dmic-info.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man1: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man1dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.1[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(MANS)
+installdirs:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+               -rm -f ./$(DEPDIR)/nhlt-dmic-info.Po
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+               -rm -f ./$(DEPDIR)/nhlt-dmic-info.Po
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/nhlt/nhlt-dmic-info.1 b/nhlt/nhlt-dmic-info.1
new file mode 100644 (file)
index 0000000..22fdc5a
--- /dev/null
@@ -0,0 +1,37 @@
+.TH NHLT-DMIC-INFO 1 "16 May 2023"
+.SH NAME
+nhlt-dmic-info \- dump microphone array information from ACPI NHLT table
+.SH SYNOPSIS
+\fBnhlt-dmic-info\fP [\fI\-option\fP]
+.SH DESCRIPTION
+
+\fB\fBnhlt-dmic-info\fP\fP dumps microphone array information from ACPI NHLT
+table in JSON format.
+
+.SH OPTIONS
+
+.TP
+\fI\-h\fP | \fI\-\-help\fP
+
+Prints the help information.
+
+.TP
+\fI\-f <file>\fP | \fI\-\-file=<file>\fP
+
+Input file with the binary ACPI NHLT table (default is \fB/sys/firmware/acpi/tables/NHLT\fR).
+
+.TP
+\fI\-o <file>\fP | \fI\-\-output=<file>\fP
+
+JSON output file (default is stdout: \fB\-\fR).
+
+.SH EXAMPLES
+.nf
+\fBnhlt-dmic-info \-f nhlt.bin \-o dmic.json\fR
+
+.ne
+.SH BUGS
+None known.
+.SH AUTHOR
+\fBnhlt-dmic-info\fP is by Jaroslav Kysela <perex@perex.cz>.
+This document is by Jaroslav Kysela <perex@perex.cz>.
diff --git a/nhlt/nhlt-dmic-info.c b/nhlt/nhlt-dmic-info.c
new file mode 100644 (file)
index 0000000..7726c3c
--- /dev/null
@@ -0,0 +1,427 @@
+/*
+ *  Extract microphone configuration from the ACPI NHLT table
+ *
+ *  Specification:
+ *         https://01.org/sites/default/files/595976_intel_sst_nhlt.pdf
+ *
+ *     Author: Jaroslav Kysela <perex@perex.cz>
+ *
+ *
+ *   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
+ *
+ */
+
+#include "aconfig.h"
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <sys/stat.h>
+#include <arpa/inet.h>
+
+int debug = 0;
+
+/*
+ * Dump dmic parameters in json
+ */
+
+#define ACPI_HDR_SIZE (4 + 4 + 1 + 1 + 6 + 8 + 4 + 4 + 4)
+#define NHLT_EP_HDR_SIZE (4 + 1 + 1 + 2 + 2 + 2 + 4 + 1 + 1 + 1)
+#define VENDOR_MIC_CFG_SIZE (1 + 1 + 2 + 2 + 2 + 1 + 1 + 2 + 2 + 2 + 2 + 2 + 2)
+
+static const char *microphone_type(uint8_t type)
+{
+       switch (type) {
+       case 0: return "omnidirectional";
+       case 1: return "subcardoid";
+       case 2: return "cardoid";
+       case 3: return "supercardoid";
+       case 4: return "hypercardoid";
+       case 5: return "8shaped";
+       case 7: return "vendor";
+       }
+       return "unknown";
+}
+
+static const char *microphone_location(uint8_t location)
+{
+       switch (location) {
+       case 0: return "laptop-top-panel";
+       case 1: return "laptop-bottom-panel";
+       case 2: return "laptop-left-panel";
+       case 3: return "laptop-right-panel";
+       case 4: return "laptop-front-panel";
+       case 5: return "laptop-rear-panel";
+       }
+       return "unknown";
+}
+
+
+static inline uint8_t get_u8(uint8_t *base, uint32_t off)
+{
+       return *(base + off);
+}
+
+static inline int32_t get_s16le(uint8_t *base, uint32_t off)
+{
+       uint32_t v =  *(base + off + 0) |
+                     (*(base + off + 1) << 8);
+       if (v & 0x8000)
+               return -((int32_t)0x10000 - (int32_t)v);
+       return v;
+}
+
+static inline uint32_t get_u32le(uint8_t *base, uint32_t off)
+{
+       return   *(base + off + 0) |
+               (*(base + off + 1) << 8) |
+               (*(base + off + 2) << 16) |
+               (*(base + off + 3) << 24);
+}
+
+static int nhlt_dmic_config(FILE *out, uint8_t *dmic, uint8_t mic)
+{
+       int32_t angle_begin, angle_end;
+
+       if (mic > 0)
+               fprintf(out, ",\n");
+       fprintf(out, "\t\t{\n");
+       fprintf(out, "\t\t\t\"channel\":%i,\n", mic);
+       fprintf(out, "\t\t\t\"type\":\"%s\",\n", microphone_type(get_u8(dmic, 0)));
+       fprintf(out, "\t\t\t\"location\":\"%s\"", microphone_location(get_u8(dmic, 1)));
+       if (get_s16le(dmic, 2) != 0)
+               fprintf(out, ",\n\t\t\t\"speaker-distance\":%i", get_s16le(dmic, 2));
+       if (get_s16le(dmic, 4) != 0)
+               fprintf(out, ",\n\t\t\t\"horizontal-offset\":%i", get_s16le(dmic, 4));
+       if (get_s16le(dmic, 6) != 0)
+               fprintf(out, ",\n\t\t\t\"vertical-offset\":%i", get_s16le(dmic, 6));
+       if (get_u8(dmic, 8) != 0)
+               fprintf(out, ",\n\t\t\t\"freq-low-band\":%i", get_u8(dmic, 8) * 5);
+       if (get_u8(dmic, 9) != 0)
+               fprintf(out, ",\n\t\t\t\"freq-high-band\":%i", get_u8(dmic, 9) * 500);
+       if (get_s16le(dmic, 10) != 0)
+               fprintf(out, ",\n\t\t\t\"direction-angle\":%i", get_s16le(dmic, 10));
+       if (get_s16le(dmic, 12) != 0)
+               fprintf(out, ",\n\t\t\t\"elevation-angle\":%i", get_s16le(dmic, 12));
+       angle_begin = get_s16le(dmic, 14);
+       angle_end = get_s16le(dmic, 16);
+       if (!((angle_begin == 180 && angle_end == -180) ||
+             (angle_begin == -180 && angle_end == 180))) {
+               fprintf(out, ",\n\t\t\t\"vertical-angle-begin\":%i,\n", angle_begin);
+               fprintf(out, "\t\t\t\"vertical-angle-end\":%i", angle_end);
+       }
+       angle_begin = get_s16le(dmic, 18);
+       angle_end = get_s16le(dmic, 20);
+       if (!((angle_begin == 180 && angle_end == -180) ||
+             (angle_begin == -180 && angle_end == 180))) {
+               fprintf(out, ",\n\t\t\t\"horizontal-angle-begin\":%i,\n", angle_begin);
+               fprintf(out, "\t\t\t\"horizontal-angle-end\":%i", angle_end);
+       }
+       fprintf(out, "\n\t\t}");
+       return 0;
+}
+
+static int nhlt_dmic_ep_to_json(FILE *out, uint8_t *ep, uint32_t ep_size)
+{
+       uint32_t off, specific_cfg_size;
+       uint8_t config_type, array_type, mic, num_mics;
+       int res;
+
+       off = NHLT_EP_HDR_SIZE;
+       specific_cfg_size = get_u32le(ep, off);
+       if (off + specific_cfg_size > ep_size)
+               goto oob;
+       off += 4;
+       config_type = get_u8(ep, off + 1);
+       if (config_type != 1)   /* mic array */
+               return 0;
+       array_type = get_u8(ep, off + 2);
+       if ((array_type & 0x0f) != 0x0f) {
+               fprintf(stderr, "Unsupported ArrayType %02x\n", array_type & 0x0f);
+               return -EINVAL;
+       }
+       num_mics = get_u8(ep, off + 3);
+       fprintf(out, "{\n");
+       fprintf(out, "\t\"mics-data-version\":1,\n");
+       fprintf(out, "\t\"mics-data-source\":\"acpi-nhlt\"");
+       for (mic = 0; mic < num_mics; mic++) {
+               if (off - NHLT_EP_HDR_SIZE + VENDOR_MIC_CFG_SIZE > specific_cfg_size) {
+                       fprintf(out, "\n}\n");
+                       goto oob;
+               }
+               if (mic == 0)
+                       fprintf(out, ",\n\t\"mics\":[\n");
+               res = nhlt_dmic_config(out, ep + off + 4, mic);
+               if (res < 0)
+                       return res;
+               off += VENDOR_MIC_CFG_SIZE;
+       }
+       if (num_mics > 0)
+               fprintf(out, "\n\t]\n");
+       fprintf(out, "}\n");
+       return num_mics;
+oob:
+       fprintf(stderr, "Data (out-of-bounds) error\n");
+       return -EINVAL;
+}
+
+static int nhlt_table_to_json(FILE *out, uint8_t *nhlt, uint32_t size)
+{
+       uint32_t _size, off, ep_size;
+       uint8_t sum = 0, ep, ep_count, link_type, dmics = 0;
+       int res;
+
+       _size = get_u32le(nhlt, 4);
+       if (_size != size) {
+               fprintf(stderr, "Table size mismatch (%08x != %08x)\n", _size, (uint32_t)size);
+               return -EINVAL;
+       }
+       for (off = 0; off < size; off++)
+               sum += get_u8(nhlt, off);
+       if (sum != 0) {
+               fprintf(stderr, "Checksum error (%02x)\n", sum);
+               return -EINVAL;
+       }
+       /* skip header */
+       off = ACPI_HDR_SIZE;
+       ep_count = get_u8(nhlt, off++);
+       for (ep = 0; ep < ep_count; ep++) {
+               if (off + 17 > size)
+                       goto oob;
+               ep_size = get_u32le(nhlt, off);
+               if (off + ep_size > size)
+                       goto oob;
+               link_type = get_u8(nhlt, off + 4);
+               res = 0;
+               if (link_type == 2) {   /* PDM */
+                       res = nhlt_dmic_ep_to_json(out, nhlt + off, ep_size);
+                       if (res > 0)
+                               dmics++;
+               }
+               if (res < 0)
+                       return res;
+               off += ep_size;
+       }
+       if (dmics == 0) {
+               fprintf(stderr, "No dmic endpoint found\n");
+               return -EINVAL;
+       }
+       return 0;
+oob:
+       fprintf(stderr, "Data (out-of-bounds) error\n");
+       return -EINVAL;
+}
+
+static int nhlt_to_json(FILE *out, const char *nhlt_file)
+{
+       struct stat st;
+       uint8_t *buf;
+       int _errno, fd, res;
+       size_t pos, size;
+       ssize_t ret;
+
+       if (stat(nhlt_file, &st))
+               return -errno;
+       size = st.st_size;
+       if (size < 45)
+               return -EINVAL;
+       buf = malloc(size);
+       if (buf == NULL)
+               return -ENOMEM;
+       fd = open(nhlt_file, O_RDONLY);
+       if (fd < 0) {
+               _errno = errno;
+               fprintf(stderr, "Unable to open file '%s': %s\n", nhlt_file, strerror(errno));
+               free(buf);
+               return _errno;
+       }
+       pos = 0;
+       while (pos < size) {
+               ret = read(fd, buf + pos, size - pos);
+               if (ret <= 0) {
+                       fprintf(stderr, "Short read\n");
+                       close(fd);
+                       free(buf);
+                       return -EIO;
+               }
+               pos += ret;
+       }
+       close(fd);
+       res = nhlt_table_to_json(out, buf, size);
+       free(buf);
+       return res;
+}
+
+/*
+ *
+ */
+
+#define PROG "nhlt-dmic-info"
+#define PROG_VERSION "1"
+
+#define NHLT_FILE "/sys/firmware/acpi/tables/NHLT"
+
+#define TITLE  0x0100
+#define HEADER 0x0200
+#define FILEARG 0x0400
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+struct arg {
+       int sarg;
+       char *larg;
+       char *comment;
+};
+
+static struct arg args[] = {
+{ TITLE, NULL, "Usage: nhtl-dmic-json <options>" },
+{ HEADER, NULL, "global options:" },
+{ 'h', "help", "this help" },
+{ 'v', "version", "print version of this program" },
+{ FILEARG | 'f', "file", "NHLT file (default " NHLT_FILE ")" },
+{ FILEARG | 'o', "output", "output file" },
+{ 0, NULL, NULL }
+};
+
+static void help(void)
+{
+       struct arg *n = args, *a;
+       char *larg, sa[4], buf[32];
+       int sarg;
+
+       sa[0] = '-';
+       sa[2] = ',';
+       sa[3] = '\0';
+       while (n->comment) {
+               a = n;
+               n++;
+               sarg = a->sarg;
+               if (sarg & (HEADER|TITLE)) {
+                       printf("%s%s\n", (sarg & HEADER) != 0 ? "\n" : "",
+                                                               a->comment);
+                       continue;
+               }
+               buf[0] = '\0';
+               larg = a->larg;
+               sa[1] = a->sarg;
+               sprintf(buf, "%s%s%s", sa[1] ? sa : "",
+                               larg ? "--" : "", larg ? larg : "");
+               if (sarg & FILEARG)
+                       strcat(buf, " #");
+               printf("  %-15s  %s\n", buf, a->comment);
+       }
+}
+
+int main(int argc, char *argv[])
+{
+       char *nhlt_file = NHLT_FILE;
+       char *output_file = "-";
+       int i, j, k, res;
+       struct arg *a;
+       struct option *o, *long_option;
+       char *short_option;
+       FILE *output = NULL;
+
+       long_option = calloc(ARRAY_SIZE(args), sizeof(struct option));
+       if (long_option == NULL)
+               exit(EXIT_FAILURE);
+       short_option = malloc(128);
+       if (short_option == NULL) {
+               free(long_option);
+               exit(EXIT_FAILURE);
+       }
+       for (i = j = k = 0; i < (int)ARRAY_SIZE(args); i++) {
+               a = &args[i];
+               if ((a->sarg & 0xff) == 0)
+                       continue;
+               o = &long_option[j];
+               o->name = a->larg;
+               o->has_arg = (a->sarg & FILEARG) != 0;
+               o->flag = NULL;
+               o->val = a->sarg & 0xff;
+               j++;
+               short_option[k++] = o->val;
+               if (o->has_arg)
+                       short_option[k++] = ':';
+       }
+       short_option[k] = '\0';
+       while (1) {
+               int c;
+
+               if ((c = getopt_long(argc, argv, short_option, long_option,
+                                                                 NULL)) < 0)
+                       break;
+               switch (c) {
+               case 'h':
+                       help();
+                       res = EXIT_SUCCESS;
+                       goto out;
+               case 'f':
+                       nhlt_file = optarg;
+                       break;
+               case 'o':
+                       output_file = optarg;
+                       break;
+               case 'd':
+                       debug = 1;
+                       break;
+               case 'v':
+                       printf(PROG " version " PROG_VERSION "\n");
+                       res = EXIT_SUCCESS;
+                       goto out;
+               case '?':               // error msg already printed
+                       help();
+                       res = EXIT_FAILURE;
+                       goto out;
+               default:                // should never happen
+                       fprintf(stderr,
+                       "Invalid option '%c' (%d) not handled??\n", c, c);
+               }
+       }
+       free(short_option);
+       short_option = NULL;
+       free(long_option);
+       long_option = NULL;
+
+       if (strcmp(output_file, "-") == 0) {
+               output = stdout;
+       } else {
+               output = fopen(output_file, "w+");
+               if (output == NULL) {
+                       fprintf(stderr, "Unable to create output file \"%s\": %s\n",
+                                               output_file, strerror(errno));
+                       res = EXIT_FAILURE;
+                       goto out;
+               }
+       }
+
+       if (argc - optind > 0)
+               fprintf(stderr, PROG ": Ignoring extra parameters\n");
+
+       res = 0;
+       if (nhlt_to_json(output, nhlt_file))
+               res = EXIT_FAILURE;
+
+out:
+       if (output)
+               fclose(output);
+       free(short_option);
+       free(long_option);
+       return res;
+}
index 2027386..d336b9a 100644 (file)
@@ -1 +1 @@
-de fr ja
+de eu fr ja ka ko sk
index 83d8838..6b25f0d 100644 (file)
@@ -1,20 +1,20 @@
 # Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 1995-2000 Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 2000-2020 Free Software Foundation, Inc.
 #
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU General Public
-# License but which still want to provide support for the GNU gettext
-# functionality.
-# Please note that the actual code of GNU gettext is covered by the GNU
-# General Public License and is *not* in the public domain.
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.  This file is offered as-is,
+# without any warranty.
 #
-# Origin: gettext-0.18
-GETTEXT_MACRO_VERSION = 0.18
+# Origin: gettext-0.21
+GETTEXT_MACRO_VERSION = 0.20
 
 PACKAGE = @PACKAGE@
 VERSION = @VERSION@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 
+SED = @SED@
 SHELL = /bin/sh
 @SET_MAKE@
 
@@ -44,20 +44,22 @@ install_sh = $(SHELL) @install_sh@
 MKDIR_P = @MKDIR_P@
 mkdir_p = @mkdir_p@
 
+# When building gettext-tools, we prefer to use the built programs
+# rather than installed programs.  However, we can't do that when we
+# are cross compiling.
+CROSS_COMPILING = @CROSS_COMPILING@
+
 GMSGFMT_ = @GMSGFMT@
 GMSGFMT_no = @GMSGFMT@
 GMSGFMT_yes = @GMSGFMT_015@
 GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
-MSGFMT_ = @MSGFMT@
-MSGFMT_no = @MSGFMT@
-MSGFMT_yes = @MSGFMT_015@
-MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
 XGETTEXT_ = @XGETTEXT@
 XGETTEXT_no = @XGETTEXT@
 XGETTEXT_yes = @XGETTEXT_015@
 XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
-MSGMERGE = msgmerge
+MSGMERGE = @MSGMERGE@
 MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 MSGINIT = msginit
 MSGCONV = msgconv
 MSGFILTER = msgfilter
@@ -76,34 +78,61 @@ POTFILES = \
 
 CATALOGS = @CATALOGS@
 
+POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
+POFILESDEPS_yes = $(POFILESDEPS_)
+POFILESDEPS_no =
+POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
+
+DISTFILESDEPS_ = update-po
+DISTFILESDEPS_yes = $(DISTFILESDEPS_)
+DISTFILESDEPS_no =
+DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
+
 # Makevars gets inserted here. (Don't remove this line!)
 
-.SUFFIXES:
-.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+all: all-@USE_NLS@
 
-.po.mo:
-       @echo "$(MSGFMT) -c -o $@ $<"; \
-       $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
 
+.SUFFIXES:
+.SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update
+
+# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
+# The GNU Coding Standards say in
+# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
+#   "GNU distributions usually contain some files which are not source files
+#    ... . Since these files normally appear in the source directory, they
+#    should always appear in the source directory, not in the build directory.
+#    So Makefile rules to update them should put the updated files in the
+#    source directory."
+# Therefore we put these files in the source directory, not the build directory.
+
+# During .po -> .gmo conversion, take into account the most recent changes to
+# the .pot file. This eliminates the need to update the .po files when the
+# .pot file has changed, which would be troublesome if the .po files are put
+# under version control.
+$(GMOFILES): $(srcdir)/$(DOMAIN).pot
 .po.gmo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
-       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
+       cd $(srcdir) && \
+       rm -f $${lang}.gmo && \
+       $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
+       $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
+       mv t-$${lang}.gmo $${lang}.gmo && \
+       rm -f $${lang}.1po
 
 .sin.sed:
        sed -e '/^#/d' $< > t-$@
        mv t-$@ $@
 
 
-all: check-macro-version all-@USE_NLS@
-
-all-yes: stamp-po
+all-yes: $(srcdir)/stamp-po
 all-no:
 
 # Ensure that the gettext macros and this Makefile.in.in are in sync.
-check-macro-version:
-       @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+CHECK_MACRO_VERSION = \
+       test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
          || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
               exit 1; \
             }
@@ -112,23 +141,24 @@ check-macro-version:
 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
 # we don't want to bother translators with empty POT files). We assume that
 # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
-# In this case, stamp-po is a nop (i.e. a phony target).
-
-# stamp-po is a timestamp denoting the last time at which the CATALOGS have
-# been loosely updated. Its purpose is that when a developer or translator
-# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
-# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
-# invocations of "make" will do nothing. This timestamp would not be necessary
-# if updating the $(CATALOGS) would always touch them; however, the rule for
-# $(POFILES) has been designed to not touch files that don't need to be
-# changed.
-stamp-po: $(srcdir)/$(DOMAIN).pot
+# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target).
+
+# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS
+# have been loosely updated. Its purpose is that when a developer or translator
+# checks out the package from a version control system, and the $(DOMAIN).pot
+# file is not under version control, "make" will update the $(DOMAIN).pot and
+# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This
+# timestamp would not be necessary if updating the $(CATALOGS) would always
+# touch them; however, the rule for $(POFILES) has been designed to not touch
+# files that don't need to be changed.
+$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot
+       @$(CHECK_MACRO_VERSION)
        test ! -f $(srcdir)/$(DOMAIN).pot || \
          test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
        @test ! -f $(srcdir)/$(DOMAIN).pot || { \
-         echo "touch stamp-po" && \
-         echo timestamp > stamp-poT && \
-         mv stamp-poT stamp-po; \
+         echo "touch $(srcdir)/stamp-po" && \
+         echo timestamp > $(srcdir)/stamp-poT && \
+         mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \
        }
 
 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
@@ -137,11 +167,27 @@ stamp-po: $(srcdir)/$(DOMAIN).pot
 
 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+# The determination of whether the package xyz is a GNU one is based on the
+# heuristic whether some file in the top level directory mentions "GNU xyz".
+# If GNU 'find' is available, we avoid grepping through monster files.
 $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
-       if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
-         package_gnu='GNU '; \
+       package_gnu="$(PACKAGE_GNU)"; \
+       test -n "$$package_gnu" || { \
+         if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
+                LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \
+              else \
+                LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
+              fi; \
+            } | grep -v 'libtool:' >/dev/null; then \
+            package_gnu=yes; \
+          else \
+            package_gnu=no; \
+          fi; \
+       }; \
+       if test "$$package_gnu" = "yes"; then \
+         package_prefix='GNU '; \
        else \
-         package_gnu=''; \
+         package_prefix=''; \
        fi; \
        if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
          msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
@@ -151,22 +197,30 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
        case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
          '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
            $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
-             --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+             --add-comments=TRANSLATORS: \
              --files-from=$(srcdir)/POTFILES.in \
              --copyright-holder='$(COPYRIGHT_HOLDER)' \
              --msgid-bugs-address="$$msgid_bugs_address" \
+             $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
            ;; \
          *) \
            $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
-             --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+             --add-comments=TRANSLATORS: \
              --files-from=$(srcdir)/POTFILES.in \
              --copyright-holder='$(COPYRIGHT_HOLDER)' \
-             --package-name="$${package_gnu}@PACKAGE@" \
+             --package-name="$${package_prefix}@PACKAGE@" \
              --package-version='@VERSION@' \
              --msgid-bugs-address="$$msgid_bugs_address" \
+             $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
            ;; \
        esac
        test ! -f $(DOMAIN).po || { \
+         if test -f $(srcdir)/$(DOMAIN).pot-header; then \
+           sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \
+           cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \
+           rm -f $(DOMAIN).1po \
+           || exit 1; \
+         fi; \
          if test -f $(srcdir)/$(DOMAIN).pot; then \
            sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
            sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
@@ -189,17 +243,20 @@ $(srcdir)/$(DOMAIN).pot:
 
 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
 # Note that a PO file is not touched if it doesn't need to be changed.
-$(POFILES): $(srcdir)/$(DOMAIN).pot
+$(POFILES): $(POFILESDEPS)
+       @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
        if test -f "$(srcdir)/$${lang}.po"; then \
          test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-         echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+         echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \
          cd $(srcdir) \
            && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
-                  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+                  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \
                     $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+                  0.1[6-7] | 0.1[6-7].*) \
+                    $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \
                   *) \
-                    $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+                    $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \
                 esac; \
               }; \
        else \
@@ -334,34 +391,41 @@ check: all
 
 info dvi ps pdf html tags TAGS ctags CTAGS ID:
 
+install-dvi install-ps install-pdf install-html:
+
 mostlyclean:
        rm -f remove-potcdate.sed
-       rm -f stamp-poT
+       rm -f $(srcdir)/stamp-poT
        rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
        rm -fr *.o
 
 clean: mostlyclean
 
 distclean: clean
-       rm -f Makefile Makefile.in POTFILES *.mo
+       rm -f Makefile Makefile.in POTFILES
 
 maintainer-clean: distclean
        @echo "This command is intended for maintainers to use;"
        @echo "it deletes files that may require special tools to rebuild."
-       rm -f stamp-po $(GMOFILES)
+       rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES)
 
 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 dist distdir:
-       $(MAKE) update-po
+       test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
        @$(MAKE) dist2
 # This is a separate target because 'update-po' must be executed before.
-dist2: stamp-po $(DISTFILES)
-       dists="$(DISTFILES)"; \
+dist2: $(srcdir)/stamp-po $(DISTFILES)
+       @dists="$(DISTFILES)"; \
        if test "$(PACKAGE)" = "gettext-tools"; then \
          dists="$$dists Makevars.template"; \
        fi; \
        if test -f $(srcdir)/$(DOMAIN).pot; then \
          dists="$$dists $(DOMAIN).pot stamp-po"; \
+       else \
+         case $(XGETTEXT) in \
+           :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \
+           *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \
+         esac; \
        fi; \
        if test -f $(srcdir)/ChangeLog; then \
          dists="$$dists ChangeLog"; \
@@ -396,17 +460,19 @@ update-po: Makefile
 
 .nop.po-update:
        @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
-       if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+       if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \
        tmpdir=`pwd`; \
        echo "$$lang:"; \
        test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-       echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+       echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
        cd $(srcdir); \
        if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
-              '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+              '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \
                 $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+              0.1[6-7] | 0.1[6-7].*) \
+                $(MSGMERGE) $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
               *) \
-                $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+                $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
             esac; \
           }; then \
          if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
index 4618f48..672fef2 100644 (file)
@@ -10,6 +10,13 @@ top_builddir = ..
 # These options get passed to xgettext.
 XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
 
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty.  If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU =
+
 # This is the copyright holder that gets inserted into the header of the
 # $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
 # package.  (Note that the msgstr strings, extracted from the package's
@@ -51,3 +58,21 @@ USE_MSGCTXT = no
 #   --previous            to keep previous msgids of translated messages,
 #   --quiet               to reduce the verbosity.
 MSGMERGE_OPTIONS =
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed.  Possible values are "yes" and "no".  Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = yes
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist".  Possible values are "yes" and
+# "no".  Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = yes
index af52487..18c024b 100644 (file)
@@ -1,4 +1,9 @@
 # Special Makefile rules for English message catalogs with quotation marks.
+#
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# This file, Rules-quot, and its auxiliary files (listed under
+# DISTFILES.common.extra1) are free software; the Free Software Foundation
+# gives unlimited permission to use, copy, distribute, and modify them.
 
 DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
 
@@ -14,13 +19,23 @@ en@boldquot.po-update: en@boldquot.po-update-en
 
 .insert-header.po-update-en:
        @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
-       if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
+       if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
        tmpdir=`pwd`; \
        echo "$$lang:"; \
        ll=`echo $$lang | sed -e 's/@.*//'`; \
        LC_ALL=C; export LC_ALL; \
        cd $(srcdir); \
-       if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
+       if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \
+          | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \
+          { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+            '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \
+              $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \
+              ;; \
+            *) \
+              $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \
+              ;; \
+            esac } 2>/dev/null > $$tmpdir/$$lang.new.po \
+            ; then \
          if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
            rm -f $$tmpdir/$$lang.new.po; \
          else \
index 76e6dfb..7ff6363 100644 (file)
@@ -1,14 +1,14 @@
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR The ALSA Team
-# This file is distributed under the same license as the PACKAGE package.
+# This file is distributed under the same license as the alsa-utils package.
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: alsa-utils 1.0.29\n"
+"Project-Id-Version: alsa-utils 1.2.12\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-26 15:50+0100\n"
+"POT-Creation-Date: 2024-06-10 09:22+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,58 +17,63 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: alsamixer/card_select.c:126 alsamixer/device_name.c:126
+#: alsamixer/card_select.c:77 alsamixer/device_name.c:127
 msgid "Sound Card"
 msgstr ""
 
-#: alsamixer/card_select.c:181
+#: alsamixer/card_select.c:115
 msgid "(default)"
 msgstr ""
 
-#: alsamixer/card_select.c:191
+#: alsamixer/card_select.c:125
 msgid "cannot enumerate sound cards"
 msgstr ""
 
-#: alsamixer/card_select.c:215
+#: alsamixer/card_select.c:151
 msgid "enter device name..."
 msgstr ""
 
-#: alsamixer/cli.c:40
+#: alsamixer/cli.c:45
 msgid "Usage: alsamixer [options]"
 msgstr ""
 
-#: alsamixer/cli.c:41
+#: alsamixer/cli.c:46
 msgid ""
 "Useful options:\n"
 "  -h, --help              this help\n"
 "  -c, --card=NUMBER       sound card number or id\n"
 "  -D, --device=NAME       mixer device name\n"
-"  -V, --view=MODE         starting view mode: playback/capture/all"
+"  -m, --mouse             enable mouse\n"
+"  -M, --no-mouse          disable mouse\n"
+"  -f, --config=FILE       configuration file\n"
+"  -F, --no-config         do not load configuration file\n"
+"  -V, --view=MODE         starting view mode: playback/capture/all\n"
+"  -B, --black-background  use black background color"
 msgstr ""
 
-#: alsamixer/cli.c:46
+#: alsamixer/cli.c:56
 msgid ""
 "Debugging options:\n"
 "  -g, --no-color          toggle using of colors\n"
 "  -a, --abstraction=NAME  mixer abstraction level: none/basic"
 msgstr ""
 
-#: alsamixer/cli.c:77
+#: alsamixer/cli.c:92
 #, c-format
 msgid "invalid card index: %s\n"
 msgstr ""
 
-#: alsamixer/cli.c:103
+#: alsamixer/cli.c:137
 #, c-format
 msgid "unknown abstraction level: %s\n"
 msgstr ""
 
-#: alsamixer/cli.c:108
+#: alsamixer/cli.c:142
 #, c-format
 msgid "unknown option: %c\n"
 msgstr ""
 
-#: alsamixer/cli.c:110
+#: alsamixer/cli.c:144
 msgid "try `alsamixer --help' for more information\n"
 msgstr ""
 
@@ -81,138 +86,138 @@ msgstr ""
 msgid "%s: %s\n"
 msgstr ""
 
-#: alsamixer/mixer_display.c:98
+#: alsamixer/mixer_display.c:99
 msgid "Card:"
 msgstr ""
 
-#: alsamixer/mixer_display.c:99
+#: alsamixer/mixer_display.c:100
 msgid "Chip:"
 msgstr ""
 
-#: alsamixer/mixer_display.c:100
+#: alsamixer/mixer_display.c:101
 msgid "View:"
 msgstr ""
 
-#: alsamixer/mixer_display.c:101
+#: alsamixer/mixer_display.c:102
 msgid "Item:"
 msgstr ""
 
-#: alsamixer/mixer_display.c:104
+#: alsamixer/mixer_display.c:105
 msgid "F1:  Help"
 msgstr ""
 
-#: alsamixer/mixer_display.c:105
+#: alsamixer/mixer_display.c:106
 msgid "F2:  System information"
 msgstr ""
 
-#: alsamixer/mixer_display.c:106
+#: alsamixer/mixer_display.c:107
 msgid "F6:  Select sound card"
 msgstr ""
 
-#: alsamixer/mixer_display.c:107
+#: alsamixer/mixer_display.c:108
 msgid "Esc: Exit"
 msgstr ""
 
-#: alsamixer/mixer_display.c:174
+#: alsamixer/mixer_display.c:179
 msgid "(unplugged)"
 msgstr ""
 
-#: alsamixer/mixer_display.c:192
+#: alsamixer/mixer_display.c:197
 msgid "Playback"
 msgstr ""
 
-#: alsamixer/mixer_display.c:193
+#: alsamixer/mixer_display.c:198
 msgid "Capture"
 msgstr ""
 
-#: alsamixer/mixer_display.c:194
+#: alsamixer/mixer_display.c:199
 msgid "All"
 msgstr ""
 
-#: alsamixer/mixer_display.c:234
+#: alsamixer/mixer_display.c:240
 msgid "mute"
 msgstr ""
 
-#: alsamixer/mixer_display.c:275 alsamixer/mixer_display.c:285
+#: alsamixer/mixer_display.c:281 alsamixer/mixer_display.c:291
 msgid "dB gain:"
 msgstr ""
 
-#: alsamixer/mixer_display.c:285
+#: alsamixer/mixer_display.c:291
 #, c-format
 msgid " [%s %s, %s]"
 msgstr ""
 
-#: alsamixer/mixer_display.c:294 alsamixer/mixer_display.c:300
-#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:312
+#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:306
+#: alsamixer/mixer_display.c:312 alsamixer/mixer_display.c:318
 msgid "Off"
 msgstr ""
 
-#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:312
+#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:318
 msgid "On"
 msgstr ""
 
-#: alsamixer/mixer_display.c:363
+#: alsamixer/mixer_display.c:370
 msgid "The sound device was unplugged."
 msgstr ""
 
-#: alsamixer/mixer_display.c:364
+#: alsamixer/mixer_display.c:371
 msgid "Press F6 to select another sound card."
 msgstr ""
 
-#: alsamixer/mixer_display.c:379
+#: alsamixer/mixer_display.c:386
 msgid "This sound device does not have any playback controls."
 msgstr ""
 
-#: alsamixer/mixer_display.c:381
+#: alsamixer/mixer_display.c:388
 msgid "This sound device does not have any capture controls."
 msgstr ""
 
-#: alsamixer/mixer_display.c:383
+#: alsamixer/mixer_display.c:390
 msgid "This sound device does not have any controls."
 msgstr ""
 
 #. TRANSLATORS: playback on; one character
-#: alsamixer/mixer_display.c:516 alsamixer/mixer_display.c:521
+#: alsamixer/mixer_display.c:523 alsamixer/mixer_display.c:528
 msgid "O"
 msgstr ""
 
 #. TRANSLATORS: playback muted; one character
-#: alsamixer/mixer_display.c:518 alsamixer/mixer_display.c:522
+#: alsamixer/mixer_display.c:525 alsamixer/mixer_display.c:529
 msgid "M"
 msgstr ""
 
 #. TRANSLATORS: "left"; no more than two characters
-#: alsamixer/mixer_display.c:536
+#: alsamixer/mixer_display.c:545
 msgid "L"
 msgstr ""
 
 #. TRANSLATORS: "right"; no more than two characters
-#: alsamixer/mixer_display.c:540
+#: alsamixer/mixer_display.c:551
 msgid "R"
 msgstr ""
 
 #. TRANSLATORS: no more than eight characters
-#: alsamixer/mixer_display.c:542
+#: alsamixer/mixer_display.c:555
 msgid "CAPTURE"
 msgstr ""
 
-#: alsamixer/mixer_display.c:592
+#: alsamixer/mixer_display.c:611
 msgid "Front"
 msgstr ""
 
-#: alsamixer/mixer_display.c:595
+#: alsamixer/mixer_display.c:614
 msgid "Rear"
 msgstr ""
 
-#: alsamixer/mixer_display.c:598 speaker-test/speaker-test.c:124
+#: alsamixer/mixer_display.c:617 speaker-test/speaker-test.c:134
 msgid "Center"
 msgstr ""
 
-#: alsamixer/mixer_display.c:601
+#: alsamixer/mixer_display.c:620
 msgid "Woofer"
 msgstr ""
 
-#: alsamixer/mixer_display.c:604
+#: alsamixer/mixer_display.c:623
 msgid "Side"
 msgstr ""
 
@@ -344,11 +349,11 @@ msgstr ""
 msgid "Help"
 msgstr ""
 
-#: alsamixer/proc_files.c:103
+#: alsamixer/proc_files.c:56
 msgid "Select File"
 msgstr ""
 
-#: alsamixer/textbox.c:52 alsamixer/textbox.c:66
+#: alsamixer/textbox.c:51 alsamixer/textbox.c:65
 msgid "Error"
 msgstr ""
 
@@ -357,23 +362,23 @@ msgstr ""
 msgid "Cannot open file \"%s\"."
 msgstr ""
 
-#: aplay/aplay.c:175
+#: aplay/aplay.c:184
 msgid "raw data"
 msgstr ""
 
-#: aplay/aplay.c:176
+#: aplay/aplay.c:185
 msgid "VOC"
 msgstr ""
 
-#: aplay/aplay.c:178
+#: aplay/aplay.c:187
 msgid "WAVE"
 msgstr ""
 
-#: aplay/aplay.c:179
+#: aplay/aplay.c:188
 msgid "Sparc Audio"
 msgstr ""
 
-#: aplay/aplay.c:200
+#: aplay/aplay.c:209
 #, c-format
 msgid ""
 "Usage: %s [OPTION]... [FILE]...\n"
@@ -387,8 +392,10 @@ msgid ""
 "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
 "-c, --channels=#        channels\n"
 "-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
 "-r, --rate=#            sample rate\n"
 "-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
 "-M, --mmap              mmap stream\n"
 "-N, --nonblock          nonblocking mode\n"
 "-F, --period-time=#     distance between interrupts is # microseconds\n"
@@ -424,1018 +431,1164 @@ msgid ""
 "    --fatal-errors      treat all errors as fatal\n"
 msgstr ""
 
-#: aplay/aplay.c:244 speaker-test/speaker-test.c:1021
+#: aplay/aplay.c:255 speaker-test/speaker-test.c:1001
 #, c-format
 msgid "Recognized sample formats are:"
 msgstr ""
 
-#: aplay/aplay.c:250
+#: aplay/aplay.c:261
 #, c-format
 msgid ""
 "\n"
 "Some of these may not be available on selected hardware\n"
 msgstr ""
 
-#: aplay/aplay.c:251
+#: aplay/aplay.c:262
 #, c-format
 msgid "The available format shortcuts are:\n"
 msgstr ""
 
-#: aplay/aplay.c:252
+#: aplay/aplay.c:263
 #, c-format
 msgid "-f cd (16 bit little endian, 44100, stereo)\n"
 msgstr ""
 
-#: aplay/aplay.c:253
+#: aplay/aplay.c:264
 #, c-format
 msgid "-f cdr (16 bit big endian, 44100, stereo)\n"
 msgstr ""
 
-#: aplay/aplay.c:254
+#: aplay/aplay.c:265
 #, c-format
 msgid "-f dat (16 bit little endian, 48000, stereo)\n"
 msgstr ""
 
-#: aplay/aplay.c:268
+#: aplay/aplay.c:279
 msgid "no soundcards found..."
 msgstr ""
 
-#: aplay/aplay.c:271
+#: aplay/aplay.c:282
 #, c-format
 msgid "**** List of %s Hardware Devices ****\n"
 msgstr ""
 
-#: aplay/aplay.c:300
+#: aplay/aplay.c:311
 #, c-format
 msgid "card %i: %s [%s], device %i: %s [%s]\n"
 msgstr ""
 
-#: aplay/aplay.c:306
+#: aplay/aplay.c:317
 #, c-format
 msgid "  Subdevices: %i/%i\n"
 msgstr ""
 
-#: aplay/aplay.c:313
+#: aplay/aplay.c:324
 #, c-format
 msgid "  Subdevice #%i: %s\n"
 msgstr ""
 
-#: aplay/aplay.c:394
+#: aplay/aplay.c:405
 #, c-format
 msgid "Aborted by signal %s...\n"
 msgstr ""
 
-#: aplay/aplay.c:512
+#: aplay/aplay.c:562
 msgid "command should be named either arecord or aplay"
 msgstr ""
 
-#: aplay/aplay.c:556
+#: aplay/aplay.c:607
 #, c-format
 msgid "unrecognized file format %s"
 msgstr ""
 
-#: aplay/aplay.c:563
+#: aplay/aplay.c:614
+#, c-format
+msgid "invalid channels argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:618
 #, c-format
 msgid "value %i for channels is invalid"
 msgstr ""
 
-#: aplay/aplay.c:582
+#: aplay/aplay.c:638
 #, c-format
 msgid "wrong extended format '%s'"
 msgstr ""
 
-#: aplay/aplay.c:593
+#: aplay/aplay.c:650
+#, c-format
+msgid "wrong extended subformat '%s'"
+msgstr ""
+
+#: aplay/aplay.c:657
+#, c-format
+msgid "invalid rate argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:664
 #, c-format
 msgid "bad speed value %i"
 msgstr ""
 
-#: aplay/aplay.c:700 speaker-test/speaker-test.c:665
+#: aplay/aplay.c:670
+msgid "duration and samples arguments cannot be used together"
+msgstr ""
+
+#: aplay/aplay.c:675
 #, c-format
-msgid "Unable to parse channel map string: %s\n"
+msgid "invalid duration argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:682
+msgid "samples and duration arguments cannot be used together"
+msgstr ""
+
+#: aplay/aplay.c:687
+#, c-format
+msgid "invalid samples argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:699
+#, c-format
+msgid "invalid period time argument '%s'"
 msgstr ""
 
 #: aplay/aplay.c:706
 #, c-format
+msgid "invalid buffer time argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:713
+#, c-format
+msgid "invalid period size argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:720
+#, c-format
+msgid "invalid buffer size argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:727
+#, c-format
+msgid "invalid min available space argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:734
+#, c-format
+msgid "invalid start delay argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:741
+#, c-format
+msgid "invalid stop delay argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:796
+#, c-format
+msgid "invalid test coef argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:808
+#, c-format
+msgid "invalid max file time argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:828 speaker-test/speaker-test.c:616
+#, c-format
+msgid "Unable to parse channel map string: %s\n"
+msgstr ""
+
+#: aplay/aplay.c:834
+#, c-format
 msgid "Try `%s --help' for more information.\n"
 msgstr ""
 
-#: aplay/aplay.c:722
+#: aplay/aplay.c:850
 #, c-format
 msgid "audio open error: %s"
 msgstr ""
 
-#: aplay/aplay.c:727
+#: aplay/aplay.c:855
 #, c-format
 msgid "info error: %s"
 msgstr ""
 
-#: aplay/aplay.c:734
+#: aplay/aplay.c:862
 #, c-format
 msgid "nonblock setting error: %s"
 msgstr ""
 
-#: aplay/aplay.c:744 aplay/aplay.c:868 aplay/aplay.c:1158 aplay/aplay.c:1351
-#: aplay/aplay.c:1867 aplay/aplay.c:1897
+#: aplay/aplay.c:880 aplay/aplay.c:1004 aplay/aplay.c:1310 aplay/aplay.c:1526
+#: aplay/aplay.c:2106 aplay/aplay.c:2136
 msgid "not enough memory"
 msgstr ""
 
-#: aplay/aplay.c:768
+#: aplay/aplay.c:904
 #, c-format
 msgid "Cannot create process ID file %s: %s"
 msgstr ""
 
-#: aplay/aplay.c:858
+#: aplay/aplay.c:994
 #, c-format
 msgid "read error (called from line %i)"
 msgstr ""
 
-#: aplay/aplay.c:925
+#: aplay/aplay.c:1062
 #, c-format
 msgid "unknown length of 'fmt ' chunk (read %u, should be %u at least)"
 msgstr ""
 
-#: aplay/aplay.c:936
+#: aplay/aplay.c:1073
 #, c-format
 msgid ""
 "unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"
 msgstr ""
 
-#: aplay/aplay.c:941
+#: aplay/aplay.c:1078
 msgid "wrong format tag in extensible 'fmt ' chunk"
 msgstr ""
 
-#: aplay/aplay.c:948
+#: aplay/aplay.c:1086
 #, c-format
 msgid "can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"
 msgstr ""
 
-#: aplay/aplay.c:953
+#: aplay/aplay.c:1091
 #, c-format
 msgid "can't play WAVE-files with %d tracks"
 msgstr ""
 
-#: aplay/aplay.c:961 aplay/aplay.c:1087
+#: aplay/aplay.c:1096
+#, c-format
+msgid "valid bps greater than bps: %d > %d"
+msgstr ""
+
+#: aplay/aplay.c:1103 aplay/aplay.c:1239
 #, c-format
 msgid "Warning: format is changed to U8\n"
 msgstr ""
 
-#: aplay/aplay.c:971 aplay/aplay.c:984 aplay/aplay.c:995
+#: aplay/aplay.c:1113 aplay/aplay.c:1126 aplay/aplay.c:1137
 #, c-format
 msgid "Warning: format is changed to %s\n"
 msgstr ""
 
-#: aplay/aplay.c:1000
+#: aplay/aplay.c:1142
 #, c-format
 msgid ""
 " can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"
 msgstr ""
 
-#: aplay/aplay.c:1023
+#: aplay/aplay.c:1175
 #, c-format
 msgid " can't play WAVE-files with sample %d bits wide"
 msgstr ""
 
-#: aplay/aplay.c:1081
+#: aplay/aplay.c:1233
 #, c-format
 msgid "Warning: format is changed to MU_LAW\n"
 msgstr ""
 
-#: aplay/aplay.c:1093
+#: aplay/aplay.c:1245
 #, c-format
 msgid "Warning: format is changed to S16_BE\n"
 msgstr ""
 
-#: aplay/aplay.c:1106 aplay/aplay.c:2182 aplay/aplay.c:2189 aplay/aplay.c:2715
-#: aplay/aplay.c:2727
+#: aplay/aplay.c:1258 aplay/aplay.c:2427 aplay/aplay.c:2434 aplay/aplay.c:2964
 msgid "read error"
 msgstr ""
 
-#: aplay/aplay.c:1136
+#: aplay/aplay.c:1288
 msgid "Channel numbers don't match between hw_params and channel map"
 msgstr ""
 
-#: aplay/aplay.c:1145
+#: aplay/aplay.c:1297
 #, c-format
 msgid "Warning: unable to get channel map\n"
 msgstr ""
 
-#: aplay/aplay.c:1178
+#: aplay/aplay.c:1331
 #, c-format
-msgid "Channel %d doesn't match with hw_parmas"
+msgid "Channel %d doesn't match with hw_params"
 msgstr ""
 
-#: aplay/aplay.c:1204
+#: aplay/aplay.c:1358
 msgid "Broken configuration for this PCM: no configurations available"
 msgstr ""
 
-#: aplay/aplay.c:1208
+#: aplay/aplay.c:1362
 #, c-format
 msgid "HW Params of device \"%s\":\n"
 msgstr ""
 
-#: aplay/aplay.c:1228
+#: aplay/aplay.c:1382
 msgid "Access type not available"
 msgstr ""
 
-#: aplay/aplay.c:1233
+#: aplay/aplay.c:1387
 msgid "Sample format non available"
 msgstr ""
 
-#: aplay/aplay.c:1239
+#: aplay/aplay.c:1393
+msgid "Sample subformat not available"
+msgstr ""
+
+#: aplay/aplay.c:1398
 msgid "Channels count non available"
 msgstr ""
 
-#: aplay/aplay.c:1254
+#: aplay/aplay.c:1413
 #, c-format
 msgid "Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"
 msgstr ""
 
-#: aplay/aplay.c:1260
+#: aplay/aplay.c:1419
 #, c-format
 msgid "         please, try the plug plugin %s\n"
 msgstr ""
 
-#: aplay/aplay.c:1297
+#: aplay/aplay.c:1456
 msgid "Unable to install hw params:"
 msgstr ""
 
-#: aplay/aplay.c:1304
+#: aplay/aplay.c:1463
 #, c-format
 msgid "Can't use period equal to buffer size (%lu == %lu)"
 msgstr ""
 
-#: aplay/aplay.c:1335
+#: aplay/aplay.c:1469
+msgid "Unable to get current sw params."
+msgstr ""
+
+#: aplay/aplay.c:1509
 msgid "unable to install sw params:"
 msgstr ""
 
-#: aplay/aplay.c:1369
+#: aplay/aplay.c:1544
 #, c-format
 msgid "snd_pcm_mmap_begin problem: %s"
 msgstr ""
 
-#: aplay/aplay.c:1398
+#: aplay/aplay.c:1573
 #, c-format
 msgid "stdin O_NONBLOCK flag setup failed\n"
 msgstr ""
 
-#: aplay/aplay.c:1422
+#: aplay/aplay.c:1610
 #, c-format
 msgid "\rPAUSE command ignored (no hw support)\n"
 msgstr ""
 
-#: aplay/aplay.c:1427
+#: aplay/aplay.c:1618
 #, c-format
 msgid "pause push error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1436
+#: aplay/aplay.c:1629
 #, c-format
 msgid "pause release error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1452
+#: aplay/aplay.c:1645
 #, c-format
 msgid ""
 "\r=== PAUSE ===                                                            "
 msgstr ""
 
-#: aplay/aplay.c:1494
+#: aplay/aplay.c:1687
 #, c-format
 msgid "status error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1499
+#: aplay/aplay.c:1697 aplay/aplay.c:1708
 #, c-format
-msgid "fatal %s: %s"
+msgid "%s!!! (at least %.3f ms long)\n"
 msgstr ""
 
-#: aplay/aplay.c:1500 aplay/aplay.c:1511 aplay/aplay.c:1514 aplay/aplay.c:1522
+#: aplay/aplay.c:1698 aplay/aplay.c:1701 aplay/aplay.c:1709 aplay/aplay.c:1718
 msgid "underrun"
 msgstr ""
 
-#: aplay/aplay.c:1500 aplay/aplay.c:1511 aplay/aplay.c:1522
+#: aplay/aplay.c:1698 aplay/aplay.c:1709 aplay/aplay.c:1718
 msgid "overrun"
 msgstr ""
 
-#: aplay/aplay.c:1510 aplay/aplay.c:1521
+#: aplay/aplay.c:1713
 #, c-format
-msgid "%s!!! (at least %.3f ms long)\n"
+msgid "Status:\n"
 msgstr ""
 
-#: aplay/aplay.c:1526
+#: aplay/aplay.c:1717
 #, c-format
-msgid "Status:\n"
+msgid "fatal %s: %s"
 msgstr ""
 
-#: aplay/aplay.c:1530
+#: aplay/aplay.c:1723
 #, c-format
 msgid "xrun: prepare error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1536
+#: aplay/aplay.c:1730
 #, c-format
 msgid "Status(DRAINING):\n"
 msgstr ""
 
-#: aplay/aplay.c:1540
+#: aplay/aplay.c:1734
 #, c-format
 msgid "capture stream format change? attempting recover...\n"
 msgstr ""
 
-#: aplay/aplay.c:1542
+#: aplay/aplay.c:1736
 #, c-format
 msgid "xrun(DRAINING): prepare error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1549
+#: aplay/aplay.c:1743
 #, c-format
 msgid "Status(R/W):\n"
 msgstr ""
 
-#: aplay/aplay.c:1552
+#: aplay/aplay.c:1746
 #, c-format
 msgid "read/write error, state = %s"
 msgstr ""
 
-#: aplay/aplay.c:1562
+#: aplay/aplay.c:1756
 #, c-format
 msgid "Suspended. Trying resume. "
 msgstr ""
 
-#: aplay/aplay.c:1567
+#: aplay/aplay.c:1762
 #, c-format
 msgid "Failed. Restarting stream. "
 msgstr ""
 
-#: aplay/aplay.c:1569
+#: aplay/aplay.c:1765
 #, c-format
 msgid "suspend: prepare error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1574
+#: aplay/aplay.c:1770
 #, c-format
 msgid "Done.\n"
 msgstr ""
 
-#: aplay/aplay.c:1596
+#: aplay/aplay.c:1792
 #, c-format
 msgid " !clip  "
 msgstr ""
 
-#: aplay/aplay.c:1743
+#: aplay/aplay.c:1944
 #, c-format
 msgid "Unsupported bit size %d.\n"
 msgstr ""
 
-#: aplay/aplay.c:1777
+#: aplay/aplay.c:1980
 #, c-format
 msgid "Max peak (%li samples): 0x%08x "
 msgstr ""
 
-#: aplay/aplay.c:1811
+#: aplay/aplay.c:2021
 #, c-format
 msgid ""
 "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer = "
 "%li\n"
 msgstr ""
 
-#: aplay/aplay.c:1939
+#: aplay/aplay.c:2030
+#, c-format
+msgid ""
+"Suspicious status buffer position (%li total): avail = %li, delay = %li, "
+"buffer = %li\n"
+msgstr ""
+
+#: aplay/aplay.c:2034
+#, c-format
+msgid ""
+"Suspicious buffer position avail > delay (%li total): avail = %li, delay = "
+"%li\n"
+msgstr ""
+
+#: aplay/aplay.c:2038
+#, c-format
+msgid ""
+"Suspicious status buffer position avail > delay (%li total): avail = %li, "
+"delay = %li\n"
+msgstr ""
+
+#: aplay/aplay.c:2081
+#, c-format
+msgid "Status(R/W) (standalone avail=%li delay=%li):\n"
+msgstr ""
+
+#: aplay/aplay.c:2178
 #, c-format
 msgid "write error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1987
+#: aplay/aplay.c:2226
 #, c-format
 msgid "writev error: %s"
 msgstr ""
 
-#: aplay/aplay.c:2031
+#: aplay/aplay.c:2272
 #, c-format
 msgid "read error: %s"
 msgstr ""
 
-#: aplay/aplay.c:2075
+#: aplay/aplay.c:2319
 #, c-format
 msgid "readv error: %s"
 msgstr ""
 
-#: aplay/aplay.c:2123
+#: aplay/aplay.c:2368
 msgid "can't allocate buffer for silence"
 msgstr ""
 
-#: aplay/aplay.c:2132 aplay/aplay.c:2360 aplay/aplay.c:2365 aplay/aplay.c:2412
-#: aplay/aplay.c:2421 aplay/aplay.c:2428 aplay/aplay.c:2438 aplay/aplay.c:2444
-#: aplay/aplay.c:2516 aplay/aplay.c:2546 aplay/aplay.c:2560
+#: aplay/aplay.c:2377 aplay/aplay.c:2606 aplay/aplay.c:2611 aplay/aplay.c:2663
+#: aplay/aplay.c:2672 aplay/aplay.c:2679 aplay/aplay.c:2689 aplay/aplay.c:2695
+#: aplay/aplay.c:2767 aplay/aplay.c:2797 aplay/aplay.c:2811
 msgid "write error"
 msgstr ""
 
-#: aplay/aplay.c:2145
+#: aplay/aplay.c:2390
 #, c-format
 msgid "voc_pcm_flush - silence error"
 msgstr ""
 
-#: aplay/aplay.c:2148
+#: aplay/aplay.c:2393
 msgid "voc_pcm_flush error"
 msgstr ""
 
-#: aplay/aplay.c:2173
+#: aplay/aplay.c:2418
 msgid "malloc error"
 msgstr ""
 
-#: aplay/aplay.c:2177
+#: aplay/aplay.c:2422
 #, c-format
 msgid "Playing Creative Labs Channel file '%s'...\n"
 msgstr ""
 
-#: aplay/aplay.c:2245 aplay/aplay.c:2340
+#: aplay/aplay.c:2491 aplay/aplay.c:2586
 msgid "can't play packed .voc files"
 msgstr ""
 
-#: aplay/aplay.c:2300
+#: aplay/aplay.c:2546
 #, c-format
 msgid "can't play loops; %s isn't seekable\n"
 msgstr ""
 
-#: aplay/aplay.c:2349
+#: aplay/aplay.c:2595
 #, c-format
 msgid "unknown blocktype %d. terminate."
 msgstr ""
 
-#: aplay/aplay.c:2480
+#: aplay/aplay.c:2731
 #, c-format
 msgid "Wave doesn't support %s format..."
 msgstr ""
 
-#: aplay/aplay.c:2540
+#: aplay/aplay.c:2791
 #, c-format
 msgid "Sparc Audio doesn't support %s format..."
 msgstr ""
 
-#: aplay/aplay.c:2621
+#: aplay/aplay.c:2866
 msgid "Playing"
 msgstr ""
 
-#: aplay/aplay.c:2621
+#: aplay/aplay.c:2866
 msgid "Recording"
 msgstr ""
 
-#: aplay/aplay.c:2625
+#: aplay/aplay.c:2870
 #, c-format
 msgid "Rate %d Hz, "
 msgstr ""
 
-#: aplay/aplay.c:2627
+#: aplay/aplay.c:2872
 #, c-format
 msgid "Mono"
 msgstr ""
 
-#: aplay/aplay.c:2629
+#: aplay/aplay.c:2874
 #, c-format
 msgid "Stereo"
 msgstr ""
 
-#: aplay/aplay.c:2631
+#: aplay/aplay.c:2876
 #, c-format
 msgid "Channels %i"
 msgstr ""
 
-#: aplay/aplay.c:3145 aplay/aplay.c:3198
+#: aplay/aplay.c:3483
+#, c-format
+msgid "You need to specify %u files"
+msgstr ""
+
+#: aplay/aplay.c:3536
 #, c-format
 msgid "You need to specify %d files"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:49
+#: seq/aconnect/aconnect.c:56
 #, c-format
 msgid "aconnect - ALSA sequencer connection manager\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:50
+#: seq/aconnect/aconnect.c:57
 #, c-format
 msgid "Copyright (C) 1999-2000 Takashi Iwai\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:51
+#: seq/aconnect/aconnect.c:58
 #, c-format
 msgid "Usage:\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:52
+#: seq/aconnect/aconnect.c:59
 #, c-format
 msgid " * Connection/disconnection between two ports\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:53
+#: seq/aconnect/aconnect.c:60
 #, c-format
 msgid "   aconnect [-options] sender receiver\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:54
+#: seq/aconnect/aconnect.c:61
 #, c-format
 msgid "     sender, receiver = client:port pair\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:55
+#: seq/aconnect/aconnect.c:62
 #, c-format
 msgid "     -d,--disconnect     disconnect\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:56
+#: seq/aconnect/aconnect.c:63
 #, c-format
 msgid "     -e,--exclusive      exclusive connection\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:57
+#: seq/aconnect/aconnect.c:64
 #, c-format
 msgid "     -r,--real #         convert real-time-stamp on queue\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:58
+#: seq/aconnect/aconnect.c:65
 #, c-format
 msgid "     -t,--tick #         convert tick-time-stamp on queue\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:59
+#: seq/aconnect/aconnect.c:66
 #, c-format
 msgid " * List connected ports (no subscription action)\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:60
+#: seq/aconnect/aconnect.c:67
 #, c-format
 msgid "   aconnect -i|-o [-options]\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:61
+#: seq/aconnect/aconnect.c:68
 #, c-format
 msgid "     -i,--input          list input (readable) ports\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:62
+#: seq/aconnect/aconnect.c:69
 #, c-format
 msgid "     -o,--output         list output (writable) ports\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:63
+#: seq/aconnect/aconnect.c:71
+#, c-format
+msgid "     -a,--all            show inactive ports, too\n"
+msgstr ""
+
+#: seq/aconnect/aconnect.c:73
 #, c-format
 msgid "     -l,--list           list current connections of each port\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:64
+#: seq/aconnect/aconnect.c:74
 #, c-format
 msgid " * Remove all exported connections\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:65
+#: seq/aconnect/aconnect.c:75
 #, c-format
 msgid "     -x, --removeall\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:132
+#: seq/aconnect/aconnect.c:155
 msgid "Connecting To"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:133
+#: seq/aconnect/aconnect.c:156
 msgid "Connected From"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:169
+#: seq/aconnect/aconnect.c:203
 #, c-format
-msgid "client %d: '%s' [type=%s]\n"
+msgid "client %d: '%s' [type=%s"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:173
+#: seq/aconnect/aconnect.c:207
 msgid "user"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:173
+#: seq/aconnect/aconnect.c:207
 msgid "kernel"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:308
+#: seq/aconnect/aconnect.c:385
 #, c-format
 msgid "can't open sequencer\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:336
+#: seq/aconnect/aconnect.c:413
 #, c-format
 msgid "can't get client id\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:343
+#: seq/aconnect/aconnect.c:420
 #, c-format
 msgid "can't set client info\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:350
+#: seq/aconnect/aconnect.c:427
 #, c-format
 msgid "invalid sender address %s\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:355 seq/aseqnet/aseqnet.c:290
+#: seq/aconnect/aconnect.c:432 seq/aseqnet/aseqnet.c:303
 #, c-format
 msgid "invalid destination address %s\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:369
+#: seq/aconnect/aconnect.c:446
 #, c-format
 msgid "No subscription is found\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:374
+#: seq/aconnect/aconnect.c:451
 #, c-format
 msgid "Disconnection failed (%s)\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:380
+#: seq/aconnect/aconnect.c:457
 #, c-format
 msgid "Connection is already subscribed\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:385
+#: seq/aconnect/aconnect.c:462
 #, c-format
 msgid "Connection failed (%s)\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:164
+#: seq/aseqnet/aseqnet.c:171
 #, c-format
 msgid "aseqnet - network client/server on ALSA sequencer\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:165
+#: seq/aseqnet/aseqnet.c:172
 #, c-format
 msgid "  Copyright (C) 1999 Takashi Iwai\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:166
+#: seq/aseqnet/aseqnet.c:173
 #, c-format
 msgid "usage:\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:167
+#: seq/aseqnet/aseqnet.c:174
 #, c-format
 msgid "  server mode: aseqnet [-options]\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:168
+#: seq/aseqnet/aseqnet.c:175
 #, c-format
 msgid "  client mode: aseqnet [-options] server_host\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:169
+#: seq/aseqnet/aseqnet.c:176
 #, c-format
 msgid "options:\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:170
+#: seq/aseqnet/aseqnet.c:177
+#, c-format
+msgid "  -6,--ipv6 : use IPv6 TCP protocol\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:178
 #, c-format
 msgid "  -p,--port # : specify TCP port (digit or service name)\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:171
+#: seq/aseqnet/aseqnet.c:179
 #, c-format
 msgid "  -s,--source addr : read from given addr (client:port)\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:172
+#: seq/aseqnet/aseqnet.c:180
 #, c-format
 msgid "  -d,--dest addr : write to given addr (client:port)\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:173
+#: seq/aseqnet/aseqnet.c:181
+#, c-format
+msgid "  -n,--name value : use a specific midi process name\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:182
 #, c-format
 msgid "  -v, --verbose : print verbose messages\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:174
+#: seq/aseqnet/aseqnet.c:183
 #, c-format
 msgid "  -i, --info : print certain received events\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:188
+#: seq/aseqnet/aseqnet.c:197
 #, c-format
 msgid "can't malloc\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:213
+#: seq/aseqnet/aseqnet.c:222
 #, c-format
 msgid "closing files..\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:272
+#: seq/aseqnet/aseqnet.c:285
 #, c-format
 msgid "sequencer opened: %d:%d\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:279
+#: seq/aseqnet/aseqnet.c:292
 #, c-format
 msgid "invalid source address %s\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:309
+#: seq/aseqnet/aseqnet.c:362
+#, c-format
+msgid "can't get address\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:376 seq/aseqnet/aseqnet.c:461
 #, c-format
-msgid "service '%s' is not found in /etc/services\n"
+msgid "connecting to: %s\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:377
+#: seq/aseqnet/aseqnet.c:414
 #, c-format
 msgid "too many connections!\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:388
+#: seq/aseqnet/aseqnet.c:425
 #, c-format
 msgid "accepted[%d]\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:411
+#: seq/aseqnet/aseqnet.c:447
 #, c-format
 msgid "can't get address %s\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:422
+#: seq/aseqnet/aseqnet.c:475
 #, c-format
 msgid "ok.. connected\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:518
+#: seq/aseqnet/aseqnet.c:574
 #, c-format
 msgid "Channel %2d: Control event : %5d\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:522
+#: seq/aseqnet/aseqnet.c:578
 #, c-format
 msgid "Channel %2d: Pitchbender   : %5d\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:526
+#: seq/aseqnet/aseqnet.c:582
 #, c-format
 msgid "Channel %2d: Note On event : %5d\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:530
+#: seq/aseqnet/aseqnet.c:586
 #, c-format
 msgid "Channel %2d: Note Off event: %5d\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:585
+#: seq/aseqnet/aseqnet.c:641
 #, c-format
 msgid "disconnected\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:120
+#: speaker-test/speaker-test.c:130
 msgid "Front Left"
 msgstr ""
 
-#: speaker-test/speaker-test.c:121
+#: speaker-test/speaker-test.c:131
 msgid "Front Right"
 msgstr ""
 
-#: speaker-test/speaker-test.c:122
+#: speaker-test/speaker-test.c:132
 msgid "Rear Left"
 msgstr ""
 
-#: speaker-test/speaker-test.c:123
+#: speaker-test/speaker-test.c:133
 msgid "Rear Right"
 msgstr ""
 
-#: speaker-test/speaker-test.c:125
+#: speaker-test/speaker-test.c:135
 msgid "LFE"
 msgstr ""
 
-#: speaker-test/speaker-test.c:126
+#: speaker-test/speaker-test.c:136
 msgid "Side Left"
 msgstr ""
 
-#: speaker-test/speaker-test.c:127
+#: speaker-test/speaker-test.c:137
 msgid "Side Right"
 msgstr ""
 
-#: speaker-test/speaker-test.c:128
+#: speaker-test/speaker-test.c:138
 msgid "Channel 9"
 msgstr ""
 
-#: speaker-test/speaker-test.c:129
+#: speaker-test/speaker-test.c:139
 msgid "Channel 10"
 msgstr ""
 
-#: speaker-test/speaker-test.c:130
+#: speaker-test/speaker-test.c:140
 msgid "Channel 11"
 msgstr ""
 
-#: speaker-test/speaker-test.c:131
+#: speaker-test/speaker-test.c:141
 msgid "Channel 12"
 msgstr ""
 
-#: speaker-test/speaker-test.c:132
+#: speaker-test/speaker-test.c:142
 msgid "Channel 13"
 msgstr ""
 
-#: speaker-test/speaker-test.c:133
+#: speaker-test/speaker-test.c:143
 msgid "Channel 14"
 msgstr ""
 
-#: speaker-test/speaker-test.c:134
+#: speaker-test/speaker-test.c:144
 msgid "Channel 15"
 msgstr ""
 
-#: speaker-test/speaker-test.c:135
+#: speaker-test/speaker-test.c:145
 msgid "Channel 16"
 msgstr ""
 
-#: speaker-test/speaker-test.c:518
+#: speaker-test/speaker-test.c:465
 #, c-format
 msgid "Broken configuration for playback: no configurations available: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:525
+#: speaker-test/speaker-test.c:472
 #, c-format
 msgid "Access type not available for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:532
+#: speaker-test/speaker-test.c:479
 #, c-format
 msgid "Sample format not available for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:539
+#: speaker-test/speaker-test.c:486
 #, c-format
 msgid "Channels count (%i) not available for playbacks: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:547
+#: speaker-test/speaker-test.c:494
 #, c-format
 msgid "Rate %iHz not available for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:552
+#: speaker-test/speaker-test.c:499
 #, c-format
 msgid "Rate doesn't match (requested %iHz, get %iHz, err %d)\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:556
+#: speaker-test/speaker-test.c:503
 #, c-format
 msgid "Rate set to %iHz (requested %iHz)\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:562
+#: speaker-test/speaker-test.c:509
 #, c-format
 msgid "Buffer size range from %lu to %lu\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:563
+#: speaker-test/speaker-test.c:510
 #, c-format
 msgid "Period size range from %lu to %lu\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:565
+#: speaker-test/speaker-test.c:514
 #, c-format
 msgid "Requested period time %u us\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:568
+#: speaker-test/speaker-test.c:519
 #, c-format
 msgid "Unable to set period time %u us for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:574
+#: speaker-test/speaker-test.c:525
 #, c-format
 msgid "Requested buffer time %u us\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:577
+#: speaker-test/speaker-test.c:528
 #, c-format
 msgid "Unable to set buffer time %u us for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:586
+#: speaker-test/speaker-test.c:537
 #, c-format
 msgid "Using max buffer size %lu\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:589
+#: speaker-test/speaker-test.c:540
 #, c-format
 msgid "Unable to set buffer size %lu for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:595
+#: speaker-test/speaker-test.c:546
 #, c-format
 msgid "Periods = %u\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:598
+#: speaker-test/speaker-test.c:549
 #, c-format
 msgid "Unable to set nperiods %u for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:607
+#: speaker-test/speaker-test.c:558
 #, c-format
 msgid "Unable to set hw params for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:613
+#: speaker-test/speaker-test.c:564
 #, c-format
 msgid "was set period_size = %lu\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:614
+#: speaker-test/speaker-test.c:565
 #, c-format
 msgid "was set buffer_size = %lu\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:616
+#: speaker-test/speaker-test.c:567
 #, c-format
 msgid "buffer to small, could not use\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:629
+#: speaker-test/speaker-test.c:580
 #, c-format
 msgid "Unable to determine current swparams for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:636
+#: speaker-test/speaker-test.c:587
 #, c-format
 msgid "Unable to set start threshold mode for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:643
+#: speaker-test/speaker-test.c:594
 #, c-format
 msgid "Unable to set avail min for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:650
+#: speaker-test/speaker-test.c:601
 #, c-format
 msgid "Unable to set sw params for playback: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:670
+#: speaker-test/speaker-test.c:621
 #, c-format
 msgid "Unable to set channel map: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:695
+#: speaker-test/speaker-test.c:646
 #, c-format
 msgid "Can't recovery from underrun, prepare failed: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:706
+#: speaker-test/speaker-test.c:657
 #, c-format
 msgid "Can't recovery from suspend, prepare failed: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:770 speaker-test/speaker-test.c:1261
+#: speaker-test/speaker-test.c:721 speaker-test/speaker-test.c:1257
 #, c-format
 msgid "No enough memory\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:775
+#: speaker-test/speaker-test.c:726
 #, c-format
 msgid "Cannot open WAV file %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:779 speaker-test/speaker-test.c:808
+#: speaker-test/speaker-test.c:730 speaker-test/speaker-test.c:759
 #, c-format
 msgid "Invalid WAV file %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:784
+#: speaker-test/speaker-test.c:735
 #, c-format
 msgid "Not a WAV file: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:788
+#: speaker-test/speaker-test.c:739
 #, c-format
 msgid "Unsupported WAV format %d for %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:793
+#: speaker-test/speaker-test.c:744
 #, c-format
 msgid "%s is not a mono stream (%d channels)\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:798
+#: speaker-test/speaker-test.c:749
 #, c-format
 msgid "Sample rate doesn't match (%d) for %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:803
+#: speaker-test/speaker-test.c:754
 #, c-format
 msgid "Unsupported sample format bits %d for %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:864
+#: speaker-test/speaker-test.c:815
 #, c-format
 msgid "Undefined channel %d\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:915
+#: speaker-test/speaker-test.c:866
 #, c-format
 msgid "Write error: %d,%s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:917
+#: speaker-test/speaker-test.c:868
 #, c-format
 msgid "xrun_recovery failed: %d,%s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1003
+#: speaker-test/speaker-test.c:938
+#, c-format
+msgid "\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:982
 #, c-format
 msgid ""
 "Usage: speaker-test [OPTION]... \n"
@@ -1448,82 +1601,90 @@ msgid ""
 "-b,--buffer\tring buffer size in us\n"
 "-p,--period\tperiod size in us\n"
 "-P,--nperiods\tnumber of periods\n"
-"-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+"-t,--test\tpink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 "
+"noise, wav=WAV file\n"
 "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
 "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
 "-w,--wavfile\tUse the given WAV file as a test sound\n"
 "-W,--wavdir\tSpecify the directory containing WAV files\n"
 "-m,--chmap\tSpecify the channel map to override\n"
 "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+"-S,--scale\tScale of generated test tones in percent (default=80)\n"
 "\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1132
+#: speaker-test/speaker-test.c:1114
 #, c-format
 msgid "Invalid number of periods %d\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1148 speaker-test/speaker-test.c:1152
+#: speaker-test/speaker-test.c:1127 speaker-test/speaker-test.c:1137
+#: speaker-test/speaker-test.c:1141
 #, c-format
 msgid "Invalid test type %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1164
+#: speaker-test/speaker-test.c:1174
 #, c-format
-msgid "Invalid parameter for -s option.\n"
+msgid "Unknown option '%c'\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1186
+#: speaker-test/speaker-test.c:1188
 #, c-format
-msgid "Unknown option '%c'\n"
+msgid "Invalid parameter for -s option.\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1207
+#: speaker-test/speaker-test.c:1203
 #, c-format
 msgid "Playback device is %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1208
+#: speaker-test/speaker-test.c:1204
 #, c-format
 msgid "Stream parameters are %iHz, %s, %i channels\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1211
+#: speaker-test/speaker-test.c:1207
+#, c-format
+msgid "Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:1210
 #, c-format
 msgid "Using 16 octaves of pink noise\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1214
+#: speaker-test/speaker-test.c:1213
 #, c-format
 msgid "Sine wave rate is %.4fHz\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1217
+#: speaker-test/speaker-test.c:1216
 #, c-format
 msgid "WAV file(s)\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1227
+#: speaker-test/speaker-test.c:1226
 #, c-format
 msgid "Playback open error: %d,%s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1233
+#: speaker-test/speaker-test.c:1232
 #, c-format
 msgid "Setting of hwparams failed: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1237
+#: speaker-test/speaker-test.c:1236
 #, c-format
 msgid "Setting of swparams failed: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1284 speaker-test/speaker-test.c:1306
+#: speaker-test/speaker-test.c:1282 speaker-test/speaker-test.c:1304
 #, c-format
 msgid "Transfer failed: %s\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1292
+#: speaker-test/speaker-test.c:1290
 #, c-format
 msgid "Time per period = %lf\n"
 msgstr ""
index 90e894b..7c01680 100644 (file)
Binary files a/po/de.gmo and b/po/de.gmo differ
index 08cc4d5..6214da2 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: alsa-utils 1.0.23\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-26 15:50+0100\n"
+"POT-Creation-Date: 2024-06-10 09:22+0000\n"
 "PO-Revision-Date: 2010-11-09 21:12+0100\n"
 "Last-Translator: Clemens Ladisch <clemens@ladisch.de>\n"
 "Language-Team: German\n"
@@ -16,33 +16,45 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: alsamixer/card_select.c:126 alsamixer/device_name.c:126
+#: alsamixer/card_select.c:77 alsamixer/device_name.c:127
 msgid "Sound Card"
 msgstr "Soundkarte"
 
-#: alsamixer/card_select.c:181
+#: alsamixer/card_select.c:115
 msgid "(default)"
 msgstr "(Standard)"
 
-#: alsamixer/card_select.c:191
+#: alsamixer/card_select.c:125
 msgid "cannot enumerate sound cards"
 msgstr "Fehler beim Aufzählen der Soundkarten"
 
-#: alsamixer/card_select.c:215
+#: alsamixer/card_select.c:151
 msgid "enter device name..."
 msgstr "Gerätenamen eingeben..."
 
-#: alsamixer/cli.c:40
+#: alsamixer/cli.c:45
 msgid "Usage: alsamixer [options]"
 msgstr "Verwendung: alsamixer [Optionen]"
 
-#: alsamixer/cli.c:41
+#: alsamixer/cli.c:46
+#, fuzzy
+#| msgid ""
+#| "Useful options:\n"
+#| "  -h, --help              this help\n"
+#| "  -c, --card=NUMBER       sound card number or id\n"
+#| "  -D, --device=NAME       mixer device name\n"
+#| "  -V, --view=MODE         starting view mode: playback/capture/all"
 msgid ""
 "Useful options:\n"
 "  -h, --help              this help\n"
 "  -c, --card=NUMBER       sound card number or id\n"
 "  -D, --device=NAME       mixer device name\n"
-"  -V, --view=MODE         starting view mode: playback/capture/all"
+"  -m, --mouse             enable mouse\n"
+"  -M, --no-mouse          disable mouse\n"
+"  -f, --config=FILE       configuration file\n"
+"  -F, --no-config         do not load configuration file\n"
+"  -V, --view=MODE         starting view mode: playback/capture/all\n"
+"  -B, --black-background  use black background color"
 msgstr ""
 "Optionen:\n"
 "  -h, --help              Hilfe\n"
@@ -51,7 +63,7 @@ msgstr ""
 "  -V, --view=MODUS        Ansicht beim Starten: playback=Wiedergabe, "
 "capture=Aufnahme, all=alle"
 
-#: alsamixer/cli.c:46
+#: alsamixer/cli.c:56
 msgid ""
 "Debugging options:\n"
 "  -g, --no-color          toggle using of colors\n"
@@ -61,22 +73,22 @@ msgstr ""
 "  -g, --no-color          keine Farben\n"
 "  -a, --abstraction=NAME  Mixer-Abstraktion: none/basic"
 
-#: alsamixer/cli.c:77
+#: alsamixer/cli.c:92
 #, c-format
 msgid "invalid card index: %s\n"
 msgstr "ungültige Karten-Nummer: %s\n"
 
-#: alsamixer/cli.c:103
+#: alsamixer/cli.c:137
 #, c-format
 msgid "unknown abstraction level: %s\n"
 msgstr "unbekannte Abstraktion: %s\n"
 
-#: alsamixer/cli.c:108
+#: alsamixer/cli.c:142
 #, c-format
 msgid "unknown option: %c\n"
 msgstr "unbekannte Option: %c\n"
 
-#: alsamixer/cli.c:110
+#: alsamixer/cli.c:144
 msgid "try `alsamixer --help' for more information\n"
 msgstr "siehe `alsamixer --help' für mehr Informationen\n"
 
@@ -89,138 +101,138 @@ msgstr "Gerätename:"
 msgid "%s: %s\n"
 msgstr "%s: %s\n"
 
-#: alsamixer/mixer_display.c:98
+#: alsamixer/mixer_display.c:99
 msgid "Card:"
 msgstr "Gerät:"
 
-#: alsamixer/mixer_display.c:99
+#: alsamixer/mixer_display.c:100
 msgid "Chip:"
 msgstr "Chip:"
 
-#: alsamixer/mixer_display.c:100
+#: alsamixer/mixer_display.c:101
 msgid "View:"
 msgstr "Ansicht:"
 
-#: alsamixer/mixer_display.c:101
+#: alsamixer/mixer_display.c:102
 msgid "Item:"
 msgstr "Element:"
 
-#: alsamixer/mixer_display.c:104
+#: alsamixer/mixer_display.c:105
 msgid "F1:  Help"
 msgstr "F1:  Hilfe"
 
-#: alsamixer/mixer_display.c:105
+#: alsamixer/mixer_display.c:106
 msgid "F2:  System information"
 msgstr "F2:  System-Informationen"
 
-#: alsamixer/mixer_display.c:106
+#: alsamixer/mixer_display.c:107
 msgid "F6:  Select sound card"
 msgstr "F6:  Soundkarte auswählen"
 
-#: alsamixer/mixer_display.c:107
+#: alsamixer/mixer_display.c:108
 msgid "Esc: Exit"
 msgstr "Esc: Beenden"
 
-#: alsamixer/mixer_display.c:174
+#: alsamixer/mixer_display.c:179
 msgid "(unplugged)"
 msgstr "(entfernt)"
 
-#: alsamixer/mixer_display.c:192
+#: alsamixer/mixer_display.c:197
 msgid "Playback"
 msgstr "Wiedergabe"
 
-#: alsamixer/mixer_display.c:193
+#: alsamixer/mixer_display.c:198
 msgid "Capture"
 msgstr "Aufnahme"
 
-#: alsamixer/mixer_display.c:194
+#: alsamixer/mixer_display.c:199
 msgid "All"
 msgstr "Alle"
 
-#: alsamixer/mixer_display.c:234
+#: alsamixer/mixer_display.c:240
 msgid "mute"
 msgstr "stumm"
 
-#: alsamixer/mixer_display.c:275 alsamixer/mixer_display.c:285
+#: alsamixer/mixer_display.c:281 alsamixer/mixer_display.c:291
 msgid "dB gain:"
 msgstr "dB-Änderung:"
 
-#: alsamixer/mixer_display.c:285
+#: alsamixer/mixer_display.c:291
 #, c-format
 msgid " [%s %s, %s]"
 msgstr " [%s %s; %s]"
 
-#: alsamixer/mixer_display.c:294 alsamixer/mixer_display.c:300
-#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:312
+#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:306
+#: alsamixer/mixer_display.c:312 alsamixer/mixer_display.c:318
 msgid "Off"
 msgstr "Aus"
 
-#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:312
+#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:318
 msgid "On"
 msgstr "An"
 
-#: alsamixer/mixer_display.c:363
+#: alsamixer/mixer_display.c:370
 msgid "The sound device was unplugged."
 msgstr "Das Gerät wurde entfernt."
 
-#: alsamixer/mixer_display.c:364
+#: alsamixer/mixer_display.c:371
 msgid "Press F6 to select another sound card."
 msgstr "Drücken Sie F6, um eine andere Soundkarte auszuwählen."
 
-#: alsamixer/mixer_display.c:379
+#: alsamixer/mixer_display.c:386
 msgid "This sound device does not have any playback controls."
 msgstr "Dieses Gerät hat keine Wiedergabe-Regler."
 
-#: alsamixer/mixer_display.c:381
+#: alsamixer/mixer_display.c:388
 msgid "This sound device does not have any capture controls."
 msgstr "Dieses Gerät hat keine Aufnahme-Regler."
 
-#: alsamixer/mixer_display.c:383
+#: alsamixer/mixer_display.c:390
 msgid "This sound device does not have any controls."
 msgstr "Dieses Gerät hat keine Regler."
 
 #. TRANSLATORS: playback on; one character
-#: alsamixer/mixer_display.c:516 alsamixer/mixer_display.c:521
+#: alsamixer/mixer_display.c:523 alsamixer/mixer_display.c:528
 msgid "O"
 msgstr "O"
 
 #. TRANSLATORS: playback muted; one character
-#: alsamixer/mixer_display.c:518 alsamixer/mixer_display.c:522
+#: alsamixer/mixer_display.c:525 alsamixer/mixer_display.c:529
 msgid "M"
 msgstr "M"
 
 #. TRANSLATORS: "left"; no more than two characters
-#: alsamixer/mixer_display.c:536
+#: alsamixer/mixer_display.c:545
 msgid "L"
 msgstr "L"
 
 #. TRANSLATORS: "right"; no more than two characters
-#: alsamixer/mixer_display.c:540
+#: alsamixer/mixer_display.c:551
 msgid "R"
 msgstr "R"
 
 #. TRANSLATORS: no more than eight characters
-#: alsamixer/mixer_display.c:542
+#: alsamixer/mixer_display.c:555
 msgid "CAPTURE"
 msgstr "AUFNAHME"
 
-#: alsamixer/mixer_display.c:592
+#: alsamixer/mixer_display.c:611
 msgid "Front"
 msgstr "Vorne"
 
-#: alsamixer/mixer_display.c:595
+#: alsamixer/mixer_display.c:614
 msgid "Rear"
 msgstr "Hinten"
 
-#: alsamixer/mixer_display.c:598 speaker-test/speaker-test.c:124
+#: alsamixer/mixer_display.c:617 speaker-test/speaker-test.c:134
 msgid "Center"
 msgstr "Mitte"
 
-#: alsamixer/mixer_display.c:601
+#: alsamixer/mixer_display.c:620
 msgid "Woofer"
 msgstr "Bass"
 
-#: alsamixer/mixer_display.c:604
+#: alsamixer/mixer_display.c:623
 msgid "Side"
 msgstr "Seiten"
 
@@ -352,11 +364,11 @@ msgstr "  Clemens Ladisch <clemens@ladisch.de>"
 msgid "Help"
 msgstr "Hilfe"
 
-#: alsamixer/proc_files.c:103
+#: alsamixer/proc_files.c:56
 msgid "Select File"
 msgstr "Datei wählen"
 
-#: alsamixer/textbox.c:52 alsamixer/textbox.c:66
+#: alsamixer/textbox.c:51 alsamixer/textbox.c:65
 msgid "Error"
 msgstr "Fehler"
 
@@ -365,23 +377,23 @@ msgstr "Fehler"
 msgid "Cannot open file \"%s\"."
 msgstr "Fehler beim Öffnen der Datei \"%s\"."
 
-#: aplay/aplay.c:175
+#: aplay/aplay.c:184
 msgid "raw data"
 msgstr "Rohdaten"
 
-#: aplay/aplay.c:176
+#: aplay/aplay.c:185
 msgid "VOC"
 msgstr "VOC"
 
-#: aplay/aplay.c:178
+#: aplay/aplay.c:187
 msgid "WAVE"
 msgstr "WAVE"
 
-#: aplay/aplay.c:179
+#: aplay/aplay.c:188
 msgid "Sparc Audio"
 msgstr "Sparc-Audio"
 
-#: aplay/aplay.c:200
+#: aplay/aplay.c:209
 #, fuzzy, c-format
 msgid ""
 "Usage: %s [OPTION]... [FILE]...\n"
@@ -395,8 +407,10 @@ msgid ""
 "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
 "-c, --channels=#        channels\n"
 "-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
 "-r, --rate=#            sample rate\n"
 "-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
 "-M, --mmap              mmap stream\n"
 "-N, --nonblock          nonblocking mode\n"
 "-F, --period-time=#     distance between interrupts is # microseconds\n"
@@ -471,12 +485,12 @@ msgstr ""
 "    --process-id-file=# schreibe Prozess-ID in diese Datei\n"
 "    --use-strftime      formatiere Dateiname mit strftime; %%v=Dateinummer\n"
 
-#: aplay/aplay.c:244 speaker-test/speaker-test.c:1021
+#: aplay/aplay.c:255 speaker-test/speaker-test.c:1001
 #, c-format
 msgid "Recognized sample formats are:"
 msgstr "Unterstützte Sample-Formate:"
 
-#: aplay/aplay.c:250
+#: aplay/aplay.c:261
 #, c-format
 msgid ""
 "\n"
@@ -485,126 +499,205 @@ msgstr ""
 "\n"
 "Nicht alle davon sind auf jeder Hardware verfügbar.\n"
 
-#: aplay/aplay.c:251
+#: aplay/aplay.c:262
 #, fuzzy, c-format
 msgid "The available format shortcuts are:\n"
 msgstr "Unterstütze Format-Abkürzungen:\n"
 
-#: aplay/aplay.c:252
+#: aplay/aplay.c:263
 #, c-format
 msgid "-f cd (16 bit little endian, 44100, stereo)\n"
 msgstr "-f cd (16 Bits, Little Endian, 44100 Hz, stereo)\n"
 
-#: aplay/aplay.c:253
+#: aplay/aplay.c:264
 #, c-format
 msgid "-f cdr (16 bit big endian, 44100, stereo)\n"
 msgstr "-f cdr (16 Bits, Big Endian, 44100 Hz, stereo)\n"
 
-#: aplay/aplay.c:254
+#: aplay/aplay.c:265
 #, c-format
 msgid "-f dat (16 bit little endian, 48000, stereo)\n"
 msgstr "-f dat (16 Bits, Little Endian, 48000 Hz, stereo)\n"
 
-#: aplay/aplay.c:268
+#: aplay/aplay.c:279
 msgid "no soundcards found..."
 msgstr "keine Soundkarten gefunden ..."
 
-#: aplay/aplay.c:271
+#: aplay/aplay.c:282
 #, c-format
 msgid "**** List of %s Hardware Devices ****\n"
 msgstr "**** Liste der Hardware-Geräte (%s) ****\n"
 
-#: aplay/aplay.c:300
+#: aplay/aplay.c:311
 #, c-format
 msgid "card %i: %s [%s], device %i: %s [%s]\n"
 msgstr "Karte %i: %s [%s], Gerät %i: %s [%s]\n"
 
-#: aplay/aplay.c:306
+#: aplay/aplay.c:317
 #, c-format
 msgid "  Subdevices: %i/%i\n"
 msgstr "  Sub-Geräte: %i/%i\n"
 
-#: aplay/aplay.c:313
+#: aplay/aplay.c:324
 #, c-format
 msgid "  Subdevice #%i: %s\n"
 msgstr "  Sub-Gerät #%i: %s\n"
 
-#: aplay/aplay.c:394
+#: aplay/aplay.c:405
 #, c-format
 msgid "Aborted by signal %s...\n"
 msgstr "Abbruch durch Signal %s ...\n"
 
-#: aplay/aplay.c:512
+#: aplay/aplay.c:562
 msgid "command should be named either arecord or aplay"
 msgstr "Befehl sollte arecord oder aplay sein"
 
-#: aplay/aplay.c:556
+#: aplay/aplay.c:607
 #, c-format
 msgid "unrecognized file format %s"
 msgstr "unbekanntes Dateiformat %s"
 
-#: aplay/aplay.c:563
+#: aplay/aplay.c:614
+#, fuzzy, c-format
+msgid "invalid channels argument '%s'"
+msgstr "ungültige Sender-Adresse %s\n"
+
+#: aplay/aplay.c:618
 #, c-format
 msgid "value %i for channels is invalid"
 msgstr "Kanalanzahl %i ist ungültig"
 
-#: aplay/aplay.c:582
+#: aplay/aplay.c:638
 #, c-format
 msgid "wrong extended format '%s'"
 msgstr "erweitertes Format '%s' ist ungültig"
 
-#: aplay/aplay.c:593
+#: aplay/aplay.c:650
+#, fuzzy, c-format
+#| msgid "wrong extended format '%s'"
+msgid "wrong extended subformat '%s'"
+msgstr "erweitertes Format '%s' ist ungültig"
+
+#: aplay/aplay.c:657
+#, fuzzy, c-format
+msgid "invalid rate argument '%s'"
+msgstr "ungültige Quell-Adresse %s\n"
+
+#: aplay/aplay.c:664
 #, c-format
 msgid "bad speed value %i"
 msgstr "ungültige Rate %i"
 
-#: aplay/aplay.c:700 speaker-test/speaker-test.c:665
+#: aplay/aplay.c:670
+msgid "duration and samples arguments cannot be used together"
+msgstr ""
+
+#: aplay/aplay.c:675
+#, fuzzy, c-format
+msgid "invalid duration argument '%s'"
+msgstr "ungültige Ziel-Adresse %s\n"
+
+#: aplay/aplay.c:682
+msgid "samples and duration arguments cannot be used together"
+msgstr ""
+
+#: aplay/aplay.c:687
+#, fuzzy, c-format
+msgid "invalid samples argument '%s'"
+msgstr "ungültige Sender-Adresse %s\n"
+
+#: aplay/aplay.c:699
+#, fuzzy, c-format
+msgid "invalid period time argument '%s'"
+msgstr "ungültige Sender-Adresse %s\n"
+
+#: aplay/aplay.c:706
+#, fuzzy, c-format
+msgid "invalid buffer time argument '%s'"
+msgstr "ungültige Quell-Adresse %s\n"
+
+#: aplay/aplay.c:713
+#, fuzzy, c-format
+msgid "invalid period size argument '%s'"
+msgstr "ungültige Sender-Adresse %s\n"
+
+#: aplay/aplay.c:720
+#, fuzzy, c-format
+msgid "invalid buffer size argument '%s'"
+msgstr "ungültige Quell-Adresse %s\n"
+
+#: aplay/aplay.c:727
+#, c-format
+msgid "invalid min available space argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:734
+#, fuzzy, c-format
+msgid "invalid start delay argument '%s'"
+msgstr "ungültige Sender-Adresse %s\n"
+
+#: aplay/aplay.c:741
+#, fuzzy, c-format
+msgid "invalid stop delay argument '%s'"
+msgstr "ungültige Sender-Adresse %s\n"
+
+#: aplay/aplay.c:796
+#, fuzzy, c-format
+msgid "invalid test coef argument '%s'"
+msgstr "ungültige Quell-Adresse %s\n"
+
+#: aplay/aplay.c:808
+#, c-format
+msgid "invalid max file time argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:828 speaker-test/speaker-test.c:616
 #, fuzzy, c-format
 msgid "Unable to parse channel map string: %s\n"
 msgstr "Fehler beim Setzen des Mindest-verfügbar-Wertes: %s\n"
 
-#: aplay/aplay.c:706
+#: aplay/aplay.c:834
 #, c-format
 msgid "Try `%s --help' for more information.\n"
 msgstr "Siehe `%s --help' für mehr Informationen.\n"
 
-#: aplay/aplay.c:722
+#: aplay/aplay.c:850
 #, c-format
 msgid "audio open error: %s"
 msgstr "Fehler beim Öffnen des Gerätes: %s"
 
-#: aplay/aplay.c:727
+#: aplay/aplay.c:855
 #, c-format
 msgid "info error: %s"
 msgstr "Fehler beim Lesen der Geräteinformationen: %s"
 
-#: aplay/aplay.c:734
+#: aplay/aplay.c:862
 #, c-format
 msgid "nonblock setting error: %s"
 msgstr "Fehler beim Setzen des nonblock-Modus: %s"
 
-#: aplay/aplay.c:744 aplay/aplay.c:868 aplay/aplay.c:1158 aplay/aplay.c:1351
-#: aplay/aplay.c:1867 aplay/aplay.c:1897
+#: aplay/aplay.c:880 aplay/aplay.c:1004 aplay/aplay.c:1310 aplay/aplay.c:1526
+#: aplay/aplay.c:2106 aplay/aplay.c:2136
 msgid "not enough memory"
 msgstr "nicht genug Speicher"
 
-#: aplay/aplay.c:768
+#: aplay/aplay.c:904
 #, c-format
 msgid "Cannot create process ID file %s: %s"
 msgstr "Fehler beim Schreiben der Prozess-ID-Datei %s: %s"
 
-#: aplay/aplay.c:858
+#: aplay/aplay.c:994
 #, c-format
 msgid "read error (called from line %i)"
 msgstr "Lesefehler (aufgerufen von Zeile %i)"
 
-#: aplay/aplay.c:925
+#: aplay/aplay.c:1062
 #, c-format
 msgid "unknown length of 'fmt ' chunk (read %u, should be %u at least)"
 msgstr ""
 "unbekannte Länge des 'fmt '-Blocks (gelesen: %u, sollte mindestens %u sein)"
 
-#: aplay/aplay.c:936
+#: aplay/aplay.c:1073
 #, c-format
 msgid ""
 "unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"
@@ -612,244 +705,260 @@ msgstr ""
 "unbekannte Länge des erweiterten 'fmt '-Blocks (gelesen: %u, sollte "
 "mindestens %u sein)"
 
-#: aplay/aplay.c:941
+#: aplay/aplay.c:1078
 msgid "wrong format tag in extensible 'fmt ' chunk"
 msgstr "ungültiger Format-Wert im erweiterten 'fmt '-Block"
 
-#: aplay/aplay.c:948
+#: aplay/aplay.c:1086
 #, c-format
 msgid "can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"
 msgstr ""
 "kann WAVE-Datei-Format 0x%04x nicht abspielen; ist weder PCM noch FLOAT"
 
-#: aplay/aplay.c:953
+#: aplay/aplay.c:1091
 #, c-format
 msgid "can't play WAVE-files with %d tracks"
 msgstr "kann WAVE-Datei mit %d Kanälen nicht abspielen"
 
-#: aplay/aplay.c:961 aplay/aplay.c:1087
+#: aplay/aplay.c:1096
+#, c-format
+msgid "valid bps greater than bps: %d > %d"
+msgstr ""
+
+#: aplay/aplay.c:1103 aplay/aplay.c:1239
 #, c-format
 msgid "Warning: format is changed to U8\n"
 msgstr "Warnung: benutztes Format ist U8\n"
 
-#: aplay/aplay.c:971 aplay/aplay.c:984 aplay/aplay.c:995
+#: aplay/aplay.c:1113 aplay/aplay.c:1126 aplay/aplay.c:1137
 #, fuzzy, c-format
 msgid "Warning: format is changed to %s\n"
 msgstr "Warnung: benutztes Format ist U8\n"
 
-#: aplay/aplay.c:1000
+#: aplay/aplay.c:1142
 #, c-format
 msgid ""
 " can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"
 msgstr ""
 "kann WAVE-Datei mit %d-Bit-Samples in %d Bytes (%d Kanäle) nicht abspielen"
 
-#: aplay/aplay.c:1023
+#: aplay/aplay.c:1175
 #, c-format
 msgid " can't play WAVE-files with sample %d bits wide"
 msgstr "kann WAVE-Datei mit %d-Bit-Samples nicht abspielen"
 
-#: aplay/aplay.c:1081
+#: aplay/aplay.c:1233
 #, c-format
 msgid "Warning: format is changed to MU_LAW\n"
 msgstr "Warnung: benutztes Format ist MU_LAW\n"
 
-#: aplay/aplay.c:1093
+#: aplay/aplay.c:1245
 #, c-format
 msgid "Warning: format is changed to S16_BE\n"
 msgstr "Warnung: benutztes Format ist S16_BE\n"
 
-#: aplay/aplay.c:1106 aplay/aplay.c:2182 aplay/aplay.c:2189 aplay/aplay.c:2715
-#: aplay/aplay.c:2727
+#: aplay/aplay.c:1258 aplay/aplay.c:2427 aplay/aplay.c:2434 aplay/aplay.c:2964
 msgid "read error"
 msgstr "Lesefehler"
 
-#: aplay/aplay.c:1136
+#: aplay/aplay.c:1288
 msgid "Channel numbers don't match between hw_params and channel map"
 msgstr ""
 
-#: aplay/aplay.c:1145
+#: aplay/aplay.c:1297
 #, c-format
 msgid "Warning: unable to get channel map\n"
 msgstr ""
 
-#: aplay/aplay.c:1178
+#: aplay/aplay.c:1331
 #, c-format
-msgid "Channel %d doesn't match with hw_parmas"
+msgid "Channel %d doesn't match with hw_params"
 msgstr ""
 
-#: aplay/aplay.c:1204
+#: aplay/aplay.c:1358
 msgid "Broken configuration for this PCM: no configurations available"
 msgstr ""
 "ungültige Konfiguration für dieses Gerät: keine unterstützte Konfiguration"
 
-#: aplay/aplay.c:1208
+#: aplay/aplay.c:1362
 #, c-format
 msgid "HW Params of device \"%s\":\n"
 msgstr ""
 
-#: aplay/aplay.c:1228
+#: aplay/aplay.c:1382
 msgid "Access type not available"
 msgstr "Zugriffs-Modus nicht unterstützt"
 
-#: aplay/aplay.c:1233
+#: aplay/aplay.c:1387
 msgid "Sample format non available"
 msgstr "Sample-Format nicht unterstützt"
 
-#: aplay/aplay.c:1239
+#: aplay/aplay.c:1393
+#, fuzzy
+#| msgid "Sample format non available"
+msgid "Sample subformat not available"
+msgstr "Sample-Format nicht unterstützt"
+
+#: aplay/aplay.c:1398
 msgid "Channels count non available"
 msgstr "Kanalanzahl nicht unterstützt"
 
-#: aplay/aplay.c:1254
+#: aplay/aplay.c:1413
 #, c-format
 msgid "Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"
 msgstr ""
 "Warnung: Rate ist nicht exakt (angefordert: %i Hz, unterstützt: %i Hz)\n"
 
-#: aplay/aplay.c:1260
+#: aplay/aplay.c:1419
 #, c-format
 msgid "         please, try the plug plugin %s\n"
 msgstr "         probieren Sie bitte das plug-Plugin: %s\n"
 
-#: aplay/aplay.c:1297
+#: aplay/aplay.c:1456
 msgid "Unable to install hw params:"
 msgstr "Fehler beim Setzen der Hardware-Parameter:"
 
-#: aplay/aplay.c:1304
+#: aplay/aplay.c:1463
 #, c-format
 msgid "Can't use period equal to buffer size (%lu == %lu)"
 msgstr "Periode gleich der Puffer-Größe wird nicht unterstützt (%lu == %lu)"
 
-#: aplay/aplay.c:1335
+#: aplay/aplay.c:1469
+#, fuzzy
+#| msgid "unable to install sw params:"
+msgid "Unable to get current sw params."
+msgstr "Fehler beim Setzen der Software-Parameter:"
+
+#: aplay/aplay.c:1509
 msgid "unable to install sw params:"
 msgstr "Fehler beim Setzen der Software-Parameter:"
 
-#: aplay/aplay.c:1369
+#: aplay/aplay.c:1544
 #, c-format
 msgid "snd_pcm_mmap_begin problem: %s"
 msgstr "Fehler bei snd_pcm_mmap_begin: %s"
 
-#: aplay/aplay.c:1398
+#: aplay/aplay.c:1573
 #, c-format
 msgid "stdin O_NONBLOCK flag setup failed\n"
 msgstr "Fehler beim Setzen von O_NONBLOCK in stdin\n"
 
-#: aplay/aplay.c:1422
+#: aplay/aplay.c:1610
 #, c-format
 msgid "\rPAUSE command ignored (no hw support)\n"
 msgstr "\rPause-Kommando ignoriert (keine HW-Unterstützung)\n"
 
-#: aplay/aplay.c:1427
+#: aplay/aplay.c:1618
 #, c-format
 msgid "pause push error: %s"
 msgstr "Fehler beim Pausieren: %s"
 
-#: aplay/aplay.c:1436
+#: aplay/aplay.c:1629
 #, c-format
 msgid "pause release error: %s"
 msgstr "Fehler beim Beenden der Pause: %s"
 
-#: aplay/aplay.c:1452
+#: aplay/aplay.c:1645
 #, c-format
 msgid ""
 "\r=== PAUSE ===                                                            "
 msgstr ""
 "\r=== PAUSE ===                                                            "
 
-#: aplay/aplay.c:1494
+#: aplay/aplay.c:1687
 #, c-format
 msgid "status error: %s"
 msgstr "Status-Fehler: %s"
 
-#: aplay/aplay.c:1499
-#, fuzzy, c-format
-msgid "fatal %s: %s"
-msgstr "%s: %s\n"
+#: aplay/aplay.c:1697 aplay/aplay.c:1708
+#, c-format
+msgid "%s!!! (at least %.3f ms long)\n"
+msgstr "%s!!! (mindestens %.3f ms)\n"
 
-#: aplay/aplay.c:1500 aplay/aplay.c:1511 aplay/aplay.c:1514 aplay/aplay.c:1522
+#: aplay/aplay.c:1698 aplay/aplay.c:1701 aplay/aplay.c:1709 aplay/aplay.c:1718
 msgid "underrun"
 msgstr "Unterlauf"
 
-#: aplay/aplay.c:1500 aplay/aplay.c:1511 aplay/aplay.c:1522
+#: aplay/aplay.c:1698 aplay/aplay.c:1709 aplay/aplay.c:1718
 msgid "overrun"
 msgstr "Überlauf"
 
-#: aplay/aplay.c:1510 aplay/aplay.c:1521
-#, c-format
-msgid "%s!!! (at least %.3f ms long)\n"
-msgstr "%s!!! (mindestens %.3f ms)\n"
-
-#: aplay/aplay.c:1526
+#: aplay/aplay.c:1713
 #, c-format
 msgid "Status:\n"
 msgstr "Status:\n"
 
-#: aplay/aplay.c:1530
+#: aplay/aplay.c:1717
+#, fuzzy, c-format
+msgid "fatal %s: %s"
+msgstr "%s: %s\n"
+
+#: aplay/aplay.c:1723
 #, c-format
 msgid "xrun: prepare error: %s"
 msgstr "Unter-/Überlauf: Fehler beim Re-Initialisieren des Gerätes: %s"
 
-#: aplay/aplay.c:1536
+#: aplay/aplay.c:1730
 #, c-format
 msgid "Status(DRAINING):\n"
 msgstr "Status (DRAINING):\n"
 
-#: aplay/aplay.c:1540
+#: aplay/aplay.c:1734
 #, c-format
 msgid "capture stream format change? attempting recover...\n"
 msgstr "Format-Wechsel der Aufnahme-Daten? Versuche Wiederherstellung ...\n"
 
-#: aplay/aplay.c:1542
+#: aplay/aplay.c:1736
 #, c-format
 msgid "xrun(DRAINING): prepare error: %s"
 msgstr "XRUN (DRAINING): Fehler beim Re-Initialisieren des Gerätes: %s"
 
-#: aplay/aplay.c:1549
+#: aplay/aplay.c:1743
 #, c-format
 msgid "Status(R/W):\n"
 msgstr "Status (R/W):\n"
 
-#: aplay/aplay.c:1552
+#: aplay/aplay.c:1746
 #, c-format
 msgid "read/write error, state = %s"
 msgstr "Lese-/Schreibfehler, Status = %s"
 
-#: aplay/aplay.c:1562
+#: aplay/aplay.c:1756
 #, c-format
 msgid "Suspended. Trying resume. "
 msgstr "Ruhezustand. Versuche, aufzuwecken. "
 
-#: aplay/aplay.c:1567
+#: aplay/aplay.c:1762
 #, c-format
 msgid "Failed. Restarting stream. "
 msgstr "Fehlgeschlagen. Re-Initialisierung. "
 
-#: aplay/aplay.c:1569
+#: aplay/aplay.c:1765
 #, c-format
 msgid "suspend: prepare error: %s"
 msgstr "Ruhezustand: Fehler beim Re-Initialisieren: %s"
 
-#: aplay/aplay.c:1574
+#: aplay/aplay.c:1770
 #, c-format
 msgid "Done.\n"
 msgstr "Fertig.\n"
 
-#: aplay/aplay.c:1596
+#: aplay/aplay.c:1792
 #, c-format
 msgid " !clip  "
 msgstr " !clip  "
 
-#: aplay/aplay.c:1743
+#: aplay/aplay.c:1944
 #, c-format
 msgid "Unsupported bit size %d.\n"
 msgstr "%d-Bit-Samples werden nicht unterstützt.\n"
 
-#: aplay/aplay.c:1777
+#: aplay/aplay.c:1980
 #, c-format
 msgid "Max peak (%li samples): 0x%08x "
 msgstr "Höchstwert (%li Samples): 0x%08x "
 
-#: aplay/aplay.c:1811
+#: aplay/aplay.c:2021
 #, c-format
 msgid ""
 "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer = "
@@ -858,649 +967,724 @@ msgstr ""
 "verdächtige Puffer-Position (total %li): avail = %li, delay = %li, buffer = "
 "%li\n"
 
-#: aplay/aplay.c:1939
+#: aplay/aplay.c:2030
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position (%li total): avail = %li, delay = %li, "
+"buffer = %li\n"
+msgstr ""
+"verdächtige Puffer-Position (total %li): avail = %li, delay = %li, buffer = "
+"%li\n"
+
+#: aplay/aplay.c:2034
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious buffer position avail > delay (%li total): avail = %li, delay = "
+"%li\n"
+msgstr ""
+"verdächtige Puffer-Position (total %li): avail = %li, delay = %li, buffer = "
+"%li\n"
+
+#: aplay/aplay.c:2038
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position avail > delay (%li total): avail = %li, "
+"delay = %li\n"
+msgstr ""
+"verdächtige Puffer-Position (total %li): avail = %li, delay = %li, buffer = "
+"%li\n"
+
+#: aplay/aplay.c:2081
+#, c-format
+msgid "Status(R/W) (standalone avail=%li delay=%li):\n"
+msgstr ""
+
+#: aplay/aplay.c:2178
 #, c-format
 msgid "write error: %s"
 msgstr "Schreibfehler: %s"
 
-#: aplay/aplay.c:1987
+#: aplay/aplay.c:2226
 #, c-format
 msgid "writev error: %s"
 msgstr "Vektor-Schreib-Fehler: %s"
 
-#: aplay/aplay.c:2031
+#: aplay/aplay.c:2272
 #, c-format
 msgid "read error: %s"
 msgstr "Lesefehler: %s"
 
-#: aplay/aplay.c:2075
+#: aplay/aplay.c:2319
 #, c-format
 msgid "readv error: %s"
 msgstr "Vektor-Lese-Fehler: %s"
 
-#: aplay/aplay.c:2123
+#: aplay/aplay.c:2368
 msgid "can't allocate buffer for silence"
 msgstr "nicht genug Speicher für Stille-Block"
 
-#: aplay/aplay.c:2132 aplay/aplay.c:2360 aplay/aplay.c:2365 aplay/aplay.c:2412
-#: aplay/aplay.c:2421 aplay/aplay.c:2428 aplay/aplay.c:2438 aplay/aplay.c:2444
-#: aplay/aplay.c:2516 aplay/aplay.c:2546 aplay/aplay.c:2560
+#: aplay/aplay.c:2377 aplay/aplay.c:2606 aplay/aplay.c:2611 aplay/aplay.c:2663
+#: aplay/aplay.c:2672 aplay/aplay.c:2679 aplay/aplay.c:2689 aplay/aplay.c:2695
+#: aplay/aplay.c:2767 aplay/aplay.c:2797 aplay/aplay.c:2811
 msgid "write error"
 msgstr "Schreibfehler"
 
-#: aplay/aplay.c:2145
+#: aplay/aplay.c:2390
 #, c-format
 msgid "voc_pcm_flush - silence error"
 msgstr "voc_pcm_flush - Fehler in set_silence"
 
-#: aplay/aplay.c:2148
+#: aplay/aplay.c:2393
 msgid "voc_pcm_flush error"
 msgstr "Schreibfehler"
 
-#: aplay/aplay.c:2173
+#: aplay/aplay.c:2418
 msgid "malloc error"
 msgstr "nicht genug Speicher"
 
-#: aplay/aplay.c:2177
+#: aplay/aplay.c:2422
 #, c-format
 msgid "Playing Creative Labs Channel file '%s'...\n"
 msgstr "Spiele Creative Labs Channel-Datei '%s'...\n"
 
-#: aplay/aplay.c:2245 aplay/aplay.c:2340
+#: aplay/aplay.c:2491 aplay/aplay.c:2586
 msgid "can't play packed .voc files"
 msgstr "kann komprimierte .voc-Dateien nicht abspielen"
 
-#: aplay/aplay.c:2300
+#: aplay/aplay.c:2546
 #, c-format
 msgid "can't play loops; %s isn't seekable\n"
 msgstr ""
 "kann Schleife nicht abspielen; Dateiposition in %s ist nicht änderbar\n"
 
-#: aplay/aplay.c:2349
+#: aplay/aplay.c:2595
 #, c-format
 msgid "unknown blocktype %d. terminate."
 msgstr "Unbekannter Block-Typ %d. Abbruch."
 
-#: aplay/aplay.c:2480
+#: aplay/aplay.c:2731
 #, c-format
 msgid "Wave doesn't support %s format..."
 msgstr "Format %s wird in WAVE nicht unterstützt ..."
 
-#: aplay/aplay.c:2540
+#: aplay/aplay.c:2791
 #, c-format
 msgid "Sparc Audio doesn't support %s format..."
 msgstr "Format %s wird in Sparc-Audio nicht unterstützt ..."
 
-#: aplay/aplay.c:2621
+#: aplay/aplay.c:2866
 msgid "Playing"
 msgstr "Wiedergabe:"
 
-#: aplay/aplay.c:2621
+#: aplay/aplay.c:2866
 msgid "Recording"
 msgstr "Aufnahme:"
 
-#: aplay/aplay.c:2625
+#: aplay/aplay.c:2870
 #, c-format
 msgid "Rate %d Hz, "
 msgstr "Rate: %d Hz, "
 
-#: aplay/aplay.c:2627
+#: aplay/aplay.c:2872
 #, c-format
 msgid "Mono"
 msgstr "mono"
 
-#: aplay/aplay.c:2629
+#: aplay/aplay.c:2874
 #, c-format
 msgid "Stereo"
 msgstr "stereo"
 
-#: aplay/aplay.c:2631
+#: aplay/aplay.c:2876
 #, c-format
 msgid "Channels %i"
 msgstr "%i Kanäle"
 
-#: aplay/aplay.c:3145 aplay/aplay.c:3198
+#: aplay/aplay.c:3483
+#, fuzzy, c-format
+#| msgid "You need to specify %d files"
+msgid "You need to specify %u files"
+msgstr "Es werden %d Dateien benötigt."
+
+#: aplay/aplay.c:3536
 #, c-format
 msgid "You need to specify %d files"
 msgstr "Es werden %d Dateien benötigt."
 
-#: seq/aconnect/aconnect.c:49
+#: seq/aconnect/aconnect.c:56
 #, c-format
 msgid "aconnect - ALSA sequencer connection manager\n"
 msgstr "aconnect - ALSA Sequenzer Verbindungs-Manager\n"
 
-#: seq/aconnect/aconnect.c:50
+#: seq/aconnect/aconnect.c:57
 #, c-format
 msgid "Copyright (C) 1999-2000 Takashi Iwai\n"
 msgstr "Copyright © 1999-2000 Takashi Iwai\n"
 
-#: seq/aconnect/aconnect.c:51
+#: seq/aconnect/aconnect.c:58
 #, c-format
 msgid "Usage:\n"
 msgstr "Verwendung:\n"
 
-#: seq/aconnect/aconnect.c:52
+#: seq/aconnect/aconnect.c:59
 #, c-format
 msgid " * Connection/disconnection between two ports\n"
 msgstr " * Verbindung zwischen zwei Ports herstellen/trennen\n"
 
-#: seq/aconnect/aconnect.c:53
+#: seq/aconnect/aconnect.c:60
 #, c-format
 msgid "   aconnect [-options] sender receiver\n"
 msgstr "   aconnect [Optionen] Sender Empfänger\n"
 
-#: seq/aconnect/aconnect.c:54
+#: seq/aconnect/aconnect.c:61
 #, c-format
 msgid "     sender, receiver = client:port pair\n"
 msgstr "     Sender, Empfänger = Client:Port\n"
 
-#: seq/aconnect/aconnect.c:55
+#: seq/aconnect/aconnect.c:62
 #, c-format
 msgid "     -d,--disconnect     disconnect\n"
 msgstr "     -d,--disconnect     Verbindung trennen\n"
 
-#: seq/aconnect/aconnect.c:56
+#: seq/aconnect/aconnect.c:63
 #, c-format
 msgid "     -e,--exclusive      exclusive connection\n"
 msgstr "     -e,--exclusive      exklusive Verbindung\n"
 
-#: seq/aconnect/aconnect.c:57
+#: seq/aconnect/aconnect.c:64
 #, c-format
 msgid "     -r,--real #         convert real-time-stamp on queue\n"
 msgstr "     -r,--real #         benutze Zeitstempel der Queue #\n"
 
-#: seq/aconnect/aconnect.c:58
+#: seq/aconnect/aconnect.c:65
 #, c-format
 msgid "     -t,--tick #         convert tick-time-stamp on queue\n"
 msgstr "     -t,--tick #         benutze Tick-Zeitstempel der Queue #\n"
 
-#: seq/aconnect/aconnect.c:59
+#: seq/aconnect/aconnect.c:66
 #, c-format
 msgid " * List connected ports (no subscription action)\n"
 msgstr " * Ports und Verbindungen auflisten\n"
 
-#: seq/aconnect/aconnect.c:60
+#: seq/aconnect/aconnect.c:67
 #, c-format
 msgid "   aconnect -i|-o [-options]\n"
 msgstr "   aconnect -i|-o [Optionen]\n"
 
-#: seq/aconnect/aconnect.c:61
+#: seq/aconnect/aconnect.c:68
 #, c-format
 msgid "     -i,--input          list input (readable) ports\n"
 msgstr "     -i,--input          Eingabe-Ports (lesbar) auflisten\n"
 
-#: seq/aconnect/aconnect.c:62
+#: seq/aconnect/aconnect.c:69
 #, c-format
 msgid "     -o,--output         list output (writable) ports\n"
 msgstr "     -o,--output         Ausgabe-Ports (schreibbar) auflisten\n"
 
-#: seq/aconnect/aconnect.c:63
+#: seq/aconnect/aconnect.c:71
+#, fuzzy, c-format
+#| msgid "     -i,--input          list input (readable) ports\n"
+msgid "     -a,--all            show inactive ports, too\n"
+msgstr "     -i,--input          Eingabe-Ports (lesbar) auflisten\n"
+
+#: seq/aconnect/aconnect.c:73
 #, c-format
 msgid "     -l,--list           list current connections of each port\n"
 msgstr "     -l,--list           Verbindungen der Ports auflisten\n"
 
-#: seq/aconnect/aconnect.c:64
+#: seq/aconnect/aconnect.c:74
 #, c-format
 msgid " * Remove all exported connections\n"
 msgstr " * alle Verbindungen trennen\n"
 
-#: seq/aconnect/aconnect.c:65
+#: seq/aconnect/aconnect.c:75
 #, c-format
 msgid "     -x, --removeall\n"
 msgstr "     -x,--removeall\n"
 
-#: seq/aconnect/aconnect.c:132
+#: seq/aconnect/aconnect.c:155
 msgid "Connecting To"
 msgstr "verbunden zu"
 
-#: seq/aconnect/aconnect.c:133
+#: seq/aconnect/aconnect.c:156
 msgid "Connected From"
 msgstr "verbunden von"
 
-#: seq/aconnect/aconnect.c:169
-#, c-format
-msgid "client %d: '%s' [type=%s]\n"
+#: seq/aconnect/aconnect.c:203
+#, fuzzy, c-format
+msgid "client %d: '%s' [type=%s"
 msgstr "Client %d: '%s' [Typ=%s]\n"
 
-#: seq/aconnect/aconnect.c:173
+#: seq/aconnect/aconnect.c:207
 msgid "user"
 msgstr "User"
 
-#: seq/aconnect/aconnect.c:173
+#: seq/aconnect/aconnect.c:207
 msgid "kernel"
 msgstr "Kernel"
 
-#: seq/aconnect/aconnect.c:308
+#: seq/aconnect/aconnect.c:385
 #, c-format
 msgid "can't open sequencer\n"
 msgstr "Fehler beim Öffnen des Sequenzers\n"
 
-#: seq/aconnect/aconnect.c:336
+#: seq/aconnect/aconnect.c:413
 #, c-format
 msgid "can't get client id\n"
 msgstr "Fehler beim Lesen der Client-ID\n"
 
-#: seq/aconnect/aconnect.c:343
+#: seq/aconnect/aconnect.c:420
 #, c-format
 msgid "can't set client info\n"
 msgstr "Fehler beim Setzen des Client-Namens\n"
 
-#: seq/aconnect/aconnect.c:350
+#: seq/aconnect/aconnect.c:427
 #, c-format
 msgid "invalid sender address %s\n"
 msgstr "ungültige Sender-Adresse %s\n"
 
-#: seq/aconnect/aconnect.c:355 seq/aseqnet/aseqnet.c:290
+#: seq/aconnect/aconnect.c:432 seq/aseqnet/aseqnet.c:303
 #, c-format
 msgid "invalid destination address %s\n"
 msgstr "ungültige Ziel-Adresse %s\n"
 
-#: seq/aconnect/aconnect.c:369
+#: seq/aconnect/aconnect.c:446
 #, c-format
 msgid "No subscription is found\n"
 msgstr "keine Verbindung gefunden\n"
 
-#: seq/aconnect/aconnect.c:374
+#: seq/aconnect/aconnect.c:451
 #, c-format
 msgid "Disconnection failed (%s)\n"
 msgstr "Verbindungs-Trennung fehlgeschlagen (%s)\n"
 
-#: seq/aconnect/aconnect.c:380
+#: seq/aconnect/aconnect.c:457
 #, c-format
 msgid "Connection is already subscribed\n"
 msgstr "Verbindung ist bereits vorhanden\n"
 
-#: seq/aconnect/aconnect.c:385
+#: seq/aconnect/aconnect.c:462
 #, c-format
 msgid "Connection failed (%s)\n"
 msgstr "Verbindung fehlgeschlagen (%s)\n"
 
-#: seq/aseqnet/aseqnet.c:164
+#: seq/aseqnet/aseqnet.c:171
 #, c-format
 msgid "aseqnet - network client/server on ALSA sequencer\n"
 msgstr "aseqnet - Netzwerk-Client/Server für ALSA Sequenzer\n"
 
-#: seq/aseqnet/aseqnet.c:165
+#: seq/aseqnet/aseqnet.c:172
 #, c-format
 msgid "  Copyright (C) 1999 Takashi Iwai\n"
 msgstr "  Copyright © 1999 Takashi Iwai\n"
 
-#: seq/aseqnet/aseqnet.c:166
+#: seq/aseqnet/aseqnet.c:173
 #, c-format
 msgid "usage:\n"
 msgstr "Verwendung:\n"
 
-#: seq/aseqnet/aseqnet.c:167
+#: seq/aseqnet/aseqnet.c:174
 #, c-format
 msgid "  server mode: aseqnet [-options]\n"
 msgstr "  Server-Modus: aseqnet [Optionen]\n"
 
-#: seq/aseqnet/aseqnet.c:168
+#: seq/aseqnet/aseqnet.c:175
 #, c-format
 msgid "  client mode: aseqnet [-options] server_host\n"
 msgstr "  Client-Modus: aseqnet [Optionen] ServerHost\n"
 
-#: seq/aseqnet/aseqnet.c:169
+#: seq/aseqnet/aseqnet.c:176
 #, c-format
 msgid "options:\n"
 msgstr "Optionen:\n"
 
-#: seq/aseqnet/aseqnet.c:170
+#: seq/aseqnet/aseqnet.c:177
+#, c-format
+msgid "  -6,--ipv6 : use IPv6 TCP protocol\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:178
 #, fuzzy, c-format
 msgid "  -p,--port # : specify TCP port (digit or service name)\n"
 msgstr "  -p,--port # : TCP-Port (Zahl oder Service-Name)\n"
 
-#: seq/aseqnet/aseqnet.c:171
+#: seq/aseqnet/aseqnet.c:179
 #, c-format
 msgid "  -s,--source addr : read from given addr (client:port)\n"
 msgstr "  -s,--source # : lese von Sequenzer-Port (Client:Port)\n"
 
-#: seq/aseqnet/aseqnet.c:172
+#: seq/aseqnet/aseqnet.c:180
 #, c-format
 msgid "  -d,--dest addr : write to given addr (client:port)\n"
 msgstr "  -d,--dest # : schreibe auf Sequenzer-Port (Client:Port)\n"
 
-#: seq/aseqnet/aseqnet.c:173
+#: seq/aseqnet/aseqnet.c:181
+#, c-format
+msgid "  -n,--name value : use a specific midi process name\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:182
 #, c-format
 msgid "  -v, --verbose : print verbose messages\n"
 msgstr "  -v,--verbose : ausführliche Meldungen\n"
 
-#: seq/aseqnet/aseqnet.c:174
+#: seq/aseqnet/aseqnet.c:183
 #, c-format
 msgid "  -i, --info : print certain received events\n"
 msgstr "  -i,--info : Ausgabe bestimmter empfangener Ereignisse\n"
 
-#: seq/aseqnet/aseqnet.c:188
+#: seq/aseqnet/aseqnet.c:197
 #, c-format
 msgid "can't malloc\n"
 msgstr "nicht genug Speicher\n"
 
-#: seq/aseqnet/aseqnet.c:213
+#: seq/aseqnet/aseqnet.c:222
 #, c-format
 msgid "closing files..\n"
 msgstr "schließe Dateien ...\n"
 
-#: seq/aseqnet/aseqnet.c:272
+#: seq/aseqnet/aseqnet.c:285
 #, c-format
 msgid "sequencer opened: %d:%d\n"
 msgstr "Sequenzer geöffnet: %d:%d\n"
 
-#: seq/aseqnet/aseqnet.c:279
+#: seq/aseqnet/aseqnet.c:292
 #, c-format
 msgid "invalid source address %s\n"
 msgstr "ungültige Quell-Adresse %s\n"
 
-#: seq/aseqnet/aseqnet.c:309
-#, c-format
-msgid "service '%s' is not found in /etc/services\n"
-msgstr "Service '%s' in /etc/services nicht gefunden\n"
+#: seq/aseqnet/aseqnet.c:362
+#, fuzzy, c-format
+#| msgid "can't get address %s\n"
+msgid "can't get address\n"
+msgstr "kann Adresse für %s nicht bestimmen\n"
+
+#: seq/aseqnet/aseqnet.c:376 seq/aseqnet/aseqnet.c:461
+#, fuzzy, c-format
+#| msgid "Connecting To"
+msgid "connecting to: %s\n"
+msgstr "verbunden zu"
 
-#: seq/aseqnet/aseqnet.c:377
+#: seq/aseqnet/aseqnet.c:414
 #, c-format
 msgid "too many connections!\n"
 msgstr "zu viele Verbindungen\n"
 
-#: seq/aseqnet/aseqnet.c:388
+#: seq/aseqnet/aseqnet.c:425
 #, c-format
 msgid "accepted[%d]\n"
 msgstr "angenommen[%d]\n"
 
-#: seq/aseqnet/aseqnet.c:411
+#: seq/aseqnet/aseqnet.c:447
 #, c-format
 msgid "can't get address %s\n"
 msgstr "kann Adresse für %s nicht bestimmen\n"
 
-#: seq/aseqnet/aseqnet.c:422
+#: seq/aseqnet/aseqnet.c:475
 #, c-format
 msgid "ok.. connected\n"
 msgstr "OK ... verbunden\n"
 
-#: seq/aseqnet/aseqnet.c:518
+#: seq/aseqnet/aseqnet.c:574
 #, c-format
 msgid "Channel %2d: Control event : %5d\n"
 msgstr "Channel %2d: Control event : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:522
+#: seq/aseqnet/aseqnet.c:578
 #, c-format
 msgid "Channel %2d: Pitchbender   : %5d\n"
 msgstr "Channel %2d: Pitchbender   : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:526
+#: seq/aseqnet/aseqnet.c:582
 #, c-format
 msgid "Channel %2d: Note On event : %5d\n"
 msgstr "Channel %2d: Note On evenet : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:530
+#: seq/aseqnet/aseqnet.c:586
 #, c-format
 msgid "Channel %2d: Note Off event: %5d\n"
 msgstr "Channel %2d: Note Off event: %5d\n"
 
-#: seq/aseqnet/aseqnet.c:585
+#: seq/aseqnet/aseqnet.c:641
 #, c-format
 msgid "disconnected\n"
 msgstr "Verbindung getrennt\n"
 
-#: speaker-test/speaker-test.c:120
+#: speaker-test/speaker-test.c:130
 msgid "Front Left"
 msgstr "Vorne links"
 
-#: speaker-test/speaker-test.c:121
+#: speaker-test/speaker-test.c:131
 msgid "Front Right"
 msgstr "Vorne rechts"
 
-#: speaker-test/speaker-test.c:122
+#: speaker-test/speaker-test.c:132
 msgid "Rear Left"
 msgstr "Hinten links"
 
-#: speaker-test/speaker-test.c:123
+#: speaker-test/speaker-test.c:133
 msgid "Rear Right"
 msgstr "Hinten rechts"
 
-#: speaker-test/speaker-test.c:125
+#: speaker-test/speaker-test.c:135
 msgid "LFE"
 msgstr "Bass"
 
-#: speaker-test/speaker-test.c:126
+#: speaker-test/speaker-test.c:136
 msgid "Side Left"
 msgstr "Seitlich links"
 
-#: speaker-test/speaker-test.c:127
+#: speaker-test/speaker-test.c:137
 msgid "Side Right"
 msgstr "Seitlich rechts"
 
-#: speaker-test/speaker-test.c:128
+#: speaker-test/speaker-test.c:138
 msgid "Channel 9"
 msgstr "Kanal 9"
 
-#: speaker-test/speaker-test.c:129
+#: speaker-test/speaker-test.c:139
 msgid "Channel 10"
 msgstr "Kanal 10"
 
-#: speaker-test/speaker-test.c:130
+#: speaker-test/speaker-test.c:140
 msgid "Channel 11"
 msgstr "Kanal 11"
 
-#: speaker-test/speaker-test.c:131
+#: speaker-test/speaker-test.c:141
 msgid "Channel 12"
 msgstr "Kanal 12"
 
-#: speaker-test/speaker-test.c:132
+#: speaker-test/speaker-test.c:142
 msgid "Channel 13"
 msgstr "Kanal 13"
 
-#: speaker-test/speaker-test.c:133
+#: speaker-test/speaker-test.c:143
 msgid "Channel 14"
 msgstr "Kanal 14"
 
-#: speaker-test/speaker-test.c:134
+#: speaker-test/speaker-test.c:144
 msgid "Channel 15"
 msgstr "Kanal 15"
 
-#: speaker-test/speaker-test.c:135
+#: speaker-test/speaker-test.c:145
 msgid "Channel 16"
 msgstr "Kanal 16"
 
-#: speaker-test/speaker-test.c:518
+#: speaker-test/speaker-test.c:465
 #, c-format
 msgid "Broken configuration for playback: no configurations available: %s\n"
 msgstr "Ungültige Konfiguration: keine unterstützte Konfiguration: %s\n"
 
-#: speaker-test/speaker-test.c:525
+#: speaker-test/speaker-test.c:472
 #, c-format
 msgid "Access type not available for playback: %s\n"
 msgstr "Zugriffsmodus nicht unterstützt: %s\n"
 
-#: speaker-test/speaker-test.c:532
+#: speaker-test/speaker-test.c:479
 #, c-format
 msgid "Sample format not available for playback: %s\n"
 msgstr "Sample-Format nicht unterstützt: %s\n"
 
-#: speaker-test/speaker-test.c:539
+#: speaker-test/speaker-test.c:486
 #, c-format
 msgid "Channels count (%i) not available for playbacks: %s\n"
 msgstr "Kanal-Anzahl %i nicht unterstützt: %s\n"
 
-#: speaker-test/speaker-test.c:547
+#: speaker-test/speaker-test.c:494
 #, c-format
 msgid "Rate %iHz not available for playback: %s\n"
 msgstr "Rate %i Hz nicht unterstützt: %s\n"
 
-#: speaker-test/speaker-test.c:552
+#: speaker-test/speaker-test.c:499
 #, c-format
 msgid "Rate doesn't match (requested %iHz, get %iHz, err %d)\n"
 msgstr ""
 "Rate ist nicht exakt (angefordert: %i Hz, unterstützt: %i Hz, Fehlercode "
 "%d)\n"
 
-#: speaker-test/speaker-test.c:556
+#: speaker-test/speaker-test.c:503
 #, c-format
 msgid "Rate set to %iHz (requested %iHz)\n"
 msgstr "Rate ist %i Hz (angefordert: %i Hz)\n"
 
-#: speaker-test/speaker-test.c:562
+#: speaker-test/speaker-test.c:509
 #, c-format
 msgid "Buffer size range from %lu to %lu\n"
 msgstr "Puffergröße von %lu bis %lu\n"
 
-#: speaker-test/speaker-test.c:563
+#: speaker-test/speaker-test.c:510
 #, c-format
 msgid "Period size range from %lu to %lu\n"
 msgstr "Periodengröße von %lu bis %lu\n"
 
-#: speaker-test/speaker-test.c:565
+#: speaker-test/speaker-test.c:514
 #, c-format
 msgid "Requested period time %u us\n"
 msgstr "Angeforderte Periodenzeit %u µs\n"
 
-#: speaker-test/speaker-test.c:568
+#: speaker-test/speaker-test.c:519
 #, c-format
 msgid "Unable to set period time %u us for playback: %s\n"
 msgstr "Fehler beim Setzen der Periodenzeit %u µs: %s\n"
 
-#: speaker-test/speaker-test.c:574
+#: speaker-test/speaker-test.c:525
 #, c-format
 msgid "Requested buffer time %u us\n"
 msgstr "Angeforderte Pufferlänge %u µs\n"
 
-#: speaker-test/speaker-test.c:577
+#: speaker-test/speaker-test.c:528
 #, c-format
 msgid "Unable to set buffer time %u us for playback: %s\n"
 msgstr "Fehler beim Setzen der Pufferlänge %u µs: %s\n"
 
-#: speaker-test/speaker-test.c:586
+#: speaker-test/speaker-test.c:537
 #, c-format
 msgid "Using max buffer size %lu\n"
 msgstr "Verwende maximale Puffergröße %lu\n"
 
-#: speaker-test/speaker-test.c:589
+#: speaker-test/speaker-test.c:540
 #, c-format
 msgid "Unable to set buffer size %lu for playback: %s\n"
 msgstr "Fehler beim Setzen der Puffergröße %lu: %s\n"
 
-#: speaker-test/speaker-test.c:595
+#: speaker-test/speaker-test.c:546
 #, c-format
 msgid "Periods = %u\n"
 msgstr "Perioden = %u\n"
 
-#: speaker-test/speaker-test.c:598
+#: speaker-test/speaker-test.c:549
 #, c-format
 msgid "Unable to set nperiods %u for playback: %s\n"
 msgstr "Fehler beim Setzen der Periodenanzahl %u: %s\n"
 
-#: speaker-test/speaker-test.c:607
+#: speaker-test/speaker-test.c:558
 #, c-format
 msgid "Unable to set hw params for playback: %s\n"
 msgstr "Fehler beim Setzen der Hardware-Parameter: %s\n"
 
-#: speaker-test/speaker-test.c:613
+#: speaker-test/speaker-test.c:564
 #, c-format
 msgid "was set period_size = %lu\n"
 msgstr "gesetzt: period_size = %lu\n"
 
-#: speaker-test/speaker-test.c:614
+#: speaker-test/speaker-test.c:565
 #, c-format
 msgid "was set buffer_size = %lu\n"
 msgstr "gesetzt: buffer_size = %lu\n"
 
-#: speaker-test/speaker-test.c:616
+#: speaker-test/speaker-test.c:567
 #, c-format
 msgid "buffer to small, could not use\n"
 msgstr "Puffer zu klein, kann nicht benutzt werden\n"
 
-#: speaker-test/speaker-test.c:629
+#: speaker-test/speaker-test.c:580
 #, c-format
 msgid "Unable to determine current swparams for playback: %s\n"
 msgstr "Fehler beim Lesen der Software-Parameter: %s\n"
 
-#: speaker-test/speaker-test.c:636
+#: speaker-test/speaker-test.c:587
 #, c-format
 msgid "Unable to set start threshold mode for playback: %s\n"
 msgstr "Fehler beim Setzen des Start-Schwellenwertes: %s\n"
 
-#: speaker-test/speaker-test.c:643
+#: speaker-test/speaker-test.c:594
 #, c-format
 msgid "Unable to set avail min for playback: %s\n"
 msgstr "Fehler beim Setzen des Mindest-verfügbar-Wertes: %s\n"
 
-#: speaker-test/speaker-test.c:650
+#: speaker-test/speaker-test.c:601
 #, c-format
 msgid "Unable to set sw params for playback: %s\n"
 msgstr "Fehler beim Setzen der Software-Parameter: %s\n"
 
-#: speaker-test/speaker-test.c:670
+#: speaker-test/speaker-test.c:621
 #, fuzzy, c-format
 msgid "Unable to set channel map: %s\n"
 msgstr "Fehler beim Setzen des Mindest-verfügbar-Wertes: %s\n"
 
-#: speaker-test/speaker-test.c:695
+#: speaker-test/speaker-test.c:646
 #, c-format
 msgid "Can't recovery from underrun, prepare failed: %s\n"
 msgstr ""
 "Fehler bei Unterlauf-Behandlung, Re-Initialisierung fehlgeschlagen: %s\n"
 
-#: speaker-test/speaker-test.c:706
+#: speaker-test/speaker-test.c:657
 #, c-format
 msgid "Can't recovery from suspend, prepare failed: %s\n"
 msgstr ""
 "Fehler beim Aufwachen aus dem Ruhezustand, Re-Initialisierung "
 "fehlgeschlagen: %s\n"
 
-#: speaker-test/speaker-test.c:770 speaker-test/speaker-test.c:1261
+#: speaker-test/speaker-test.c:721 speaker-test/speaker-test.c:1257
 #, c-format
 msgid "No enough memory\n"
 msgstr "Nicht genug Speicher\n"
 
-#: speaker-test/speaker-test.c:775
+#: speaker-test/speaker-test.c:726
 #, c-format
 msgid "Cannot open WAV file %s\n"
 msgstr "Kann WAV-Datei %s nicht öffnen\n"
 
-#: speaker-test/speaker-test.c:779 speaker-test/speaker-test.c:808
+#: speaker-test/speaker-test.c:730 speaker-test/speaker-test.c:759
 #, c-format
 msgid "Invalid WAV file %s\n"
 msgstr "Ungültige WAV-Datei %s\n"
 
-#: speaker-test/speaker-test.c:784
+#: speaker-test/speaker-test.c:735
 #, c-format
 msgid "Not a WAV file: %s\n"
 msgstr "Keine WAV-Datei: %s\n"
 
-#: speaker-test/speaker-test.c:788
+#: speaker-test/speaker-test.c:739
 #, c-format
 msgid "Unsupported WAV format %d for %s\n"
 msgstr "Nicht unterstütztes WAV-Format %d in %s\n"
 
-#: speaker-test/speaker-test.c:793
+#: speaker-test/speaker-test.c:744
 #, c-format
 msgid "%s is not a mono stream (%d channels)\n"
 msgstr "%s ist keine Mono-Datei (%d Kanäle)\n"
 
-#: speaker-test/speaker-test.c:798
+#: speaker-test/speaker-test.c:749
 #, c-format
 msgid "Sample rate doesn't match (%d) for %s\n"
 msgstr "Sample-Rate (%d) stimmt nicht überein in %s\n"
 
-#: speaker-test/speaker-test.c:803
+#: speaker-test/speaker-test.c:754
 #, c-format
 msgid "Unsupported sample format bits %d for %s\n"
 msgstr "Nicht unterstütztes Sample-Format mit %d Bits in %s\n"
 
-#: speaker-test/speaker-test.c:864
+#: speaker-test/speaker-test.c:815
 #, c-format
 msgid "Undefined channel %d\n"
 msgstr "Kanal %d nicht definiert\n"
 
-#: speaker-test/speaker-test.c:915
+#: speaker-test/speaker-test.c:866
 #, c-format
 msgid "Write error: %d,%s\n"
 msgstr "Schreibfehler: %d, %s\n"
 
-#: speaker-test/speaker-test.c:917
+#: speaker-test/speaker-test.c:868
 #, c-format
 msgid "xrun_recovery failed: %d,%s\n"
 msgstr "xrun_recovery fehlgeschlagen: %d, %s\n"
 
-#: speaker-test/speaker-test.c:1003
+#: speaker-test/speaker-test.c:938
+#, c-format
+msgid "\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:982
 #, fuzzy, c-format
 msgid ""
 "Usage: speaker-test [OPTION]... \n"
@@ -1513,13 +1697,15 @@ msgid ""
 "-b,--buffer\tring buffer size in us\n"
 "-p,--period\tperiod size in us\n"
 "-P,--nperiods\tnumber of periods\n"
-"-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+"-t,--test\tpink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 "
+"noise, wav=WAV file\n"
 "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
 "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
 "-w,--wavfile\tUse the given WAV file as a test sound\n"
 "-W,--wavdir\tSpecify the directory containing WAV files\n"
 "-m,--chmap\tSpecify the channel map to override\n"
 "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+"-S,--scale\tScale of generated test tones in percent (default=80)\n"
 "\n"
 msgstr ""
 "Verwendung: speaker-test [Option]...\n"
@@ -1541,76 +1727,86 @@ msgstr ""
 "Bereich\n"
 "\n"
 
-#: speaker-test/speaker-test.c:1132
+#: speaker-test/speaker-test.c:1114
 #, c-format
 msgid "Invalid number of periods %d\n"
 msgstr "Ungültige Periodenanzahl %d\n"
 
-#: speaker-test/speaker-test.c:1148 speaker-test/speaker-test.c:1152
+#: speaker-test/speaker-test.c:1127 speaker-test/speaker-test.c:1137
+#: speaker-test/speaker-test.c:1141
 #, c-format
 msgid "Invalid test type %s\n"
 msgstr "Ungültiger Test-Typ %s\n"
 
-#: speaker-test/speaker-test.c:1164
-#, c-format
-msgid "Invalid parameter for -s option.\n"
-msgstr "Ungültiger Wert für Option -s\n"
-
-#: speaker-test/speaker-test.c:1186
+#: speaker-test/speaker-test.c:1174
 #, c-format
 msgid "Unknown option '%c'\n"
 msgstr "Unbekannte Options '%c'\n"
 
-#: speaker-test/speaker-test.c:1207
+#: speaker-test/speaker-test.c:1188
+#, c-format
+msgid "Invalid parameter for -s option.\n"
+msgstr "Ungültiger Wert für Option -s\n"
+
+#: speaker-test/speaker-test.c:1203
 #, c-format
 msgid "Playback device is %s\n"
 msgstr "Wiedergabe-Gerät ist %s\n"
 
-#: speaker-test/speaker-test.c:1208
+#: speaker-test/speaker-test.c:1204
 #, c-format
 msgid "Stream parameters are %iHz, %s, %i channels\n"
 msgstr "Stream-Parameter sind %i Hz, %s, %i Kanäle\n"
 
-#: speaker-test/speaker-test.c:1211
+#: speaker-test/speaker-test.c:1207
+#, c-format
+msgid "Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:1210
 #, c-format
 msgid "Using 16 octaves of pink noise\n"
 msgstr "Verwende 16 Oktaven rosa Rauschen\n"
 
-#: speaker-test/speaker-test.c:1214
+#: speaker-test/speaker-test.c:1213
 #, c-format
 msgid "Sine wave rate is %.4fHz\n"
 msgstr "Sinuswelle mit Frequenz %.4f Hz\n"
 
-#: speaker-test/speaker-test.c:1217
+#: speaker-test/speaker-test.c:1216
 #, c-format
 msgid "WAV file(s)\n"
 msgstr "WAV-Datei(en)\n"
 
-#: speaker-test/speaker-test.c:1227
+#: speaker-test/speaker-test.c:1226
 #, c-format
 msgid "Playback open error: %d,%s\n"
 msgstr "Fehler beim Öffnen des Gerätes: %d, %s\n"
 
-#: speaker-test/speaker-test.c:1233
+#: speaker-test/speaker-test.c:1232
 #, c-format
 msgid "Setting of hwparams failed: %s\n"
 msgstr "Fehler beim Setzen der Hardware-Parameter: %s\n"
 
-#: speaker-test/speaker-test.c:1237
+#: speaker-test/speaker-test.c:1236
 #, c-format
 msgid "Setting of swparams failed: %s\n"
 msgstr "Fehler beim Setzen der Software-Parameter: %s\n"
 
-#: speaker-test/speaker-test.c:1284 speaker-test/speaker-test.c:1306
+#: speaker-test/speaker-test.c:1282 speaker-test/speaker-test.c:1304
 #, c-format
 msgid "Transfer failed: %s\n"
 msgstr "Schreibfehler: %s\n"
 
-#: speaker-test/speaker-test.c:1292
+#: speaker-test/speaker-test.c:1290
 #, c-format
 msgid "Time per period = %lf\n"
 msgstr "Zeit pro Periode = %lf\n"
 
+#, c-format
+#~ msgid "service '%s' is not found in /etc/services\n"
+#~ msgstr "Service '%s' in /etc/services nicht gefunden\n"
+
 #~ msgid "Warning: format is changed to S16_LE\n"
 #~ msgstr "Warnung: benutztes Format ist S16_LE\n"
 
index fedb6a0..506ca9e 100644 (file)
@@ -2,7 +2,7 @@
 # The msgids must be ASCII and therefore cannot contain real quotation
 # characters, only substitutes like grave accent (0x60), apostrophe (0x27)
 # and double quote (0x22). These substitutes look strange; see
-# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+# https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
 #
 # This catalog translates grave accent (0x60) and apostrophe (0x27) to
 # left single quotation mark (U+2018) and right single quotation mark (U+2019).
index a9647fc..6522f0c 100644 (file)
@@ -2,7 +2,7 @@
 # The msgids must be ASCII and therefore cannot contain real quotation
 # characters, only substitutes like grave accent (0x60), apostrophe (0x27)
 # and double quote (0x22). These substitutes look strange; see
-# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+# https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
 #
 # This catalog translates grave accent (0x60) and apostrophe (0x27) to
 # left single quotation mark (U+2018) and right single quotation mark (U+2019).
diff --git a/po/eu.gmo b/po/eu.gmo
new file mode 100644 (file)
index 0000000..c955ac9
Binary files /dev/null and b/po/eu.gmo differ
diff --git a/po/eu.po b/po/eu.po
new file mode 100644 (file)
index 0000000..af86edd
--- /dev/null
+++ b/po/eu.po
@@ -0,0 +1,1910 @@
+# Basque translation for alsa-utils
+# Copyright (C) 2011 The ALSA Team
+# This file is distributed under the same license as the alsa-utils package.
+# Porrumentzio <porrumentzio@riseup.net>, 2020.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: alsa-utils 1.0.23\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-06-10 09:22+0000\n"
+"PO-Revision-Date: 2020-07-26 12:01+0200\n"
+"Last-Translator: Porrumentzio <porrumentzio@riseup.net>\n"
+"Language-Team: Librezale <librezale@librezale.eus>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 2.3.1\n"
+
+#: alsamixer/card_select.c:77 alsamixer/device_name.c:127
+msgid "Sound Card"
+msgstr "Soinu-txartela"
+
+#: alsamixer/card_select.c:115
+msgid "(default)"
+msgstr "(lehenetsia)"
+
+#: alsamixer/card_select.c:125
+msgid "cannot enumerate sound cards"
+msgstr "ezin dira zerrendatu soinu-txartelak"
+
+#: alsamixer/card_select.c:151
+msgid "enter device name..."
+msgstr "sartu gailuaren izena..."
+
+#: alsamixer/cli.c:45
+msgid "Usage: alsamixer [options]"
+msgstr "Erabilera: alsamixer [aukerak]"
+
+# capture --> atzemate, hartze, kaptura(tze)...?
+#: alsamixer/cli.c:46
+#, fuzzy
+#| msgid ""
+#| "Useful options:\n"
+#| "  -h, --help              this help\n"
+#| "  -c, --card=NUMBER       sound card number or id\n"
+#| "  -D, --device=NAME       mixer device name\n"
+#| "  -V, --view=MODE         starting view mode: playback/capture/all"
+msgid ""
+"Useful options:\n"
+"  -h, --help              this help\n"
+"  -c, --card=NUMBER       sound card number or id\n"
+"  -D, --device=NAME       mixer device name\n"
+"  -m, --mouse             enable mouse\n"
+"  -M, --no-mouse          disable mouse\n"
+"  -f, --config=FILE       configuration file\n"
+"  -F, --no-config         do not load configuration file\n"
+"  -V, --view=MODE         starting view mode: playback/capture/all\n"
+"  -B, --black-background  use black background color"
+msgstr ""
+"Aukera erabilgarriak:\n"
+"  -h, --help              lagunta-koadro hau\n"
+"  -c, --card=ZENBAKIA     soinu-txartelaren zenbakia edo id-a\n"
+"  -D, --device=IZENA      nahasgailuaren izena\n"
+"  -V, --view=MODUA        hasteko ikuspegia: erreprodukzioa/kapturatzea/"
+"guztiak"
+
+#: alsamixer/cli.c:56
+msgid ""
+"Debugging options:\n"
+"  -g, --no-color          toggle using of colors\n"
+"  -a, --abstraction=NAME  mixer abstraction level: none/basic"
+msgstr ""
+"Arazketa aukerak:\n"
+"  -g, --no-color          kolore gabeko interfazea\n"
+"  -a, --abstraction=IZENA nahasgailuaren abstrakzio maila: bat ere ez / "
+"oinarrizkoa"
+
+#: alsamixer/cli.c:92
+#, c-format
+msgid "invalid card index: %s\n"
+msgstr "txartel-indize baliogabea: %s\n"
+
+#: alsamixer/cli.c:137
+#, c-format
+msgid "unknown abstraction level: %s\n"
+msgstr "abstrakzio-maila ezezaguna: %s\n"
+
+#: alsamixer/cli.c:142
+#, c-format
+msgid "unknown option: %c\n"
+msgstr "aukera ezezaguna: %c\n"
+
+#: alsamixer/cli.c:144
+msgid "try `alsamixer --help' for more information\n"
+msgstr "probatu `alsamixer --help' xehetasunetarako\n"
+
+#: alsamixer/device_name.c:177
+msgid "Device name:"
+msgstr "Gailu-izena:"
+
+#: alsamixer/die.c:37
+#, c-format
+msgid "%s: %s\n"
+msgstr "%s: %s\n"
+
+#: alsamixer/mixer_display.c:99
+msgid "Card:"
+msgstr "Txartela:"
+
+#: alsamixer/mixer_display.c:100
+msgid "Chip:"
+msgstr "Txipa:"
+
+#: alsamixer/mixer_display.c:101
+msgid "View:"
+msgstr "Ikuspegia:"
+
+#: alsamixer/mixer_display.c:102
+msgid "Item:"
+msgstr "Elementua:"
+
+#: alsamixer/mixer_display.c:105
+msgid "F1:  Help"
+msgstr "F1:  Laguntza"
+
+#: alsamixer/mixer_display.c:106
+msgid "F2:  System information"
+msgstr "F2:  Sistemaren informazioa"
+
+#: alsamixer/mixer_display.c:107
+msgid "F6:  Select sound card"
+msgstr "F6:  Hautatu soinu-txartela"
+
+# Esc --> Ihes / Esc
+#: alsamixer/mixer_display.c:108
+msgid "Esc: Exit"
+msgstr "Esc: Irten"
+
+#: alsamixer/mixer_display.c:179
+msgid "(unplugged)"
+msgstr "(deskonektatuta)"
+
+#: alsamixer/mixer_display.c:197
+msgid "Playback"
+msgstr "Erreprodukzioa"
+
+#: alsamixer/mixer_display.c:198
+msgid "Capture"
+msgstr "Kapturtzea"
+
+#: alsamixer/mixer_display.c:199
+msgid "All"
+msgstr "Guztiak"
+
+#: alsamixer/mixer_display.c:240
+msgid "mute"
+msgstr "mututu"
+
+#: alsamixer/mixer_display.c:281 alsamixer/mixer_display.c:291
+msgid "dB gain:"
+msgstr "dB irabazia:"
+
+#: alsamixer/mixer_display.c:291
+#, c-format
+msgid " [%s %s, %s]"
+msgstr " [%s %s, %s]"
+
+#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:306
+#: alsamixer/mixer_display.c:312 alsamixer/mixer_display.c:318
+msgid "Off"
+msgstr "Itzalita"
+
+#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:318
+msgid "On"
+msgstr "Piztuta"
+
+#: alsamixer/mixer_display.c:370
+msgid "The sound device was unplugged."
+msgstr "Soinu-txartela deskonektatu egin da."
+
+#: alsamixer/mixer_display.c:371
+msgid "Press F6 to select another sound card."
+msgstr "Sakatu F6 beste soinu-txartel bat hautatzeko."
+
+#: alsamixer/mixer_display.c:386
+msgid "This sound device does not have any playback controls."
+msgstr "Soinu-txartel honek ez du erreprodukzio kontrolik."
+
+#: alsamixer/mixer_display.c:388
+msgid "This sound device does not have any capture controls."
+msgstr "Soinu-txartel honek ez du kapturatze kontrolik."
+
+#: alsamixer/mixer_display.c:390
+msgid "This sound device does not have any controls."
+msgstr "Soinu-txartel honek ez du kontrolik."
+
+#. TRANSLATORS: playback on; one character
+#: alsamixer/mixer_display.c:523 alsamixer/mixer_display.c:528
+msgid "O"
+msgstr "O"
+
+#. TRANSLATORS: playback muted; one character
+#: alsamixer/mixer_display.c:525 alsamixer/mixer_display.c:529
+msgid "M"
+msgstr "M"
+
+#. TRANSLATORS: "left"; no more than two characters
+#: alsamixer/mixer_display.c:545
+msgid "L"
+msgstr "L"
+
+#. TRANSLATORS: "right"; no more than two characters
+#: alsamixer/mixer_display.c:551
+msgid "R"
+msgstr "R"
+
+#. TRANSLATORS: no more than eight characters
+#: alsamixer/mixer_display.c:555
+msgid "CAPTURE"
+msgstr "KAPTURATZEA"
+
+#: alsamixer/mixer_display.c:611
+msgid "Front"
+msgstr "Aurrealdekoa"
+
+#: alsamixer/mixer_display.c:614
+msgid "Rear"
+msgstr "Atzealdekoa"
+
+#: alsamixer/mixer_display.c:617 speaker-test/speaker-test.c:134
+msgid "Center"
+msgstr "Erdialdekoa"
+
+#: alsamixer/mixer_display.c:620
+msgid "Woofer"
+msgstr "Wooferra"
+
+#: alsamixer/mixer_display.c:623
+msgid "Side"
+msgstr "Aldekoa"
+
+#: alsamixer/mixer_widget.c:91 alsamixer/mixer_widget.c:96
+msgid "cannot open mixer"
+msgstr "ezin da ireki nahasgailua"
+
+#: alsamixer/mixer_widget.c:102 alsamixer/mixer_widget.c:179
+msgid "cannot load mixer controls"
+msgstr "ezin dira kargatu nahasgailu-kontrolak"
+
+#: alsamixer/mixer_widget.c:169
+#, c-format
+msgid "Cannot open mixer device '%s'."
+msgstr "Ezin da ireki '%s' nahasgailua."
+
+#: alsamixer/mixer_widget.c:190
+msgid "Esc     Exit"
+msgstr "Esc     Irten"
+
+#: alsamixer/mixer_widget.c:191
+msgid "F1 ? H  Help"
+msgstr "F1 ? H  Laguntza"
+
+#: alsamixer/mixer_widget.c:192
+msgid "F2 /    System information"
+msgstr "F2 /    Sistemaren informazioa"
+
+#: alsamixer/mixer_widget.c:193
+msgid "F3      Show playback controls"
+msgstr "F3      Erakutsi erreprodukzio kontrolak"
+
+#: alsamixer/mixer_widget.c:194
+msgid "F4      Show capture controls"
+msgstr "F4      Erakutsi kaptura kontrolak"
+
+#: alsamixer/mixer_widget.c:195
+msgid "F5      Show all controls"
+msgstr "F5      Erakutsi kontrol guztiak"
+
+#: alsamixer/mixer_widget.c:196
+msgid "Tab     Toggle view mode (F3/F4/F5)"
+msgstr "Tab     Aldatu ikuspegi modua (F3/F4/F5)"
+
+#: alsamixer/mixer_widget.c:197
+msgid "F6 S    Select sound card"
+msgstr "F6 S    Hautatu soinu-txartela"
+
+#: alsamixer/mixer_widget.c:198
+msgid "L       Redraw screen"
+msgstr "L       Pantaila birmarraztu"
+
+#: alsamixer/mixer_widget.c:200
+msgid "Left    Move to the previous control"
+msgstr "←       Mugitu ezkerreko kontrolera"
+
+#: alsamixer/mixer_widget.c:201
+msgid "Right   Move to the next control"
+msgstr "→       Mugitu eskuineko kontrolera"
+
+#: alsamixer/mixer_widget.c:203
+msgid "Up/Down    Change volume"
+msgstr "↑ ↓     Bolumena aldatu"
+
+#: alsamixer/mixer_widget.c:204
+msgid "+ -        Change volume"
+msgstr "+ -     Bolumena aldatu"
+
+#: alsamixer/mixer_widget.c:205
+msgid "Page Up/Dn Change volume in big steps"
+msgstr "Orria↑/↓   Aldatu bolumena urrats handinaka"
+
+#: alsamixer/mixer_widget.c:206
+msgid "End        Set volume to 0%"
+msgstr "Amaiera    Ezarri bolumena %0n"
+
+#: alsamixer/mixer_widget.c:207
+msgid "0-9        Set volume to 0%-90%"
+msgstr "0-9        Ezarri bolumena %0-%90 bitartean"
+
+#: alsamixer/mixer_widget.c:208
+msgid "Q W E      Increase left/both/right volumes"
+msgstr "Q W E      Handitu ezker/bi/eskuin bolumenak"
+
+#. TRANSLATORS: or Y instead of Z
+#: alsamixer/mixer_widget.c:210
+msgid "Z X C      Decrease left/both/right volumes"
+msgstr "Z X C      Txikitu ezker/bi/eskuin bolumenak"
+
+#: alsamixer/mixer_widget.c:211
+msgid "B          Balance left and right volumes"
+msgstr "B          Orekatu ezker eta eskuin bolumenak"
+
+#: alsamixer/mixer_widget.c:213
+msgid "M          Toggle mute"
+msgstr "M          Mututu/Desmututu"
+
+#. TRANSLATORS: or , .
+#: alsamixer/mixer_widget.c:215
+msgid "< >        Toggle left/right mute"
+msgstr "< >        Mututu/Desmututu ezker/eskuin"
+
+#: alsamixer/mixer_widget.c:217
+msgid "Space      Toggle capture"
+msgstr "Zuriunea   Gaitu/Desgaitu kapturatzea"
+
+#. TRANSLATORS: or Insert Delete
+#: alsamixer/mixer_widget.c:219
+msgid "; '        Toggle left/right capture"
+msgstr "; '        Gaitu/Desgaitu ezker/eskuin kapturatzea"
+
+#: alsamixer/mixer_widget.c:221
+msgid "Authors:"
+msgstr "Egileak:"
+
+#: alsamixer/mixer_widget.c:222
+msgid "  Tim Janik"
+msgstr "  Tim Janik"
+
+#: alsamixer/mixer_widget.c:223
+msgid "  Jaroslav Kysela <perex@perex.cz>"
+msgstr "  Jaroslav Kysela <perex@perex.cz>"
+
+#: alsamixer/mixer_widget.c:224
+msgid "  Clemens Ladisch <clemens@ladisch.de>"
+msgstr "  Clemens Ladisch <clemens@ladisch.de>"
+
+#: alsamixer/mixer_widget.c:226
+msgid "Help"
+msgstr "Laguntza"
+
+#: alsamixer/proc_files.c:56
+msgid "Select File"
+msgstr "Hautatu fitxategia"
+
+#: alsamixer/textbox.c:51 alsamixer/textbox.c:65
+msgid "Error"
+msgstr "Errorea"
+
+#: alsamixer/textbox.c:80
+#, c-format
+msgid "Cannot open file \"%s\"."
+msgstr "Ezin da ireki \"%s\" fitxategia."
+
+#: aplay/aplay.c:184
+msgid "raw data"
+msgstr "datu gordinak"
+
+#: aplay/aplay.c:185
+msgid "VOC"
+msgstr "VOC"
+
+#: aplay/aplay.c:187
+msgid "WAVE"
+msgstr "WAVE"
+
+#: aplay/aplay.c:188
+msgid "Sparc Audio"
+msgstr "Sparc Audio"
+
+#: aplay/aplay.c:209
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: %s [OPTION]... [FILE]...\n"
+#| "\n"
+#| "-h, --help              help\n"
+#| "    --version           print current version\n"
+#| "-l, --list-devices      list all soundcards and digital audio devices\n"
+#| "-L, --list-pcms         list device names\n"
+#| "-D, --device=NAME       select PCM by name\n"
+#| "-q, --quiet             quiet mode\n"
+#| "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+#| "-c, --channels=#        channels\n"
+#| "-f, --format=FORMAT     sample format (case insensitive)\n"
+#| "-r, --rate=#            sample rate\n"
+#| "-d, --duration=#        interrupt after # seconds\n"
+#| "-s, --samples=#         interrupt after # samples per channel\n"
+#| "-M, --mmap              mmap stream\n"
+#| "-N, --nonblock          nonblocking mode\n"
+#| "-F, --period-time=#     distance between interrupts is # microseconds\n"
+#| "-B, --buffer-time=#     buffer duration is # microseconds\n"
+#| "    --period-size=#     distance between interrupts is # frames\n"
+#| "    --buffer-size=#     buffer duration is # frames\n"
+#| "-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+#| "-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+#| "                        (relative to buffer size if <= 0)\n"
+#| "-T, --stop-delay=#      delay for automatic PCM stop is # microseconds "
+#| "from xrun\n"
+#| "-v, --verbose           show PCM structure and setup (accumulative)\n"
+#| "-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+#| "-I, --separate-channels one file for each channel\n"
+#| "-i, --interactive       allow interactive operation from stdin\n"
+#| "-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+#| "    --disable-resample  disable automatic rate resample\n"
+#| "    --disable-channels  disable automatic channel conversions\n"
+#| "    --disable-format    disable automatic format conversions\n"
+#| "    --disable-softvol   disable software volume control (softvol)\n"
+#| "    --test-position     test ring buffer position\n"
+#| "    --test-coef=#       test coefficient for ring buffer position "
+#| "(default 8)\n"
+#| "                        expression for validation is: coef * "
+#| "(buffer_size / 2)\n"
+#| "    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+#| "    --max-file-time=#   start another output file when the old file has "
+#| "recorded\n"
+#| "                        for this many seconds\n"
+#| "    --process-id-file   write the process ID here\n"
+#| "    --use-strftime      apply the strftime facility to the output file "
+#| "name\n"
+#| "    --dump-hw-params    dump hw_params of the device\n"
+#| "    --fatal-errors      treat all errors as fatal\n"
+msgid ""
+"Usage: %s [OPTION]... [FILE]...\n"
+"\n"
+"-h, --help              help\n"
+"    --version           print current version\n"
+"-l, --list-devices      list all soundcards and digital audio devices\n"
+"-L, --list-pcms         list device names\n"
+"-D, --device=NAME       select PCM by name\n"
+"-q, --quiet             quiet mode\n"
+"-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+"-c, --channels=#        channels\n"
+"-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
+"-r, --rate=#            sample rate\n"
+"-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
+"-M, --mmap              mmap stream\n"
+"-N, --nonblock          nonblocking mode\n"
+"-F, --period-time=#     distance between interrupts is # microseconds\n"
+"-B, --buffer-time=#     buffer duration is # microseconds\n"
+"    --period-size=#     distance between interrupts is # frames\n"
+"    --buffer-size=#     buffer duration is # frames\n"
+"-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+"-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+"                        (relative to buffer size if <= 0)\n"
+"-T, --stop-delay=#      delay for automatic PCM stop is # microseconds from "
+"xrun\n"
+"-v, --verbose           show PCM structure and setup (accumulative)\n"
+"-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+"-I, --separate-channels one file for each channel\n"
+"-i, --interactive       allow interactive operation from stdin\n"
+"-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+"    --disable-resample  disable automatic rate resample\n"
+"    --disable-channels  disable automatic channel conversions\n"
+"    --disable-format    disable automatic format conversions\n"
+"    --disable-softvol   disable software volume control (softvol)\n"
+"    --test-position     test ring buffer position\n"
+"    --test-coef=#       test coefficient for ring buffer position (default "
+"8)\n"
+"                        expression for validation is: coef * (buffer_size / "
+"2)\n"
+"    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+"    --max-file-time=#   start another output file when the old file has "
+"recorded\n"
+"                        for this many seconds\n"
+"    --process-id-file   write the process ID here\n"
+"    --use-strftime      apply the strftime facility to the output file name\n"
+"    --dump-hw-params    dump hw_params of the device\n"
+"    --fatal-errors      treat all errors as fatal\n"
+msgstr ""
+"Usage: %s [OPTION]... [FILE]...\n"
+"\n"
+"-h, --help              laguntza\n"
+"    --version           erakutsi oraingo bertsioa\n"
+"-l, --list-devices      zerrendatu soinu-txartel eta audio-digital gailu "
+"guztiak\n"
+"-L, --list-pcms         zerrendatu gailuen izenak\n"
+"-D, --device=IZENA      hautatu PCM izenaren arabera\n"
+"-q, --quiet             modu isila\n"
+"-t, --file-type MOTA    fitxategi mota (voc, wav, raw edo au)\n"
+"-c, --channels=#        kanalak\n"
+"-f, --format=FORMATUA   laginaren formatua (ez dira bereizten maiuskulak eta "
+"minuskulak)\n"
+"-r, --rate=#            lagin-tasa\n"
+"-d, --duration=#        gelditu # segundu ostean\n"
+"-s, --samples=#         gelditu kanaleko # lagin ostean\n"
+"-M, --mmap              mmap stream-a\n"
+"-N, --nonblock          nonblocking modua\n"
+"-F, --period-time=#     geldialdien arteko distantzia # mikrosegundokoa da\n"
+"-B, --buffer-time=#     bufferraren iraupena # mikrosegunfokoa da\n"
+"    --period-size=#     geldialdien arteko distantzia # laginekoa da\n"
+"    --buffer-size=#     bufferraren iraupena # laginekoa da\n"
+"-A, --avail-min=#       esnatzeko gutxieneko espazio eskuragarria # "
+"mikrosegundo da\n"
+"-R, --start-delay=#     PCM automatikoki hasteko atzerapena # mikrosegundo "
+"da \n"
+"                        (buffer-tamainaren erlatiboa baldin eta <= 0)\n"
+"-T, --stop-delay=#       PCM automatikoki gelditzeko atzerapena # "
+"mikrosegundo da xrun-etik\n"
+"-v, --verbose           erakutsi PCM egitura eta ezarpena (pilagarria)\n"
+"-V, --vumeter=MOTA      gaitu VU neurgailua (MOTA: mono edo stereo)\n"
+"-I, --separate-channels fitxategi bat kanaleko\n"
+"-i, --interactive       baimendu ekintza interaktiboa stdin-etik\n"
+"-m, --chmap=ch1,ch2,..  Eman kanal-mapa gainidatzi edo jarraitzeko\n"
+"    --disable-resample  desgaitu tasa birlagintze automatikoa\n"
+"    --disable-channels  desgaitu kanal bihurketa automatikoa\n"
+"    --disable-format    desgaitu formatu bihurketa automatikoa\n"
+"    --disable-softvol   desgaitu software volume control (softvol)\n"
+"    --test-position     probatu eraztun-bufferraren kokalekua\n"
+"    --test-coef=#       probatu eraztun-bufferraren kokalekuarentzako "
+"koefizientea (lehenetsia 8)\n"
+"                        baliozkotzeko adierazpena hau da: koef * "
+"(buffer_tamaina / 2)\n"
+"    --test-nowait       ez itxaron eraztun-bufferrari - PUZ osoa erabiliko "
+"du\n"
+"    --max-file-time=#   beste irteera-fitxategi bat abiarazi, fitxategi "
+"zaharrak\n"
+"                        segundo askotarako grabatu duenean\n"
+"    --process-id-file   erakutsi hemen prozesuaren IDa\n"
+"    --use-strftime      aplikatu strftime instalazioa irteera-fitxategiaren "
+"izenari \n"
+"    --dump-hw-params    ezkutatu gailuaren hw parametroak\n"
+"    --fatal-errors      jo errore guztiak larritzat\n"
+
+#: aplay/aplay.c:255 speaker-test/speaker-test.c:1001
+#, c-format
+msgid "Recognized sample formats are:"
+msgstr "Hauek dira onartutako lagin-formatuak:"
+
+#: aplay/aplay.c:261
+#, c-format
+msgid ""
+"\n"
+"Some of these may not be available on selected hardware\n"
+msgstr ""
+"\n"
+"Baliteke horietako batzuk erabilgarri ez egotea hautatutako hardwarean\n"
+
+#: aplay/aplay.c:262
+#, c-format
+msgid "The available format shortcuts are:\n"
+msgstr "Hauek dira formatu laster-tekla erabilgarriak:\n"
+
+#: aplay/aplay.c:263
+#, c-format
+msgid "-f cd (16 bit little endian, 44100, stereo)\n"
+msgstr "-f cd (16 bit bukaera txikia, 44100, estereo)\n"
+
+#: aplay/aplay.c:264
+#, c-format
+msgid "-f cdr (16 bit big endian, 44100, stereo)\n"
+msgstr "-f cdr (16 bit bukaera handia, 44100, estereo)\n"
+
+#: aplay/aplay.c:265
+#, c-format
+msgid "-f dat (16 bit little endian, 48000, stereo)\n"
+msgstr "-f dat (16 bit bukaera txikia, 48000, estereo)\n"
+
+#: aplay/aplay.c:279
+msgid "no soundcards found..."
+msgstr "ez da soinu-txartelik aurkitu..."
+
+#: aplay/aplay.c:282
+#, c-format
+msgid "**** List of %s Hardware Devices ****\n"
+msgstr "**** %s hardware gailuen zerrenda ****\n"
+
+#: aplay/aplay.c:311
+#, c-format
+msgid "card %i: %s [%s], device %i: %s [%s]\n"
+msgstr "%i txartela: %s [%s], %i gailua: %s [%s]\n"
+
+#: aplay/aplay.c:317
+#, c-format
+msgid "  Subdevices: %i/%i\n"
+msgstr "  Azpigailuak: %i/%i\n"
+
+#: aplay/aplay.c:324
+#, c-format
+msgid "  Subdevice #%i: %s\n"
+msgstr "  #%i azpigailua: %s\n"
+
+#: aplay/aplay.c:405
+#, c-format
+msgid "Aborted by signal %s...\n"
+msgstr "%s seinaleak abortatuta...\n"
+
+#: aplay/aplay.c:562
+msgid "command should be named either arecord or aplay"
+msgstr "komandoa arecord edo aplay gisa izendatu behar da"
+
+#: aplay/aplay.c:607
+#, c-format
+msgid "unrecognized file format %s"
+msgstr "%s fitxategi-formatu ezezaguna"
+
+#: aplay/aplay.c:614
+#, c-format
+msgid "invalid channels argument '%s'"
+msgstr "kanalen '%s' argumentu baliogabea"
+
+#: aplay/aplay.c:618
+#, c-format
+msgid "value %i for channels is invalid"
+msgstr "kanalentzako %i balio baliogabea"
+
+#: aplay/aplay.c:638
+#, c-format
+msgid "wrong extended format '%s'"
+msgstr "'%s' formatu hedatua ez da zuzena"
+
+#: aplay/aplay.c:650
+#, fuzzy, c-format
+#| msgid "wrong extended format '%s'"
+msgid "wrong extended subformat '%s'"
+msgstr "'%s' formatu hedatua ez da zuzena"
+
+#: aplay/aplay.c:657
+#, c-format
+msgid "invalid rate argument '%s'"
+msgstr "'%s' tasa argumentu baliogabea"
+
+#: aplay/aplay.c:664
+#, c-format
+msgid "bad speed value %i"
+msgstr "%i abiadura balio okerra"
+
+#: aplay/aplay.c:670
+msgid "duration and samples arguments cannot be used together"
+msgstr "iraupen eta lagin argumentuak ezin dira elkarrekin erabili"
+
+#: aplay/aplay.c:675
+#, c-format
+msgid "invalid duration argument '%s'"
+msgstr "'%s' iraupen argumentu baliogabea"
+
+#: aplay/aplay.c:682
+msgid "samples and duration arguments cannot be used together"
+msgstr "lagin eta iraupen argumentuak ezin dira elkarrekin erabili"
+
+#: aplay/aplay.c:687
+#, c-format
+msgid "invalid samples argument '%s'"
+msgstr "'%s' lagin argumentu baliogabea"
+
+#: aplay/aplay.c:699
+#, c-format
+msgid "invalid period time argument '%s'"
+msgstr "'%s' periodo-denbora argumentu baliogabea"
+
+#: aplay/aplay.c:706
+#, c-format
+msgid "invalid buffer time argument '%s'"
+msgstr "'%s' buffer-denbora argumentu baliogabea"
+
+#: aplay/aplay.c:713
+#, c-format
+msgid "invalid period size argument '%s'"
+msgstr "'%s' periodo-tamaina argumentu baliogabea"
+
+#: aplay/aplay.c:720
+#, c-format
+msgid "invalid buffer size argument '%s'"
+msgstr "'%s' buffer-tamaina argumentu baliogabea"
+
+#: aplay/aplay.c:727
+#, c-format
+msgid "invalid min available space argument '%s'"
+msgstr "'%s' gutxieneko espazio erabilgarri argumentu baliogabea"
+
+#: aplay/aplay.c:734
+#, c-format
+msgid "invalid start delay argument '%s'"
+msgstr "'%s' haste-atzerapen argumentu baliogabea"
+
+#: aplay/aplay.c:741
+#, c-format
+msgid "invalid stop delay argument '%s'"
+msgstr "'%s' gelditze-atzerapen argumentu baliogabea"
+
+#: aplay/aplay.c:796
+#, c-format
+msgid "invalid test coef argument '%s'"
+msgstr "'%s' koef. proba argumentu baliogabea"
+
+#: aplay/aplay.c:808
+#, c-format
+msgid "invalid max file time argument '%s'"
+msgstr "'%s' gehienezko fitxategi-denbora argumentu baliogabea"
+
+#: aplay/aplay.c:828 speaker-test/speaker-test.c:616
+#, c-format
+msgid "Unable to parse channel map string: %s\n"
+msgstr "Ezin da kanal-maparen katea analizatu: %s\n"
+
+#: aplay/aplay.c:834
+#, c-format
+msgid "Try `%s --help' for more information.\n"
+msgstr "Probatu `%s --help' xehetasun gehiagorako.\n"
+
+#: aplay/aplay.c:850
+#, c-format
+msgid "audio open error: %s"
+msgstr "audio irekitze errorea: %s"
+
+#: aplay/aplay.c:855
+#, c-format
+msgid "info error: %s"
+msgstr "informazio errorea: %s"
+
+#: aplay/aplay.c:862
+#, c-format
+msgid "nonblock setting error: %s"
+msgstr "nonblock-en konfigurazio-ezarpen errorea: %s"
+
+#: aplay/aplay.c:880 aplay/aplay.c:1004 aplay/aplay.c:1310 aplay/aplay.c:1526
+#: aplay/aplay.c:2106 aplay/aplay.c:2136
+msgid "not enough memory"
+msgstr "ez dago behar adina memoria"
+
+#: aplay/aplay.c:904
+#, c-format
+msgid "Cannot create process ID file %s: %s"
+msgstr "Ezin da sortu %s prozesuaren ID fitxategia: %s"
+
+#: aplay/aplay.c:994
+#, c-format
+msgid "read error (called from line %i)"
+msgstr "irakurtzean errorea (%i lerrotik deitua)"
+
+#: aplay/aplay.c:1062
+#, c-format
+msgid "unknown length of 'fmt ' chunk (read %u, should be %u at least)"
+msgstr "'fmt' chunk luzera ezezaguna (%u irakurri, %u izan behar du gutxienez)"
+
+#: aplay/aplay.c:1073
+#, c-format
+msgid ""
+"unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"
+msgstr ""
+"'fmt' chunk hedagarri luzera ezezaguna (%u irakurri, %u izan behar du "
+"gutxienez)"
+
+#: aplay/aplay.c:1078
+msgid "wrong format tag in extensible 'fmt ' chunk"
+msgstr "formatua ez da zuzena 'fmt' chunk hedagarrian"
+
+#: aplay/aplay.c:1086
+#, c-format
+msgid "can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"
+msgstr ""
+"ezin da erreproduzitu PCM edo FLOAT kodetua ez den 0x%04x WAVE-fitxategiaren "
+"formatua"
+
+#: aplay/aplay.c:1091
+#, c-format
+msgid "can't play WAVE-files with %d tracks"
+msgstr "ezin dira erreproduzitu %d pista dituzten WAVE-fitxategiak"
+
+#: aplay/aplay.c:1096
+#, c-format
+msgid "valid bps greater than bps: %d > %d"
+msgstr ""
+
+#: aplay/aplay.c:1103 aplay/aplay.c:1239
+#, c-format
+msgid "Warning: format is changed to U8\n"
+msgstr "Abisua: formatua U8-ra aldatu da\n"
+
+#: aplay/aplay.c:1113 aplay/aplay.c:1126 aplay/aplay.c:1137
+#, c-format
+msgid "Warning: format is changed to %s\n"
+msgstr "Abisua: formatua %s-(e)ra aldatu da\n"
+
+#: aplay/aplay.c:1142
+#, c-format
+msgid ""
+" can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"
+msgstr ""
+" ezin dira erreproduzitu %d byteko zabaleran %d lagin-bita duten WAVE-"
+"fitxategiak (%d kanal)"
+
+#: aplay/aplay.c:1175
+#, c-format
+msgid " can't play WAVE-files with sample %d bits wide"
+msgstr ""
+" ezin dira erreproduzitu %d lagin-biteko zabalera duten WAVE-fitxategiak"
+
+#: aplay/aplay.c:1233
+#, c-format
+msgid "Warning: format is changed to MU_LAW\n"
+msgstr "Abisua: formatua MU_LAW-era aldatu da\n"
+
+#: aplay/aplay.c:1245
+#, c-format
+msgid "Warning: format is changed to S16_BE\n"
+msgstr "Abisua: formatua S16_BE-ra aldatu da\n"
+
+#: aplay/aplay.c:1258 aplay/aplay.c:2427 aplay/aplay.c:2434 aplay/aplay.c:2964
+msgid "read error"
+msgstr "irakurtze errorea"
+
+#: aplay/aplay.c:1288
+msgid "Channel numbers don't match between hw_params and channel map"
+msgstr "Kanal-zenbakiak ez datoz bat hw parametro eta kanal-maparen artean"
+
+#: aplay/aplay.c:1297
+#, c-format
+msgid "Warning: unable to get channel map\n"
+msgstr "Abisua: ezin dat kanal-mapa eskuratu\n"
+
+#: aplay/aplay.c:1331
+#, fuzzy, c-format
+#| msgid "Channel %d doesn't match with hw_parmas"
+msgid "Channel %d doesn't match with hw_params"
+msgstr "%d kanala ez dator bat hw parametroekin"
+
+#: aplay/aplay.c:1358
+msgid "Broken configuration for this PCM: no configurations available"
+msgstr ""
+"PCM honetarako konfigurazio hautsia: ez dago konfigurazio erabilgarririk"
+
+#: aplay/aplay.c:1362
+#, c-format
+msgid "HW Params of device \"%s\":\n"
+msgstr "\"%s\" gailuaren HW parametroak:\n"
+
+#: aplay/aplay.c:1382
+msgid "Access type not available"
+msgstr "Sarbide-mota ez dago erabilgarri"
+
+#: aplay/aplay.c:1387
+msgid "Sample format non available"
+msgstr "Lagin formatua ez dago erabilgarri"
+
+#: aplay/aplay.c:1393
+#, fuzzy
+#| msgid "Sample format non available"
+msgid "Sample subformat not available"
+msgstr "Lagin formatua ez dago erabilgarri"
+
+#: aplay/aplay.c:1398
+msgid "Channels count non available"
+msgstr "Kanal zenbaketa ez dago erabilgarri"
+
+#: aplay/aplay.c:1413
+#, c-format
+msgid "Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"
+msgstr ""
+"Abisua: lagin-tasa ez da zehatza (eskatutakoa = %iHz, eskuratutakoa = %iHz)\n"
+
+#: aplay/aplay.c:1419
+#, c-format
+msgid "         please, try the plug plugin %s\n"
+msgstr "         probatu %s konektatze-plugina\n"
+
+#: aplay/aplay.c:1456
+msgid "Unable to install hw params:"
+msgstr "Ezin dira hw parametroak instalatu:"
+
+#: aplay/aplay.c:1463
+#, c-format
+msgid "Can't use period equal to buffer size (%lu == %lu)"
+msgstr "Ezin da bufferraren tamaina bereko periodoa erabili (%lu == %lu)"
+
+#: aplay/aplay.c:1469
+#, fuzzy
+#| msgid "unable to install sw params:"
+msgid "Unable to get current sw params."
+msgstr "ezin dira sw parametroak instalatu:"
+
+#: aplay/aplay.c:1509
+msgid "unable to install sw params:"
+msgstr "ezin dira sw parametroak instalatu:"
+
+#: aplay/aplay.c:1544
+#, c-format
+msgid "snd_pcm_mmap_begin problem: %s"
+msgstr "snd_pcm_mmap_begin arazoa: %s"
+
+#: aplay/aplay.c:1573
+#, c-format
+msgid "stdin O_NONBLOCK flag setup failed\n"
+msgstr "stdin O_NONBLOCK marka ezartzeak huts egin du\n"
+
+#: aplay/aplay.c:1610
+#, c-format
+msgid "\rPAUSE command ignored (no hw support)\n"
+msgstr "\rPAUSE komandoa ezikusi da (ez du hw sostengurik)\n"
+
+#: aplay/aplay.c:1618
+#, c-format
+msgid "pause push error: %s"
+msgstr "pause push errorea: %s"
+
+#: aplay/aplay.c:1629
+#, c-format
+msgid "pause release error: %s"
+msgstr "pause release errorea: %s"
+
+#: aplay/aplay.c:1645
+#, c-format
+msgid ""
+"\r=== PAUSE ===                                                            "
+msgstr ""
+"\r=== PAUSE ===                                                            "
+
+#: aplay/aplay.c:1687
+#, c-format
+msgid "status error: %s"
+msgstr "egoera errorea: %s"
+
+#: aplay/aplay.c:1697 aplay/aplay.c:1708
+#, c-format
+msgid "%s!!! (at least %.3f ms long)\n"
+msgstr "%s!!! (behintzat %.3f ms luze)\n"
+
+#: aplay/aplay.c:1698 aplay/aplay.c:1701 aplay/aplay.c:1709 aplay/aplay.c:1718
+msgid "underrun"
+msgstr "underrun (azpiratzea)"
+
+#: aplay/aplay.c:1698 aplay/aplay.c:1709 aplay/aplay.c:1718
+msgid "overrun"
+msgstr "overrun (gainditzea)"
+
+#: aplay/aplay.c:1713
+#, c-format
+msgid "Status:\n"
+msgstr "Egoera:\n"
+
+#: aplay/aplay.c:1717
+#, c-format
+msgid "fatal %s: %s"
+msgstr "%s larria: %s"
+
+#: aplay/aplay.c:1723
+#, c-format
+msgid "xrun: prepare error: %s"
+msgstr "xrun: prestakuntza errorea: %s"
+
+#: aplay/aplay.c:1730
+#, c-format
+msgid "Status(DRAINING):\n"
+msgstr "Egoera(HUSTEN):\n"
+
+#: aplay/aplay.c:1734
+#, c-format
+msgid "capture stream format change? attempting recover...\n"
+msgstr "kaptura-fluxu formatua aldatu? berreskuratzea saiatzen...\n"
+
+#: aplay/aplay.c:1736
+#, c-format
+msgid "xrun(DRAINING): prepare error: %s"
+msgstr "xrun(HUSTEN): prestakuntza errorea: %s"
+
+#: aplay/aplay.c:1743
+#, c-format
+msgid "Status(R/W):\n"
+msgstr "Egoera(Irak/Idat):\n"
+
+#: aplay/aplay.c:1746
+#, c-format
+msgid "read/write error, state = %s"
+msgstr "irakurtze/idazte errorea, egoera = %s"
+
+#: aplay/aplay.c:1756
+#, c-format
+msgid "Suspended. Trying resume. "
+msgstr "Etenda. Berrekiten saiatzen. "
+
+#: aplay/aplay.c:1762
+#, c-format
+msgid "Failed. Restarting stream. "
+msgstr "Huts egin du. Fluxua berrabiarazten. "
+
+#: aplay/aplay.c:1765
+#, c-format
+msgid "suspend: prepare error: %s"
+msgstr "eten: prestakuntza errorea: %s"
+
+#: aplay/aplay.c:1770
+#, c-format
+msgid "Done.\n"
+msgstr "Egina.\n"
+
+#: aplay/aplay.c:1792
+#, c-format
+msgid " !clip  "
+msgstr " !clip  "
+
+#: aplay/aplay.c:1944
+#, c-format
+msgid "Unsupported bit size %d.\n"
+msgstr "Euskarririk gabeko %d bit-tamaina.\n"
+
+#: aplay/aplay.c:1980
+#, c-format
+msgid "Max peak (%li samples): 0x%08x "
+msgstr "Gehiengo gailurra (%li lagin): 0x%08x "
+
+#: aplay/aplay.c:2021
+#, c-format
+msgid ""
+"Suspicious buffer position (%li total): avail = %li, delay = %li, buffer = "
+"%li\n"
+msgstr ""
+"Buffer-kokaleku susmagarria (%li guztira) eskurag = %li, atzerapena = %li, "
+"bufferra = %li\n"
+
+#: aplay/aplay.c:2030
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position (%li total): avail = %li, delay = %li, "
+"buffer = %li\n"
+msgstr ""
+"Buffer-kokaleku susmagarria (%li guztira) eskurag = %li, atzerapena = %li, "
+"bufferra = %li\n"
+
+#: aplay/aplay.c:2034
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious buffer position avail > delay (%li total): avail = %li, delay = "
+"%li\n"
+msgstr ""
+"Buffer-kokaleku susmagarria (%li guztira) eskurag = %li, atzerapena = %li, "
+"bufferra = %li\n"
+
+#: aplay/aplay.c:2038
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position avail > delay (%li total): avail = %li, "
+"delay = %li\n"
+msgstr ""
+"Buffer-kokaleku susmagarria (%li guztira) eskurag = %li, atzerapena = %li, "
+"bufferra = %li\n"
+
+#: aplay/aplay.c:2081
+#, c-format
+msgid "Status(R/W) (standalone avail=%li delay=%li):\n"
+msgstr ""
+
+#: aplay/aplay.c:2178
+#, c-format
+msgid "write error: %s"
+msgstr "idazte errorea: %s"
+
+#: aplay/aplay.c:2226
+#, c-format
+msgid "writev error: %s"
+msgstr "writev errorea: %s"
+
+#: aplay/aplay.c:2272
+#, c-format
+msgid "read error: %s"
+msgstr "irakurtze errorea: %s"
+
+#: aplay/aplay.c:2319
+#, c-format
+msgid "readv error: %s"
+msgstr "readv errorea: %s"
+
+#: aplay/aplay.c:2368
+msgid "can't allocate buffer for silence"
+msgstr "ezin da esleitu bufferra isiltasunerako"
+
+#: aplay/aplay.c:2377 aplay/aplay.c:2606 aplay/aplay.c:2611 aplay/aplay.c:2663
+#: aplay/aplay.c:2672 aplay/aplay.c:2679 aplay/aplay.c:2689 aplay/aplay.c:2695
+#: aplay/aplay.c:2767 aplay/aplay.c:2797 aplay/aplay.c:2811
+msgid "write error"
+msgstr "idazte errorea"
+
+#: aplay/aplay.c:2390
+#, c-format
+msgid "voc_pcm_flush - silence error"
+msgstr "voc_pcm_flush - isiltasun errorea"
+
+#: aplay/aplay.c:2393
+msgid "voc_pcm_flush error"
+msgstr "voc_pcm_flush errorea"
+
+#: aplay/aplay.c:2418
+msgid "malloc error"
+msgstr "malloc errorea"
+
+#: aplay/aplay.c:2422
+#, c-format
+msgid "Playing Creative Labs Channel file '%s'...\n"
+msgstr "'%s' Creative Labs Channel fitxategia erreproduzitzen...\n"
+
+#: aplay/aplay.c:2491 aplay/aplay.c:2586
+msgid "can't play packed .voc files"
+msgstr "ezin dira erreproduzitu paketatutako .voc fitxategiak"
+
+#: aplay/aplay.c:2546
+#, c-format
+msgid "can't play loops; %s isn't seekable\n"
+msgstr "ezin dira begiztak erreproduzitu; %s ez da bilagarria\n"
+
+#: aplay/aplay.c:2595
+#, c-format
+msgid "unknown blocktype %d. terminate."
+msgstr "%d bloke-mota ezezaguna. Amaitu."
+
+#: aplay/aplay.c:2731
+#, c-format
+msgid "Wave doesn't support %s format..."
+msgstr "Wave-ek ez du %s formatua onartzen..."
+
+#: aplay/aplay.c:2791
+#, c-format
+msgid "Sparc Audio doesn't support %s format..."
+msgstr "Sparc Audio-k ez du %s formatua onartzen..."
+
+#: aplay/aplay.c:2866
+msgid "Playing"
+msgstr "Erreproduzitzen"
+
+#: aplay/aplay.c:2866
+msgid "Recording"
+msgstr "Grabatzen"
+
+#: aplay/aplay.c:2870
+#, c-format
+msgid "Rate %d Hz, "
+msgstr "Tasa %d Hz, "
+
+#: aplay/aplay.c:2872
+#, c-format
+msgid "Mono"
+msgstr "Mono"
+
+#: aplay/aplay.c:2874
+#, c-format
+msgid "Stereo"
+msgstr "Estereo"
+
+#: aplay/aplay.c:2876
+#, c-format
+msgid "Channels %i"
+msgstr "Kanalak %i"
+
+#: aplay/aplay.c:3483
+#, fuzzy, c-format
+#| msgid "You need to specify %d files"
+msgid "You need to specify %u files"
+msgstr "%d fitxategiak zehaztu behar dituzu"
+
+#: aplay/aplay.c:3536
+#, c-format
+msgid "You need to specify %d files"
+msgstr "%d fitxategiak zehaztu behar dituzu"
+
+#: seq/aconnect/aconnect.c:56
+#, c-format
+msgid "aconnect - ALSA sequencer connection manager\n"
+msgstr "aconnect - ALSA konexio sekuentziadorearen kudeatzailea\n"
+
+#: seq/aconnect/aconnect.c:57
+#, c-format
+msgid "Copyright (C) 1999-2000 Takashi Iwai\n"
+msgstr "Copyright (C) 1999-2000 Takashi Iwai\n"
+
+#: seq/aconnect/aconnect.c:58
+#, c-format
+msgid "Usage:\n"
+msgstr "Erabilera:\n"
+
+#: seq/aconnect/aconnect.c:59
+#, c-format
+msgid " * Connection/disconnection between two ports\n"
+msgstr " * Bi ataken arteko konexio/deskonexioak\n"
+
+#: seq/aconnect/aconnect.c:60
+#, c-format
+msgid "   aconnect [-options] sender receiver\n"
+msgstr "   aconnect [-aukerak] bidaltzailea hartzailea\n"
+
+#: seq/aconnect/aconnect.c:61
+#, c-format
+msgid "     sender, receiver = client:port pair\n"
+msgstr "     bidaltzailea, hartzailea = bezeroa:ataka parea\n"
+
+#: seq/aconnect/aconnect.c:62
+#, c-format
+msgid "     -d,--disconnect     disconnect\n"
+msgstr "     -d,--disconnect     deskonektatu\n"
+
+#: seq/aconnect/aconnect.c:63
+#, c-format
+msgid "     -e,--exclusive      exclusive connection\n"
+msgstr "     -e,--exclusive      konexio esklusiboa\n"
+
+#: seq/aconnect/aconnect.c:64
+#, c-format
+msgid "     -r,--real #         convert real-time-stamp on queue\n"
+msgstr "     -r,--real #         sartu denbora-errealeko-zigilua ilaran\n"
+
+#: seq/aconnect/aconnect.c:65
+#, c-format
+msgid "     -t,--tick #         convert tick-time-stamp on queue\n"
+msgstr "     -t,--tick #         sartu denbora-marka-zigilua ilaran\n"
+
+#: seq/aconnect/aconnect.c:66
+#, c-format
+msgid " * List connected ports (no subscription action)\n"
+msgstr " * Zerrendatu konektatutako atakak (harpidetza-ekintzarik ez)\n"
+
+#: seq/aconnect/aconnect.c:67
+#, c-format
+msgid "   aconnect -i|-o [-options]\n"
+msgstr "   aconnect -i|-o [-aukerak]\n"
+
+#: seq/aconnect/aconnect.c:68
+#, c-format
+msgid "     -i,--input          list input (readable) ports\n"
+msgstr ""
+"     -i,--input          zerrendatu sarrera-atakak (irakurgarriak)\n"
+"\n"
+
+#: seq/aconnect/aconnect.c:69
+#, c-format
+msgid "     -o,--output         list output (writable) ports\n"
+msgstr "     -o,--output         zerrendatu irteera-atakak (idazgarriak)\n"
+
+#: seq/aconnect/aconnect.c:71
+#, fuzzy, c-format
+#| msgid "     -i,--input          list input (readable) ports\n"
+msgid "     -a,--all            show inactive ports, too\n"
+msgstr ""
+"     -i,--input          zerrendatu sarrera-atakak (irakurgarriak)\n"
+"\n"
+
+#: seq/aconnect/aconnect.c:73
+#, c-format
+msgid "     -l,--list           list current connections of each port\n"
+msgstr ""
+"     -l,--list           zerrendatu ataka bakoitzak orain dituen loturak\n"
+
+#: seq/aconnect/aconnect.c:74
+#, c-format
+msgid " * Remove all exported connections\n"
+msgstr ""
+" * Ezabatu esportatutako konexio guztiak\n"
+"\n"
+
+#: seq/aconnect/aconnect.c:75
+#, c-format
+msgid "     -x, --removeall\n"
+msgstr "     -x, --removeall\n"
+
+#: seq/aconnect/aconnect.c:155
+msgid "Connecting To"
+msgstr "Hona konektatzen"
+
+#: seq/aconnect/aconnect.c:156
+msgid "Connected From"
+msgstr "Hemendik konektatuta"
+
+#: seq/aconnect/aconnect.c:203
+#, c-format
+msgid "client %d: '%s' [type=%s"
+msgstr "%d bezeroa: '%s' [mota=%s"
+
+#: seq/aconnect/aconnect.c:207
+msgid "user"
+msgstr "erabiltzailea"
+
+#: seq/aconnect/aconnect.c:207
+msgid "kernel"
+msgstr "kernela"
+
+#: seq/aconnect/aconnect.c:385
+#, c-format
+msgid "can't open sequencer\n"
+msgstr "ezin da ireki sekuentziadorea\n"
+
+#: seq/aconnect/aconnect.c:413
+#, c-format
+msgid "can't get client id\n"
+msgstr "ezin da lortu bezeroaren IDa\n"
+
+#: seq/aconnect/aconnect.c:420
+#, c-format
+msgid "can't set client info\n"
+msgstr "ezin da zehaztu bezeroaren informazioa\n"
+
+#: seq/aconnect/aconnect.c:427
+#, c-format
+msgid "invalid sender address %s\n"
+msgstr "%s bidaltzaile-helbide baliogabea\n"
+
+#: seq/aconnect/aconnect.c:432 seq/aseqnet/aseqnet.c:303
+#, c-format
+msgid "invalid destination address %s\n"
+msgstr "%s hartzaile-helbide baliogabea\n"
+
+#: seq/aconnect/aconnect.c:446
+#, c-format
+msgid "No subscription is found\n"
+msgstr "Ez da harpidetzarik aurkitu\n"
+
+#: seq/aconnect/aconnect.c:451
+#, c-format
+msgid "Disconnection failed (%s)\n"
+msgstr "Deskonektatzeak huts egin du (%s)\n"
+
+#: seq/aconnect/aconnect.c:457
+#, c-format
+msgid "Connection is already subscribed\n"
+msgstr "Konexioa jada harpidetua dago\n"
+
+#: seq/aconnect/aconnect.c:462
+#, c-format
+msgid "Connection failed (%s)\n"
+msgstr "Konexioak huts egin du (%s)\n"
+
+#: seq/aseqnet/aseqnet.c:171
+#, c-format
+msgid "aseqnet - network client/server on ALSA sequencer\n"
+msgstr "aseqnet - ALSA sekuentziadorearen sarerako bezeroa/zerbitzaria\n"
+
+#: seq/aseqnet/aseqnet.c:172
+#, c-format
+msgid "  Copyright (C) 1999 Takashi Iwai\n"
+msgstr "  Copyright (C) 1999 Takashi Iwai\n"
+
+#: seq/aseqnet/aseqnet.c:173
+#, c-format
+msgid "usage:\n"
+msgstr "erabilera:\n"
+
+#: seq/aseqnet/aseqnet.c:174
+#, c-format
+msgid "  server mode: aseqnet [-options]\n"
+msgstr "  zerbitzari modua: aseqnet [-aukerak]\n"
+
+#: seq/aseqnet/aseqnet.c:175
+#, c-format
+msgid "  client mode: aseqnet [-options] server_host\n"
+msgstr "  bezero modua: aseqnet [-aukerak] zerbitzari_ostalaria\n"
+
+#: seq/aseqnet/aseqnet.c:176
+#, c-format
+msgid "options:\n"
+msgstr "aukerak:\n"
+
+#: seq/aseqnet/aseqnet.c:177
+#, c-format
+msgid "  -6,--ipv6 : use IPv6 TCP protocol\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:178
+#, c-format
+msgid "  -p,--port # : specify TCP port (digit or service name)\n"
+msgstr "  -p,--port # : zehaztu TCP ataka (zerbitzuaren digitua edo izena)\n"
+
+#: seq/aseqnet/aseqnet.c:179
+#, c-format
+msgid "  -s,--source addr : read from given addr (client:port)\n"
+msgstr ""
+"  -s,--source helbidea : irakurri emandako helbidetik (bezeroa:ataka)\n"
+
+#: seq/aseqnet/aseqnet.c:180
+#, c-format
+msgid "  -d,--dest addr : write to given addr (client:port)\n"
+msgstr "  -d,--dest helbidea : idatzi emandako helbidean (bezeroa:ataka)\n"
+
+#: seq/aseqnet/aseqnet.c:181
+#, c-format
+msgid "  -n,--name value : use a specific midi process name\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:182
+#, c-format
+msgid "  -v, --verbose : print verbose messages\n"
+msgstr "  -v, --verbose : erakutsi mezu xehatuak\n"
+
+#: seq/aseqnet/aseqnet.c:183
+#, c-format
+msgid "  -i, --info : print certain received events\n"
+msgstr "  -i, --info : erakutsi jasotako zenbait gertaera\n"
+
+#: seq/aseqnet/aseqnet.c:197
+#, c-format
+msgid "can't malloc\n"
+msgstr "ezin da malloc exekutatu\n"
+
+#: seq/aseqnet/aseqnet.c:222
+#, c-format
+msgid "closing files..\n"
+msgstr "fitxategiak ixten...\n"
+
+#: seq/aseqnet/aseqnet.c:285
+#, c-format
+msgid "sequencer opened: %d:%d\n"
+msgstr "sekuentziadorea ireki da: %d:%d\n"
+
+#: seq/aseqnet/aseqnet.c:292
+#, c-format
+msgid "invalid source address %s\n"
+msgstr "%s iturburu-helbide baliogabea\n"
+
+#: seq/aseqnet/aseqnet.c:362
+#, fuzzy, c-format
+#| msgid "can't get address %s\n"
+msgid "can't get address\n"
+msgstr "ezin da %s helbidea lortu\n"
+
+#: seq/aseqnet/aseqnet.c:376 seq/aseqnet/aseqnet.c:461
+#, fuzzy, c-format
+#| msgid "Connecting To"
+msgid "connecting to: %s\n"
+msgstr "Hona konektatzen"
+
+#: seq/aseqnet/aseqnet.c:414
+#, c-format
+msgid "too many connections!\n"
+msgstr "konexio gehiegi!\n"
+
+#: seq/aseqnet/aseqnet.c:425
+#, c-format
+msgid "accepted[%d]\n"
+msgstr "onartua[%d]\n"
+
+#: seq/aseqnet/aseqnet.c:447
+#, c-format
+msgid "can't get address %s\n"
+msgstr "ezin da %s helbidea lortu\n"
+
+#: seq/aseqnet/aseqnet.c:475
+#, c-format
+msgid "ok.. connected\n"
+msgstr "ados... konektatuta\n"
+
+#: seq/aseqnet/aseqnet.c:574
+#, c-format
+msgid "Channel %2d: Control event : %5d\n"
+msgstr "%2d kanala: kontrol-gertaera : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:578
+#, c-format
+msgid "Channel %2d: Pitchbender   : %5d\n"
+msgstr "%2d kanala: Tonu aldatzailea   : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:582
+#, c-format
+msgid "Channel %2d: Note On event : %5d\n"
+msgstr "%2d kanala: 'Oharra gaituta' gertaera : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:586
+#, c-format
+msgid "Channel %2d: Note Off event: %5d\n"
+msgstr "%2d kanala: 'Oharra desgaituta' gertaera : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:641
+#, c-format
+msgid "disconnected\n"
+msgstr "deskonektatuta\n"
+
+#: speaker-test/speaker-test.c:130
+msgid "Front Left"
+msgstr "Aurrealde ezkerra"
+
+#: speaker-test/speaker-test.c:131
+msgid "Front Right"
+msgstr "Aurrealde eskuina"
+
+#: speaker-test/speaker-test.c:132
+msgid "Rear Left"
+msgstr "Atzealde ezkerra"
+
+#: speaker-test/speaker-test.c:133
+msgid "Rear Right"
+msgstr "Atzealde eskuina"
+
+#: speaker-test/speaker-test.c:135
+msgid "LFE"
+msgstr "LFE"
+
+#: speaker-test/speaker-test.c:136
+msgid "Side Left"
+msgstr "Ezker aldea"
+
+#: speaker-test/speaker-test.c:137
+msgid "Side Right"
+msgstr "Eskuin aldea"
+
+#: speaker-test/speaker-test.c:138
+msgid "Channel 9"
+msgstr "9 kanala"
+
+#: speaker-test/speaker-test.c:139
+msgid "Channel 10"
+msgstr "10 kanala"
+
+#: speaker-test/speaker-test.c:140
+msgid "Channel 11"
+msgstr "11 kanala"
+
+#: speaker-test/speaker-test.c:141
+msgid "Channel 12"
+msgstr "12 kanala"
+
+#: speaker-test/speaker-test.c:142
+msgid "Channel 13"
+msgstr "13 kanala"
+
+#: speaker-test/speaker-test.c:143
+msgid "Channel 14"
+msgstr "14 kanala"
+
+#: speaker-test/speaker-test.c:144
+msgid "Channel 15"
+msgstr "15 kanala"
+
+#: speaker-test/speaker-test.c:145
+msgid "Channel 16"
+msgstr "16 kanala"
+
+#: speaker-test/speaker-test.c:465
+#, c-format
+msgid "Broken configuration for playback: no configurations available: %s\n"
+msgstr ""
+"Erreprodukziorako konfigurazio hautsia: ez dago konfigurazio erabilgarririk: "
+"%s\n"
+
+#: speaker-test/speaker-test.c:472
+#, c-format
+msgid "Access type not available for playback: %s\n"
+msgstr "Sarbide mota ez erabilgarri erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:479
+#, c-format
+msgid "Sample format not available for playback: %s\n"
+msgstr "Lagin formatua ez erabilgarri erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:486
+#, c-format
+msgid "Channels count (%i) not available for playbacks: %s\n"
+msgstr "Kanal zenbaketa (%i) ez erabilgarri erreprodukzioetarako: %s \n"
+
+#: speaker-test/speaker-test.c:494
+#, c-format
+msgid "Rate %iHz not available for playback: %s\n"
+msgstr "%iHz lagin-tasa ez erabilgarri erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:499
+#, c-format
+msgid "Rate doesn't match (requested %iHz, get %iHz, err %d)\n"
+msgstr ""
+"Lagin-tasa ez dator bat (eskatutakoa %iHz, eskuratutakoa %iHz, errorea %d)\n"
+
+#: speaker-test/speaker-test.c:503
+#, c-format
+msgid "Rate set to %iHz (requested %iHz)\n"
+msgstr "Lagin-tasa %iHz-tan ezarria (eskatutakoa %iHz)\n"
+
+#: speaker-test/speaker-test.c:509
+#, c-format
+msgid "Buffer size range from %lu to %lu\n"
+msgstr "Buffer tamainaren barrutia %lu(e)tik %lu(e)ra\n"
+
+#: speaker-test/speaker-test.c:510
+#, c-format
+msgid "Period size range from %lu to %lu\n"
+msgstr "Periodo tamainaren barrutia %lu(e)tik %lu(e)ra\n"
+
+#: speaker-test/speaker-test.c:514
+#, c-format
+msgid "Requested period time %u us\n"
+msgstr "Eskatutako periodo denbora %u µs\n"
+
+#: speaker-test/speaker-test.c:519
+#, c-format
+msgid "Unable to set period time %u us for playback: %s\n"
+msgstr "Ezin da ezarri periodo denbora %u µs gisa erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:525
+#, c-format
+msgid "Requested buffer time %u us\n"
+msgstr "Eskatutako buffer denbora %u µs\n"
+
+#: speaker-test/speaker-test.c:528
+#, c-format
+msgid "Unable to set buffer time %u us for playback: %s\n"
+msgstr "Ezin da ezarri buffer denbora %u µs gisa erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:537
+#, c-format
+msgid "Using max buffer size %lu\n"
+msgstr "Buffer tamaina handiena erabiltzen: %lu\n"
+
+#: speaker-test/speaker-test.c:540
+#, c-format
+msgid "Unable to set buffer size %lu for playback: %s\n"
+msgstr "Ezin da ezarri buffer tamaina %lu gisa erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:546
+#, c-format
+msgid "Periods = %u\n"
+msgstr "Periodoak = %u\n"
+
+#: speaker-test/speaker-test.c:549
+#, c-format
+msgid "Unable to set nperiods %u for playback: %s\n"
+msgstr "Ezin dira ezarri nperiods-ak %u gisa erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:558
+#, c-format
+msgid "Unable to set hw params for playback: %s\n"
+msgstr "Ezin dira ezarri hw parametroak erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:564
+#, c-format
+msgid "was set period_size = %lu\n"
+msgstr "period_size ezarri da = %lu\n"
+
+#: speaker-test/speaker-test.c:565
+#, c-format
+msgid "was set buffer_size = %lu\n"
+msgstr "buffer_size ezarri da = %lu\n"
+
+#: speaker-test/speaker-test.c:567
+#, c-format
+msgid "buffer to small, could not use\n"
+msgstr "buffer txikiegia, ezin izan da erabili\n"
+
+#: speaker-test/speaker-test.c:580
+#, c-format
+msgid "Unable to determine current swparams for playback: %s\n"
+msgstr "Ezin dira zehaztu oraingo sw parametroak erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:587
+#, c-format
+msgid "Unable to set start threshold mode for playback: %s\n"
+msgstr "Ezin da ezarri 'hasi atalasea' modua erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:594
+#, c-format
+msgid "Unable to set avail min for playback: %s\n"
+msgstr "Ezin da ezarri 'avail min' erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:601
+#, c-format
+msgid "Unable to set sw params for playback: %s\n"
+msgstr "Ezin dira ezarri sw parametroak erreprodukziorako: %s\n"
+
+#: speaker-test/speaker-test.c:621
+#, c-format
+msgid "Unable to set channel map: %s\n"
+msgstr "Ezin da ezarri kanal-mapa: %s\n"
+
+#: speaker-test/speaker-test.c:646
+#, c-format
+msgid "Can't recovery from underrun, prepare failed: %s\n"
+msgstr ""
+"Ezin da berreskuratu azpiratzetik (underrun), prestakuntzak huts egin du: "
+"%s\n"
+
+#: speaker-test/speaker-test.c:657
+#, c-format
+msgid "Can't recovery from suspend, prepare failed: %s\n"
+msgstr "Ezin da berreskuratu esekitzetik, prestakuntzak huts egin du: %s\n"
+
+#: speaker-test/speaker-test.c:721 speaker-test/speaker-test.c:1257
+#, c-format
+msgid "No enough memory\n"
+msgstr "Ez dago behar adina memoria\n"
+
+#: speaker-test/speaker-test.c:726
+#, c-format
+msgid "Cannot open WAV file %s\n"
+msgstr "Ezin da ireki %s WAV fitxategia\n"
+
+#: speaker-test/speaker-test.c:730 speaker-test/speaker-test.c:759
+#, c-format
+msgid "Invalid WAV file %s\n"
+msgstr "%s WAV fitxategi baliogabea\n"
+
+#: speaker-test/speaker-test.c:735
+#, c-format
+msgid "Not a WAV file: %s\n"
+msgstr "Ez da WAV fitxategia: %s\n"
+
+#: speaker-test/speaker-test.c:739
+#, c-format
+msgid "Unsupported WAV format %d for %s\n"
+msgstr "Euskarririk gabeko %d WAV formatua %s(r)entzat\n"
+
+#: speaker-test/speaker-test.c:744
+#, c-format
+msgid "%s is not a mono stream (%d channels)\n"
+msgstr "%s ez da mono bidalketa (%d kanal)\n"
+
+#: speaker-test/speaker-test.c:749
+#, c-format
+msgid "Sample rate doesn't match (%d) for %s\n"
+msgstr "Lagin-tasa ez dator bat (%d) %s(r)ekin\n"
+
+#: speaker-test/speaker-test.c:754
+#, c-format
+msgid "Unsupported sample format bits %d for %s\n"
+msgstr "Euskarririk gabeko %d lagin formatu bitak %s(r)entzat\n"
+
+#: speaker-test/speaker-test.c:815
+#, c-format
+msgid "Undefined channel %d\n"
+msgstr "%d kanal zehaztugabea\n"
+
+#: speaker-test/speaker-test.c:866
+#, c-format
+msgid "Write error: %d,%s\n"
+msgstr "Idazte errorea: %d,%s\n"
+
+#: speaker-test/speaker-test.c:868
+#, c-format
+msgid "xrun_recovery failed: %d,%s\n"
+msgstr "xrun_recovery ekintzak huts egin du: %d,%s\n"
+
+#: speaker-test/speaker-test.c:938
+#, c-format
+msgid "\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:982
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: speaker-test [OPTION]... \n"
+#| "-h,--help\thelp\n"
+#| "-D,--device\tplayback device\n"
+#| "-r,--rate\tstream rate in Hz\n"
+#| "-c,--channels\tcount of channels in stream\n"
+#| "-f,--frequency\tsine wave frequency in Hz\n"
+#| "-F,--format\tsample format\n"
+#| "-b,--buffer\tring buffer size in us\n"
+#| "-p,--period\tperiod size in us\n"
+#| "-P,--nperiods\tnumber of periods\n"
+#| "-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+#| "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+#| "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+#| "-w,--wavfile\tUse the given WAV file as a test sound\n"
+#| "-W,--wavdir\tSpecify the directory containing WAV files\n"
+#| "-m,--chmap\tSpecify the channel map to override\n"
+#| "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+#| "-S,--scale\tScale of generated test tones in percent (default=80)\n"
+#| "\n"
+msgid ""
+"Usage: speaker-test [OPTION]... \n"
+"-h,--help\thelp\n"
+"-D,--device\tplayback device\n"
+"-r,--rate\tstream rate in Hz\n"
+"-c,--channels\tcount of channels in stream\n"
+"-f,--frequency\tsine wave frequency in Hz\n"
+"-F,--format\tsample format\n"
+"-b,--buffer\tring buffer size in us\n"
+"-p,--period\tperiod size in us\n"
+"-P,--nperiods\tnumber of periods\n"
+"-t,--test\tpink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 "
+"noise, wav=WAV file\n"
+"-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+"-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+"-w,--wavfile\tUse the given WAV file as a test sound\n"
+"-W,--wavdir\tSpecify the directory containing WAV files\n"
+"-m,--chmap\tSpecify the channel map to override\n"
+"-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+"-S,--scale\tScale of generated test tones in percent (default=80)\n"
+"\n"
+msgstr ""
+"Erabilera: speaker-test [AUKERA]... \n"
+"-h,--help\tlaguntza\n"
+"-D,--device\terreprodukzio gailua\n"
+"-r,--rate\tbidalketaren lagin-tasa Hz-tan\n"
+"-c,--channels\tbidalt¡keta burutzen ari diren kanalen zenbaketa\n"
+"-f,--frequency\tuhin sinusoidalaren frekuentzia Hz-tan\n"
+"-F,--format\tlagin formatua\n"
+"-b,--buffer\teraztun-bufferraren tamaina µs-tan\n"
+"-p,--period\tperiodo taimaina µs-tan\n"
+"-P,--nperiods\tperiodo kopurua\n"
+"-t,--test\tpink=erabili soinu arrosa, sine=erabili uhin sinusoidala, wav=WAV "
+"fitxategia\n"
+"-l,--nloops\tzehaztu proba egiteko begizta kopurua, 0 = mugagabe\n"
+"-s,--speaker\tbozgorailu bakarreko proba. Balioak: 1=Ezkerra, 2=Eskuina, "
+"etb.\n"
+"-w,--wavfile\tErabili emandako WAV fitxategia probarako soinutzat\n"
+"-W,--wavdir\tZehaztu WAV fitxategiak dituen direktorioa\n"
+"-m,--chmap\tZehaztu gainidatziko den kanal-mapa\n"
+"-X,--force-frequency\tbehartu 30-8.000Hz barruti kanpoko frekuentziak\n"
+"-S,--scale\tSortutako proba-tonuen eskala portzentaian (lehenetsia=80)\n"
+"\n"
+
+#: speaker-test/speaker-test.c:1114
+#, c-format
+msgid "Invalid number of periods %d\n"
+msgstr "%d periodo kopuru baliogabea\n"
+
+#: speaker-test/speaker-test.c:1127 speaker-test/speaker-test.c:1137
+#: speaker-test/speaker-test.c:1141
+#, c-format
+msgid "Invalid test type %s\n"
+msgstr "%s proba mota baliogabea\n"
+
+#: speaker-test/speaker-test.c:1174
+#, c-format
+msgid "Unknown option '%c'\n"
+msgstr "'%c' aukera ezezaguna\n"
+
+#: speaker-test/speaker-test.c:1188
+#, c-format
+msgid "Invalid parameter for -s option.\n"
+msgstr "-s aukerarako parametro baliogabea.\n"
+
+#: speaker-test/speaker-test.c:1203
+#, c-format
+msgid "Playback device is %s\n"
+msgstr "Erreprodukzio gailua %s da\n"
+
+#: speaker-test/speaker-test.c:1204
+#, c-format
+msgid "Stream parameters are %iHz, %s, %i channels\n"
+msgstr "Erreprodukzio parametroak %iHz, %s, %i kanal dira\n"
+
+#: speaker-test/speaker-test.c:1207
+#, c-format
+msgid "Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:1210
+#, c-format
+msgid "Using 16 octaves of pink noise\n"
+msgstr "Soinu arroseko 16 zortzidun erabiltzen\n"
+
+#: speaker-test/speaker-test.c:1213
+#, c-format
+msgid "Sine wave rate is %.4fHz\n"
+msgstr "Uhin sinusoidalaren tasa %.4fHz da\n"
+
+#: speaker-test/speaker-test.c:1216
+#, c-format
+msgid "WAV file(s)\n"
+msgstr ""
+"WAV fitxategia(k)\n"
+"\n"
+
+#: speaker-test/speaker-test.c:1226
+#, c-format
+msgid "Playback open error: %d,%s\n"
+msgstr "Erreprodukzio irekitze errorea: %d,%s\n"
+
+#: speaker-test/speaker-test.c:1232
+#, c-format
+msgid "Setting of hwparams failed: %s\n"
+msgstr "hwparams-eko hobespenek huts egin dute: %s\n"
+
+#: speaker-test/speaker-test.c:1236
+#, c-format
+msgid "Setting of swparams failed: %s\n"
+msgstr "swparams-eko hobespenek huts egin dute: %s\n"
+
+#: speaker-test/speaker-test.c:1282 speaker-test/speaker-test.c:1304
+#, c-format
+msgid "Transfer failed: %s\n"
+msgstr "Bidalketak huts egin du: %s\n"
+
+#: speaker-test/speaker-test.c:1290
+#, c-format
+msgid "Time per period = %lf\n"
+msgstr "Denbora periodoko = %lf\n"
+
+#, c-format
+#~ msgid "service '%s' is not found in /etc/services\n"
+#~ msgstr "ez da aurkitu '%s' zerbitzua /etc/services direktorioan\n"
index 3983f2f..457769d 100644 (file)
Binary files a/po/fr.gmo and b/po/fr.gmo differ
index a2108d9..8d69965 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
 # Copyright (C) 2011 The ALSA Team
 # This file is distributed under the same license as the alsa-utils package.
 # Christoph J. Thompson <cjsthompson@gmail.com>, 2011.
+# Olivier Humbert <trebmuh@tuxfamily.org>, 2020
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: alsa-utils 1.0.23\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-26 15:50+0100\n"
-"PO-Revision-Date: 2011-01-07 06:23+0100\n"
-"Last-Translator: Christoph J. Thompson <cjsthompson@gmail.com>\n"
+"POT-Creation-Date: 2024-06-10 09:22+0000\n"
+"PO-Revision-Date: 2020-07-08 16:05+0100\n"
+"Last-Translator: Olivier Humbert <trebmuh@tuxfamily.org>\n"
 "Language-Team: French <fr@li.org>\n"
 "Language: fr\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: alsamixer/card_select.c:126 alsamixer/device_name.c:126
+#: alsamixer/card_select.c:77 alsamixer/device_name.c:127
 msgid "Sound Card"
 msgstr "Carte Son"
 
-#: alsamixer/card_select.c:181
+#: alsamixer/card_select.c:115
 msgid "(default)"
 msgstr "(par défaut)"
 
-#: alsamixer/card_select.c:191
+#: alsamixer/card_select.c:125
 msgid "cannot enumerate sound cards"
 msgstr "les cartes son n'ont pas pu être énumérées"
 
-#: alsamixer/card_select.c:215
+#: alsamixer/card_select.c:151
 msgid "enter device name..."
 msgstr "entrez le nom du périphérique..."
 
-#: alsamixer/cli.c:40
+#: alsamixer/cli.c:45
 msgid "Usage: alsamixer [options]"
-msgstr "Utilisation: alsamixer [options]"
+msgstr "Utilisation : alsamixer [options]"
 
-#: alsamixer/cli.c:41
+#: alsamixer/cli.c:46
+#, fuzzy
+#| msgid ""
+#| "Useful options:\n"
+#| "  -h, --help              this help\n"
+#| "  -c, --card=NUMBER       sound card number or id\n"
+#| "  -D, --device=NAME       mixer device name\n"
+#| "  -V, --view=MODE         starting view mode: playback/capture/all"
 msgid ""
 "Useful options:\n"
 "  -h, --help              this help\n"
 "  -c, --card=NUMBER       sound card number or id\n"
 "  -D, --device=NAME       mixer device name\n"
-"  -V, --view=MODE         starting view mode: playback/capture/all"
+"  -m, --mouse             enable mouse\n"
+"  -M, --no-mouse          disable mouse\n"
+"  -f, --config=FILE       configuration file\n"
+"  -F, --no-config         do not load configuration file\n"
+"  -V, --view=MODE         starting view mode: playback/capture/all\n"
+"  -B, --black-background  use black background color"
 msgstr ""
 "Options utiles:\n"
 "  -h, --help           cette aide\n"
 "  -c, --card=NUMÉRO    numéro ou identifiant de la carte son\n"
 "  -D, --device=NOM     nom du périphérique de mixage\n"
-"  -V, --view=MODE      mode de visualisation par défaut: lecture/capture/tous"
+"  -V, --view=MODE      mode de visualisation par défaut : lecture/capture/"
+"tous"
 
-#: alsamixer/cli.c:46
+#: alsamixer/cli.c:56
 msgid ""
 "Debugging options:\n"
 "  -g, --no-color          toggle using of colors\n"
 "  -a, --abstraction=NAME  mixer abstraction level: none/basic"
 msgstr ""
 "Options de débogage:\n"
-"  -g, --no-color          supprimer la couleur\n"
-"  -a, --abstraction=NOM   niveau d'abstraction du mixeur: aucun/basique"
+"  -g, --no-color          basculer l'utilisation de la couleur\n"
+"  -a, --abstraction=NOM   niveau d'abstraction du mixeur : aucun/basique"
 
-#: alsamixer/cli.c:77
+#: alsamixer/cli.c:92
 #, c-format
 msgid "invalid card index: %s\n"
-msgstr "index de carte invalide: %s\n"
+msgstr "index de carte invalide : %s\n"
 
-#: alsamixer/cli.c:103
+#: alsamixer/cli.c:137
 #, c-format
 msgid "unknown abstraction level: %s\n"
-msgstr "niveau d'abstraction inconnu: %s\n"
+msgstr "niveau d'abstraction inconnu : %s\n"
 
-#: alsamixer/cli.c:108
+#: alsamixer/cli.c:142
 #, c-format
 msgid "unknown option: %c\n"
-msgstr "option inconnue: %c\n"
+msgstr "option inconnue : %c\n"
 
-#: alsamixer/cli.c:110
+#: alsamixer/cli.c:144
 msgid "try `alsamixer --help' for more information\n"
-msgstr "essayez `alsamixer --help' pour plus d'information\n"
+msgstr "essayez `alsamixer --help' pour plus d'informations\n"
 
 #: alsamixer/device_name.c:177
 msgid "Device name:"
-msgstr "Nom du périphérique:"
+msgstr "Nom du périphérique :"
 
 #: alsamixer/die.c:37
 #, c-format
 msgid "%s: %s\n"
 msgstr "%s: %s\n"
 
-#: alsamixer/mixer_display.c:98
+#: alsamixer/mixer_display.c:99
 msgid "Card:"
-msgstr "Carte:"
+msgstr "Carte :"
 
-#: alsamixer/mixer_display.c:99
+#: alsamixer/mixer_display.c:100
 msgid "Chip:"
-msgstr "Puce:"
+msgstr "Puce :"
 
-#: alsamixer/mixer_display.c:100
+#: alsamixer/mixer_display.c:101
 msgid "View:"
-msgstr "Vue:"
+msgstr "Vue :"
 
-#: alsamixer/mixer_display.c:101
+#: alsamixer/mixer_display.c:102
 msgid "Item:"
-msgstr "Contrôle:"
+msgstr "Élement :"
 
-#: alsamixer/mixer_display.c:104
+#: alsamixer/mixer_display.c:105
 msgid "F1:  Help"
-msgstr "F1:  Aide"
+msgstr "F1 :  Aide"
 
-#: alsamixer/mixer_display.c:105
+#: alsamixer/mixer_display.c:106
 msgid "F2:  System information"
-msgstr "F2:  Informations Système"
+msgstr "F2 :  Informations système"
 
-#: alsamixer/mixer_display.c:106
+#: alsamixer/mixer_display.c:107
 msgid "F6:  Select sound card"
-msgstr "F6:  Choisir la carte son"
+msgstr "F6 :  Choisir la carte son"
 
-#: alsamixer/mixer_display.c:107
+#: alsamixer/mixer_display.c:108
 msgid "Esc: Exit"
-msgstr "Esc: Quitter"
+msgstr "Esc : quitter"
 
-#: alsamixer/mixer_display.c:174
+#: alsamixer/mixer_display.c:179
 msgid "(unplugged)"
 msgstr "(non branché)"
 
-#: alsamixer/mixer_display.c:192
+#: alsamixer/mixer_display.c:197
 msgid "Playback"
 msgstr "Lecture"
 
-#: alsamixer/mixer_display.c:193
+#: alsamixer/mixer_display.c:198
 msgid "Capture"
 msgstr "Capture"
 
-#: alsamixer/mixer_display.c:194
+#: alsamixer/mixer_display.c:199
 msgid "All"
 msgstr "Tout"
 
-#: alsamixer/mixer_display.c:234
+#: alsamixer/mixer_display.c:240
 msgid "mute"
 msgstr "muet"
 
-#: alsamixer/mixer_display.c:275 alsamixer/mixer_display.c:285
+#: alsamixer/mixer_display.c:281 alsamixer/mixer_display.c:291
 msgid "dB gain:"
-msgstr "gain dB:"
+msgstr "gain dB :"
 
-#: alsamixer/mixer_display.c:285
+#: alsamixer/mixer_display.c:291
 #, c-format
 msgid " [%s %s, %s]"
 msgstr " [%s %s, %s]"
 
-#: alsamixer/mixer_display.c:294 alsamixer/mixer_display.c:300
-#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:312
+#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:306
+#: alsamixer/mixer_display.c:312 alsamixer/mixer_display.c:318
 msgid "Off"
 msgstr "Fermé"
 
-#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:312
+#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:318
 msgid "On"
 msgstr "Ouvert"
 
-#: alsamixer/mixer_display.c:363
+#: alsamixer/mixer_display.c:370
 msgid "The sound device was unplugged."
-msgstr "Le périphérique a été débranché"
+msgstr "Le périphérique son a été débranché"
 
-#: alsamixer/mixer_display.c:364
+#: alsamixer/mixer_display.c:371
 msgid "Press F6 to select another sound card."
-msgstr "Appuyez sur F6 pour choisir une autre carte son."
+msgstr "Appuyez sur F6 pour sélectionner une autre carte son."
 
-#: alsamixer/mixer_display.c:379
+#: alsamixer/mixer_display.c:386
 msgid "This sound device does not have any playback controls."
-msgstr "Ce périphérique n'a pas de commandes de lecture."
+msgstr "Ce périphérique son n'a pas de commandes de lecture."
 
-#: alsamixer/mixer_display.c:381
+#: alsamixer/mixer_display.c:388
 msgid "This sound device does not have any capture controls."
-msgstr "Ce périphérique n'a pas de commandes de capture."
+msgstr "Ce périphérique son n'a pas de commandes de capture."
 
-#: alsamixer/mixer_display.c:383
+#: alsamixer/mixer_display.c:390
 msgid "This sound device does not have any controls."
-msgstr "Ce périphérique n'a pas de commandes."
+msgstr "Ce périphérique son n'a pas de commandes."
 
 #. TRANSLATORS: playback on; one character
-#: alsamixer/mixer_display.c:516 alsamixer/mixer_display.c:521
+#: alsamixer/mixer_display.c:523 alsamixer/mixer_display.c:528
 msgid "O"
 msgstr "O"
 
 #. TRANSLATORS: playback muted; one character
-#: alsamixer/mixer_display.c:518 alsamixer/mixer_display.c:522
+#: alsamixer/mixer_display.c:525 alsamixer/mixer_display.c:529
 msgid "M"
 msgstr "M"
 
 #. TRANSLATORS: "left"; no more than two characters
-#: alsamixer/mixer_display.c:536
+#: alsamixer/mixer_display.c:545
 msgid "L"
 msgstr "G"
 
 #. TRANSLATORS: "right"; no more than two characters
-#: alsamixer/mixer_display.c:540
+#: alsamixer/mixer_display.c:551
 msgid "R"
 msgstr "D"
 
 #. TRANSLATORS: no more than eight characters
-#: alsamixer/mixer_display.c:542
+#: alsamixer/mixer_display.c:555
 msgid "CAPTURE"
 msgstr "CAPTURE"
 
-#: alsamixer/mixer_display.c:592
+#: alsamixer/mixer_display.c:611
 msgid "Front"
 msgstr "Avant"
 
-#: alsamixer/mixer_display.c:595
+#: alsamixer/mixer_display.c:614
 msgid "Rear"
 msgstr "Arrière"
 
-#: alsamixer/mixer_display.c:598 speaker-test/speaker-test.c:124
+#: alsamixer/mixer_display.c:617 speaker-test/speaker-test.c:134
 msgid "Center"
 msgstr "Centre"
 
-#: alsamixer/mixer_display.c:601
+#: alsamixer/mixer_display.c:620
 msgid "Woofer"
 msgstr "Basses"
 
-#: alsamixer/mixer_display.c:604
+#: alsamixer/mixer_display.c:623
 msgid "Side"
 msgstr "Côté"
 
@@ -229,7 +243,7 @@ msgstr "le mixeur ne peut pas être ouvert"
 
 #: alsamixer/mixer_widget.c:102 alsamixer/mixer_widget.c:179
 msgid "cannot load mixer controls"
-msgstr "les commandes de mixage ne peuvent pas être chargés"
+msgstr "les contrôles de mixage ne peuvent pas être chargés"
 
 #: alsamixer/mixer_widget.c:169
 #, c-format
@@ -250,19 +264,19 @@ msgstr "F2 /    Informations système"
 
 #: alsamixer/mixer_widget.c:193
 msgid "F3      Show playback controls"
-msgstr "F3      Afficher les commandes de lecture"
+msgstr "F3      Afficher les contrôles de lecture"
 
 #: alsamixer/mixer_widget.c:194
 msgid "F4      Show capture controls"
-msgstr "F4      Afficher les commandes de capture"
+msgstr "F4      Afficher les contrôles de capture"
 
 #: alsamixer/mixer_widget.c:195
 msgid "F5      Show all controls"
-msgstr "F5      Afficher toutes les commandes"
+msgstr "F5      Afficher tous les contrôles"
 
 #: alsamixer/mixer_widget.c:196
 msgid "Tab     Toggle view mode (F3/F4/F5)"
-msgstr "Tab     Choisir le mode de visualisation (F3/F4/F5)"
+msgstr "Tab     Basculer le mode de visualisation (F3/F4/F5)"
 
 #: alsamixer/mixer_widget.c:197
 msgid "F6 S    Select sound card"
@@ -270,27 +284,27 @@ msgstr "F6 S    Choisir la carte son"
 
 #: alsamixer/mixer_widget.c:198
 msgid "L       Redraw screen"
-msgstr "L       Actualiser l'écran"
+msgstr "L       Rafraîchir l'écran"
 
 #: alsamixer/mixer_widget.c:200
 msgid "Left    Move to the previous control"
-msgstr "Gauche  Aller à la commande précédente"
+msgstr "Gauche  Aller au contrôle précédent"
 
 #: alsamixer/mixer_widget.c:201
 msgid "Right   Move to the next control"
-msgstr "Droite  Aller à la commande suivante"
+msgstr "Droite  Aller au contrôle suivant"
 
 #: alsamixer/mixer_widget.c:203
 msgid "Up/Down    Change volume"
-msgstr "Haut/Bas   Ajuster le volume"
+msgstr "Haut/Bas   Modifier le volume"
 
 #: alsamixer/mixer_widget.c:204
 msgid "+ -        Change volume"
-msgstr "+ -        Ajuster le volume"
+msgstr "+ -        Modifier le volume"
 
 #: alsamixer/mixer_widget.c:205
 msgid "Page Up/Dn Change volume in big steps"
-msgstr "Page Préc./Suiv. Ajuster le volume en grandes intervalles"
+msgstr "Page Préc./Suiv. Modifier le volume par grands intervalles"
 
 #: alsamixer/mixer_widget.c:206
 msgid "End        Set volume to 0%"
@@ -315,25 +329,25 @@ msgstr "B          Égaliser les volumes de gauche et droite"
 
 #: alsamixer/mixer_widget.c:213
 msgid "M          Toggle mute"
-msgstr "M          (Dés)activer le mode muet"
+msgstr "M          Basculer le mode muet"
 
 #. TRANSLATORS: or , .
 #: alsamixer/mixer_widget.c:215
 msgid "< >        Toggle left/right mute"
-msgstr "< >        (Dés)activer le mode muet à gauche et à droite"
+msgstr "< >        Basculer le mode muet à gauche et à droite"
 
 #: alsamixer/mixer_widget.c:217
 msgid "Space      Toggle capture"
-msgstr "Espace     (Dés)activer la capture"
+msgstr "Espace     Basculer la capture"
 
 #. TRANSLATORS: or Insert Delete
 #: alsamixer/mixer_widget.c:219
 msgid "; '        Toggle left/right capture"
-msgstr ";          (Dés)activer la capture à gauche et à droite"
+msgstr ";          Basculer la capture à gauche et à droite"
 
 #: alsamixer/mixer_widget.c:221
 msgid "Authors:"
-msgstr "Auteurs:"
+msgstr "Auteurs :"
 
 #: alsamixer/mixer_widget.c:222
 msgid "  Tim Janik"
@@ -351,11 +365,11 @@ msgstr ""
 msgid "Help"
 msgstr "Aide"
 
-#: alsamixer/proc_files.c:103
+#: alsamixer/proc_files.c:56
 msgid "Select File"
-msgstr "Choisir un Fichier"
+msgstr "Choisir un fichier"
 
-#: alsamixer/textbox.c:52 alsamixer/textbox.c:66
+#: alsamixer/textbox.c:51 alsamixer/textbox.c:65
 msgid "Error"
 msgstr "Erreur"
 
@@ -364,24 +378,73 @@ msgstr "Erreur"
 msgid "Cannot open file \"%s\"."
 msgstr "Le fichier \"%s\" n'a pas pu être ouvert."
 
-#: aplay/aplay.c:175
+#: aplay/aplay.c:184
 msgid "raw data"
 msgstr "données brutes"
 
-#: aplay/aplay.c:176
+#: aplay/aplay.c:185
 msgid "VOC"
 msgstr ""
 
-#: aplay/aplay.c:178
+#: aplay/aplay.c:187
 msgid "WAVE"
 msgstr ""
 
-#: aplay/aplay.c:179
+#: aplay/aplay.c:188
 msgid "Sparc Audio"
 msgstr ""
 
-#: aplay/aplay.c:200
+#: aplay/aplay.c:209
 #, fuzzy, c-format
+#| msgid ""
+#| "Usage: %s [OPTION]... [FILE]...\n"
+#| "\n"
+#| "-h, --help              help\n"
+#| "    --version           print current version\n"
+#| "-l, --list-devices      list all soundcards and digital audio devices\n"
+#| "-L, --list-pcms         list device names\n"
+#| "-D, --device=NAME       select PCM by name\n"
+#| "-q, --quiet             quiet mode\n"
+#| "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+#| "-c, --channels=#        channels\n"
+#| "-f, --format=FORMAT     sample format (case insensitive)\n"
+#| "-r, --rate=#            sample rate\n"
+#| "-d, --duration=#        interrupt after # seconds\n"
+#| "-s, --samples=#         interrupt after # samples per channel\n"
+#| "-M, --mmap              mmap stream\n"
+#| "-N, --nonblock          nonblocking mode\n"
+#| "-F, --period-time=#     distance between interrupts is # microseconds\n"
+#| "-B, --buffer-time=#     buffer duration is # microseconds\n"
+#| "    --period-size=#     distance between interrupts is # frames\n"
+#| "    --buffer-size=#     buffer duration is # frames\n"
+#| "-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+#| "-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+#| "                        (relative to buffer size if <= 0)\n"
+#| "-T, --stop-delay=#      delay for automatic PCM stop is # microseconds "
+#| "from xrun\n"
+#| "-v, --verbose           show PCM structure and setup (accumulative)\n"
+#| "-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+#| "-I, --separate-channels one file for each channel\n"
+#| "-i, --interactive       allow interactive operation from stdin\n"
+#| "-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+#| "    --disable-resample  disable automatic rate resample\n"
+#| "    --disable-channels  disable automatic channel conversions\n"
+#| "    --disable-format    disable automatic format conversions\n"
+#| "    --disable-softvol   disable software volume control (softvol)\n"
+#| "    --test-position     test ring buffer position\n"
+#| "    --test-coef=#       test coefficient for ring buffer position "
+#| "(default 8)\n"
+#| "                        expression for validation is: coef * "
+#| "(buffer_size / 2)\n"
+#| "    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+#| "    --max-file-time=#   start another output file when the old file has "
+#| "recorded\n"
+#| "                        for this many seconds\n"
+#| "    --process-id-file   write the process ID here\n"
+#| "    --use-strftime      apply the strftime facility to the output file "
+#| "name\n"
+#| "    --dump-hw-params    dump hw_params of the device\n"
+#| "    --fatal-errors      treat all errors as fatal\n"
 msgid ""
 "Usage: %s [OPTION]... [FILE]...\n"
 "\n"
@@ -394,8 +457,10 @@ msgid ""
 "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
 "-c, --channels=#        channels\n"
 "-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
 "-r, --rate=#            sample rate\n"
 "-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
 "-M, --mmap              mmap stream\n"
 "-N, --nonblock          nonblocking mode\n"
 "-F, --period-time=#     distance between interrupts is # microseconds\n"
@@ -434,8 +499,9 @@ msgstr ""
 "\n"
 "-h, --help              aide\n"
 "    --version           afficher la version du programme\n"
-"-l, --list-devices      afficher la listes des périphériques\n"
-"-L, --list-pcms         afficher la liste des noms de périphériques\n"
+"-l, --list-devices      lister tous périphériques audio-numériques et cartes "
+"son\n"
+"-L, --list-pcms         lister les noms de périphériques\n"
 "-D, --device=NOM        choisir le périphérique PCM par son nom\n"
 "-Q, --quiet             mode silencieux\n"
 "-t, --file-type TYPE    type de fichier (voc, wav, raw ou au)\n"
@@ -443,174 +509,263 @@ msgstr ""
 "-f, --format=FORMAT     format d'échantillonage (insensible à la casse)\n"
 "-r, --rate=#            fréquence d'échantillonage\n"
 "-d, --duration=#        interrompre après # secondes\n"
-"-M, --mmap              charger le flux en mémoire avec mmap\n"
+"-s, --samples=#         interrompre après # échantillons par canal\n"
+"-M, --mmap              flux mmap\n"
 "-N, --nonblock          mode non-bloquant\n"
-"-F, --period-time=#     # microsecondes entre chaque interruption\n"
+"-F, --period-time=#     la durée entre les interruptions est de\n"
+"# microsecondes\n"
 "-B, --buffer-time=#     la durée du tampon est de # microsecondes\n"
-"    --period-size=#     # trames entre chaque interruption\n"
+"    --period-size=#     la durée entre interruptions est # trames\n"
 "    --buffer-size=#     la durée du tampon est de # trames\n"
-"-A, --avail-min=#       # microsecondes min. disponibles entre chaque "
-"réveil\n"
-"-R, --start-delay=#     # microsecondes de délai avant le démarrage\n"
-"                        automatique du périphérique PCM (relatif à la "
-"taille\n"
-"                        du tampon si <= 0)\n"
+"-A, --avail-min=#       l'espace minimum disponible pour le réveil est de\n"
+"# microsecondes\n"
+"-R, --start-delay=#     le délai pour le démarrage PCM automtique est de \n"
+"# microsecondes (relatif à la taille du tampon si\n"
+"<= 0)\n"
 "-T, --stop-delay=#      # microsecondes de délai depuis xrun avant l'arrêt\n"
-"                        automatique du périphérique PCM \n"
+"automatique du périphérique PCM \n"
 "-v, --verbose           afficher la structure et la configuration du\n"
-"                        périphérique PCM (accumulatif)\n"
-"-V, --vumeter=TYPE      activer le VU-mètre (TYPE: mono ou stereo)\n"
+"périphérique PCM (accumulatif)\n"
+"-V, --vumeter=TYPE      activer le VU-mètre (TYPE : mono ou stéréo)\n"
 "-I, --separate-channels un fichier par canal\n"
+"-i, --interactive       permet une opération interactive depuis stdin\n"
+"-m, --chmap=ch1,ch2,..  donne la carte du canal à écraser ou suivre\n"
 "    --disable-resample  désactiver le rééchantillonage de fréquence\n"
-"                        automatique\n"
+"automatique\n"
 "    --disable-channels  désactiver les conversions automatiques de canal\n"
 "    --disable-format    désactiver les conversions automatiques de format\n"
-"    --disable-softvol   désactiver la commande du volume logicielle\n"
+"    --disable-softvol   désactiver le contrôle du volume logiciel (softvol)\n"
 "    --test-position     tester la position du tampon circulaire\n"
 "    --test-coef=#       test coefficient pour la position du tampon\n"
-"                        circulaire (par défaut 8). L'expression pour la\n"
-"                        validation est : coef * (taille_tampon / 2)\n"
+"circulaire (par défaut 8). L'expression pour la\n"
+"validation est : coef * (taille_tampon / 2)\n"
 "    --test-nowait       ne pas attendre le tampon circulaire - prend toutes\n"
-"                        les resources du processeur\n"
+"les resources du processeur\n"
 "    --max-file-time=#   commencer un autre fichier de capture quand "
 "l'ancien\n"
-"                        fichier a enregistré pendant # secondes\n"
+"fichier a enregistré pendant X secondes\n"
 "    --process-id-file   écrire l'identifiant du processus ici\n"
-"    --use-strftime      utiliser strftime pour le nom du fichier de capture\n"
+"    --use-strftime      utiliser strftime pour le nom du fichier de sortie\n"
+"    --dump-hw-params    récupérer le hw_params du périphérique\n"
+"    --fatal-errors      traiter toutes les erreurs comme fatales\n"
 
-#: aplay/aplay.c:244 speaker-test/speaker-test.c:1021
+#: aplay/aplay.c:255 speaker-test/speaker-test.c:1001
 #, c-format
 msgid "Recognized sample formats are:"
-msgstr "Les formats d'échantillonage connus sont:"
+msgstr "Les formats d'échantillonage connus sont :"
 
-#: aplay/aplay.c:250
+#: aplay/aplay.c:261
 #, c-format
 msgid ""
 "\n"
 "Some of these may not be available on selected hardware\n"
 msgstr ""
 "\n"
-"Certains de ceux-ci ne sont peut être pas disponibles avec ce matériel\n"
+"Certains de ceux-ci ne sont peut être pas disponibles avec le matériel "
+"sélectionné\n"
 
-#: aplay/aplay.c:251
-#, fuzzy, c-format
+#: aplay/aplay.c:262
+#, c-format
 msgid "The available format shortcuts are:\n"
-msgstr "Les raccourcis format disponibles sont:\n"
+msgstr "Les raccourcis format disponibles sont :\n"
 
-#: aplay/aplay.c:252
+#: aplay/aplay.c:263
 #, c-format
 msgid "-f cd (16 bit little endian, 44100, stereo)\n"
 msgstr "-f cd (16 bit petit boutiste, 44100, stéréo)\n"
 
-#: aplay/aplay.c:253
+#: aplay/aplay.c:264
 #, c-format
 msgid "-f cdr (16 bit big endian, 44100, stereo)\n"
 msgstr "-f cdr (16 bit gros boutiste, 44100, stéréo)\n"
 
-#: aplay/aplay.c:254
+#: aplay/aplay.c:265
 #, c-format
 msgid "-f dat (16 bit little endian, 48000, stereo)\n"
 msgstr "-f dat (16 bit petit boutiste, 48000, stéréo)\n"
 
-#: aplay/aplay.c:268
+#: aplay/aplay.c:279
 msgid "no soundcards found..."
 msgstr "aucune carte son n'a été trouvée..."
 
-#: aplay/aplay.c:271
+#: aplay/aplay.c:282
 #, c-format
 msgid "**** List of %s Hardware Devices ****\n"
-msgstr "**** Liste des Périphériques Matériels %s ****\n"
+msgstr "**** Liste des périphériques matériels %s ****\n"
 
-#: aplay/aplay.c:300
+#: aplay/aplay.c:311
 #, c-format
 msgid "card %i: %s [%s], device %i: %s [%s]\n"
-msgstr "carte %i: %s [%s], périphérique %i: %s [%s]\n"
+msgstr "carte %i : %s [%s], périphérique %i : %s [%s]\n"
 
-#: aplay/aplay.c:306
+#: aplay/aplay.c:317
 #, c-format
 msgid "  Subdevices: %i/%i\n"
-msgstr "  Sous-périphériques: %i/%i\n"
+msgstr "  Sous-périphériques : %i/%i\n"
 
-#: aplay/aplay.c:313
+#: aplay/aplay.c:324
 #, c-format
 msgid "  Subdevice #%i: %s\n"
-msgstr "  Sous-périphérique #%i: %s\n"
+msgstr "  Sous-périphérique #%i : %s\n"
 
-#: aplay/aplay.c:394
+#: aplay/aplay.c:405
 #, c-format
 msgid "Aborted by signal %s...\n"
 msgstr "Interrompu par le signal %s...\n"
 
-#: aplay/aplay.c:512
+#: aplay/aplay.c:562
 msgid "command should be named either arecord or aplay"
 msgstr "la commande doit être nommée arecord ou aplay"
 
-#: aplay/aplay.c:556
+#: aplay/aplay.c:607
 #, c-format
 msgid "unrecognized file format %s"
 msgstr "format de fichier inconnu %s"
 
-#: aplay/aplay.c:563
+#: aplay/aplay.c:614
+#, c-format
+msgid "invalid channels argument '%s'"
+msgstr "argument des canaux invalides '%s'"
+
+#: aplay/aplay.c:618
 #, c-format
 msgid "value %i for channels is invalid"
 msgstr "la valeur %i pour les canaux est incorrecte"
 
-#: aplay/aplay.c:582
+#: aplay/aplay.c:638
 #, c-format
 msgid "wrong extended format '%s'"
 msgstr "format étendu '%s' erronné"
 
-#: aplay/aplay.c:593
+#: aplay/aplay.c:650
+#, fuzzy, c-format
+#| msgid "wrong extended format '%s'"
+msgid "wrong extended subformat '%s'"
+msgstr "format étendu '%s' erronné"
+
+#: aplay/aplay.c:657
+#, c-format
+msgid "invalid rate argument '%s'"
+msgstr "argument de taux invalide '%s'"
+
+#: aplay/aplay.c:664
 #, c-format
 msgid "bad speed value %i"
 msgstr "mauvaise valeur de vitesse %i"
 
-#: aplay/aplay.c:700 speaker-test/speaker-test.c:665
+#: aplay/aplay.c:670
+msgid "duration and samples arguments cannot be used together"
+msgstr ""
+"la durée et les arguments d'échantillons ne peuvent pas être utilisés "
+"ensemble"
+
+#: aplay/aplay.c:675
 #, c-format
-msgid "Unable to parse channel map string: %s\n"
+msgid "invalid duration argument '%s'"
+msgstr "argument de durée invalide '%s'"
+
+#: aplay/aplay.c:682
+msgid "samples and duration arguments cannot be used together"
 msgstr ""
+"les échantillons et les arguments de durée ne peuvent pas être utilisés "
+"ensemble"
+
+#: aplay/aplay.c:687
+#, c-format
+msgid "invalid samples argument '%s'"
+msgstr "argument d'échantillon invalide '%s'"
+
+#: aplay/aplay.c:699
+#, c-format
+msgid "invalid period time argument '%s'"
+msgstr "argument de temps de période invalide '%s'"
 
 #: aplay/aplay.c:706
 #, c-format
+msgid "invalid buffer time argument '%s'"
+msgstr "argument de temps de tampon invalide '%s'"
+
+#: aplay/aplay.c:713
+#, c-format
+msgid "invalid period size argument '%s'"
+msgstr "argument de taille de période invalide '%s'"
+
+#: aplay/aplay.c:720
+#, c-format
+msgid "invalid buffer size argument '%s'"
+msgstr "argument de taille de tampon invalide '%s'"
+
+#: aplay/aplay.c:727
+#, c-format
+msgid "invalid min available space argument '%s'"
+msgstr "argument d'espace disponible minimum invalide '%s'"
+
+#: aplay/aplay.c:734
+#, c-format
+msgid "invalid start delay argument '%s'"
+msgstr "argument de délai de départ invalide '%s'"
+
+#: aplay/aplay.c:741
+#, c-format
+msgid "invalid stop delay argument '%s'"
+msgstr "argument de délai d'arrêt invalide '%s'"
+
+#: aplay/aplay.c:796
+#, c-format
+msgid "invalid test coef argument '%s'"
+msgstr "argument de coef de test invalide '%s'"
+
+#: aplay/aplay.c:808
+#, c-format
+msgid "invalid max file time argument '%s'"
+msgstr "argument de temps de fichier maximum invalide '%s'"
+
+#: aplay/aplay.c:828 speaker-test/speaker-test.c:616
+#, c-format
+msgid "Unable to parse channel map string: %s\n"
+msgstr "Impossible d'analyser la chaîne de map du canal : %s\n"
+
+#: aplay/aplay.c:834
+#, c-format
 msgid "Try `%s --help' for more information.\n"
 msgstr "Essayez `%s --help' pour plus d'informations.\n"
 
-#: aplay/aplay.c:722
+#: aplay/aplay.c:850
 #, c-format
 msgid "audio open error: %s"
-msgstr "erreur à l'ouverture audio: %s"
+msgstr "erreur à l'ouverture audio : %s"
 
-#: aplay/aplay.c:727
+#: aplay/aplay.c:855
 #, c-format
 msgid "info error: %s"
-msgstr "erreur info: %s"
+msgstr "erreur info : %s"
 
-#: aplay/aplay.c:734
+#: aplay/aplay.c:862
 #, c-format
 msgid "nonblock setting error: %s"
-msgstr "paramètre de non-blocage erronné: %s"
+msgstr "paramètre de non-blocage erronné : %s"
 
-#: aplay/aplay.c:744 aplay/aplay.c:868 aplay/aplay.c:1158 aplay/aplay.c:1351
-#: aplay/aplay.c:1867 aplay/aplay.c:1897
+#: aplay/aplay.c:880 aplay/aplay.c:1004 aplay/aplay.c:1310 aplay/aplay.c:1526
+#: aplay/aplay.c:2106 aplay/aplay.c:2136
 msgid "not enough memory"
 msgstr "pas assez de mémoire"
 
-#: aplay/aplay.c:768
+#: aplay/aplay.c:904
 #, c-format
 msgid "Cannot create process ID file %s: %s"
-msgstr "Le fichier de numéro de processus %s n'a pas pu être créé: %s"
+msgstr "Le fichier d'identifiant de processus %s n'a pas pu être créé : %s"
 
-#: aplay/aplay.c:858
+#: aplay/aplay.c:994
 #, c-format
 msgid "read error (called from line %i)"
 msgstr "erreur de lecture (appelé à la ligne %i)"
 
-#: aplay/aplay.c:925
+#: aplay/aplay.c:1062
 #, c-format
 msgid "unknown length of 'fmt ' chunk (read %u, should be %u at least)"
 msgstr "longueur du morceau 'fmt ' inconnue (lu %u, devrait être au moins %u)"
 
-#: aplay/aplay.c:936
+#: aplay/aplay.c:1073
 #, c-format
 msgid ""
 "unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"
@@ -618,902 +773,1021 @@ msgstr ""
 "longueur du morceau 'fmt ' extensible inconnue (lu %u, devrait être au moins "
 "%u)"
 
-#: aplay/aplay.c:941
+#: aplay/aplay.c:1078
 msgid "wrong format tag in extensible 'fmt ' chunk"
 msgstr "libellé de format erronné dans le morceau extensible 'fmt '"
 
-#: aplay/aplay.c:948
+#: aplay/aplay.c:1086
 #, c-format
 msgid "can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"
 msgstr ""
-"Les formats de ficher WAVE 0x%04x qui ne sont pas encodés en PCM ouFLOAT ne "
+"Les formats de ficher WAVE 0x%04x qui ne sont pas encodés en PCM ou FLOAT ne "
 "sont pas supportés"
 
-#: aplay/aplay.c:953
+#: aplay/aplay.c:1091
 #, c-format
 msgid "can't play WAVE-files with %d tracks"
 msgstr "Les fichiers WAVE avec %d pistes ne sont pas supportés"
 
-#: aplay/aplay.c:961 aplay/aplay.c:1087
+#: aplay/aplay.c:1096
+#, c-format
+msgid "valid bps greater than bps: %d > %d"
+msgstr ""
+
+#: aplay/aplay.c:1103 aplay/aplay.c:1239
 #, c-format
 msgid "Warning: format is changed to U8\n"
-msgstr "Avertissement: le format est changé en U8\n"
+msgstr "Avertissement : le format est changé en U8\n"
 
-#: aplay/aplay.c:971 aplay/aplay.c:984 aplay/aplay.c:995
-#, fuzzy, c-format
+#: aplay/aplay.c:1113 aplay/aplay.c:1126 aplay/aplay.c:1137
+#, c-format
 msgid "Warning: format is changed to %s\n"
-msgstr "Avertissement: le format est changé en U8\n"
+msgstr "Avertissement : le format est changé en %s\n"
 
-#: aplay/aplay.c:1000
+#: aplay/aplay.c:1142
 #, c-format
 msgid ""
 " can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"
 msgstr ""
-" les fichiers WAVE échantillonés %d bits par %d octets en largeur (%d canaux)"
-"ne sont pas supportés"
+" les fichiers WAVE échantillonés %d bits par %d octets en largeur (%d "
+"canaux) ne sont pas supportés"
 
-#: aplay/aplay.c:1023
+#: aplay/aplay.c:1175
 #, c-format
 msgid " can't play WAVE-files with sample %d bits wide"
 msgstr ""
-" les fichiers WAVES échantillonés %d bits en largeur ne sont passupportés"
+" les fichiers WAVES échantillonés %d bits en largeur ne sont pas supportés"
 
-#: aplay/aplay.c:1081
+#: aplay/aplay.c:1233
 #, c-format
 msgid "Warning: format is changed to MU_LAW\n"
-msgstr "Avertissement: le format est changé en MU_LAW\n"
+msgstr "Avertissement : le format est changé en MU_LAW\n"
 
-#: aplay/aplay.c:1093
+#: aplay/aplay.c:1245
 #, c-format
 msgid "Warning: format is changed to S16_BE\n"
-msgstr "Avertissement: le format est changé en S16_BE\n"
+msgstr "Avertissement : le format est changé en S16_BE\n"
 
-#: aplay/aplay.c:1106 aplay/aplay.c:2182 aplay/aplay.c:2189 aplay/aplay.c:2715
-#: aplay/aplay.c:2727
+#: aplay/aplay.c:1258 aplay/aplay.c:2427 aplay/aplay.c:2434 aplay/aplay.c:2964
 msgid "read error"
 msgstr "erreur de lecture"
 
-#: aplay/aplay.c:1136
+#: aplay/aplay.c:1288
 msgid "Channel numbers don't match between hw_params and channel map"
 msgstr ""
+"Les numéros de canal ne correspondent pas entre hw_params et la carte de "
+"canal"
 
-#: aplay/aplay.c:1145
+#: aplay/aplay.c:1297
 #, c-format
 msgid "Warning: unable to get channel map\n"
-msgstr ""
+msgstr "Avertissement : impossible d'obtenir la carte de canal\n"
 
-#: aplay/aplay.c:1178
-#, c-format
-msgid "Channel %d doesn't match with hw_parmas"
-msgstr ""
+#: aplay/aplay.c:1331
+#, fuzzy, c-format
+#| msgid "Channel %d doesn't match with hw_parmas"
+msgid "Channel %d doesn't match with hw_params"
+msgstr "Le canal %d ne correspond pas avec hw_parmas"
 
-#: aplay/aplay.c:1204
+#: aplay/aplay.c:1358
 msgid "Broken configuration for this PCM: no configurations available"
-msgstr "Configuration erronée pour ce périphérique PCM: pas de configuration"
+msgstr "Configuration erronée pour ce PCM : pas de configuration disponible"
 
-#: aplay/aplay.c:1208
+#: aplay/aplay.c:1362
 #, c-format
 msgid "HW Params of device \"%s\":\n"
-msgstr ""
+msgstr "Params HW pour le périphérique \"%s\" :\n"
 
-#: aplay/aplay.c:1228
+#: aplay/aplay.c:1382
 msgid "Access type not available"
 msgstr "Ce type d'accès n'est pas disponible"
 
-#: aplay/aplay.c:1233
+#: aplay/aplay.c:1387
 msgid "Sample format non available"
 msgstr "Ce format d'échantillonage n'est pas disponible"
 
-#: aplay/aplay.c:1239
+#: aplay/aplay.c:1393
+#, fuzzy
+#| msgid "Sample format non available"
+msgid "Sample subformat not available"
+msgstr "Ce format d'échantillonage n'est pas disponible"
+
+#: aplay/aplay.c:1398
 msgid "Channels count non available"
 msgstr "Nombre de canaux non disponible"
 
-#: aplay/aplay.c:1254
+#: aplay/aplay.c:1413
 #, c-format
 msgid "Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"
 msgstr ""
-"Avertissement: la fréquence n'est pas précise (demandé = %iHz,\n"
+"Avertissement : la fréquence n'est pas précise (demandé = %iHz,\n"
 "obtenu = %iHz)\n"
 
-#: aplay/aplay.c:1260
+#: aplay/aplay.c:1419
 #, c-format
 msgid "         please, try the plug plugin %s\n"
 msgstr "         veuillez essayez le greffon de branchement %s\n"
 
-#: aplay/aplay.c:1297
+#: aplay/aplay.c:1456
 msgid "Unable to install hw params:"
-msgstr "Les paramètres matériel n'ont pas pu être installés:"
+msgstr "Les paramètres matériel n'ont pas pu être installés :"
 
-#: aplay/aplay.c:1304
+#: aplay/aplay.c:1463
 #, c-format
 msgid "Can't use period equal to buffer size (%lu == %lu)"
 msgstr ""
-"Une période égale à la taille du tampon (%lu == %lu) ne peut êtreutilisée"
+"Une période égale à la taille du tampon (%lu == %lu) ne peut être utilisée"
+
+#: aplay/aplay.c:1469
+#, fuzzy
+#| msgid "unable to install sw params:"
+msgid "Unable to get current sw params."
+msgstr "Les paramètres logiciel n'ont pas pu être installés :"
 
-#: aplay/aplay.c:1335
+#: aplay/aplay.c:1509
 msgid "unable to install sw params:"
-msgstr "Les paramètres logiciel n'ont pas pu être installés:"
+msgstr "Les paramètres logiciel n'ont pas pu être installés :"
 
-#: aplay/aplay.c:1369
+#: aplay/aplay.c:1544
 #, c-format
 msgid "snd_pcm_mmap_begin problem: %s"
-msgstr ""
+msgstr "problème snd_pcm_mmap_begin : %s"
 
-#: aplay/aplay.c:1398
+#: aplay/aplay.c:1573
 #, c-format
 msgid "stdin O_NONBLOCK flag setup failed\n"
-msgstr ""
+msgstr "paramétrage du fanion stdin O_NONBLOCK échoué\n"
 
-#: aplay/aplay.c:1422
+#: aplay/aplay.c:1610
 #, c-format
 msgid "\rPAUSE command ignored (no hw support)\n"
-msgstr ""
+msgstr "commande \rPAUSE ignorée (pas de support hw)\n"
 
-#: aplay/aplay.c:1427
-#, fuzzy, c-format
+#: aplay/aplay.c:1618
+#, c-format
 msgid "pause push error: %s"
-msgstr "erreur d'état: %s"
+msgstr "erreur de poussée de pause : %s"
 
-#: aplay/aplay.c:1436
-#, fuzzy, c-format
+#: aplay/aplay.c:1629
+#, c-format
 msgid "pause release error: %s"
-msgstr "suspension: prepare error: %s"
+msgstr "erreur de la relâche de la pause : %s"
 
-#: aplay/aplay.c:1452
+#: aplay/aplay.c:1645
 #, c-format
 msgid ""
 "\r=== PAUSE ===                                                            "
 msgstr ""
 
-#: aplay/aplay.c:1494
+#: aplay/aplay.c:1687
 #, c-format
 msgid "status error: %s"
-msgstr "erreur d'état: %s"
+msgstr "erreur d'état : %s"
 
-#: aplay/aplay.c:1499
-#, fuzzy, c-format
-msgid "fatal %s: %s"
-msgstr "%s: %s\n"
+#: aplay/aplay.c:1697 aplay/aplay.c:1708
+#, c-format
+msgid "%s!!! (at least %.3f ms long)\n"
+msgstr "%s!!! (au moins longue de %.3f ms)\n"
 
-#: aplay/aplay.c:1500 aplay/aplay.c:1511 aplay/aplay.c:1514 aplay/aplay.c:1522
+#: aplay/aplay.c:1698 aplay/aplay.c:1701 aplay/aplay.c:1709 aplay/aplay.c:1718
 msgid "underrun"
 msgstr "perte"
 
-#: aplay/aplay.c:1500 aplay/aplay.c:1511 aplay/aplay.c:1522
+#: aplay/aplay.c:1698 aplay/aplay.c:1709 aplay/aplay.c:1718
 msgid "overrun"
 msgstr "dépassement"
 
-#: aplay/aplay.c:1510 aplay/aplay.c:1521
+#: aplay/aplay.c:1713
 #, c-format
-msgid "%s!!! (at least %.3f ms long)\n"
-msgstr "%s!!! (au moins longue de %.3f ms)\n"
+msgid "Status:\n"
+msgstr "État :\n"
 
-#: aplay/aplay.c:1526
+#: aplay/aplay.c:1717
 #, c-format
-msgid "Status:\n"
-msgstr "État:\n"
+msgid "fatal %s: %s"
+msgstr "fatal %s : %s"
 
-#: aplay/aplay.c:1530
+#: aplay/aplay.c:1723
 #, c-format
 msgid "xrun: prepare error: %s"
-msgstr ""
+msgstr "xrun : erreur de préparation : %s"
 
-#: aplay/aplay.c:1536
+#: aplay/aplay.c:1730
 #, c-format
 msgid "Status(DRAINING):\n"
-msgstr ""
+msgstr "Statut (DRAINAGE) :\n"
 
-#: aplay/aplay.c:1540
+#: aplay/aplay.c:1734
 #, c-format
 msgid "capture stream format change? attempting recover...\n"
 msgstr ""
-"changement de format de flux de capture? tentative de récupération...\n"
+"changement de format de flux de capture ? tentative de récupération...\n"
 
-#: aplay/aplay.c:1542
+#: aplay/aplay.c:1736
 #, c-format
 msgid "xrun(DRAINING): prepare error: %s"
-msgstr ""
+msgstr "xrun(DRAINAGE) : erreur de préparation : %s"
 
-#: aplay/aplay.c:1549
+#: aplay/aplay.c:1743
 #, c-format
 msgid "Status(R/W):\n"
-msgstr ""
+msgstr "Status(R/W) :\n"
 
-#: aplay/aplay.c:1552
+#: aplay/aplay.c:1746
 #, c-format
 msgid "read/write error, state = %s"
 msgstr "erreur de lecture/écriture, état = %s"
 
-#: aplay/aplay.c:1562
+#: aplay/aplay.c:1756
 #, c-format
 msgid "Suspended. Trying resume. "
 msgstr "Suspendu. Tentative de reprise. "
 
-#: aplay/aplay.c:1567
+#: aplay/aplay.c:1762
 #, c-format
 msgid "Failed. Restarting stream. "
 msgstr "Échec. Redémarrage du flux."
 
-#: aplay/aplay.c:1569
+#: aplay/aplay.c:1765
 #, c-format
 msgid "suspend: prepare error: %s"
-msgstr "suspension: prepare error: %s"
+msgstr "suspension : prepare error : %s"
 
-#: aplay/aplay.c:1574
+#: aplay/aplay.c:1770
 #, c-format
 msgid "Done.\n"
 msgstr "Terminé.\n"
 
-#: aplay/aplay.c:1596
+#: aplay/aplay.c:1792
 #, c-format
 msgid " !clip  "
 msgstr ""
 
-#: aplay/aplay.c:1743
+#: aplay/aplay.c:1944
 #, c-format
 msgid "Unsupported bit size %d.\n"
 msgstr "%d bit(s) non supporté(s).\n"
 
-#: aplay/aplay.c:1777
+#: aplay/aplay.c:1980
 #, c-format
 msgid "Max peak (%li samples): 0x%08x "
-msgstr "Pic max. (%li échantillons): 0x%08x "
+msgstr "Pic max. (%li échantillons) : 0x%08x "
 
-#: aplay/aplay.c:1811
+#: aplay/aplay.c:2021
 #, c-format
 msgid ""
 "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer = "
 "%li\n"
 msgstr ""
-"Position de tampon suspicieuse (total %li): dispo = %li, délai = %li, tampon "
-"= %li\n"
+"Position de tampon suspicieuse (total %li) : dispo = %li, délai = %li, "
+"tampon = %li\n"
+
+#: aplay/aplay.c:2030
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position (%li total): avail = %li, delay = %li, "
+"buffer = %li\n"
+msgstr ""
+"Position de tampon suspicieuse (total %li) : dispo = %li, délai = %li, "
+"tampon = %li\n"
+
+#: aplay/aplay.c:2034
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious buffer position avail > delay (%li total): avail = %li, delay = "
+"%li\n"
+msgstr ""
+"Position de tampon suspicieuse (total %li) : dispo = %li, délai = %li, "
+"tampon = %li\n"
+
+#: aplay/aplay.c:2038
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position avail > delay (%li total): avail = %li, "
+"delay = %li\n"
+msgstr ""
+"Position de tampon suspicieuse (total %li) : dispo = %li, délai = %li, "
+"tampon = %li\n"
 
-#: aplay/aplay.c:1939
+#: aplay/aplay.c:2081
+#, c-format
+msgid "Status(R/W) (standalone avail=%li delay=%li):\n"
+msgstr ""
+
+#: aplay/aplay.c:2178
 #, c-format
 msgid "write error: %s"
-msgstr "erreur en écriture: %s"
+msgstr "erreur en écriture : %s"
 
-#: aplay/aplay.c:1987
+#: aplay/aplay.c:2226
 #, c-format
 msgid "writev error: %s"
-msgstr "erreur de writev: %s"
+msgstr "erreur de writev : %s"
 
-#: aplay/aplay.c:2031
+#: aplay/aplay.c:2272
 #, c-format
 msgid "read error: %s"
-msgstr "erreur en lecture: %s"
+msgstr "erreur en lecture : %s"
 
-#: aplay/aplay.c:2075
+#: aplay/aplay.c:2319
 #, c-format
 msgid "readv error: %s"
-msgstr "erreur de readv: %s"
+msgstr "erreur de readv : %s"
 
-#: aplay/aplay.c:2123
+#: aplay/aplay.c:2368
 msgid "can't allocate buffer for silence"
 msgstr "Un tampon pour silence n'a pas pu être alloué"
 
-#: aplay/aplay.c:2132 aplay/aplay.c:2360 aplay/aplay.c:2365 aplay/aplay.c:2412
-#: aplay/aplay.c:2421 aplay/aplay.c:2428 aplay/aplay.c:2438 aplay/aplay.c:2444
-#: aplay/aplay.c:2516 aplay/aplay.c:2546 aplay/aplay.c:2560
+#: aplay/aplay.c:2377 aplay/aplay.c:2606 aplay/aplay.c:2611 aplay/aplay.c:2663
+#: aplay/aplay.c:2672 aplay/aplay.c:2679 aplay/aplay.c:2689 aplay/aplay.c:2695
+#: aplay/aplay.c:2767 aplay/aplay.c:2797 aplay/aplay.c:2811
 msgid "write error"
 msgstr "erreur en écriture"
 
-#: aplay/aplay.c:2145
+#: aplay/aplay.c:2390
 #, c-format
 msgid "voc_pcm_flush - silence error"
 msgstr "voc_pcm_flush - erreur de silence"
 
-#: aplay/aplay.c:2148
+#: aplay/aplay.c:2393
 msgid "voc_pcm_flush error"
 msgstr "erreur voc_pcm_flush"
 
-#: aplay/aplay.c:2173
+#: aplay/aplay.c:2418
 msgid "malloc error"
 msgstr "erreur malloc"
 
-#: aplay/aplay.c:2177
+#: aplay/aplay.c:2422
 #, c-format
 msgid "Playing Creative Labs Channel file '%s'...\n"
 msgstr "Lecture du ficher de canaux Creative Labs '%s'...\n"
 
-#: aplay/aplay.c:2245 aplay/aplay.c:2340
+#: aplay/aplay.c:2491 aplay/aplay.c:2586
 msgid "can't play packed .voc files"
 msgstr "les fichiers .voc de type 'packed' ne sont pas supportés"
 
-#: aplay/aplay.c:2300
+#: aplay/aplay.c:2546
 #, c-format
 msgid "can't play loops; %s isn't seekable\n"
 msgstr "%s n'est pas navigable; les motifs n'ont pas pu être lus\n"
 
-#: aplay/aplay.c:2349
+#: aplay/aplay.c:2595
 #, c-format
 msgid "unknown blocktype %d. terminate."
 msgstr "type de bloc %d inconnu. fin."
 
-#: aplay/aplay.c:2480
+#: aplay/aplay.c:2731
 #, c-format
 msgid "Wave doesn't support %s format..."
 msgstr "Le format wave %s n'est pas supporté..."
 
-#: aplay/aplay.c:2540
+#: aplay/aplay.c:2791
 #, c-format
 msgid "Sparc Audio doesn't support %s format..."
 msgstr "Le format %s Sparc Audio n'est pas supporté..."
 
-#: aplay/aplay.c:2621
+#: aplay/aplay.c:2866
 msgid "Playing"
 msgstr "Lecture"
 
-#: aplay/aplay.c:2621
+#: aplay/aplay.c:2866
 msgid "Recording"
 msgstr "Capture"
 
-#: aplay/aplay.c:2625
+#: aplay/aplay.c:2870
 #, c-format
 msgid "Rate %d Hz, "
 msgstr "Fréquence %d Hz, "
 
-#: aplay/aplay.c:2627
+#: aplay/aplay.c:2872
 #, c-format
 msgid "Mono"
 msgstr ""
 
-#: aplay/aplay.c:2629
+#: aplay/aplay.c:2874
 #, c-format
 msgid "Stereo"
 msgstr "Stéréo"
 
-#: aplay/aplay.c:2631
+#: aplay/aplay.c:2876
 #, c-format
 msgid "Channels %i"
 msgstr "%i Canaux"
 
-#: aplay/aplay.c:3145 aplay/aplay.c:3198
+#: aplay/aplay.c:3483
+#, fuzzy, c-format
+#| msgid "You need to specify %d files"
+msgid "You need to specify %u files"
+msgstr "Vous devez spécifier %d fichiers"
+
+#: aplay/aplay.c:3536
 #, c-format
 msgid "You need to specify %d files"
 msgstr "Vous devez spécifier %d fichiers"
 
-#: seq/aconnect/aconnect.c:49
+#: seq/aconnect/aconnect.c:56
 #, c-format
 msgid "aconnect - ALSA sequencer connection manager\n"
 msgstr "aconnect - gestionnaire de connection séquenceur ALSA\n"
 
-#: seq/aconnect/aconnect.c:50
+#: seq/aconnect/aconnect.c:57
 #, c-format
 msgid "Copyright (C) 1999-2000 Takashi Iwai\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:51
+#: seq/aconnect/aconnect.c:58
 #, c-format
 msgid "Usage:\n"
-msgstr "Utilisation:\n"
+msgstr "Utilisation :\n"
 
-#: seq/aconnect/aconnect.c:52
+#: seq/aconnect/aconnect.c:59
 #, c-format
 msgid " * Connection/disconnection between two ports\n"
 msgstr " * Connexion/déconnexion entre deux ports\n"
 
-#: seq/aconnect/aconnect.c:53
+#: seq/aconnect/aconnect.c:60
 #, c-format
 msgid "   aconnect [-options] sender receiver\n"
 msgstr "   aconnect [-options] envoyeur destinataire\n"
 
-#: seq/aconnect/aconnect.c:54
+#: seq/aconnect/aconnect.c:61
 #, c-format
 msgid "     sender, receiver = client:port pair\n"
 msgstr "     envoyeur, destinataire = couple client:port\n"
 
-#: seq/aconnect/aconnect.c:55
+#: seq/aconnect/aconnect.c:62
 #, c-format
 msgid "     -d,--disconnect     disconnect\n"
 msgstr "     -d,--disconnect     déconnecter\n"
 
-#: seq/aconnect/aconnect.c:56
+#: seq/aconnect/aconnect.c:63
 #, c-format
 msgid "     -e,--exclusive      exclusive connection\n"
 msgstr "     -e,--exclusive      connexion exclusive\n"
 
-#: seq/aconnect/aconnect.c:57
+#: seq/aconnect/aconnect.c:64
 #, c-format
 msgid "     -r,--real #         convert real-time-stamp on queue\n"
-msgstr ""
+msgstr "     -r,--real #         convertit real-time-stamp à la queue\n"
 
-#: seq/aconnect/aconnect.c:58
+#: seq/aconnect/aconnect.c:65
 #, c-format
 msgid "     -t,--tick #         convert tick-time-stamp on queue\n"
-msgstr ""
+msgstr "     -t,--tick #         convertit tick-time-stamp à la queue\n"
 
-#: seq/aconnect/aconnect.c:59
+#: seq/aconnect/aconnect.c:66
 #, c-format
 msgid " * List connected ports (no subscription action)\n"
-msgstr " * Afficher la liste des ports connectés (pas de souscription)\n"
+msgstr " * Lister les ports connectés (pas de souscription)\n"
 
-#: seq/aconnect/aconnect.c:60
+#: seq/aconnect/aconnect.c:67
 #, c-format
 msgid "   aconnect -i|-o [-options]\n"
-msgstr "   aconnect -i|-o [-options]\n"
+msgstr ""
 
-#: seq/aconnect/aconnect.c:61
+#: seq/aconnect/aconnect.c:68
 #, c-format
 msgid "     -i,--input          list input (readable) ports\n"
-msgstr "     -i,--input          afficher la liste des ports d'entrée\n"
+msgstr "     -i,--input          lister les ports (lisibles) d'entrée\n"
 
-#: seq/aconnect/aconnect.c:62
+#: seq/aconnect/aconnect.c:69
 #, c-format
 msgid "     -o,--output         list output (writable) ports\n"
-msgstr "     -o,--output         afficher la liste des ports de sortie\n"
+msgstr "     -o,--output         lister les ports (écrivables) de sortie\n"
 
-#: seq/aconnect/aconnect.c:63
+#: seq/aconnect/aconnect.c:71
+#, fuzzy, c-format
+#| msgid "     -i,--input          list input (readable) ports\n"
+msgid "     -a,--all            show inactive ports, too\n"
+msgstr "     -i,--input          lister les ports (lisibles) d'entrée\n"
+
+#: seq/aconnect/aconnect.c:73
 #, c-format
 msgid "     -l,--list           list current connections of each port\n"
 msgstr ""
-"     -l,--list           afficher la liste des connexions en cours\n"
-"                         sur chaque port\n"
+"     -l,--list           lister les connexions en cours\n"
+"                         de chaque port\n"
 
-#: seq/aconnect/aconnect.c:64
+#: seq/aconnect/aconnect.c:74
 #, c-format
 msgid " * Remove all exported connections\n"
 msgstr " * Retirer toutes les connexions exportées\n"
 
-#: seq/aconnect/aconnect.c:65
+#: seq/aconnect/aconnect.c:75
 #, c-format
 msgid "     -x, --removeall\n"
-msgstr "     -x, --removeall\n"
+msgstr ""
 
-#: seq/aconnect/aconnect.c:132
+#: seq/aconnect/aconnect.c:155
 msgid "Connecting To"
-msgstr "Connexion Ã\80"
+msgstr "Connexion Ã "
 
-#: seq/aconnect/aconnect.c:133
+#: seq/aconnect/aconnect.c:156
 msgid "Connected From"
-msgstr "Connecté Depuis"
+msgstr "Connecté depuis"
 
-#: seq/aconnect/aconnect.c:169
+#: seq/aconnect/aconnect.c:203
 #, c-format
-msgid "client %d: '%s' [type=%s]\n"
-msgstr "client %d: '%s' [type=%s]\n"
+msgid "client %d: '%s' [type=%s"
+msgstr "client %d : '%s' [type=%s"
 
-#: seq/aconnect/aconnect.c:173
+#: seq/aconnect/aconnect.c:207
 msgid "user"
 msgstr "utilisateur"
 
-#: seq/aconnect/aconnect.c:173
+#: seq/aconnect/aconnect.c:207
 msgid "kernel"
 msgstr "noyau"
 
-#: seq/aconnect/aconnect.c:308
+#: seq/aconnect/aconnect.c:385
 #, c-format
 msgid "can't open sequencer\n"
 msgstr "le séquenceur n'a pas pu être ouvert\n"
 
-#: seq/aconnect/aconnect.c:336
+#: seq/aconnect/aconnect.c:413
 #, c-format
 msgid "can't get client id\n"
 msgstr "l'identifiant du client n'as pas pu être obtenu\n"
 
-#: seq/aconnect/aconnect.c:343
+#: seq/aconnect/aconnect.c:420
 #, c-format
 msgid "can't set client info\n"
 msgstr "les infos du client n'ont pas pu être définies\n"
 
-#: seq/aconnect/aconnect.c:350
+#: seq/aconnect/aconnect.c:427
 #, c-format
 msgid "invalid sender address %s\n"
-msgstr "l'addresse envoyeur %s est incorrecte\n"
+msgstr "l'adresse envoyeur %s est incorrecte\n"
 
-#: seq/aconnect/aconnect.c:355 seq/aseqnet/aseqnet.c:290
+#: seq/aconnect/aconnect.c:432 seq/aseqnet/aseqnet.c:303
 #, c-format
 msgid "invalid destination address %s\n"
-msgstr "l'addresse destinataire %s est incorrecte\n"
+msgstr "l'adresse destinataire %s est incorrecte\n"
 
-#: seq/aconnect/aconnect.c:369
+#: seq/aconnect/aconnect.c:446
 #, c-format
 msgid "No subscription is found\n"
 msgstr "Aucune souscription trouvée\n"
 
-#: seq/aconnect/aconnect.c:374
+#: seq/aconnect/aconnect.c:451
 #, c-format
 msgid "Disconnection failed (%s)\n"
 msgstr "La déconnexion a échoué (%s)\n"
 
-#: seq/aconnect/aconnect.c:380
+#: seq/aconnect/aconnect.c:457
 #, c-format
 msgid "Connection is already subscribed\n"
 msgstr "La connexion a déjà été souscrite\n"
 
-#: seq/aconnect/aconnect.c:385
+#: seq/aconnect/aconnect.c:462
 #, c-format
 msgid "Connection failed (%s)\n"
 msgstr "Échec de connexion (%s)\n"
 
-#: seq/aseqnet/aseqnet.c:164
+#: seq/aseqnet/aseqnet.c:171
 #, c-format
 msgid "aseqnet - network client/server on ALSA sequencer\n"
 msgstr "aseqnet - client/serveur réseau sur le séquenceur ALSA\n"
 
-#: seq/aseqnet/aseqnet.c:165
+#: seq/aseqnet/aseqnet.c:172
 #, c-format
 msgid "  Copyright (C) 1999 Takashi Iwai\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:166
+#: seq/aseqnet/aseqnet.c:173
 #, c-format
 msgid "usage:\n"
-msgstr "utilisation:\n"
+msgstr "utilisation :\n"
 
-#: seq/aseqnet/aseqnet.c:167
+#: seq/aseqnet/aseqnet.c:174
 #, c-format
 msgid "  server mode: aseqnet [-options]\n"
-msgstr "  mode serveur: aseqnet [-options]\n"
+msgstr "  mode serveur : aseqnet [-options]\n"
 
-#: seq/aseqnet/aseqnet.c:168
+#: seq/aseqnet/aseqnet.c:175
 #, c-format
 msgid "  client mode: aseqnet [-options] server_host\n"
-msgstr "  mode client: aseqnet [-options] hôte_serveur\n"
+msgstr "  mode client : aseqnet [-options] hôte_serveur\n"
 
-#: seq/aseqnet/aseqnet.c:169
+#: seq/aseqnet/aseqnet.c:176
 #, c-format
 msgid "options:\n"
-msgstr "options:\n"
+msgstr "options :\n"
 
-#: seq/aseqnet/aseqnet.c:170
-#, fuzzy, c-format
+#: seq/aseqnet/aseqnet.c:177
+#, c-format
+msgid "  -6,--ipv6 : use IPv6 TCP protocol\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:178
+#, c-format
 msgid "  -p,--port # : specify TCP port (digit or service name)\n"
-msgstr "  -p,--port # : spécifier le port TCP (numéro ou nom de service)\n"
+msgstr "  -p,--port # : spécifie le port TCP (numéro ou nom de service)\n"
 
-#: seq/aseqnet/aseqnet.c:171
+#: seq/aseqnet/aseqnet.c:179
 #, c-format
 msgid "  -s,--source addr : read from given addr (client:port)\n"
-msgstr "  -s,--source addr : lire à partir de l'addr. donnée (client:port)\n"
+msgstr "  -s,--source addr : lire à partir de l'adr. donnée (client:port)\n"
 
-#: seq/aseqnet/aseqnet.c:172
+#: seq/aseqnet/aseqnet.c:180
 #, c-format
 msgid "  -d,--dest addr : write to given addr (client:port)\n"
-msgstr "  -d,--dest addr : écrire à l'addr. donnée (client:port)\n"
+msgstr "  -d,--dest addr : écrire à l'adr. donnée (client:port)\n"
 
-#: seq/aseqnet/aseqnet.c:173
+#: seq/aseqnet/aseqnet.c:181
+#, c-format
+msgid "  -n,--name value : use a specific midi process name\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:182
 #, c-format
 msgid "  -v, --verbose : print verbose messages\n"
 msgstr "  -v, --verbose : affichage locace de messages\n"
 
-#: seq/aseqnet/aseqnet.c:174
+#: seq/aseqnet/aseqnet.c:183
 #, c-format
 msgid "  -i, --info : print certain received events\n"
 msgstr "  -i, --info : afficher certains évènements reçus\n"
 
-#: seq/aseqnet/aseqnet.c:188
+#: seq/aseqnet/aseqnet.c:197
 #, c-format
 msgid "can't malloc\n"
 msgstr "échec allocation mémoire (malloc)\n"
 
-#: seq/aseqnet/aseqnet.c:213
+#: seq/aseqnet/aseqnet.c:222
 #, c-format
 msgid "closing files..\n"
 msgstr "fermeture des fichiers...\n"
 
-#: seq/aseqnet/aseqnet.c:272
+#: seq/aseqnet/aseqnet.c:285
 #, c-format
 msgid "sequencer opened: %d:%d\n"
-msgstr "séquenceur ouvert: %d:%d\n"
+msgstr "séquenceur ouvert : %d:%d\n"
 
-#: seq/aseqnet/aseqnet.c:279
+#: seq/aseqnet/aseqnet.c:292
 #, c-format
 msgid "invalid source address %s\n"
-msgstr "addresse source %s incorrecte\n"
+msgstr "adresse source %s incorrecte\n"
 
-#: seq/aseqnet/aseqnet.c:309
-#, c-format
-msgid "service '%s' is not found in /etc/services\n"
-msgstr "le service '%s' n'as pas été trouvé dans /etc/services\n"
+#: seq/aseqnet/aseqnet.c:362
+#, fuzzy, c-format
+#| msgid "can't get address %s\n"
+msgid "can't get address\n"
+msgstr "l'adresse %s na pas pu être obtenue\n"
 
-#: seq/aseqnet/aseqnet.c:377
+#: seq/aseqnet/aseqnet.c:376 seq/aseqnet/aseqnet.c:461
+#, fuzzy, c-format
+#| msgid "Connecting To"
+msgid "connecting to: %s\n"
+msgstr "Connexion à"
+
+#: seq/aseqnet/aseqnet.c:414
 #, c-format
 msgid "too many connections!\n"
-msgstr "trop de connexions!\n"
+msgstr "trop de connexions !\n"
 
-#: seq/aseqnet/aseqnet.c:388
+#: seq/aseqnet/aseqnet.c:425
 #, c-format
 msgid "accepted[%d]\n"
 msgstr "accepté[%d]\n"
 
-#: seq/aseqnet/aseqnet.c:411
+#: seq/aseqnet/aseqnet.c:447
 #, c-format
 msgid "can't get address %s\n"
-msgstr "l'addresse %s na pas pu être obtenue\n"
+msgstr "l'adresse %s na pas pu être obtenue\n"
 
-#: seq/aseqnet/aseqnet.c:422
+#: seq/aseqnet/aseqnet.c:475
 #, c-format
 msgid "ok.. connected\n"
 msgstr "ok.. connecté\n"
 
-#: seq/aseqnet/aseqnet.c:518
+#: seq/aseqnet/aseqnet.c:574
 #, c-format
 msgid "Channel %2d: Control event : %5d\n"
-msgstr "Canal %2d: Évènement de contrôle: %5d\n"
+msgstr "Canal %2d : évènement de contrôle : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:522
+#: seq/aseqnet/aseqnet.c:578
 #, c-format
 msgid "Channel %2d: Pitchbender   : %5d\n"
-msgstr "Canal %2d: Pitchbender          : %5d\n"
+msgstr "Canal %2d : Pitchbender   : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:526
+#: seq/aseqnet/aseqnet.c:582
 #, c-format
 msgid "Channel %2d: Note On event : %5d\n"
-msgstr "Canal %2d: évènement Note On    : %5d\n"
+msgstr "Canal %2d : évènement Note On : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:530
+#: seq/aseqnet/aseqnet.c:586
 #, c-format
 msgid "Channel %2d: Note Off event: %5d\n"
-msgstr "Canal %2d: évènement Note Off   : %5d\n"
+msgstr "Canal %2d : évènement Note Off : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:585
+#: seq/aseqnet/aseqnet.c:641
 #, c-format
 msgid "disconnected\n"
 msgstr "déconnecté\n"
 
-#: speaker-test/speaker-test.c:120
+#: speaker-test/speaker-test.c:130
 msgid "Front Left"
-msgstr "Avant Gauche"
+msgstr "Avant gauche"
 
-#: speaker-test/speaker-test.c:121
+#: speaker-test/speaker-test.c:131
 msgid "Front Right"
-msgstr "Avant Droit"
+msgstr "Avant droit"
 
-#: speaker-test/speaker-test.c:122
+#: speaker-test/speaker-test.c:132
 msgid "Rear Left"
-msgstr "Arrière Gauche"
+msgstr "Arrière gauche"
 
-#: speaker-test/speaker-test.c:123
+#: speaker-test/speaker-test.c:133
 msgid "Rear Right"
-msgstr "Arrière Droit"
+msgstr "Arrière droit"
 
-#: speaker-test/speaker-test.c:125
+#: speaker-test/speaker-test.c:135
 msgid "LFE"
 msgstr ""
 
-#: speaker-test/speaker-test.c:126
+#: speaker-test/speaker-test.c:136
 msgid "Side Left"
-msgstr "Côté Gauche"
+msgstr "Côté gauche"
 
-#: speaker-test/speaker-test.c:127
+#: speaker-test/speaker-test.c:137
 msgid "Side Right"
-msgstr "Côté Droit"
+msgstr "Côté droit"
 
-#: speaker-test/speaker-test.c:128
+#: speaker-test/speaker-test.c:138
 msgid "Channel 9"
 msgstr "Canal 9"
 
-#: speaker-test/speaker-test.c:129
+#: speaker-test/speaker-test.c:139
 msgid "Channel 10"
 msgstr "Canal 10"
 
-#: speaker-test/speaker-test.c:130
+#: speaker-test/speaker-test.c:140
 msgid "Channel 11"
 msgstr "Canal 11"
 
-#: speaker-test/speaker-test.c:131
+#: speaker-test/speaker-test.c:141
 msgid "Channel 12"
 msgstr "Canal 12"
 
-#: speaker-test/speaker-test.c:132
+#: speaker-test/speaker-test.c:142
 msgid "Channel 13"
 msgstr "Canal 13"
 
-#: speaker-test/speaker-test.c:133
+#: speaker-test/speaker-test.c:143
 msgid "Channel 14"
 msgstr "Canal 14"
 
-#: speaker-test/speaker-test.c:134
+#: speaker-test/speaker-test.c:144
 msgid "Channel 15"
 msgstr "Canal 15"
 
-#: speaker-test/speaker-test.c:135
+#: speaker-test/speaker-test.c:145
 msgid "Channel 16"
 msgstr "Canal 16"
 
-#: speaker-test/speaker-test.c:518
+#: speaker-test/speaker-test.c:465
 #, c-format
 msgid "Broken configuration for playback: no configurations available: %s\n"
-msgstr "Configuration erronée pour la lecture: pas de configuration: %s\n"
+msgstr ""
+"Configuration erronée pour la lecture : pas de configuration disponible : "
+"%s\n"
 
-#: speaker-test/speaker-test.c:525
+#: speaker-test/speaker-test.c:472
 #, c-format
 msgid "Access type not available for playback: %s\n"
-msgstr "Le type d'accès est indisponible à la lecture: %s\n"
+msgstr "Le type d'accès est indisponible à la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:532
+#: speaker-test/speaker-test.c:479
 #, c-format
 msgid "Sample format not available for playback: %s\n"
-msgstr "Le format d'échantillonage est indisponible à la lecture: %s\n"
+msgstr "Le format d'échantillonage est indisponible à la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:539
+#: speaker-test/speaker-test.c:486
 #, c-format
 msgid "Channels count (%i) not available for playbacks: %s\n"
-msgstr "Le nombre (%i) de canaux est indisponible à la lecture: %s\n"
+msgstr "Le nombre (%i) de canaux est indisponible à la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:547
+#: speaker-test/speaker-test.c:494
 #, c-format
 msgid "Rate %iHz not available for playback: %s\n"
-msgstr "La fréquence %iHz est indisponible à la lecture: %s\n"
+msgstr "La fréquence %iHz est indisponible à la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:552
+#: speaker-test/speaker-test.c:499
 #, c-format
 msgid "Rate doesn't match (requested %iHz, get %iHz, err %d)\n"
 msgstr ""
-"La fréquence ne correspond pas (demandée: %iHz, obtenue %iHz, err %d)\n"
+"La fréquence ne correspond pas (demandée : %iHz, obtenue %iHz, err %d)\n"
 
-#: speaker-test/speaker-test.c:556
+#: speaker-test/speaker-test.c:503
 #, c-format
 msgid "Rate set to %iHz (requested %iHz)\n"
 msgstr "La fréquence est %iHz (demandée %iHz)\n"
 
-#: speaker-test/speaker-test.c:562
+#: speaker-test/speaker-test.c:509
 #, c-format
 msgid "Buffer size range from %lu to %lu\n"
 msgstr "L'intervalle de la taille du tampon est de %lu à %lu\n"
 
-#: speaker-test/speaker-test.c:563
+#: speaker-test/speaker-test.c:510
 #, c-format
 msgid "Period size range from %lu to %lu\n"
 msgstr "L'intervalle de la taille de la période est de %lu à %lu\n"
 
-#: speaker-test/speaker-test.c:565
+#: speaker-test/speaker-test.c:514
 #, c-format
 msgid "Requested period time %u us\n"
 msgstr "Temps de période demandé %u µs\n"
 
-#: speaker-test/speaker-test.c:568
+#: speaker-test/speaker-test.c:519
 #, c-format
 msgid "Unable to set period time %u us for playback: %s\n"
-msgstr "Le temps de période %u µs n'a pas pu être défini pour la lecture: %s\n"
+msgstr ""
+"Le temps de période %u µs n'a pas pu être défini pour la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:574
+#: speaker-test/speaker-test.c:525
 #, c-format
 msgid "Requested buffer time %u us\n"
 msgstr "Temps tampon demandé %u µs\n"
 
-#: speaker-test/speaker-test.c:577
+#: speaker-test/speaker-test.c:528
 #, c-format
 msgid "Unable to set buffer time %u us for playback: %s\n"
-msgstr "Le temps tampon de %u µs n'a pas pu être définie pour la lecture: %s\n"
+msgstr ""
+"Le temps tampon de %u µs n'a pas pu être définie pour la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:586
+#: speaker-test/speaker-test.c:537
 #, c-format
 msgid "Using max buffer size %lu\n"
 msgstr "Taille max. de tampon %lu utilisée\n"
 
-#: speaker-test/speaker-test.c:589
+#: speaker-test/speaker-test.c:540
 #, c-format
 msgid "Unable to set buffer size %lu for playback: %s\n"
-msgstr "La taile de tampon %lu n'a pas pu être définie pour la lecture: %s\n"
+msgstr "La taile de tampon %lu n'a pas pu être définie pour la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:595
+#: speaker-test/speaker-test.c:546
 #, c-format
 msgid "Periods = %u\n"
 msgstr "Périodes = %u\n"
 
-#: speaker-test/speaker-test.c:598
+#: speaker-test/speaker-test.c:549
 #, c-format
 msgid "Unable to set nperiods %u for playback: %s\n"
-msgstr "nperiods %u n'a pas pu être défini pour la lecture: %s\n"
+msgstr "nperiods %u n'a pas pu être défini pour la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:607
+#: speaker-test/speaker-test.c:558
 #, c-format
 msgid "Unable to set hw params for playback: %s\n"
 msgstr ""
-"Les paramètres matériel n'ont pas pu être définis pour la lecture: %s\n"
+"Les paramètres matériel n'ont pas pu être définis pour la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:613
+#: speaker-test/speaker-test.c:564
 #, c-format
 msgid "was set period_size = %lu\n"
-msgstr ""
+msgstr "était paramétré pour period_size = %lu\n"
 
-#: speaker-test/speaker-test.c:614
+#: speaker-test/speaker-test.c:565
 #, c-format
 msgid "was set buffer_size = %lu\n"
-msgstr ""
+msgstr "était paramétré pour buffer_size = %lu\n"
 
-#: speaker-test/speaker-test.c:616
+#: speaker-test/speaker-test.c:567
 #, c-format
 msgid "buffer to small, could not use\n"
 msgstr "tampon trop petit, il n'a pas pu être utilisé\n"
 
-#: speaker-test/speaker-test.c:629
+#: speaker-test/speaker-test.c:580
 #, c-format
 msgid "Unable to determine current swparams for playback: %s\n"
 msgstr ""
 "Les paramètres logiciels actuels n'ont pas pu être déterminés pour la "
-"lecture: %s\n"
+"lecture : %s\n"
 
-#: speaker-test/speaker-test.c:636
+#: speaker-test/speaker-test.c:587
 #, c-format
 msgid "Unable to set start threshold mode for playback: %s\n"
 msgstr ""
+"Impossible de paramétrer le mode de déclenchement de démarrage pour la "
+"lecture : %s\n"
 
-#: speaker-test/speaker-test.c:643
+#: speaker-test/speaker-test.c:594
 #, c-format
 msgid "Unable to set avail min for playback: %s\n"
-msgstr ""
+msgstr "Impossible de paramétrer le minimum disponible pour la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:650
+#: speaker-test/speaker-test.c:601
 #, c-format
 msgid "Unable to set sw params for playback: %s\n"
 msgstr ""
-"Les paramètres logiciel n'ont pas pu être définis pour la lecture: %s\n"
+"Les paramètres logiciel n'ont pas pu être définis pour la lecture : %s\n"
 
-#: speaker-test/speaker-test.c:670
-#, fuzzy, c-format
+#: speaker-test/speaker-test.c:621
+#, c-format
 msgid "Unable to set channel map: %s\n"
-msgstr ""
-"Les paramètres matériel n'ont pas pu être définis pour la lecture: %s\n"
+msgstr "Impossible de paramètrer la carte de canal : %s\n"
 
-#: speaker-test/speaker-test.c:695
+#: speaker-test/speaker-test.c:646
 #, c-format
 msgid "Can't recovery from underrun, prepare failed: %s\n"
-msgstr ""
+msgstr "Impossible de récupérer depuis une perte, préparation échouée : %s\n"
 
-#: speaker-test/speaker-test.c:706
+#: speaker-test/speaker-test.c:657
 #, c-format
 msgid "Can't recovery from suspend, prepare failed: %s\n"
-msgstr ""
+msgstr "N'a pas pu récupérer depuis suspend, préparation échouée : %s\n"
 
-#: speaker-test/speaker-test.c:770 speaker-test/speaker-test.c:1261
+#: speaker-test/speaker-test.c:721 speaker-test/speaker-test.c:1257
 #, c-format
 msgid "No enough memory\n"
 msgstr "Pas assez de mémoire\n"
 
-#: speaker-test/speaker-test.c:775
+#: speaker-test/speaker-test.c:726
 #, c-format
 msgid "Cannot open WAV file %s\n"
 msgstr "Le fichier WAV %s n'a pas pu être ouvert\n"
 
-#: speaker-test/speaker-test.c:779 speaker-test/speaker-test.c:808
+#: speaker-test/speaker-test.c:730 speaker-test/speaker-test.c:759
 #, c-format
 msgid "Invalid WAV file %s\n"
 msgstr "Fichier WAV incorrect %s\n"
 
-#: speaker-test/speaker-test.c:784
+#: speaker-test/speaker-test.c:735
 #, c-format
 msgid "Not a WAV file: %s\n"
 msgstr "Le fichier %s n'est pas au format WAV\n"
 
-#: speaker-test/speaker-test.c:788
+#: speaker-test/speaker-test.c:739
 #, c-format
 msgid "Unsupported WAV format %d for %s\n"
 msgstr "Format WAV %d non supporté pour %s\n"
 
-#: speaker-test/speaker-test.c:793
+#: speaker-test/speaker-test.c:744
 #, c-format
 msgid "%s is not a mono stream (%d channels)\n"
 msgstr "%s n'est pas un flux en mono (%d canaux)\n"
 
-#: speaker-test/speaker-test.c:798
+#: speaker-test/speaker-test.c:749
 #, c-format
 msgid "Sample rate doesn't match (%d) for %s\n"
 msgstr "La fréquence d'échantillonage (%d) ne correspond pas à %s\n"
 
-#: speaker-test/speaker-test.c:803
+#: speaker-test/speaker-test.c:754
 #, c-format
 msgid "Unsupported sample format bits %d for %s\n"
 msgstr "Le format d'échantillonage %d bits n'est pas supporté pour %s\n"
 
-#: speaker-test/speaker-test.c:864
+#: speaker-test/speaker-test.c:815
 #, c-format
 msgid "Undefined channel %d\n"
 msgstr "Canal non-défini %d\n"
 
-#: speaker-test/speaker-test.c:915
+#: speaker-test/speaker-test.c:866
 #, c-format
 msgid "Write error: %d,%s\n"
-msgstr "Erreur en écriture: %d,%s\n"
+msgstr "Erreur en écriture : %d,%s\n"
 
-#: speaker-test/speaker-test.c:917
+#: speaker-test/speaker-test.c:868
 #, c-format
 msgid "xrun_recovery failed: %d,%s\n"
+msgstr "xrun_recovery échoué : %d,%s\n"
+
+#: speaker-test/speaker-test.c:938
+#, c-format
+msgid "\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"
 msgstr ""
 
-#: speaker-test/speaker-test.c:1003
+#: speaker-test/speaker-test.c:982
 #, fuzzy, c-format
+#| msgid ""
+#| "Usage: speaker-test [OPTION]... \n"
+#| "-h,--help\thelp\n"
+#| "-D,--device\tplayback device\n"
+#| "-r,--rate\tstream rate in Hz\n"
+#| "-c,--channels\tcount of channels in stream\n"
+#| "-f,--frequency\tsine wave frequency in Hz\n"
+#| "-F,--format\tsample format\n"
+#| "-b,--buffer\tring buffer size in us\n"
+#| "-p,--period\tperiod size in us\n"
+#| "-P,--nperiods\tnumber of periods\n"
+#| "-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+#| "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+#| "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+#| "-w,--wavfile\tUse the given WAV file as a test sound\n"
+#| "-W,--wavdir\tSpecify the directory containing WAV files\n"
+#| "-m,--chmap\tSpecify the channel map to override\n"
+#| "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+#| "-S,--scale\tScale of generated test tones in percent (default=80)\n"
+#| "\n"
 msgid ""
 "Usage: speaker-test [OPTION]... \n"
 "-h,--help\thelp\n"
@@ -1525,109 +1799,123 @@ msgid ""
 "-b,--buffer\tring buffer size in us\n"
 "-p,--period\tperiod size in us\n"
 "-P,--nperiods\tnumber of periods\n"
-"-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+"-t,--test\tpink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 "
+"noise, wav=WAV file\n"
 "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
 "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
 "-w,--wavfile\tUse the given WAV file as a test sound\n"
 "-W,--wavdir\tSpecify the directory containing WAV files\n"
 "-m,--chmap\tSpecify the channel map to override\n"
 "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+"-S,--scale\tScale of generated test tones in percent (default=80)\n"
 "\n"
 msgstr ""
-"Utilisation: speaker-test [OPTION]...\n"
+"Utilisation : speaker-test [OPTION]... \n"
 "-h,--help\taide\n"
 "-D,--device\tpériphérique de lecture\n"
 "-r,--rate\tfréquence du flux en Hz\n"
 "-c,--channels\tnombre de canaux du flux\n"
-"-f,--frequency\tfréquence courbe sinus en Hz\n"
+"-f,--frequency\tfréquence d'onde sinus en Hz\n"
 "-F,--format\tformat d'échantillonage\n"
 "-b,--buffer\ttaille en µs du tampon circulaire\n"
 "-p,--period\ttaille de la période en µs\n"
 "-P,--nperiods\tnombre de périodes\n"
-"-t,--test\tpink=pink noise, sine=courbe sinus, wav=fichier WAV\n"
-"-l,--nloops\tspécifier le nombre de motifs à tester, 0 = infini\n"
+"-t,--test\tpink=bruit rose, sine=courbe sinus, wav=fichier WAV\n"
+"-l,--nloops\tspécifier le nombre de boucles à tester, 0 = infini\n"
 "-s,--speaker\ttest sur une seule enceinte.\n"
-"\t\tValeurs 1=Gauche, 2=Droite, et c.\n"
-"-w,--wavfile\tUtiliser le fichier WAV spécifié pour le test\n"
+"\t\tValeurs 1=Gauche, 2=Droite, etc.\n"
+"-w,--wavfile\tUtiliser le fichier WAV spécifié pour le test sonore\n"
 "-w,--wavdir\tSpécifier le répertoire contenant les fichiers WAV\n"
+"-m,--chmap\tSpécifier la carte de canal à écraser\n"
 "-X,--force-frequency\tpermettre fréquences en dehors de la gamme 30-8000Hz\n"
+"-S,--scale\tÉchelle des tonalités de test générées en pourcent (défaut=80)\n"
 "\n"
 
-#: speaker-test/speaker-test.c:1132
+#: speaker-test/speaker-test.c:1114
 #, c-format
 msgid "Invalid number of periods %d\n"
 msgstr "Nombre de périodes %d incorrect\n"
 
-#: speaker-test/speaker-test.c:1148 speaker-test/speaker-test.c:1152
+#: speaker-test/speaker-test.c:1127 speaker-test/speaker-test.c:1137
+#: speaker-test/speaker-test.c:1141
 #, c-format
 msgid "Invalid test type %s\n"
 msgstr "Type de test %s incorrect\n"
 
-#: speaker-test/speaker-test.c:1164
-#, c-format
-msgid "Invalid parameter for -s option.\n"
-msgstr "Paramètre incorrect pour l'option -s.\n"
-
-#: speaker-test/speaker-test.c:1186
+#: speaker-test/speaker-test.c:1174
 #, c-format
 msgid "Unknown option '%c'\n"
 msgstr "Option '%c' inconnue\n"
 
-#: speaker-test/speaker-test.c:1207
+#: speaker-test/speaker-test.c:1188
+#, c-format
+msgid "Invalid parameter for -s option.\n"
+msgstr "Paramètre incorrect pour l'option -s.\n"
+
+#: speaker-test/speaker-test.c:1203
 #, c-format
 msgid "Playback device is %s\n"
 msgstr "Le périphérique de lecture est %s\n"
 
-#: speaker-test/speaker-test.c:1208
+#: speaker-test/speaker-test.c:1204
 #, c-format
 msgid "Stream parameters are %iHz, %s, %i channels\n"
 msgstr "Les paramètres du flux sont %iHz, %s, %i canaux\n"
 
-#: speaker-test/speaker-test.c:1211
+#: speaker-test/speaker-test.c:1207
+#, c-format
+msgid "Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:1210
 #, c-format
 msgid "Using 16 octaves of pink noise\n"
-msgstr "Utilisation de 16 octaves de 'pink noise'\n"
+msgstr "Utilisation de 16 octaves de bruit rose\n"
 
-#: speaker-test/speaker-test.c:1214
+#: speaker-test/speaker-test.c:1213
 #, c-format
 msgid "Sine wave rate is %.4fHz\n"
 msgstr "La fréquence de la courbe sinus est %.4fHz\n"
 
-#: speaker-test/speaker-test.c:1217
+#: speaker-test/speaker-test.c:1216
 #, c-format
 msgid "WAV file(s)\n"
 msgstr "fichier(s) WAV\n"
 
-#: speaker-test/speaker-test.c:1227
+#: speaker-test/speaker-test.c:1226
 #, c-format
 msgid "Playback open error: %d,%s\n"
-msgstr "Erreur d'ouverture à la lecture: %d,%s\n"
+msgstr "Erreur d'ouverture à la lecture : %d,%s\n"
 
-#: speaker-test/speaker-test.c:1233
+#: speaker-test/speaker-test.c:1232
 #, c-format
 msgid "Setting of hwparams failed: %s\n"
-msgstr "Échec de la configuration des paramètres matériel: %s\n"
+msgstr "Échec de la configuration des paramètres matériel : %s\n"
 
-#: speaker-test/speaker-test.c:1237
+#: speaker-test/speaker-test.c:1236
 #, c-format
 msgid "Setting of swparams failed: %s\n"
-msgstr "Échec de la configuration des paramètres logiciel: %s\n"
+msgstr "Échec de la configuration des paramètres logiciel : %s\n"
 
-#: speaker-test/speaker-test.c:1284 speaker-test/speaker-test.c:1306
+#: speaker-test/speaker-test.c:1282 speaker-test/speaker-test.c:1304
 #, c-format
 msgid "Transfer failed: %s\n"
-msgstr "Échec du transfer: %s\n"
+msgstr "Échec du transfer : %s\n"
 
-#: speaker-test/speaker-test.c:1292
+#: speaker-test/speaker-test.c:1290
 #, c-format
 msgid "Time per period = %lf\n"
 msgstr "Temps par période = %lf\n"
 
+#, c-format
+#~ msgid "service '%s' is not found in /etc/services\n"
+#~ msgstr "le service '%s' n'as pas été trouvé dans /etc/services\n"
+
 #~ msgid "Warning: format is changed to S16_LE\n"
-#~ msgstr "Avertissement: le format est changé en S16_LE\n"
+#~ msgstr "Avertissement : le format est changé en S16_LE\n"
 
 #~ msgid "Warning: format is changed to S24_3LE\n"
-#~ msgstr "Avertissement: le format est changé en S24_3LE\n"
+#~ msgstr "Avertissement : le format est changé en S24_3LE\n"
 
 #~ msgid "Warning: format is changed to S24_LE\n"
-#~ msgstr "Avertissement: le format est changé en S24_LE\n"
+#~ msgstr "Avertissement : le format est changé en S24_LE\n"
index b26de01..ceeebb9 100644 (file)
@@ -1,5 +1,10 @@
 # Sed script that inserts the file called HEADER before the header entry.
 #
+# Copyright (C) 2001 Free Software Foundation, Inc.
+# Written by Bruno Haible <bruno@clisp.org>, 2001.
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to use, copy, distribute, and modify it.
+#
 # At each occurrence of a line starting with "msgid ", we execute the following
 # commands. At the first occurrence, insert the file. At the following
 # occurrences, do nothing. The distinction between the first and the following
index 3716988..47db5e3 100644 (file)
Binary files a/po/ja.gmo and b/po/ja.gmo differ
index 69bbbe3..5a7eb9e 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: alsa-utils 1.0.9a\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-26 15:50+0100\n"
+"POT-Creation-Date: 2024-06-10 09:22+0000\n"
 "PO-Revision-Date: 2009-05-27 15:08+0200\n"
 "Last-Translator: Takashi Iwai <tiwai@suse.de>\n"
 "Language-Team: Japanese\n"
@@ -18,33 +18,45 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
 
-#: alsamixer/card_select.c:126 alsamixer/device_name.c:126
+#: alsamixer/card_select.c:77 alsamixer/device_name.c:127
 msgid "Sound Card"
 msgstr "サウンドカード"
 
-#: alsamixer/card_select.c:181
+#: alsamixer/card_select.c:115
 msgid "(default)"
 msgstr "(デフォルト)"
 
-#: alsamixer/card_select.c:191
+#: alsamixer/card_select.c:125
 msgid "cannot enumerate sound cards"
 msgstr "サウンドカードを検出できません"
 
-#: alsamixer/card_select.c:215
+#: alsamixer/card_select.c:151
 msgid "enter device name..."
 msgstr "デバイス名入力..."
 
-#: alsamixer/cli.c:40
+#: alsamixer/cli.c:45
 msgid "Usage: alsamixer [options]"
 msgstr "使用法: alsamixer [オプション]"
 
-#: alsamixer/cli.c:41
+#: alsamixer/cli.c:46
+#, fuzzy
+#| msgid ""
+#| "Useful options:\n"
+#| "  -h, --help              this help\n"
+#| "  -c, --card=NUMBER       sound card number or id\n"
+#| "  -D, --device=NAME       mixer device name\n"
+#| "  -V, --view=MODE         starting view mode: playback/capture/all"
 msgid ""
 "Useful options:\n"
 "  -h, --help              this help\n"
 "  -c, --card=NUMBER       sound card number or id\n"
 "  -D, --device=NAME       mixer device name\n"
-"  -V, --view=MODE         starting view mode: playback/capture/all"
+"  -m, --mouse             enable mouse\n"
+"  -M, --no-mouse          disable mouse\n"
+"  -f, --config=FILE       configuration file\n"
+"  -F, --no-config         do not load configuration file\n"
+"  -V, --view=MODE         starting view mode: playback/capture/all\n"
+"  -B, --black-background  use black background color"
 msgstr ""
 "主なオプション:\n"
 "  -h, --help               このヘルプ画面\n"
@@ -52,7 +64,7 @@ msgstr ""
 "  -D, --device=名前        ミキサーデバイス名\n"
 "  -V, --view=表示モード    開始時の表示モード: playback/capture/all"
 
-#: alsamixer/cli.c:46
+#: alsamixer/cli.c:56
 msgid ""
 "Debugging options:\n"
 "  -g, --no-color          toggle using of colors\n"
@@ -62,22 +74,22 @@ msgstr ""
 "  -g, --no-color           カラー/モノクロ表示\n"
 "  -a, --abstraction=名前   ミキサー抽象レベル: none/basic"
 
-#: alsamixer/cli.c:77
+#: alsamixer/cli.c:92
 #, c-format
 msgid "invalid card index: %s\n"
 msgstr "不正なカード番号: %s\n"
 
-#: alsamixer/cli.c:103
+#: alsamixer/cli.c:137
 #, c-format
 msgid "unknown abstraction level: %s\n"
 msgstr "未知の抽象レベル: %s\n"
 
-#: alsamixer/cli.c:108
+#: alsamixer/cli.c:142
 #, c-format
 msgid "unknown option: %c\n"
 msgstr "未知のオプション '%c'\n"
 
-#: alsamixer/cli.c:110
+#: alsamixer/cli.c:144
 msgid "try `alsamixer --help' for more information\n"
 msgstr "より詳しい情報は「alsamixer --help」を実行してください\n"
 
@@ -90,138 +102,138 @@ msgstr "デバイス名:"
 msgid "%s: %s\n"
 msgstr ""
 
-#: alsamixer/mixer_display.c:98
+#: alsamixer/mixer_display.c:99
 msgid "Card:"
 msgstr "カード:"
 
-#: alsamixer/mixer_display.c:99
+#: alsamixer/mixer_display.c:100
 msgid "Chip:"
 msgstr "チップ:"
 
-#: alsamixer/mixer_display.c:100
+#: alsamixer/mixer_display.c:101
 msgid "View:"
 msgstr "表示:"
 
-#: alsamixer/mixer_display.c:101
+#: alsamixer/mixer_display.c:102
 msgid "Item:"
 msgstr "項目:"
 
-#: alsamixer/mixer_display.c:104
+#: alsamixer/mixer_display.c:105
 msgid "F1:  Help"
 msgstr "F1:  ヘルプ"
 
-#: alsamixer/mixer_display.c:105
+#: alsamixer/mixer_display.c:106
 msgid "F2:  System information"
 msgstr "F2:  システム情報"
 
-#: alsamixer/mixer_display.c:106
+#: alsamixer/mixer_display.c:107
 msgid "F6:  Select sound card"
 msgstr "F6:  サウンドカード選択"
 
-#: alsamixer/mixer_display.c:107
+#: alsamixer/mixer_display.c:108
 msgid "Esc: Exit"
 msgstr "Esc: 終了"
 
-#: alsamixer/mixer_display.c:174
+#: alsamixer/mixer_display.c:179
 msgid "(unplugged)"
 msgstr ""
 
-#: alsamixer/mixer_display.c:192
+#: alsamixer/mixer_display.c:197
 msgid "Playback"
 msgstr "再生"
 
-#: alsamixer/mixer_display.c:193
+#: alsamixer/mixer_display.c:198
 msgid "Capture"
 msgstr "録音"
 
-#: alsamixer/mixer_display.c:194
+#: alsamixer/mixer_display.c:199
 msgid "All"
 msgstr "全て"
 
-#: alsamixer/mixer_display.c:234
+#: alsamixer/mixer_display.c:240
 msgid "mute"
 msgstr "ミュート"
 
-#: alsamixer/mixer_display.c:275 alsamixer/mixer_display.c:285
+#: alsamixer/mixer_display.c:281 alsamixer/mixer_display.c:291
 msgid "dB gain:"
 msgstr "dBゲイン:"
 
-#: alsamixer/mixer_display.c:285
+#: alsamixer/mixer_display.c:291
 #, c-format
 msgid " [%s %s, %s]"
 msgstr ""
 
-#: alsamixer/mixer_display.c:294 alsamixer/mixer_display.c:300
-#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:312
+#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:306
+#: alsamixer/mixer_display.c:312 alsamixer/mixer_display.c:318
 msgid "Off"
 msgstr "オフ"
 
-#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:312
+#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:318
 msgid "On"
 msgstr "オン"
 
-#: alsamixer/mixer_display.c:363
+#: alsamixer/mixer_display.c:370
 msgid "The sound device was unplugged."
 msgstr "デバイスが接続されていません"
 
-#: alsamixer/mixer_display.c:364
+#: alsamixer/mixer_display.c:371
 msgid "Press F6 to select another sound card."
 msgstr "他のカードを選択するにはF6を押して下さい"
 
-#: alsamixer/mixer_display.c:379
+#: alsamixer/mixer_display.c:386
 msgid "This sound device does not have any playback controls."
 msgstr "このカードには再生ミキサーがありません"
 
-#: alsamixer/mixer_display.c:381
+#: alsamixer/mixer_display.c:388
 msgid "This sound device does not have any capture controls."
 msgstr "このカードには録音ミキサーがありません"
 
-#: alsamixer/mixer_display.c:383
+#: alsamixer/mixer_display.c:390
 msgid "This sound device does not have any controls."
 msgstr "このカードには制御可能なミキサーがありません"
 
 #. TRANSLATORS: playback on; one character
-#: alsamixer/mixer_display.c:516 alsamixer/mixer_display.c:521
+#: alsamixer/mixer_display.c:523 alsamixer/mixer_display.c:528
 msgid "O"
 msgstr ""
 
 #. TRANSLATORS: playback muted; one character
-#: alsamixer/mixer_display.c:518 alsamixer/mixer_display.c:522
+#: alsamixer/mixer_display.c:525 alsamixer/mixer_display.c:529
 msgid "M"
 msgstr ""
 
 #. TRANSLATORS: "left"; no more than two characters
-#: alsamixer/mixer_display.c:536
+#: alsamixer/mixer_display.c:545
 msgid "L"
 msgstr ""
 
 #. TRANSLATORS: "right"; no more than two characters
-#: alsamixer/mixer_display.c:540
+#: alsamixer/mixer_display.c:551
 msgid "R"
 msgstr ""
 
 #. TRANSLATORS: no more than eight characters
-#: alsamixer/mixer_display.c:542
+#: alsamixer/mixer_display.c:555
 msgid "CAPTURE"
 msgstr "録音"
 
-#: alsamixer/mixer_display.c:592
+#: alsamixer/mixer_display.c:611
 msgid "Front"
 msgstr "フロント"
 
-#: alsamixer/mixer_display.c:595
+#: alsamixer/mixer_display.c:614
 msgid "Rear"
 msgstr "リア"
 
-#: alsamixer/mixer_display.c:598 speaker-test/speaker-test.c:124
+#: alsamixer/mixer_display.c:617 speaker-test/speaker-test.c:134
 msgid "Center"
 msgstr "センター"
 
-#: alsamixer/mixer_display.c:601
+#: alsamixer/mixer_display.c:620
 msgid "Woofer"
 msgstr "低音"
 
-#: alsamixer/mixer_display.c:604
+#: alsamixer/mixer_display.c:623
 msgid "Side"
 msgstr "サイド"
 
@@ -354,11 +366,11 @@ msgstr ""
 msgid "Help"
 msgstr "ヘルプ"
 
-#: alsamixer/proc_files.c:103
+#: alsamixer/proc_files.c:56
 msgid "Select File"
 msgstr "ファイル選択"
 
-#: alsamixer/textbox.c:52 alsamixer/textbox.c:66
+#: alsamixer/textbox.c:51 alsamixer/textbox.c:65
 msgid "Error"
 msgstr "エラー"
 
@@ -367,23 +379,23 @@ msgstr "エラー"
 msgid "Cannot open file \"%s\"."
 msgstr "\"%s\"をオープンできません"
 
-#: aplay/aplay.c:175
+#: aplay/aplay.c:184
 msgid "raw data"
 msgstr "raw データ"
 
-#: aplay/aplay.c:176
+#: aplay/aplay.c:185
 msgid "VOC"
 msgstr "VOC"
 
-#: aplay/aplay.c:178
+#: aplay/aplay.c:187
 msgid "WAVE"
 msgstr "WAVE"
 
-#: aplay/aplay.c:179
+#: aplay/aplay.c:188
 msgid "Sparc Audio"
 msgstr "Sparc オーディオ"
 
-#: aplay/aplay.c:200
+#: aplay/aplay.c:209
 #, fuzzy, c-format
 msgid ""
 "Usage: %s [OPTION]... [FILE]...\n"
@@ -397,8 +409,10 @@ msgid ""
 "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
 "-c, --channels=#        channels\n"
 "-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
 "-r, --rate=#            sample rate\n"
 "-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
 "-M, --mmap              mmap stream\n"
 "-N, --nonblock          nonblocking mode\n"
 "-F, --period-time=#     distance between interrupts is # microseconds\n"
@@ -468,12 +482,12 @@ msgstr ""
 "                        テスト範囲: coef * (buffer_size / 2)\n"
 "    --test-nowait       リングバッファのウエイトを禁止 - 注意:高CPU負荷\n"
 
-#: aplay/aplay.c:244 speaker-test/speaker-test.c:1021
+#: aplay/aplay.c:255 speaker-test/speaker-test.c:1001
 #, c-format
 msgid "Recognized sample formats are:"
 msgstr "認識されるサンプルフォーマット:"
 
-#: aplay/aplay.c:250
+#: aplay/aplay.c:261
 #, c-format
 msgid ""
 "\n"
@@ -482,155 +496,239 @@ msgstr ""
 "\n"
 "これらのいくつかは指定のハードウェアで使用不可能な場合があります\n"
 
-#: aplay/aplay.c:251
+#: aplay/aplay.c:262
 #, fuzzy, c-format
 msgid "The available format shortcuts are:\n"
 msgstr "可能なフォーマットの省略形:\n"
 
-#: aplay/aplay.c:252
+#: aplay/aplay.c:263
 #, c-format
 msgid "-f cd (16 bit little endian, 44100, stereo)\n"
 msgstr "-f cd (16 ビット、リトルエンディアン、44100、ステレオ)\n"
 
-#: aplay/aplay.c:253
+#: aplay/aplay.c:264
 #, c-format
 msgid "-f cdr (16 bit big endian, 44100, stereo)\n"
 msgstr "-f cdr (16 ビット、ビッグエンディアン、44100、ステレオ)\n"
 
-#: aplay/aplay.c:254
+#: aplay/aplay.c:265
 #, c-format
 msgid "-f dat (16 bit little endian, 48000, stereo)\n"
 msgstr "-f dat (16 ビット、リトルエンディアン、48000、ステレオ)\n"
 
-#: aplay/aplay.c:268
+#: aplay/aplay.c:279
 msgid "no soundcards found..."
 msgstr "サウンドカードが見つかりません..."
 
-#: aplay/aplay.c:271
+#: aplay/aplay.c:282
 #, c-format
 msgid "**** List of %s Hardware Devices ****\n"
 msgstr "**** ハードウェアデバイス %s のリスト ****\n"
 
-#: aplay/aplay.c:300
+#: aplay/aplay.c:311
 #, c-format
 msgid "card %i: %s [%s], device %i: %s [%s]\n"
 msgstr "カード %i: %s [%s], デバイス %i: %s [%s]\n"
 
-#: aplay/aplay.c:306
+#: aplay/aplay.c:317
 #, c-format
 msgid "  Subdevices: %i/%i\n"
 msgstr "  サブデバイス: %i/%i\n"
 
-#: aplay/aplay.c:313
+#: aplay/aplay.c:324
 #, c-format
 msgid "  Subdevice #%i: %s\n"
 msgstr "  サブデバイス #%i: %s\n"
 
-#: aplay/aplay.c:394
+#: aplay/aplay.c:405
 #, c-format
 msgid "Aborted by signal %s...\n"
 msgstr "シグナル %s で中断...\n"
 
-#: aplay/aplay.c:512
+#: aplay/aplay.c:562
 msgid "command should be named either arecord or aplay"
 msgstr "arecord または aplay コマンドのみ可能"
 
-#: aplay/aplay.c:556
+#: aplay/aplay.c:607
 #, c-format
 msgid "unrecognized file format %s"
 msgstr "不正なファイルフォーマット %s"
 
-#: aplay/aplay.c:563
+#: aplay/aplay.c:614
+#, fuzzy, c-format
+msgid "invalid channels argument '%s'"
+msgstr "送信アドレスが不正です: %s\n"
+
+#: aplay/aplay.c:618
 #, c-format
 msgid "value %i for channels is invalid"
 msgstr "不正なチャネル数 %i"
 
-#: aplay/aplay.c:582
+#: aplay/aplay.c:638
 #, c-format
 msgid "wrong extended format '%s'"
 msgstr "不正な拡張フォーマット '%s'"
 
-#: aplay/aplay.c:593
+#: aplay/aplay.c:650
+#, fuzzy, c-format
+#| msgid "wrong extended format '%s'"
+msgid "wrong extended subformat '%s'"
+msgstr "不正な拡張フォーマット '%s'"
+
+#: aplay/aplay.c:657
+#, fuzzy, c-format
+msgid "invalid rate argument '%s'"
+msgstr "不正な送信アドレス %s\n"
+
+#: aplay/aplay.c:664
 #, c-format
 msgid "bad speed value %i"
 msgstr "不正なレート値 %i"
 
-#: aplay/aplay.c:700 speaker-test/speaker-test.c:665
+#: aplay/aplay.c:670
+msgid "duration and samples arguments cannot be used together"
+msgstr ""
+
+#: aplay/aplay.c:675
+#, fuzzy, c-format
+msgid "invalid duration argument '%s'"
+msgstr "受信アドレスが不正です: %s\n"
+
+#: aplay/aplay.c:682
+msgid "samples and duration arguments cannot be used together"
+msgstr ""
+
+#: aplay/aplay.c:687
+#, fuzzy, c-format
+msgid "invalid samples argument '%s'"
+msgstr "送信アドレスが不正です: %s\n"
+
+#: aplay/aplay.c:699
+#, fuzzy, c-format
+msgid "invalid period time argument '%s'"
+msgstr "送信アドレスが不正です: %s\n"
+
+#: aplay/aplay.c:706
+#, fuzzy, c-format
+msgid "invalid buffer time argument '%s'"
+msgstr "不正な送信アドレス %s\n"
+
+#: aplay/aplay.c:713
+#, fuzzy, c-format
+msgid "invalid period size argument '%s'"
+msgstr "送信アドレスが不正です: %s\n"
+
+#: aplay/aplay.c:720
+#, fuzzy, c-format
+msgid "invalid buffer size argument '%s'"
+msgstr "不正な送信アドレス %s\n"
+
+#: aplay/aplay.c:727
+#, c-format
+msgid "invalid min available space argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:734
+#, fuzzy, c-format
+msgid "invalid start delay argument '%s'"
+msgstr "送信アドレスが不正です: %s\n"
+
+#: aplay/aplay.c:741
+#, fuzzy, c-format
+msgid "invalid stop delay argument '%s'"
+msgstr "送信アドレスが不正です: %s\n"
+
+#: aplay/aplay.c:796
+#, fuzzy, c-format
+msgid "invalid test coef argument '%s'"
+msgstr "不正な送信アドレス %s\n"
+
+#: aplay/aplay.c:808
+#, c-format
+msgid "invalid max file time argument '%s'"
+msgstr ""
+
+#: aplay/aplay.c:828 speaker-test/speaker-test.c:616
 #, fuzzy, c-format
 msgid "Unable to parse channel map string: %s\n"
 msgstr "avail_min を設定できません: %s\n"
 
-#: aplay/aplay.c:706
+#: aplay/aplay.c:834
 #, c-format
 msgid "Try `%s --help' for more information.\n"
 msgstr "より詳しい情報は「%s --help」を実行してください\n"
 
-#: aplay/aplay.c:722
+#: aplay/aplay.c:850
 #, c-format
 msgid "audio open error: %s"
 msgstr ""
 
-#: aplay/aplay.c:727
+#: aplay/aplay.c:855
 #, c-format
 msgid "info error: %s"
 msgstr ""
 
-#: aplay/aplay.c:734
+#: aplay/aplay.c:862
 #, c-format
 msgid "nonblock setting error: %s"
 msgstr ""
 
-#: aplay/aplay.c:744 aplay/aplay.c:868 aplay/aplay.c:1158 aplay/aplay.c:1351
-#: aplay/aplay.c:1867 aplay/aplay.c:1897
+#: aplay/aplay.c:880 aplay/aplay.c:1004 aplay/aplay.c:1310 aplay/aplay.c:1526
+#: aplay/aplay.c:2106 aplay/aplay.c:2136
 msgid "not enough memory"
 msgstr "メモリが足りません"
 
-#: aplay/aplay.c:768
+#: aplay/aplay.c:904
 #, fuzzy, c-format
 msgid "Cannot create process ID file %s: %s"
 msgstr "WAVファイルがオープンできません: %s\n"
 
-#: aplay/aplay.c:858
+#: aplay/aplay.c:994
 #, c-format
 msgid "read error (called from line %i)"
 msgstr "リードエラー (%i 行)"
 
-#: aplay/aplay.c:925
+#: aplay/aplay.c:1062
 #, c-format
 msgid "unknown length of 'fmt ' chunk (read %u, should be %u at least)"
 msgstr ""
 
-#: aplay/aplay.c:936
+#: aplay/aplay.c:1073
 #, c-format
 msgid ""
 "unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"
 msgstr ""
 
-#: aplay/aplay.c:941
+#: aplay/aplay.c:1078
 msgid "wrong format tag in extensible 'fmt ' chunk"
 msgstr ""
 
-#: aplay/aplay.c:948
+#: aplay/aplay.c:1086
 #, c-format
 msgid "can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"
 msgstr ""
 
-#: aplay/aplay.c:953
+#: aplay/aplay.c:1091
 #, c-format
 msgid "can't play WAVE-files with %d tracks"
 msgstr "%d トラックを含む WAVE ファイルは再生できません"
 
-#: aplay/aplay.c:961 aplay/aplay.c:1087
+#: aplay/aplay.c:1096
+#, c-format
+msgid "valid bps greater than bps: %d > %d"
+msgstr ""
+
+#: aplay/aplay.c:1103 aplay/aplay.c:1239
 #, c-format
 msgid "Warning: format is changed to U8\n"
 msgstr "警告: フォーマットは U8 に変更されます\n"
 
-#: aplay/aplay.c:971 aplay/aplay.c:984 aplay/aplay.c:995
+#: aplay/aplay.c:1113 aplay/aplay.c:1126 aplay/aplay.c:1137
 #, fuzzy, c-format
 msgid "Warning: format is changed to %s\n"
 msgstr "警告: フォーマットは U8 に変更されます\n"
 
-#: aplay/aplay.c:1000
+#: aplay/aplay.c:1142
 #, c-format
 msgid ""
 " can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"
@@ -638,852 +736,923 @@ msgstr ""
 "%2$d バイト長 %1$d サンプルビット (%3$d チャネル) の WAVE ファイルは再生でき"
 "ません"
 
-#: aplay/aplay.c:1023
+#: aplay/aplay.c:1175
 #, c-format
 msgid " can't play WAVE-files with sample %d bits wide"
 msgstr "%d ビット長のサンプルの WAVE ファイルは再生できません"
 
-#: aplay/aplay.c:1081
+#: aplay/aplay.c:1233
 #, c-format
 msgid "Warning: format is changed to MU_LAW\n"
 msgstr "警告: フォーマットは MU_LAW に変更されます\n"
 
-#: aplay/aplay.c:1093
+#: aplay/aplay.c:1245
 #, c-format
 msgid "Warning: format is changed to S16_BE\n"
 msgstr "警告: フォーマットは S16_BE に変更されます\n"
 
-#: aplay/aplay.c:1106 aplay/aplay.c:2182 aplay/aplay.c:2189 aplay/aplay.c:2715
-#: aplay/aplay.c:2727
+#: aplay/aplay.c:1258 aplay/aplay.c:2427 aplay/aplay.c:2434 aplay/aplay.c:2964
 msgid "read error"
 msgstr "リードエラー"
 
-#: aplay/aplay.c:1136
+#: aplay/aplay.c:1288
 msgid "Channel numbers don't match between hw_params and channel map"
 msgstr ""
 
-#: aplay/aplay.c:1145
+#: aplay/aplay.c:1297
 #, c-format
 msgid "Warning: unable to get channel map\n"
 msgstr ""
 
-#: aplay/aplay.c:1178
+#: aplay/aplay.c:1331
 #, c-format
-msgid "Channel %d doesn't match with hw_parmas"
+msgid "Channel %d doesn't match with hw_params"
 msgstr ""
 
-#: aplay/aplay.c:1204
+#: aplay/aplay.c:1358
 msgid "Broken configuration for this PCM: no configurations available"
 msgstr "指定の PCM を使用できません: 設定がありません"
 
-#: aplay/aplay.c:1208
+#: aplay/aplay.c:1362
 #, c-format
 msgid "HW Params of device \"%s\":\n"
 msgstr ""
 
-#: aplay/aplay.c:1228
+#: aplay/aplay.c:1382
 msgid "Access type not available"
 msgstr "アクセスタイプが使用不可能"
 
-#: aplay/aplay.c:1233
+#: aplay/aplay.c:1387
 msgid "Sample format non available"
 msgstr "サンプルフォーマットが使用不可能"
 
-#: aplay/aplay.c:1239
+#: aplay/aplay.c:1393
+#, fuzzy
+#| msgid "Sample format non available"
+msgid "Sample subformat not available"
+msgstr "サンプルフォーマットが使用不可能"
+
+#: aplay/aplay.c:1398
 msgid "Channels count non available"
 msgstr "チャネル数が使用不可能"
 
-#: aplay/aplay.c:1254
+#: aplay/aplay.c:1413
 #, c-format
 msgid "Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"
 msgstr "警告: レートが不正確です (要求値 = %iHz, 使用値 = %iHz)\n"
 
-#: aplay/aplay.c:1260
+#: aplay/aplay.c:1419
 #, c-format
 msgid "         please, try the plug plugin %s\n"
 msgstr "        plug プラグイン%s を使用してください\n"
 
-#: aplay/aplay.c:1297
+#: aplay/aplay.c:1456
 msgid "Unable to install hw params:"
 msgstr "hw params のインストールに失敗しました:"
 
-#: aplay/aplay.c:1304
+#: aplay/aplay.c:1463
 #, c-format
 msgid "Can't use period equal to buffer size (%lu == %lu)"
 msgstr "period と buffer サイズには同じ値を使用できません (%lu == %lu)"
 
-#: aplay/aplay.c:1335
+#: aplay/aplay.c:1469
+#, fuzzy
+#| msgid "unable to install sw params:"
+msgid "Unable to get current sw params."
+msgstr "sw params のインストールに失敗しました:"
+
+#: aplay/aplay.c:1509
 msgid "unable to install sw params:"
 msgstr "sw params のインストールに失敗しました:"
 
-#: aplay/aplay.c:1369
+#: aplay/aplay.c:1544
 #, c-format
 msgid "snd_pcm_mmap_begin problem: %s"
 msgstr ""
 
-#: aplay/aplay.c:1398
+#: aplay/aplay.c:1573
 #, c-format
 msgid "stdin O_NONBLOCK flag setup failed\n"
 msgstr ""
 
-#: aplay/aplay.c:1422
+#: aplay/aplay.c:1610
 #, c-format
 msgid "\rPAUSE command ignored (no hw support)\n"
 msgstr ""
 
-#: aplay/aplay.c:1427
+#: aplay/aplay.c:1618
 #, fuzzy, c-format
 msgid "pause push error: %s"
 msgstr "ステータスエラー: %s"
 
-#: aplay/aplay.c:1436
+#: aplay/aplay.c:1629
 #, fuzzy, c-format
 msgid "pause release error: %s"
 msgstr "サスペンド: prepare エラー: %s"
 
-#: aplay/aplay.c:1452
+#: aplay/aplay.c:1645
 #, c-format
 msgid ""
 "\r=== PAUSE ===                                                            "
 msgstr ""
 
-#: aplay/aplay.c:1494
+#: aplay/aplay.c:1687
 #, c-format
 msgid "status error: %s"
 msgstr "ステータスエラー: %s"
 
-#: aplay/aplay.c:1499
+#: aplay/aplay.c:1697 aplay/aplay.c:1708
 #, c-format
-msgid "fatal %s: %s"
-msgstr ""
+msgid "%s!!! (at least %.3f ms long)\n"
+msgstr "%s!!! (少なくとも %.3f ms)\n"
 
-#: aplay/aplay.c:1500 aplay/aplay.c:1511 aplay/aplay.c:1514 aplay/aplay.c:1522
+#: aplay/aplay.c:1698 aplay/aplay.c:1701 aplay/aplay.c:1709 aplay/aplay.c:1718
 msgid "underrun"
 msgstr "アンダーラン"
 
-#: aplay/aplay.c:1500 aplay/aplay.c:1511 aplay/aplay.c:1522
+#: aplay/aplay.c:1698 aplay/aplay.c:1709 aplay/aplay.c:1718
 msgid "overrun"
 msgstr "オーバーラン"
 
-#: aplay/aplay.c:1510 aplay/aplay.c:1521
-#, c-format
-msgid "%s!!! (at least %.3f ms long)\n"
-msgstr "%s!!! (少なくとも %.3f ms)\n"
-
-#: aplay/aplay.c:1526
+#: aplay/aplay.c:1713
 #, c-format
 msgid "Status:\n"
 msgstr "ステータス:\n"
 
-#: aplay/aplay.c:1530
+#: aplay/aplay.c:1717
+#, c-format
+msgid "fatal %s: %s"
+msgstr ""
+
+#: aplay/aplay.c:1723
 #, c-format
 msgid "xrun: prepare error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1536
+#: aplay/aplay.c:1730
 #, c-format
 msgid "Status(DRAINING):\n"
 msgstr "ステータス(DRAINING):\n"
 
-#: aplay/aplay.c:1540
+#: aplay/aplay.c:1734
 #, c-format
 msgid "capture stream format change? attempting recover...\n"
 msgstr "録音ストリームのフォーマットが変更? 修復を試みます...\n"
 
-#: aplay/aplay.c:1542
+#: aplay/aplay.c:1736
 #, c-format
 msgid "xrun(DRAINING): prepare error: %s"
 msgstr ""
 
-#: aplay/aplay.c:1549
+#: aplay/aplay.c:1743
 #, c-format
 msgid "Status(R/W):\n"
 msgstr "ステータス(R/W):\n"
 
-#: aplay/aplay.c:1552
+#: aplay/aplay.c:1746
 #, c-format
 msgid "read/write error, state = %s"
 msgstr "読み書きエラー, ステータス = %s"
 
-#: aplay/aplay.c:1562
+#: aplay/aplay.c:1756
 #, c-format
 msgid "Suspended. Trying resume. "
 msgstr "サスペンド中です。レジュームします。"
 
-#: aplay/aplay.c:1567
+#: aplay/aplay.c:1762
 #, c-format
 msgid "Failed. Restarting stream. "
 msgstr "失敗しました。ストリームを再スタートします。"
 
-#: aplay/aplay.c:1569
+#: aplay/aplay.c:1765
 #, c-format
 msgid "suspend: prepare error: %s"
 msgstr "サスペンド: prepare エラー: %s"
 
-#: aplay/aplay.c:1574
+#: aplay/aplay.c:1770
 #, c-format
 msgid "Done.\n"
 msgstr "終了\n"
 
-#: aplay/aplay.c:1596
+#: aplay/aplay.c:1792
 #, c-format
 msgid " !clip  "
 msgstr ""
 
-#: aplay/aplay.c:1743
+#: aplay/aplay.c:1944
 #, c-format
 msgid "Unsupported bit size %d.\n"
 msgstr ""
 
-#: aplay/aplay.c:1777
+#: aplay/aplay.c:1980
 #, c-format
 msgid "Max peak (%li samples): 0x%08x "
 msgstr "最大ピーク (%li サンプル): 0x%08x "
 
-#: aplay/aplay.c:1811
+#: aplay/aplay.c:2021
 #, c-format
 msgid ""
 "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer = "
 "%li\n"
 msgstr ""
 
-#: aplay/aplay.c:1939
+#: aplay/aplay.c:2030
+#, c-format
+msgid ""
+"Suspicious status buffer position (%li total): avail = %li, delay = %li, "
+"buffer = %li\n"
+msgstr ""
+
+#: aplay/aplay.c:2034
+#, c-format
+msgid ""
+"Suspicious buffer position avail > delay (%li total): avail = %li, delay = "
+"%li\n"
+msgstr ""
+
+#: aplay/aplay.c:2038
+#, c-format
+msgid ""
+"Suspicious status buffer position avail > delay (%li total): avail = %li, "
+"delay = %li\n"
+msgstr ""
+
+#: aplay/aplay.c:2081
+#, c-format
+msgid "Status(R/W) (standalone avail=%li delay=%li):\n"
+msgstr ""
+
+#: aplay/aplay.c:2178
 #, c-format
 msgid "write error: %s"
 msgstr "書込エラー: %s"
 
-#: aplay/aplay.c:1987
+#: aplay/aplay.c:2226
 #, c-format
 msgid "writev error: %s"
 msgstr "書込(writev)エラー: %s"
 
-#: aplay/aplay.c:2031
+#: aplay/aplay.c:2272
 #, c-format
 msgid "read error: %s"
 msgstr "読込エラー: %s"
 
-#: aplay/aplay.c:2075
+#: aplay/aplay.c:2319
 #, c-format
 msgid "readv error: %s"
 msgstr "読込(readv)エラー: %s"
 
-#: aplay/aplay.c:2123
+#: aplay/aplay.c:2368
 msgid "can't allocate buffer for silence"
 msgstr "サイレンス用のバッファの取得に失敗しました"
 
-#: aplay/aplay.c:2132 aplay/aplay.c:2360 aplay/aplay.c:2365 aplay/aplay.c:2412
-#: aplay/aplay.c:2421 aplay/aplay.c:2428 aplay/aplay.c:2438 aplay/aplay.c:2444
-#: aplay/aplay.c:2516 aplay/aplay.c:2546 aplay/aplay.c:2560
+#: aplay/aplay.c:2377 aplay/aplay.c:2606 aplay/aplay.c:2611 aplay/aplay.c:2663
+#: aplay/aplay.c:2672 aplay/aplay.c:2679 aplay/aplay.c:2689 aplay/aplay.c:2695
+#: aplay/aplay.c:2767 aplay/aplay.c:2797 aplay/aplay.c:2811
 msgid "write error"
 msgstr "書込エラー"
 
-#: aplay/aplay.c:2145
+#: aplay/aplay.c:2390
 #, c-format
 msgid "voc_pcm_flush - silence error"
 msgstr ""
 
-#: aplay/aplay.c:2148
+#: aplay/aplay.c:2393
 msgid "voc_pcm_flush error"
 msgstr ""
 
-#: aplay/aplay.c:2173
+#: aplay/aplay.c:2418
 msgid "malloc error"
 msgstr "malloc エラー"
 
-#: aplay/aplay.c:2177
+#: aplay/aplay.c:2422
 #, c-format
 msgid "Playing Creative Labs Channel file '%s'...\n"
 msgstr "Creative Labs Channel ファイル '%s' を演奏中...\n"
 
-#: aplay/aplay.c:2245 aplay/aplay.c:2340
+#: aplay/aplay.c:2491 aplay/aplay.c:2586
 msgid "can't play packed .voc files"
 msgstr "packed .voc ファイルは演奏できません"
 
-#: aplay/aplay.c:2300
+#: aplay/aplay.c:2546
 #, c-format
 msgid "can't play loops; %s isn't seekable\n"
 msgstr "ループ演奏できません。%s はシーク不可能です\n"
 
-#: aplay/aplay.c:2349
+#: aplay/aplay.c:2595
 #, c-format
 msgid "unknown blocktype %d. terminate."
 msgstr "未知のブロックタイプ %d: 終了します。"
 
-#: aplay/aplay.c:2480
+#: aplay/aplay.c:2731
 #, c-format
 msgid "Wave doesn't support %s format..."
 msgstr "WAVE は %s フォーマットをサポートしません..."
 
-#: aplay/aplay.c:2540
+#: aplay/aplay.c:2791
 #, c-format
 msgid "Sparc Audio doesn't support %s format..."
 msgstr "Sparc オーディオは %s フォーマットをサポートしません..."
 
-#: aplay/aplay.c:2621
+#: aplay/aplay.c:2866
 msgid "Playing"
 msgstr "再生中"
 
-#: aplay/aplay.c:2621
+#: aplay/aplay.c:2866
 msgid "Recording"
 msgstr "録音中"
 
-#: aplay/aplay.c:2625
+#: aplay/aplay.c:2870
 #, c-format
 msgid "Rate %d Hz, "
 msgstr "レート %d Hz, "
 
-#: aplay/aplay.c:2627
+#: aplay/aplay.c:2872
 #, c-format
 msgid "Mono"
 msgstr "モノラル"
 
-#: aplay/aplay.c:2629
+#: aplay/aplay.c:2874
 #, c-format
 msgid "Stereo"
 msgstr "ステレオ"
 
-#: aplay/aplay.c:2631
+#: aplay/aplay.c:2876
 #, c-format
 msgid "Channels %i"
 msgstr "チャネル数 %i"
 
-#: aplay/aplay.c:3145 aplay/aplay.c:3198
+#: aplay/aplay.c:3483
+#, fuzzy, c-format
+#| msgid "You need to specify %d files"
+msgid "You need to specify %u files"
+msgstr "%d 個のファイルを指定してください"
+
+#: aplay/aplay.c:3536
 #, c-format
 msgid "You need to specify %d files"
 msgstr "%d 個のファイルを指定してください"
 
-#: seq/aconnect/aconnect.c:49
+#: seq/aconnect/aconnect.c:56
 #, c-format
 msgid "aconnect - ALSA sequencer connection manager\n"
 msgstr "aconnect - ALSA sequencer 接続マネージャ\n"
 
-#: seq/aconnect/aconnect.c:50
+#: seq/aconnect/aconnect.c:57
 #, c-format
 msgid "Copyright (C) 1999-2000 Takashi Iwai\n"
 msgstr ""
 
-#: seq/aconnect/aconnect.c:51
+#: seq/aconnect/aconnect.c:58
 #, c-format
 msgid "Usage:\n"
 msgstr "使用法:\n"
 
-#: seq/aconnect/aconnect.c:52
+#: seq/aconnect/aconnect.c:59
 #, c-format
 msgid " * Connection/disconnection between two ports\n"
 msgstr " * 二つのポートの接続/切り離し\n"
 
-#: seq/aconnect/aconnect.c:53
+#: seq/aconnect/aconnect.c:60
 #, c-format
 msgid "   aconnect [-options] sender receiver\n"
 msgstr "   aconnect [-オプション] 送信 受信\n"
 
-#: seq/aconnect/aconnect.c:54
+#: seq/aconnect/aconnect.c:61
 #, c-format
 msgid "     sender, receiver = client:port pair\n"
 msgstr "     送信, 受信 = クライアント:ポートの組\n"
 
-#: seq/aconnect/aconnect.c:55
+#: seq/aconnect/aconnect.c:62
 #, c-format
 msgid "     -d,--disconnect     disconnect\n"
 msgstr "     -d,--disconnect     切り離し\n"
 
-#: seq/aconnect/aconnect.c:56
+#: seq/aconnect/aconnect.c:63
 #, c-format
 msgid "     -e,--exclusive      exclusive connection\n"
 msgstr "     -e,--exclusive      排他接続\n"
 
-#: seq/aconnect/aconnect.c:57
+#: seq/aconnect/aconnect.c:64
 #, c-format
 msgid "     -r,--real #         convert real-time-stamp on queue\n"
 msgstr "     -r,--real #         キューのリアルタイムスタンプに変換\n"
 
-#: seq/aconnect/aconnect.c:58
+#: seq/aconnect/aconnect.c:65
 #, c-format
 msgid "     -t,--tick #         convert tick-time-stamp on queue\n"
 msgstr "    -t,--tick #          キューのティックタイムスタンプに変換\n"
 
-#: seq/aconnect/aconnect.c:59
+#: seq/aconnect/aconnect.c:66
 #, c-format
 msgid " * List connected ports (no subscription action)\n"
 msgstr " * 接続済みのポートの一覧\n"
 
-#: seq/aconnect/aconnect.c:60
+#: seq/aconnect/aconnect.c:67
 #, c-format
 msgid "   aconnect -i|-o [-options]\n"
 msgstr "   aconnect -i|-o [-オプション]\n"
 
-#: seq/aconnect/aconnect.c:61
+#: seq/aconnect/aconnect.c:68
 #, c-format
 msgid "     -i,--input          list input (readable) ports\n"
 msgstr "     -i,--input          入力 (読込) ポートの一覧\n"
 
-#: seq/aconnect/aconnect.c:62
+#: seq/aconnect/aconnect.c:69
 #, c-format
 msgid "     -o,--output         list output (writable) ports\n"
 msgstr "     -o,--output         主力 (書込) ポートの一覧\n"
 
-#: seq/aconnect/aconnect.c:63
+#: seq/aconnect/aconnect.c:71
+#, fuzzy, c-format
+#| msgid "     -i,--input          list input (readable) ports\n"
+msgid "     -a,--all            show inactive ports, too\n"
+msgstr "     -i,--input          入力 (読込) ポートの一覧\n"
+
+#: seq/aconnect/aconnect.c:73
 #, c-format
 msgid "     -l,--list           list current connections of each port\n"
 msgstr "     -l,--list           各ポートの現在の接続を表示\n"
 
-#: seq/aconnect/aconnect.c:64
+#: seq/aconnect/aconnect.c:74
 #, c-format
 msgid " * Remove all exported connections\n"
 msgstr " * 全てのエクスポートされた接続を切り離す\n"
 
-#: seq/aconnect/aconnect.c:65
+#: seq/aconnect/aconnect.c:75
 #, c-format
 msgid "     -x, --removeall\n"
 msgstr "     -x, --removall\n"
 
-#: seq/aconnect/aconnect.c:132
+#: seq/aconnect/aconnect.c:155
 msgid "Connecting To"
 msgstr "接続先"
 
-#: seq/aconnect/aconnect.c:133
+#: seq/aconnect/aconnect.c:156
 msgid "Connected From"
 msgstr "接続元"
 
-#: seq/aconnect/aconnect.c:169
-#, c-format
-msgid "client %d: '%s' [type=%s]\n"
+#: seq/aconnect/aconnect.c:203
+#, fuzzy, c-format
+msgid "client %d: '%s' [type=%s"
 msgstr "クライアント %d: '%s' [タイプ=%s]\n"
 
-#: seq/aconnect/aconnect.c:173
+#: seq/aconnect/aconnect.c:207
 msgid "user"
 msgstr "ユーザ"
 
-#: seq/aconnect/aconnect.c:173
+#: seq/aconnect/aconnect.c:207
 msgid "kernel"
 msgstr "カーネル"
 
-#: seq/aconnect/aconnect.c:308
+#: seq/aconnect/aconnect.c:385
 #, c-format
 msgid "can't open sequencer\n"
 msgstr "sequencer をオープンできません\n"
 
-#: seq/aconnect/aconnect.c:336
+#: seq/aconnect/aconnect.c:413
 #, c-format
 msgid "can't get client id\n"
 msgstr "クライアント ID を取得できません\n"
 
-#: seq/aconnect/aconnect.c:343
+#: seq/aconnect/aconnect.c:420
 #, c-format
 msgid "can't set client info\n"
 msgstr "クライアント情報を取得できません\n"
 
-#: seq/aconnect/aconnect.c:350
+#: seq/aconnect/aconnect.c:427
 #, c-format
 msgid "invalid sender address %s\n"
 msgstr "送信アドレスが不正です: %s\n"
 
-#: seq/aconnect/aconnect.c:355 seq/aseqnet/aseqnet.c:290
+#: seq/aconnect/aconnect.c:432 seq/aseqnet/aseqnet.c:303
 #, c-format
 msgid "invalid destination address %s\n"
 msgstr "受信アドレスが不正です: %s\n"
 
-#: seq/aconnect/aconnect.c:369
+#: seq/aconnect/aconnect.c:446
 #, c-format
 msgid "No subscription is found\n"
 msgstr "接続が見つかりません\n"
 
-#: seq/aconnect/aconnect.c:374
+#: seq/aconnect/aconnect.c:451
 #, c-format
 msgid "Disconnection failed (%s)\n"
 msgstr "切り離しに失敗 (%s)\n"
 
-#: seq/aconnect/aconnect.c:380
+#: seq/aconnect/aconnect.c:457
 #, c-format
 msgid "Connection is already subscribed\n"
 msgstr "既に接続されています\n"
 
-#: seq/aconnect/aconnect.c:385
+#: seq/aconnect/aconnect.c:462
 #, c-format
 msgid "Connection failed (%s)\n"
 msgstr "接続に失敗 (%s)\n"
 
-#: seq/aseqnet/aseqnet.c:164
+#: seq/aseqnet/aseqnet.c:171
 #, c-format
 msgid "aseqnet - network client/server on ALSA sequencer\n"
 msgstr "aseqnet - ALSA sequencer 上のネットワーククライアント/サーバ\n"
 
-#: seq/aseqnet/aseqnet.c:165
+#: seq/aseqnet/aseqnet.c:172
 #, c-format
 msgid "  Copyright (C) 1999 Takashi Iwai\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:166
+#: seq/aseqnet/aseqnet.c:173
 #, c-format
 msgid "usage:\n"
 msgstr "使用法:\n"
 
-#: seq/aseqnet/aseqnet.c:167
+#: seq/aseqnet/aseqnet.c:174
 #, c-format
 msgid "  server mode: aseqnet [-options]\n"
 msgstr "  サーバモード: aseqnet [-オプション]\n"
 
-#: seq/aseqnet/aseqnet.c:168
+#: seq/aseqnet/aseqnet.c:175
 #, c-format
 msgid "  client mode: aseqnet [-options] server_host\n"
 msgstr "  クライアントモード: aseqnet [-オプション] サーバホスト\n"
 
-#: seq/aseqnet/aseqnet.c:169
+#: seq/aseqnet/aseqnet.c:176
 #, c-format
 msgid "options:\n"
 msgstr "オプション:\n"
 
-#: seq/aseqnet/aseqnet.c:170
+#: seq/aseqnet/aseqnet.c:177
+#, c-format
+msgid "  -6,--ipv6 : use IPv6 TCP protocol\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:178
 #, fuzzy, c-format
 msgid "  -p,--port # : specify TCP port (digit or service name)\n"
 msgstr "  -p,--port # : TCP ポートの指定 (数字またはサービス名)\n"
 
-#: seq/aseqnet/aseqnet.c:171
+#: seq/aseqnet/aseqnet.c:179
 #, c-format
 msgid "  -s,--source addr : read from given addr (client:port)\n"
 msgstr "  -s,--source addr : 指定のアドレス(クライアント:ポート)から読み込む\n"
 
-#: seq/aseqnet/aseqnet.c:172
+#: seq/aseqnet/aseqnet.c:180
 #, c-format
 msgid "  -d,--dest addr : write to given addr (client:port)\n"
 msgstr "  -d,--dest addr : 指定のアドレス(クライアント:ポート)に書き込む\n"
 
-#: seq/aseqnet/aseqnet.c:173
+#: seq/aseqnet/aseqnet.c:181
+#, c-format
+msgid "  -n,--name value : use a specific midi process name\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:182
 #, c-format
 msgid "  -v, --verbose : print verbose messages\n"
 msgstr "  -v,--verbose : 冗長メッセージ表示\n"
 
-#: seq/aseqnet/aseqnet.c:174
+#: seq/aseqnet/aseqnet.c:183
 #, c-format
 msgid "  -i, --info : print certain received events\n"
 msgstr "  -i,--info : 受信イベントを表示する\n"
 
-#: seq/aseqnet/aseqnet.c:188
+#: seq/aseqnet/aseqnet.c:197
 #, c-format
 msgid "can't malloc\n"
 msgstr "malloc できません\n"
 
-#: seq/aseqnet/aseqnet.c:213
+#: seq/aseqnet/aseqnet.c:222
 #, c-format
 msgid "closing files..\n"
 msgstr "ファイルを閉じます..\n"
 
-#: seq/aseqnet/aseqnet.c:272
+#: seq/aseqnet/aseqnet.c:285
 #, c-format
 msgid "sequencer opened: %d:%d\n"
 msgstr ""
 
-#: seq/aseqnet/aseqnet.c:279
+#: seq/aseqnet/aseqnet.c:292
 #, c-format
 msgid "invalid source address %s\n"
 msgstr "不正な送信アドレス %s\n"
 
-#: seq/aseqnet/aseqnet.c:309
-#, c-format
-msgid "service '%s' is not found in /etc/services\n"
-msgstr "サービス '%s' が /etc/services に見つかりません\n"
+#: seq/aseqnet/aseqnet.c:362
+#, fuzzy, c-format
+#| msgid "can't get address %s\n"
+msgid "can't get address\n"
+msgstr "アドレス %s を取得できません\n"
 
-#: seq/aseqnet/aseqnet.c:377
+#: seq/aseqnet/aseqnet.c:376 seq/aseqnet/aseqnet.c:461
+#, fuzzy, c-format
+#| msgid "Connecting To"
+msgid "connecting to: %s\n"
+msgstr "接続先"
+
+#: seq/aseqnet/aseqnet.c:414
 #, c-format
 msgid "too many connections!\n"
 msgstr "接続が多すぎます!\n"
 
-#: seq/aseqnet/aseqnet.c:388
+#: seq/aseqnet/aseqnet.c:425
 #, c-format
 msgid "accepted[%d]\n"
 msgstr "了解[%d]\n"
 
-#: seq/aseqnet/aseqnet.c:411
+#: seq/aseqnet/aseqnet.c:447
 #, c-format
 msgid "can't get address %s\n"
 msgstr "アドレス %s を取得できません\n"
 
-#: seq/aseqnet/aseqnet.c:422
+#: seq/aseqnet/aseqnet.c:475
 #, c-format
 msgid "ok.. connected\n"
 msgstr "ok.. 接続\n"
 
-#: seq/aseqnet/aseqnet.c:518
+#: seq/aseqnet/aseqnet.c:574
 #, c-format
 msgid "Channel %2d: Control event : %5d\n"
 msgstr "チャネル %2d: コントロール : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:522
+#: seq/aseqnet/aseqnet.c:578
 #, c-format
 msgid "Channel %2d: Pitchbender   : %5d\n"
 msgstr "チャネル %2d: ピッチベンド : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:526
+#: seq/aseqnet/aseqnet.c:582
 #, c-format
 msgid "Channel %2d: Note On event : %5d\n"
 msgstr "チャネル %2d: ノートオン   : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:530
+#: seq/aseqnet/aseqnet.c:586
 #, c-format
 msgid "Channel %2d: Note Off event: %5d\n"
 msgstr "チャネル %2d: ノートオフ   : %5d\n"
 
-#: seq/aseqnet/aseqnet.c:585
+#: seq/aseqnet/aseqnet.c:641
 #, c-format
 msgid "disconnected\n"
 msgstr "切り離し\n"
 
-#: speaker-test/speaker-test.c:120
+#: speaker-test/speaker-test.c:130
 msgid "Front Left"
 msgstr ""
 
-#: speaker-test/speaker-test.c:121
+#: speaker-test/speaker-test.c:131
 msgid "Front Right"
 msgstr ""
 
-#: speaker-test/speaker-test.c:122
+#: speaker-test/speaker-test.c:132
 msgid "Rear Left"
 msgstr ""
 
-#: speaker-test/speaker-test.c:123
+#: speaker-test/speaker-test.c:133
 msgid "Rear Right"
 msgstr ""
 
-#: speaker-test/speaker-test.c:125
+#: speaker-test/speaker-test.c:135
 msgid "LFE"
 msgstr ""
 
-#: speaker-test/speaker-test.c:126
+#: speaker-test/speaker-test.c:136
 msgid "Side Left"
 msgstr ""
 
-#: speaker-test/speaker-test.c:127
+#: speaker-test/speaker-test.c:137
 msgid "Side Right"
 msgstr ""
 
-#: speaker-test/speaker-test.c:128
+#: speaker-test/speaker-test.c:138
 msgid "Channel 9"
 msgstr ""
 
-#: speaker-test/speaker-test.c:129
+#: speaker-test/speaker-test.c:139
 msgid "Channel 10"
 msgstr ""
 
-#: speaker-test/speaker-test.c:130
+#: speaker-test/speaker-test.c:140
 msgid "Channel 11"
 msgstr ""
 
-#: speaker-test/speaker-test.c:131
+#: speaker-test/speaker-test.c:141
 msgid "Channel 12"
 msgstr ""
 
-#: speaker-test/speaker-test.c:132
+#: speaker-test/speaker-test.c:142
 msgid "Channel 13"
 msgstr ""
 
-#: speaker-test/speaker-test.c:133
+#: speaker-test/speaker-test.c:143
 msgid "Channel 14"
 msgstr ""
 
-#: speaker-test/speaker-test.c:134
+#: speaker-test/speaker-test.c:144
 msgid "Channel 15"
 msgstr ""
 
-#: speaker-test/speaker-test.c:135
+#: speaker-test/speaker-test.c:145
 msgid "Channel 16"
 msgstr ""
 
-#: speaker-test/speaker-test.c:518
+#: speaker-test/speaker-test.c:465
 #, c-format
 msgid "Broken configuration for playback: no configurations available: %s\n"
 msgstr "再生用に設定できません: 設定がみつかりません: %s\n"
 
-#: speaker-test/speaker-test.c:525
+#: speaker-test/speaker-test.c:472
 #, c-format
 msgid "Access type not available for playback: %s\n"
 msgstr "アクセスタイプが不正です: %s\n"
 
-#: speaker-test/speaker-test.c:532
+#: speaker-test/speaker-test.c:479
 #, c-format
 msgid "Sample format not available for playback: %s\n"
 msgstr "指定のサンプルフォーマットを使用できません: %s\n"
 
-#: speaker-test/speaker-test.c:539
+#: speaker-test/speaker-test.c:486
 #, c-format
 msgid "Channels count (%i) not available for playbacks: %s\n"
 msgstr "チャネル数 (%i) を使用できません: %s\n"
 
-#: speaker-test/speaker-test.c:547
+#: speaker-test/speaker-test.c:494
 #, c-format
 msgid "Rate %iHz not available for playback: %s\n"
 msgstr "レート %iHz を使用できません: %s\n"
 
-#: speaker-test/speaker-test.c:552
+#: speaker-test/speaker-test.c:499
 #, c-format
 msgid "Rate doesn't match (requested %iHz, get %iHz, err %d)\n"
 msgstr "設定レートが一致しません< (要求値 %iHz, 取得値 %iHz, エラー %d)\n"
 
-#: speaker-test/speaker-test.c:556
+#: speaker-test/speaker-test.c:503
 #, c-format
 msgid "Rate set to %iHz (requested %iHz)\n"
 msgstr "レート %iHz (要求値 %iHz)\n"
 
-#: speaker-test/speaker-test.c:562
+#: speaker-test/speaker-test.c:509
 #, c-format
 msgid "Buffer size range from %lu to %lu\n"
 msgstr "バッファサイズ範囲 %lu 〜 %lu\n"
 
-#: speaker-test/speaker-test.c:563
+#: speaker-test/speaker-test.c:510
 #, c-format
 msgid "Period size range from %lu to %lu\n"
 msgstr "ピリオドサイズ範囲 %lu 〜 %lu\n"
 
-#: speaker-test/speaker-test.c:565
+#: speaker-test/speaker-test.c:514
 #, c-format
 msgid "Requested period time %u us\n"
 msgstr "要求されたピリオド長 %u us\n"
 
-#: speaker-test/speaker-test.c:568
+#: speaker-test/speaker-test.c:519
 #, c-format
 msgid "Unable to set period time %u us for playback: %s\n"
 msgstr "ピリオド長 %u us を設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:574
+#: speaker-test/speaker-test.c:525
 #, c-format
 msgid "Requested buffer time %u us\n"
 msgstr "要求されたバッファ長 %u us\n"
 
-#: speaker-test/speaker-test.c:577
+#: speaker-test/speaker-test.c:528
 #, c-format
 msgid "Unable to set buffer time %u us for playback: %s\n"
 msgstr "バッファ長 %u us を設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:586
+#: speaker-test/speaker-test.c:537
 #, c-format
 msgid "Using max buffer size %lu\n"
 msgstr "最大バッファサイズ %lu を使用\n"
 
-#: speaker-test/speaker-test.c:589
+#: speaker-test/speaker-test.c:540
 #, c-format
 msgid "Unable to set buffer size %lu for playback: %s\n"
 msgstr "バッファサイズ %lu を設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:595
+#: speaker-test/speaker-test.c:546
 #, c-format
 msgid "Periods = %u\n"
 msgstr "ピリオド数 = %u\n"
 
-#: speaker-test/speaker-test.c:598
+#: speaker-test/speaker-test.c:549
 #, c-format
 msgid "Unable to set nperiods %u for playback: %s\n"
 msgstr "ピリオド数 %u を設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:607
+#: speaker-test/speaker-test.c:558
 #, c-format
 msgid "Unable to set hw params for playback: %s\n"
 msgstr "hw params を設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:613
+#: speaker-test/speaker-test.c:564
 #, c-format
 msgid "was set period_size = %lu\n"
 msgstr "period_size = %lu で設定\n"
 
-#: speaker-test/speaker-test.c:614
+#: speaker-test/speaker-test.c:565
 #, c-format
 msgid "was set buffer_size = %lu\n"
 msgstr "buffer_size = %lu で設定\n"
 
-#: speaker-test/speaker-test.c:616
+#: speaker-test/speaker-test.c:567
 #, c-format
 msgid "buffer to small, could not use\n"
 msgstr "バッファが小さすぎます\n"
 
-#: speaker-test/speaker-test.c:629
+#: speaker-test/speaker-test.c:580
 #, c-format
 msgid "Unable to determine current swparams for playback: %s\n"
 msgstr "現在の swparams を取得できません: %s\n"
 
-#: speaker-test/speaker-test.c:636
+#: speaker-test/speaker-test.c:587
 #, c-format
 msgid "Unable to set start threshold mode for playback: %s\n"
 msgstr "start_threshold モードを設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:643
+#: speaker-test/speaker-test.c:594
 #, c-format
 msgid "Unable to set avail min for playback: %s\n"
 msgstr "avail_min を設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:650
+#: speaker-test/speaker-test.c:601
 #, c-format
 msgid "Unable to set sw params for playback: %s\n"
 msgstr "再生用の sw params を設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:670
+#: speaker-test/speaker-test.c:621
 #, fuzzy, c-format
 msgid "Unable to set channel map: %s\n"
 msgstr "avail_min を設定できません: %s\n"
 
-#: speaker-test/speaker-test.c:695
+#: speaker-test/speaker-test.c:646
 #, c-format
 msgid "Can't recovery from underrun, prepare failed: %s\n"
 msgstr "アンダーランから復帰失敗: %s\n"
 
-#: speaker-test/speaker-test.c:706
+#: speaker-test/speaker-test.c:657
 #, c-format
 msgid "Can't recovery from suspend, prepare failed: %s\n"
 msgstr "サスペンドから復帰失敗: %s\n"
 
-#: speaker-test/speaker-test.c:770 speaker-test/speaker-test.c:1261
+#: speaker-test/speaker-test.c:721 speaker-test/speaker-test.c:1257
 #, c-format
 msgid "No enough memory\n"
 msgstr "メモリが足りません\n"
 
-#: speaker-test/speaker-test.c:775
+#: speaker-test/speaker-test.c:726
 #, c-format
 msgid "Cannot open WAV file %s\n"
 msgstr "WAVファイルがオープンできません: %s\n"
 
-#: speaker-test/speaker-test.c:779 speaker-test/speaker-test.c:808
+#: speaker-test/speaker-test.c:730 speaker-test/speaker-test.c:759
 #, c-format
 msgid "Invalid WAV file %s\n"
 msgstr "不正なWAVファイルです: %s\n"
 
-#: speaker-test/speaker-test.c:784
+#: speaker-test/speaker-test.c:735
 #, c-format
 msgid "Not a WAV file: %s\n"
 msgstr "WAVファイルではありません: %s\n"
 
-#: speaker-test/speaker-test.c:788
+#: speaker-test/speaker-test.c:739
 #, c-format
 msgid "Unsupported WAV format %d for %s\n"
 msgstr "未サポートのWAVフォーマット %d: %s\n"
 
-#: speaker-test/speaker-test.c:793
+#: speaker-test/speaker-test.c:744
 #, c-format
 msgid "%s is not a mono stream (%d channels)\n"
 msgstr "%s はモノストリームではありません (%d チャネル)\n"
 
-#: speaker-test/speaker-test.c:798
+#: speaker-test/speaker-test.c:749
 #, c-format
 msgid "Sample rate doesn't match (%d) for %s\n"
 msgstr "サンプルレートが不一致です(%d): %s\n"
 
-#: speaker-test/speaker-test.c:803
+#: speaker-test/speaker-test.c:754
 #, c-format
 msgid "Unsupported sample format bits %d for %s\n"
 msgstr "未サポートのサンプルフォーマットビット %d: %s\n"
 
-#: speaker-test/speaker-test.c:864
+#: speaker-test/speaker-test.c:815
 #, c-format
 msgid "Undefined channel %d\n"
 msgstr "未定義のチャネル %d\n"
 
-#: speaker-test/speaker-test.c:915
+#: speaker-test/speaker-test.c:866
 #, c-format
 msgid "Write error: %d,%s\n"
 msgstr "書込エラー: %d,%s\n"
 
-#: speaker-test/speaker-test.c:917
+#: speaker-test/speaker-test.c:868
 #, c-format
 msgid "xrun_recovery failed: %d,%s\n"
 msgstr "xrun_recovery 失敗: %d,%s\n"
 
-#: speaker-test/speaker-test.c:1003
+#: speaker-test/speaker-test.c:938
+#, c-format
+msgid "\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:982
 #, fuzzy, c-format
 msgid ""
 "Usage: speaker-test [OPTION]... \n"
@@ -1496,13 +1665,15 @@ msgid ""
 "-b,--buffer\tring buffer size in us\n"
 "-p,--period\tperiod size in us\n"
 "-P,--nperiods\tnumber of periods\n"
-"-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+"-t,--test\tpink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 "
+"noise, wav=WAV file\n"
 "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
 "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
 "-w,--wavfile\tUse the given WAV file as a test sound\n"
 "-W,--wavdir\tSpecify the directory containing WAV files\n"
 "-m,--chmap\tSpecify the channel map to override\n"
 "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+"-S,--scale\tScale of generated test tones in percent (default=80)\n"
 "\n"
 msgstr ""
 "使用法: speaker-test [オプション]...\n"
@@ -1524,76 +1695,86 @@ msgstr ""
 "-X,--force-frequency\t30-8000Hz範囲外許可\n"
 "\n"
 
-#: speaker-test/speaker-test.c:1132
+#: speaker-test/speaker-test.c:1114
 #, c-format
 msgid "Invalid number of periods %d\n"
 msgstr "不正なピリオド数 %d\n"
 
-#: speaker-test/speaker-test.c:1148 speaker-test/speaker-test.c:1152
+#: speaker-test/speaker-test.c:1127 speaker-test/speaker-test.c:1137
+#: speaker-test/speaker-test.c:1141
 #, c-format
 msgid "Invalid test type %s\n"
 msgstr "不正なテストタイプ %s\n"
 
-#: speaker-test/speaker-test.c:1164
-#, c-format
-msgid "Invalid parameter for -s option.\n"
-msgstr "-s オプションの値が不正です\n"
-
-#: speaker-test/speaker-test.c:1186
+#: speaker-test/speaker-test.c:1174
 #, c-format
 msgid "Unknown option '%c'\n"
 msgstr "未知のオプション '%c'\n"
 
-#: speaker-test/speaker-test.c:1207
+#: speaker-test/speaker-test.c:1188
+#, c-format
+msgid "Invalid parameter for -s option.\n"
+msgstr "-s オプションの値が不正です\n"
+
+#: speaker-test/speaker-test.c:1203
 #, c-format
 msgid "Playback device is %s\n"
 msgstr "再生デバイス: %s\n"
 
-#: speaker-test/speaker-test.c:1208
+#: speaker-test/speaker-test.c:1204
 #, c-format
 msgid "Stream parameters are %iHz, %s, %i channels\n"
 msgstr "ストリームパラメータ: %iHz, %s, %i チャネル\n"
 
-#: speaker-test/speaker-test.c:1211
+#: speaker-test/speaker-test.c:1207
+#, c-format
+msgid "Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:1210
 #, c-format
 msgid "Using 16 octaves of pink noise\n"
 msgstr "16 オクターブのピンクノイズを使用\n"
 
-#: speaker-test/speaker-test.c:1214
+#: speaker-test/speaker-test.c:1213
 #, c-format
 msgid "Sine wave rate is %.4fHz\n"
 msgstr "正弦波レート: %.4fHz\n"
 
-#: speaker-test/speaker-test.c:1217
+#: speaker-test/speaker-test.c:1216
 #, c-format
 msgid "WAV file(s)\n"
 msgstr "WAV ファイル\n"
 
-#: speaker-test/speaker-test.c:1227
+#: speaker-test/speaker-test.c:1226
 #, c-format
 msgid "Playback open error: %d,%s\n"
 msgstr "再生オープンエラー: %d,%s\n"
 
-#: speaker-test/speaker-test.c:1233
+#: speaker-test/speaker-test.c:1232
 #, c-format
 msgid "Setting of hwparams failed: %s\n"
 msgstr "hwparams の設定に失敗: %s\n"
 
-#: speaker-test/speaker-test.c:1237
+#: speaker-test/speaker-test.c:1236
 #, c-format
 msgid "Setting of swparams failed: %s\n"
 msgstr "swparams の設定に失敗: %s\n"
 
-#: speaker-test/speaker-test.c:1284 speaker-test/speaker-test.c:1306
+#: speaker-test/speaker-test.c:1282 speaker-test/speaker-test.c:1304
 #, c-format
 msgid "Transfer failed: %s\n"
 msgstr "転送に失敗しました: %s\n"
 
-#: speaker-test/speaker-test.c:1292
+#: speaker-test/speaker-test.c:1290
 #, c-format
 msgid "Time per period = %lf\n"
 msgstr "ピリオド時間 = %lf\n"
 
+#, c-format
+#~ msgid "service '%s' is not found in /etc/services\n"
+#~ msgstr "サービス '%s' が /etc/services に見つかりません\n"
+
 #~ msgid "Warning: format is changed to S16_LE\n"
 #~ msgstr "警告: フォーマットは S16_LE に変更されます\n"
 
diff --git a/po/ka.gmo b/po/ka.gmo
new file mode 100644 (file)
index 0000000..3b34a6f
Binary files /dev/null and b/po/ka.gmo differ
diff --git a/po/ka.po b/po/ka.po
new file mode 100644 (file)
index 0000000..0818eae
--- /dev/null
+++ b/po/ka.po
@@ -0,0 +1,1877 @@
+# alsa-utils translationto Georgian.
+# Copyright (C) 2022 The ALSA Team
+# This file is distributed under the same license as the alsa-utils package.
+# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2022.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: alsa-utils 1.2.7\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-06-10 09:22+0000\n"
+"PO-Revision-Date: 2022-09-09 10:28+0200\n"
+"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
+"Language-Team: Georgian <(nothing)>\n"
+"Language: ka\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Poedit 3.1.1\n"
+
+#: alsamixer/card_select.c:77 alsamixer/device_name.c:127
+msgid "Sound Card"
+msgstr "ხმის ბარათი"
+
+#: alsamixer/card_select.c:115
+msgid "(default)"
+msgstr "(ნაგულისხმები)"
+
+#: alsamixer/card_select.c:125
+msgid "cannot enumerate sound cards"
+msgstr "ხმის ბარათების სიის მიღების შეცდომა"
+
+#: alsamixer/card_select.c:151
+msgid "enter device name..."
+msgstr "შეიყვანეთ მოწყობილობის სახელი..."
+
+#: alsamixer/cli.c:45
+msgid "Usage: alsamixer [options]"
+msgstr "გამოყენება: alsamixer [პარამეტრები]"
+
+#: alsamixer/cli.c:46
+#, fuzzy
+#| msgid ""
+#| "Useful options:\n"
+#| "  -h, --help              this help\n"
+#| "  -c, --card=NUMBER       sound card number or id\n"
+#| "  -D, --device=NAME       mixer device name\n"
+#| "  -m, --mouse             enable mouse\n"
+#| "  -M, --no-mouse          disable mouse\n"
+#| "  -f, --config=FILE       configuration file\n"
+#| "  -F, --no-config         do not load configuration file\n"
+#| "  -V, --view=MODE         starting view mode: playback/capture/all"
+msgid ""
+"Useful options:\n"
+"  -h, --help              this help\n"
+"  -c, --card=NUMBER       sound card number or id\n"
+"  -D, --device=NAME       mixer device name\n"
+"  -m, --mouse             enable mouse\n"
+"  -M, --no-mouse          disable mouse\n"
+"  -f, --config=FILE       configuration file\n"
+"  -F, --no-config         do not load configuration file\n"
+"  -V, --view=MODE         starting view mode: playback/capture/all\n"
+"  -B, --black-background  use black background color"
+msgstr ""
+"სასარგებლო პარამეტრები:\n"
+"  -h, --help              ეს დახმარება\n"
+"  -c, --card=რიცხვი        ხმის ბარათის ნომერი ან ID\n"
+"  -D, --device=სახელი      მიქსერის მოწყობილობის სახელი\n"
+"  -m, --mouse             თაგუნას ჩართვა\n"
+"  -M, --no-mouse          თაგუნას გამორთვა\n"
+"  -f, --config=ფაილი      კონფიგურაციის ფაილი\n"
+"  -F, --no-config         კონფიგურაციის ფაილი არ ჩაიტვირთება\n"
+"  -V, --view=რეჟიმი         ხედის რეჟიმის გაშვება: playback (დაკვრა)/record "
+"(ჩაჭერა)/all (ყველა)"
+
+#: alsamixer/cli.c:56
+msgid ""
+"Debugging options:\n"
+"  -g, --no-color          toggle using of colors\n"
+"  -a, --abstraction=NAME  mixer abstraction level: none/basic"
+msgstr ""
+"გამართვის პარამეტრები:\n"
+"   -g, --no-color        ფერების გამოყენების გადართვა\n"
+"   -a, --abstraction=სახელი    მიქსერის აბსტრაქციის დონე: none(არც ერთი)/"
+"basic (ძირითადი)"
+
+#: alsamixer/cli.c:92
+#, c-format
+msgid "invalid card index: %s\n"
+msgstr "ბარათის არასწორი ინდექსი: %s\n"
+
+#: alsamixer/cli.c:137
+#, c-format
+msgid "unknown abstraction level: %s\n"
+msgstr "უცნობი აბსტრაქციის დონე: %s\n"
+
+#: alsamixer/cli.c:142
+#, c-format
+msgid "unknown option: %c\n"
+msgstr "უცნობი პარამეტრი: %c\n"
+
+#: alsamixer/cli.c:144
+msgid "try `alsamixer --help' for more information\n"
+msgstr "მეტი ინფორმაციისთვის სცადეთ 'alsamixer --help'\n"
+
+#: alsamixer/device_name.c:177
+msgid "Device name:"
+msgstr "მოწყობილობის სახელი:"
+
+#: alsamixer/die.c:37
+#, c-format
+msgid "%s: %s\n"
+msgstr "%s: %s\n"
+
+#: alsamixer/mixer_display.c:99
+msgid "Card:"
+msgstr "ბარათი:"
+
+#: alsamixer/mixer_display.c:100
+msgid "Chip:"
+msgstr "ჩიპი:"
+
+#: alsamixer/mixer_display.c:101
+msgid "View:"
+msgstr "ხედი:"
+
+#: alsamixer/mixer_display.c:102
+msgid "Item:"
+msgstr "ელემენტი:"
+
+#: alsamixer/mixer_display.c:105
+msgid "F1:  Help"
+msgstr "F1:  დახმარება"
+
+#: alsamixer/mixer_display.c:106
+msgid "F2:  System information"
+msgstr "F2: ინფორმაცია სისტემის შესახებ"
+
+#: alsamixer/mixer_display.c:107
+msgid "F6:  Select sound card"
+msgstr "F6:  აირჩეთ ხმის ბარათი"
+
+#: alsamixer/mixer_display.c:108
+msgid "Esc: Exit"
+msgstr "Esc: გასვლა"
+
+#: alsamixer/mixer_display.c:179
+msgid "(unplugged)"
+msgstr "(გამოერთებული)"
+
+#: alsamixer/mixer_display.c:197
+msgid "Playback"
+msgstr "დაკვრა"
+
+#: alsamixer/mixer_display.c:198
+msgid "Capture"
+msgstr "ჩაჭერა"
+
+#: alsamixer/mixer_display.c:199
+msgid "All"
+msgstr "&ყველა"
+
+#: alsamixer/mixer_display.c:240
+msgid "mute"
+msgstr "დადუმება"
+
+#: alsamixer/mixer_display.c:281 alsamixer/mixer_display.c:291
+msgid "dB gain:"
+msgstr "გაძლიერება (დბ):"
+
+#: alsamixer/mixer_display.c:291
+#, c-format
+msgid " [%s %s, %s]"
+msgstr " [%s %s, %s]"
+
+#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:306
+#: alsamixer/mixer_display.c:312 alsamixer/mixer_display.c:318
+msgid "Off"
+msgstr "გამორთული"
+
+#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:318
+msgid "On"
+msgstr "ჩართული"
+
+#: alsamixer/mixer_display.c:370
+msgid "The sound device was unplugged."
+msgstr "ხმის მოწყობილობა გამოერთებულია."
+
+#: alsamixer/mixer_display.c:371
+msgid "Press F6 to select another sound card."
+msgstr "სხვა ხმის ბარათის ასარჩევად დააწექით F6-ს."
+
+#: alsamixer/mixer_display.c:386
+msgid "This sound device does not have any playback controls."
+msgstr "ამ ხმის მოწყობილობას დაკვრის არანაირი კონტროლი არ გააჩნია."
+
+#: alsamixer/mixer_display.c:388
+msgid "This sound device does not have any capture controls."
+msgstr "ამ ხმის მოწყობილობას ჩაჭერის არანაირი კონტროლი არ გააჩნია."
+
+#: alsamixer/mixer_display.c:390
+msgid "This sound device does not have any controls."
+msgstr "ამ ხმის მოწყობილობას არანაირი კონტროლი არ გააჩნია."
+
+#. TRANSLATORS: playback on; one character
+#: alsamixer/mixer_display.c:523 alsamixer/mixer_display.c:528
+msgid "O"
+msgstr "O"
+
+#. TRANSLATORS: playback muted; one character
+#: alsamixer/mixer_display.c:525 alsamixer/mixer_display.c:529
+msgid "M"
+msgstr "მ"
+
+#. TRANSLATORS: "left"; no more than two characters
+#: alsamixer/mixer_display.c:545
+msgid "L"
+msgstr "მხ"
+
+#. TRANSLATORS: "right"; no more than two characters
+#: alsamixer/mixer_display.c:551
+msgid "R"
+msgstr "მჯ"
+
+#. TRANSLATORS: no more than eight characters
+#: alsamixer/mixer_display.c:555
+msgid "CAPTURE"
+msgstr "ჩაჭერა"
+
+#: alsamixer/mixer_display.c:611
+msgid "Front"
+msgstr "წინა"
+
+#: alsamixer/mixer_display.c:614
+msgid "Rear"
+msgstr "უკანა"
+
+#: alsamixer/mixer_display.c:617 speaker-test/speaker-test.c:134
+msgid "Center"
+msgstr "ცენტრი"
+
+#: alsamixer/mixer_display.c:620
+msgid "Woofer"
+msgstr "ვუფერი"
+
+#: alsamixer/mixer_display.c:623
+msgid "Side"
+msgstr "გვერდითი"
+
+#: alsamixer/mixer_widget.c:91 alsamixer/mixer_widget.c:96
+msgid "cannot open mixer"
+msgstr "მიქსერის გახსნის შეცდომა"
+
+#: alsamixer/mixer_widget.c:102 alsamixer/mixer_widget.c:179
+msgid "cannot load mixer controls"
+msgstr "მიქსერის კონტროლის ჩატვირთვის შეცდომა"
+
+#: alsamixer/mixer_widget.c:169
+#, c-format
+msgid "Cannot open mixer device '%s'."
+msgstr "მიქსერის მოწყობილობის გახსნის შეცდომა: '%s'."
+
+#: alsamixer/mixer_widget.c:190
+msgid "Esc     Exit"
+msgstr "Esc     გასვლა"
+
+#: alsamixer/mixer_widget.c:191
+msgid "F1 ? H  Help"
+msgstr "F1 ? H  დახმარება"
+
+#: alsamixer/mixer_widget.c:192
+msgid "F2 /    System information"
+msgstr "F2 /    ინფორმაცია სისტემის შესახებ"
+
+#: alsamixer/mixer_widget.c:193
+msgid "F3      Show playback controls"
+msgstr "F3      დაკვრის კონტროლების ჩვენება"
+
+#: alsamixer/mixer_widget.c:194
+msgid "F4      Show capture controls"
+msgstr "F4      ჩაჭერის კონტროლების ჩვენება"
+
+#: alsamixer/mixer_widget.c:195
+msgid "F5      Show all controls"
+msgstr "F5      ყველა კონტროლის ჩვენება"
+
+#: alsamixer/mixer_widget.c:196
+msgid "Tab     Toggle view mode (F3/F4/F5)"
+msgstr "Tab     ხედის რეჟიმს გადართავს (F3/F4/F5)"
+
+#: alsamixer/mixer_widget.c:197
+msgid "F6 S    Select sound card"
+msgstr "F6 S    აირჩიეთ ხმის ბარათი"
+
+#: alsamixer/mixer_widget.c:198
+msgid "L       Redraw screen"
+msgstr "L       ეკრანის გადახატვა"
+
+#: alsamixer/mixer_widget.c:200
+msgid "Left    Move to the previous control"
+msgstr "მარცხნივ    წინა კონტროლზე გადასვლა"
+
+#: alsamixer/mixer_widget.c:201
+msgid "Right   Move to the next control"
+msgstr "მარჯვნივ   შემდეგ კონტროლზე გადასვლა"
+
+#: alsamixer/mixer_widget.c:203
+msgid "Up/Down    Change volume"
+msgstr "მაღლა/დაბლა    ხმის შეცვლა"
+
+#: alsamixer/mixer_widget.c:204
+msgid "+ -        Change volume"
+msgstr "+ -        ხმის შეცვლა"
+
+#: alsamixer/mixer_widget.c:205
+msgid "Page Up/Dn Change volume in big steps"
+msgstr "Page Up/Dn ხმის დიდი ნაბიჯებით შეცვლა"
+
+#: alsamixer/mixer_widget.c:206
+msgid "End        Set volume to 0%"
+msgstr "End        ხმის 0%-ზე დაყენება"
+
+#: alsamixer/mixer_widget.c:207
+msgid "0-9        Set volume to 0%-90%"
+msgstr "0-9        ხმის დაყენება to 0%-90%-ზე"
+
+#: alsamixer/mixer_widget.c:208
+msgid "Q W E      Increase left/both/right volumes"
+msgstr "Q W E      მარცხენა/ორივე/მარჯვენა არხის ხმის გაზრდა"
+
+#. TRANSLATORS: or Y instead of Z
+#: alsamixer/mixer_widget.c:210
+msgid "Z X C      Decrease left/both/right volumes"
+msgstr "Z X C      მარცხენა/ორივე/მარჯვენა არხის ხმის შემცირება"
+
+#: alsamixer/mixer_widget.c:211
+msgid "B          Balance left and right volumes"
+msgstr "B          მარჯვენა და მარცხენა არხების დაბალანსება"
+
+#: alsamixer/mixer_widget.c:213
+msgid "M          Toggle mute"
+msgstr "M          დადუმების გადართვა"
+
+#. TRANSLATORS: or , .
+#: alsamixer/mixer_widget.c:215
+msgid "< >        Toggle left/right mute"
+msgstr "< >        მარცხენა/მარჯვენა არხების დადუმება"
+
+#: alsamixer/mixer_widget.c:217
+msgid "Space      Toggle capture"
+msgstr "Space      ჩაჭერის გადართვა"
+
+#. TRANSLATORS: or Insert Delete
+#: alsamixer/mixer_widget.c:219
+msgid "; '        Toggle left/right capture"
+msgstr "; '        მარცხენა/მარჯვენა არხის ჩაჭერის გადართვა"
+
+#: alsamixer/mixer_widget.c:221
+msgid "Authors:"
+msgstr "ავტორები:"
+
+#: alsamixer/mixer_widget.c:222
+msgid "  Tim Janik"
+msgstr "  Tim Janik"
+
+#: alsamixer/mixer_widget.c:223
+msgid "  Jaroslav Kysela <perex@perex.cz>"
+msgstr "  Jaroslav Kysela <perex@perex.cz>"
+
+#: alsamixer/mixer_widget.c:224
+msgid "  Clemens Ladisch <clemens@ladisch.de>"
+msgstr "  Clemens Ladisch <clemens@ladisch.de>"
+
+#: alsamixer/mixer_widget.c:226
+msgid "Help"
+msgstr "დახმარება"
+
+#: alsamixer/proc_files.c:56
+msgid "Select File"
+msgstr "აირჩიეთ ფაილი"
+
+#: alsamixer/textbox.c:51 alsamixer/textbox.c:65
+msgid "Error"
+msgstr "შეცდომა"
+
+#: alsamixer/textbox.c:80
+#, c-format
+msgid "Cannot open file \"%s\"."
+msgstr "ფაილის გახსნის შეცდომა: %s."
+
+#: aplay/aplay.c:184
+msgid "raw data"
+msgstr "დაუმუშავებელი მონაცემი"
+
+#: aplay/aplay.c:185
+msgid "VOC"
+msgstr "VOC"
+
+#: aplay/aplay.c:187
+msgid "WAVE"
+msgstr "WAVE"
+
+#: aplay/aplay.c:188
+msgid "Sparc Audio"
+msgstr "Sparc აუდიო"
+
+#: aplay/aplay.c:209
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: %s [OPTION]... [FILE]...\n"
+#| "\n"
+#| "-h, --help              help\n"
+#| "    --version           print current version\n"
+#| "-l, --list-devices      list all soundcards and digital audio devices\n"
+#| "-L, --list-pcms         list device names\n"
+#| "-D, --device=NAME       select PCM by name\n"
+#| "-q, --quiet             quiet mode\n"
+#| "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+#| "-c, --channels=#        channels\n"
+#| "-f, --format=FORMAT     sample format (case insensitive)\n"
+#| "-r, --rate=#            sample rate\n"
+#| "-d, --duration=#        interrupt after # seconds\n"
+#| "-s, --samples=#         interrupt after # samples per channel\n"
+#| "-M, --mmap              mmap stream\n"
+#| "-N, --nonblock          nonblocking mode\n"
+#| "-F, --period-time=#     distance between interrupts is # microseconds\n"
+#| "-B, --buffer-time=#     buffer duration is # microseconds\n"
+#| "    --period-size=#     distance between interrupts is # frames\n"
+#| "    --buffer-size=#     buffer duration is # frames\n"
+#| "-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+#| "-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+#| "                        (relative to buffer size if <= 0)\n"
+#| "-T, --stop-delay=#      delay for automatic PCM stop is # microseconds "
+#| "from xrun\n"
+#| "-v, --verbose           show PCM structure and setup (accumulative)\n"
+#| "-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+#| "-I, --separate-channels one file for each channel\n"
+#| "-i, --interactive       allow interactive operation from stdin\n"
+#| "-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+#| "    --disable-resample  disable automatic rate resample\n"
+#| "    --disable-channels  disable automatic channel conversions\n"
+#| "    --disable-format    disable automatic format conversions\n"
+#| "    --disable-softvol   disable software volume control (softvol)\n"
+#| "    --test-position     test ring buffer position\n"
+#| "    --test-coef=#       test coefficient for ring buffer position "
+#| "(default 8)\n"
+#| "                        expression for validation is: coef * "
+#| "(buffer_size / 2)\n"
+#| "    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+#| "    --max-file-time=#   start another output file when the old file has "
+#| "recorded\n"
+#| "                        for this many seconds\n"
+#| "    --process-id-file   write the process ID here\n"
+#| "    --use-strftime      apply the strftime facility to the output file "
+#| "name\n"
+#| "    --dump-hw-params    dump hw_params of the device\n"
+#| "    --fatal-errors      treat all errors as fatal\n"
+msgid ""
+"Usage: %s [OPTION]... [FILE]...\n"
+"\n"
+"-h, --help              help\n"
+"    --version           print current version\n"
+"-l, --list-devices      list all soundcards and digital audio devices\n"
+"-L, --list-pcms         list device names\n"
+"-D, --device=NAME       select PCM by name\n"
+"-q, --quiet             quiet mode\n"
+"-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+"-c, --channels=#        channels\n"
+"-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
+"-r, --rate=#            sample rate\n"
+"-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
+"-M, --mmap              mmap stream\n"
+"-N, --nonblock          nonblocking mode\n"
+"-F, --period-time=#     distance between interrupts is # microseconds\n"
+"-B, --buffer-time=#     buffer duration is # microseconds\n"
+"    --period-size=#     distance between interrupts is # frames\n"
+"    --buffer-size=#     buffer duration is # frames\n"
+"-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+"-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+"                        (relative to buffer size if <= 0)\n"
+"-T, --stop-delay=#      delay for automatic PCM stop is # microseconds from "
+"xrun\n"
+"-v, --verbose           show PCM structure and setup (accumulative)\n"
+"-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+"-I, --separate-channels one file for each channel\n"
+"-i, --interactive       allow interactive operation from stdin\n"
+"-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+"    --disable-resample  disable automatic rate resample\n"
+"    --disable-channels  disable automatic channel conversions\n"
+"    --disable-format    disable automatic format conversions\n"
+"    --disable-softvol   disable software volume control (softvol)\n"
+"    --test-position     test ring buffer position\n"
+"    --test-coef=#       test coefficient for ring buffer position (default "
+"8)\n"
+"                        expression for validation is: coef * (buffer_size / "
+"2)\n"
+"    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+"    --max-file-time=#   start another output file when the old file has "
+"recorded\n"
+"                        for this many seconds\n"
+"    --process-id-file   write the process ID here\n"
+"    --use-strftime      apply the strftime facility to the output file name\n"
+"    --dump-hw-params    dump hw_params of the device\n"
+"    --fatal-errors      treat all errors as fatal\n"
+msgstr ""
+"გამოყენება: %s [პარამეტრი]... [ფაილი]...\n"
+"\n"
+"-h, --help              დახმარება\n"
+"    --version           მიმდინარე ვერსიის გამოტანა\n"
+"-l, --list-devices      ხმის ბარათებისა და ციფრული აუდიო მოწყობილობების სია\n"
+"-L, --list-pcms         მოწყობილობების სახელების სია\n"
+"-D, --device=NAME       PCM -ის სახელით არჩევა\n"
+"-q, --quiet             ჩუმი რეჟიმი\n"
+"-t, --file-type TYPE    ფაილის ტიპი (voc, wav, raw ან au)\n"
+"-c, --channels=#        არხები\n"
+"-f, --format=FORMAT     სემპლის ფორმატი (მგრძნობიარეა რეგისტრზე)\n"
+"-r, --rate=#            სემპლის სიხშირე\n"
+"-d, --duration=#        შეწყვეტა # წამის შემდეგ\n"
+"-s, --samples=#         შეწყვეტა # სემპლის შემდეგ თითოეულ არხზე\n"
+"-M, --mmap              mmap -ის ნაკადი\n"
+"-N, --nonblock          არაბლოკირებადი რეჟიმი\n"
+"-F, --period-time=#     წყვეტებს შორის დაშორება # მიკროწამია\n"
+"-B, --buffer-time=#     ბაფერის სიგრძე # მიკროწამია\n"
+"    --period-size=#     წყვეტების სიგრძე # კადრია\n"
+"    --buffer-size=#     ბაფერის სიგრძე # კადრია\n"
+"-A, --avail-min=#       მინიმალური ხელმისაწვდომი სივრცე გაღვიძებისთვის # "
+"მიკროწამია\n"
+"-R, --start-delay=#     PCM -ის გაშვების ავტომატური დაყოვნება # მიკროწამია\n"
+"                        (ბაფერის ზომასთან შედარებით, თუ ის  <= 0)\n"
+"-T, --stop-delay=#      PCM-ის ავტომატური გაჩერების დაყოვნება xrun-დან # "
+"მიკროწამია\n"
+"-v, --verbose           PCM-ის სტრუქტურა და მორგება (დაგროვებადი)\n"
+"-V, --vumeter=TYPE      VU-ის მზომავის ჩართვა (ტიპი: mono ან stereo)\n"
+"-I, --separate-channels ერთი ფაილი ერთი არხისთვის\n"
+"-i, --interactive       ინტერაქტიური ურთიერთობა stdin-დან\n"
+"-m, --chmap=ch1,ch2,..  არხების რუკა გადასაფარად ან მისაყოლად\n"
+"    --disable-resample  სიხშირის ავტომატური რესემპლის გამორთვა\n"
+"    --disable-channels  არხების ავტომატური გარდაქმნის გამორთვა\n"
+"    --disable-format    ფორმატის ავტომატური გარდაქმნის გამორთვა\n"
+"    --disable-softvol   ხმის პროგრამული კონტროლის გამორთვა (softvol)\n"
+"    --test-position     ბეჭდის ბაფერის მდებარეობის ტესტი\n"
+"    --test-coef=#       ბეჭდის ბაფერის მდებარეობის სატესტო კოეფიციენტი "
+"(ნაგულისხმები 8)\n"
+"                        შემოწმების გამოსახულებაა: coef * (buffer_size / 2)\n"
+"    --test-nowait       არ დაუცდის ბეჭდის ბაფერს (სრულად ხარჯავს CPU-ს "
+"რესურსს)\n"
+"    --max-file-time=#   როცა ძველი ფაილი მითითებული რაოდენობაჯერ "
+"ჩაიწერება, \n"
+"\t\t\t\t\t\tახალი ფაილის დაწყება\n"
+"    --process-id-file   პროცესის ID-ის ფაილში ჩაწერა\n"
+"    --use-strftime      გამოტანის ფაილის სახელზე strftime-ის გადატარება\n"
+"    --dump-hw-params    მოწყობილობის აპარატურული პარამეტრების ფაილში ჩაწერა\n"
+"    --fatal-errors      ყველა შეცდომის ფატალურად ჩათვლა\n"
+
+#: aplay/aplay.c:255 speaker-test/speaker-test.c:1001
+#, c-format
+msgid "Recognized sample formats are:"
+msgstr "სემპლის მისაღები ფორმატებია:"
+
+#: aplay/aplay.c:261
+#, c-format
+msgid ""
+"\n"
+"Some of these may not be available on selected hardware\n"
+msgstr ""
+"\n"
+"აქედან ზოგიერთი შეიძლება არჩეულ აპარატურაზე წვდომადი არ იყოს\n"
+
+#: aplay/aplay.c:262
+#, c-format
+msgid "The available format shortcuts are:\n"
+msgstr "ფორმატების ხელმისაწვდომი შემოკლებები:\n"
+
+#: aplay/aplay.c:263
+#, c-format
+msgid "-f cd (16 bit little endian, 44100, stereo)\n"
+msgstr "-f cd (16 bit little endian, 44100, stereo)\n"
+
+#: aplay/aplay.c:264
+#, c-format
+msgid "-f cdr (16 bit big endian, 44100, stereo)\n"
+msgstr "-f cdr (16 bit big endian, 44100, stereo)\n"
+
+#: aplay/aplay.c:265
+#, c-format
+msgid "-f dat (16 bit little endian, 48000, stereo)\n"
+msgstr "-f dat (16 bit little endian, 48000, stereo)\n"
+
+#: aplay/aplay.c:279
+msgid "no soundcards found..."
+msgstr "ხმის ბარათის პოვნა შეუძლებელია..."
+
+#: aplay/aplay.c:282
+#, c-format
+msgid "**** List of %s Hardware Devices ****\n"
+msgstr "**** %s აპარატურული მოწყობილობის სია ****\n"
+
+#: aplay/aplay.c:311
+#, c-format
+msgid "card %i: %s [%s], device %i: %s [%s]\n"
+msgstr "ბარათი %i: %s [%s], მოწყობილობა %i: %s [%s]\n"
+
+#: aplay/aplay.c:317
+#, c-format
+msgid "  Subdevices: %i/%i\n"
+msgstr "  ქვემოწყობილობები: %i/%i\n"
+
+#: aplay/aplay.c:324
+#, c-format
+msgid "  Subdevice #%i: %s\n"
+msgstr "  ქვემოწყობილობა #%i: %s\n"
+
+#: aplay/aplay.c:405
+#, c-format
+msgid "Aborted by signal %s...\n"
+msgstr "ავარიულად დასრულდა სიგნალით %s...\n"
+
+#: aplay/aplay.c:562
+msgid "command should be named either arecord or aplay"
+msgstr "ბრძანებას arecord ან aplay უნდა ერქვას"
+
+#: aplay/aplay.c:607
+#, c-format
+msgid "unrecognized file format %s"
+msgstr "ფაილის უცნობი ფორმატი: %s"
+
+#: aplay/aplay.c:614
+#, c-format
+msgid "invalid channels argument '%s'"
+msgstr "არხის არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:618
+#, c-format
+msgid "value %i for channels is invalid"
+msgstr "არხებისთვის მნიშვნელობა \"%i\" არასწორია"
+
+#: aplay/aplay.c:638
+#, c-format
+msgid "wrong extended format '%s'"
+msgstr "არასწორი გაფართოებული ფორმატი \"%s\""
+
+#: aplay/aplay.c:650
+#, fuzzy, c-format
+#| msgid "wrong extended format '%s'"
+msgid "wrong extended subformat '%s'"
+msgstr "არასწორი გაფართოებული ფორმატი \"%s\""
+
+#: aplay/aplay.c:657
+#, c-format
+msgid "invalid rate argument '%s'"
+msgstr "სიხშირის არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:664
+#, c-format
+msgid "bad speed value %i"
+msgstr "სიჩქარის არასწორი მნიშვნელობა: %i"
+
+#: aplay/aplay.c:670
+msgid "duration and samples arguments cannot be used together"
+msgstr "ხანგრძლივობის და სემპლის არგუმენტებს ერთდრულად ვერ გამოიყენებთ"
+
+#: aplay/aplay.c:675
+#, c-format
+msgid "invalid duration argument '%s'"
+msgstr "ხანგრძლივობს არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:682
+msgid "samples and duration arguments cannot be used together"
+msgstr "ხანგრძლივობის და სემპლის არგუმენტებს ერთდრულად ვერ გამოიყენებთ"
+
+#: aplay/aplay.c:687
+#, c-format
+msgid "invalid samples argument '%s'"
+msgstr "სემპლის არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:699
+#, c-format
+msgid "invalid period time argument '%s'"
+msgstr "დროის პერიოდის არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:706
+#, c-format
+msgid "invalid buffer time argument '%s'"
+msgstr "ბუფერის დროის არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:713
+#, c-format
+msgid "invalid period size argument '%s'"
+msgstr "პერიოდის ზომის არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:720
+#, c-format
+msgid "invalid buffer size argument '%s'"
+msgstr "ბუფერის ზომის არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:727
+#, c-format
+msgid "invalid min available space argument '%s'"
+msgstr "მინინალური ხელმისაწვდომი ადგილის არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:734
+#, c-format
+msgid "invalid start delay argument '%s'"
+msgstr "დაწყების დაყოვნების არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:741
+#, c-format
+msgid "invalid stop delay argument '%s'"
+msgstr "გაჩერების დაყოვნების არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:796
+#, c-format
+msgid "invalid test coef argument '%s'"
+msgstr "სატესტო კოეფიც. არასწორი არგუმენტი: '%s'"
+
+#: aplay/aplay.c:808
+#, c-format
+msgid "invalid max file time argument '%s'"
+msgstr "მაქსიმალური ფაილის დროის არასწორი არგუმენტი:'%s'"
+
+#: aplay/aplay.c:828 speaker-test/speaker-test.c:616
+#, c-format
+msgid "Unable to parse channel map string: %s\n"
+msgstr "არხების რუკის სტრიქონის დამუშავების შეცდომა: %s\n"
+
+#: aplay/aplay.c:834
+#, c-format
+msgid "Try `%s --help' for more information.\n"
+msgstr "მეტი ინფორმაციისთვის სცადეთ '%s --help'\n"
+
+#: aplay/aplay.c:850
+#, c-format
+msgid "audio open error: %s"
+msgstr "აუდიოს გახსნის პრობლემა: %s"
+
+#: aplay/aplay.c:855
+#, c-format
+msgid "info error: %s"
+msgstr "ინფორმაციის შეცდომა: %s"
+
+#: aplay/aplay.c:862
+#, c-format
+msgid "nonblock setting error: %s"
+msgstr "არაბლოკირებადი პარამეტრის შეცდომა: %s"
+
+#: aplay/aplay.c:880 aplay/aplay.c:1004 aplay/aplay.c:1310 aplay/aplay.c:1526
+#: aplay/aplay.c:2106 aplay/aplay.c:2136
+msgid "not enough memory"
+msgstr "მეხსიერება საკმარისი არ არის"
+
+#: aplay/aplay.c:904
+#, c-format
+msgid "Cannot create process ID file %s: %s"
+msgstr "პროცესის ID-ის ფაილის (\"%s\") შექმნის შეცდომა: %s"
+
+#: aplay/aplay.c:994
+#, c-format
+msgid "read error (called from line %i)"
+msgstr "კითხვის შეცდომა (გამოძახებულია ხაზიდან %i)"
+
+#: aplay/aplay.c:1062
+#, c-format
+msgid "unknown length of 'fmt ' chunk (read %u, should be %u at least)"
+msgstr "'fmt'-ის ნაწილის უცნობი სიგრძე (წავიკითხე %u, %u მაინც უნდა იყოს)"
+
+#: aplay/aplay.c:1073
+#, c-format
+msgid ""
+"unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"
+msgstr ""
+"გაგრძელებადი 'fmt' ნაწილის უცნობი სიგრძე (წავიკითხე %u, %u მაინც უნდა იყოს)"
+
+#: aplay/aplay.c:1078
+msgid "wrong format tag in extensible 'fmt ' chunk"
+msgstr "ფორმატის არასწორი ჭდე გაფართოებად 'fmt' ნაწილში"
+
+#: aplay/aplay.c:1086
+#, c-format
+msgid "can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"
+msgstr ""
+"შეუძლებელია WAVE ფაილის დაკვრა (ფორმატით 0x%04x), რომელიც PCM-ის ან FLOAT-ით "
+"არაა კოდირებული"
+
+#: aplay/aplay.c:1091
+#, c-format
+msgid "can't play WAVE-files with %d tracks"
+msgstr "შეუძლებელია WAVE ფაილის დაკვრა %d აუდიობილიკით"
+
+#: aplay/aplay.c:1096
+#, c-format
+msgid "valid bps greater than bps: %d > %d"
+msgstr ""
+
+#: aplay/aplay.c:1103 aplay/aplay.c:1239
+#, c-format
+msgid "Warning: format is changed to U8\n"
+msgstr "გაფრთხილება: ფორმატი U8-ზე შეიცვალა\n"
+
+#: aplay/aplay.c:1113 aplay/aplay.c:1126 aplay/aplay.c:1137
+#, c-format
+msgid "Warning: format is changed to %s\n"
+msgstr "გაფრთხილება: ფორმატი %s-ზე შეიცვალა\n"
+
+#: aplay/aplay.c:1142
+#, c-format
+msgid ""
+" can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"
+msgstr ""
+" შეუძლებელია WAVE ფაილის დაკვრა სემპლით %d ბიტი, %d ბაიტის სიგანეში (%d არხი)"
+
+#: aplay/aplay.c:1175
+#, c-format
+msgid " can't play WAVE-files with sample %d bits wide"
+msgstr " შეუძლებელია WAVE ფაილის დაკვრა, %d ბიტიანი სიგანის მქონე სემპლით"
+
+#: aplay/aplay.c:1233
+#, c-format
+msgid "Warning: format is changed to MU_LAW\n"
+msgstr "გაფრთხილება: ფორმატი MU_LAW-ზე შეიცვალა\n"
+
+#: aplay/aplay.c:1245
+#, c-format
+msgid "Warning: format is changed to S16_BE\n"
+msgstr "გაფრთხილება: ფორმატი S16_BE-ზე შეიცვალა\n"
+
+#: aplay/aplay.c:1258 aplay/aplay.c:2427 aplay/aplay.c:2434 aplay/aplay.c:2964
+msgid "read error"
+msgstr "წაკითხვის შეცდომა"
+
+#: aplay/aplay.c:1288
+msgid "Channel numbers don't match between hw_params and channel map"
+msgstr "არხების რაოდენობა hw_params და channel_map-ში ერმანეთს არ ემთხვევა"
+
+#: aplay/aplay.c:1297
+#, c-format
+msgid "Warning: unable to get channel map\n"
+msgstr "გაფრთხილება: არხების რუკის მიღების შეცდომა\n"
+
+#: aplay/aplay.c:1331
+#, c-format
+msgid "Channel %d doesn't match with hw_params"
+msgstr "არხი %d hw_params-ში არსებულს არ ემთხვევა"
+
+#: aplay/aplay.c:1358
+msgid "Broken configuration for this PCM: no configurations available"
+msgstr "დაზიანებული კონფიგურაცია ამ PCM-ისთვის: კონფიგურაცია მიუწვდომელია"
+
+#: aplay/aplay.c:1362
+#, c-format
+msgid "HW Params of device \"%s\":\n"
+msgstr "HW პარამეტრები მოწყობილობისთვის \"%s\".\n"
+
+#: aplay/aplay.c:1382
+msgid "Access type not available"
+msgstr "წვდომის ტიპი ხელმიუწვდომელია"
+
+#: aplay/aplay.c:1387
+msgid "Sample format non available"
+msgstr "სემპლის ფორმატი ხელიმიუწვდომელია"
+
+#: aplay/aplay.c:1393
+#, fuzzy
+#| msgid "Sample format non available"
+msgid "Sample subformat not available"
+msgstr "სემპლის ფორმატი ხელიმიუწვდომელია"
+
+#: aplay/aplay.c:1398
+msgid "Channels count non available"
+msgstr "არხების რაოდენობა ხელიუწვდომელია"
+
+#: aplay/aplay.c:1413
+#, c-format
+msgid "Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"
+msgstr "გაფრთხლება: სიხშირე სწორი არაა (მოთხოვნილი = %iჰც, მივიღე = %iჰც)\n"
+
+#: aplay/aplay.c:1419
+#, c-format
+msgid "         please, try the plug plugin %s\n"
+msgstr "         სცადეთ შეერთოთ დამატება %s\n"
+
+#: aplay/aplay.c:1456
+msgid "Unable to install hw params:"
+msgstr "აპარატურული პარამეტრების დაყენების შეცდომა:"
+
+#: aplay/aplay.c:1463
+#, c-format
+msgid "Can't use period equal to buffer size (%lu == %lu)"
+msgstr "ბუფერის ზომის ტოლ პერიოდს ვერ გამოვიყენებ (%lu == %lu)"
+
+#: aplay/aplay.c:1469
+msgid "Unable to get current sw params."
+msgstr "პროგრამის მიმდინარე პარამეტრების მიღების შეცდომა."
+
+#: aplay/aplay.c:1509
+msgid "unable to install sw params:"
+msgstr "პროგრამული პარამეტრების დაყენების შეცდომა:"
+
+#: aplay/aplay.c:1544
+#, c-format
+msgid "snd_pcm_mmap_begin problem: %s"
+msgstr "snd_pcm_mmap_begin -ის პრობლემა: %s"
+
+#: aplay/aplay.c:1573
+#, c-format
+msgid "stdin O_NONBLOCK flag setup failed\n"
+msgstr "stdin-დან O_NONBLOCK ალმის დაყენების შეცდომა\n"
+
+#: aplay/aplay.c:1610
+#, c-format
+msgid "\rPAUSE command ignored (no hw support)\n"
+msgstr ""
+"\rშეჩერების ბრძანება იგნორირებულია (აპარატურული მხარდაჭერა არ არსებობს)\n"
+
+#: aplay/aplay.c:1618
+#, c-format
+msgid "pause push error: %s"
+msgstr "შეჩერების გადაცემის შეცდომა: %s"
+
+#: aplay/aplay.c:1629
+#, c-format
+msgid "pause release error: %s"
+msgstr "შეჩერების მოხსნის შეცდომა: %s"
+
+#: aplay/aplay.c:1645
+#, c-format
+msgid ""
+"\r=== PAUSE ===                                                            "
+msgstr ""
+"\r=== შეჩერება "
+"===                                                            "
+
+#: aplay/aplay.c:1687
+#, c-format
+msgid "status error: %s"
+msgstr "შეცდომის სტატუსი: %s"
+
+#: aplay/aplay.c:1697 aplay/aplay.c:1708
+#, c-format
+msgid "%s!!! (at least %.3f ms long)\n"
+msgstr "%s!!! (სულ ცოტა %.3f მწმ სიგრძით)\n"
+
+#: aplay/aplay.c:1698 aplay/aplay.c:1701 aplay/aplay.c:1709 aplay/aplay.c:1718
+msgid "underrun"
+msgstr "არშევსება"
+
+#: aplay/aplay.c:1698 aplay/aplay.c:1709 aplay/aplay.c:1718
+msgid "overrun"
+msgstr "გადავსება"
+
+#: aplay/aplay.c:1713
+#, c-format
+msgid "Status:\n"
+msgstr "სტატუსი:\n"
+
+#: aplay/aplay.c:1717
+#, c-format
+msgid "fatal %s: %s"
+msgstr "გატალური %s: %s"
+
+#: aplay/aplay.c:1723
+#, c-format
+msgid "xrun: prepare error: %s"
+msgstr "xrun: მომზადების შეცდომა: %s"
+
+#: aplay/aplay.c:1730
+#, c-format
+msgid "Status(DRAINING):\n"
+msgstr "სტატუსი(DRAINING):\n"
+
+#: aplay/aplay.c:1734
+#, c-format
+msgid "capture stream format change? attempting recover...\n"
+msgstr "ჩასაჭერი ნაკადის ფორმატი შეიცვალა? ვცდილობ აღვდგე....\n"
+
+#: aplay/aplay.c:1736
+#, c-format
+msgid "xrun(DRAINING): prepare error: %s"
+msgstr "xrun(DRAINING): მომზადების შეცდომა: %s"
+
+#: aplay/aplay.c:1743
+#, c-format
+msgid "Status(R/W):\n"
+msgstr "სტატუსი(R/W):\n"
+
+#: aplay/aplay.c:1746
+#, c-format
+msgid "read/write error, state = %s"
+msgstr "წაკითხვა/ჩაწერის შეცდომა. მდგომარეობა = %s"
+
+#: aplay/aplay.c:1756
+#, c-format
+msgid "Suspended. Trying resume. "
+msgstr "შეჩერებულია. ვცდილობ, გავაგრძელო. "
+
+#: aplay/aplay.c:1762
+#, c-format
+msgid "Failed. Restarting stream. "
+msgstr "შეცდომა. ნაკადის გადატვირთვა. "
+
+#: aplay/aplay.c:1765
+#, c-format
+msgid "suspend: prepare error: %s"
+msgstr "შეჩერება: მომზადების შეცდომა: %s"
+
+#: aplay/aplay.c:1770
+#, c-format
+msgid "Done.\n"
+msgstr "დასრულდა.\n"
+
+#: aplay/aplay.c:1792
+#, c-format
+msgid " !clip  "
+msgstr " !clip  "
+
+#: aplay/aplay.c:1944
+#, c-format
+msgid "Unsupported bit size %d.\n"
+msgstr "ბიტის არასწორი ზომა %d.\n"
+
+#: aplay/aplay.c:1980
+#, c-format
+msgid "Max peak (%li samples): 0x%08x "
+msgstr "მაქს პიკი (%li სემპლი): 0x%08x "
+
+#: aplay/aplay.c:2021
+#, c-format
+msgid ""
+"Suspicious buffer position (%li total): avail = %li, delay = %li, buffer = "
+"%li\n"
+msgstr ""
+"ბუფერის საეჭვო მდებარეობა (%li სულ): ხელმის. = %li, დაყოვნება = %li, ბუფერი "
+"= %li\n"
+
+#: aplay/aplay.c:2030
+#, c-format
+msgid ""
+"Suspicious status buffer position (%li total): avail = %li, delay = %li, "
+"buffer = %li\n"
+msgstr ""
+"სტატუსის ბუფერის საეჭვო მდებარეობა (%li სულ): ხელმის. = %li, დაყოვნება = "
+"%li, ბუფერი = %li\n"
+
+#: aplay/aplay.c:2034
+#, c-format
+msgid ""
+"Suspicious buffer position avail > delay (%li total): avail = %li, delay = "
+"%li\n"
+msgstr ""
+"ბუფერის საეჭვო მდებარეობის ხელმის. > დაყოვნება (%li სულ): ხელმის. = %li, "
+"დაყოვნება = %li\n"
+
+#: aplay/aplay.c:2038
+#, c-format
+msgid ""
+"Suspicious status buffer position avail > delay (%li total): avail = %li, "
+"delay = %li\n"
+msgstr ""
+"სტატუსის ბუფერის საეჭვო მდებარეობის ხელმის. > დაყოვნება (%li სულ): ხელმის. = "
+"%li, დაყოვნება = %li\n"
+
+#: aplay/aplay.c:2081
+#, c-format
+msgid "Status(R/W) (standalone avail=%li delay=%li):\n"
+msgstr "სტატუსი(R/W) (ხელმისაწვდ=%li დაყოვნება=%li):\n"
+
+#: aplay/aplay.c:2178
+#, c-format
+msgid "write error: %s"
+msgstr "ჩაწერის შეცდომა: %s"
+
+#: aplay/aplay.c:2226
+#, c-format
+msgid "writev error: %s"
+msgstr "writev -ის შეცდომა: %s"
+
+#: aplay/aplay.c:2272
+#, c-format
+msgid "read error: %s"
+msgstr "read -ის შეცდომა: %s"
+
+#: aplay/aplay.c:2319
+#, c-format
+msgid "readv error: %s"
+msgstr "readv -ის შეცდომა: %s"
+
+#: aplay/aplay.c:2368
+msgid "can't allocate buffer for silence"
+msgstr "დადუმების ბუფერისთვის მეხსიერების გამოყოფის შეცდომა"
+
+#: aplay/aplay.c:2377 aplay/aplay.c:2606 aplay/aplay.c:2611 aplay/aplay.c:2663
+#: aplay/aplay.c:2672 aplay/aplay.c:2679 aplay/aplay.c:2689 aplay/aplay.c:2695
+#: aplay/aplay.c:2767 aplay/aplay.c:2797 aplay/aplay.c:2811
+msgid "write error"
+msgstr "ჩაწერის შეცდომა"
+
+#: aplay/aplay.c:2390
+#, c-format
+msgid "voc_pcm_flush - silence error"
+msgstr "voc_pcm_flush - დადუმების სეცდომა"
+
+#: aplay/aplay.c:2393
+msgid "voc_pcm_flush error"
+msgstr "voc_pcm_flush -ის შეცდომა"
+
+#: aplay/aplay.c:2418
+msgid "malloc error"
+msgstr "malloc -ის შეცდომა"
+
+#: aplay/aplay.c:2422
+#, c-format
+msgid "Playing Creative Labs Channel file '%s'...\n"
+msgstr "Creative Labs-ი არხის ფაილის \"%s\"-ის დაკვრა...\n"
+
+#: aplay/aplay.c:2491 aplay/aplay.c:2586
+msgid "can't play packed .voc files"
+msgstr "შეკუმშული .voc ფაილების დაკვრა შეუძლებელია"
+
+#: aplay/aplay.c:2546
+#, c-format
+msgid "can't play loops; %s isn't seekable\n"
+msgstr "მარყუჟების დაკვრის პრობლემა: %s გადახვევადი არაა\n"
+
+#: aplay/aplay.c:2595
+#, c-format
+msgid "unknown blocktype %d. terminate."
+msgstr "ბლოკის უცნობი ტიპი %d. მუშაობის დასასრული."
+
+#: aplay/aplay.c:2731
+#, c-format
+msgid "Wave doesn't support %s format..."
+msgstr "Waved-ს %s ფორმატის მხარდაჭერა არ გააჩნია..."
+
+#: aplay/aplay.c:2791
+#, c-format
+msgid "Sparc Audio doesn't support %s format..."
+msgstr "Sparc-ის აუდიოს %s ფორმატის მხარდაჭერა არ გააჩნია..."
+
+#: aplay/aplay.c:2866
+msgid "Playing"
+msgstr "მიმდინარეობს დაკვრა"
+
+#: aplay/aplay.c:2866
+msgid "Recording"
+msgstr "ჩაწერა"
+
+#: aplay/aplay.c:2870
+#, c-format
+msgid "Rate %d Hz, "
+msgstr "სიხშირე %d ჰც, "
+
+#: aplay/aplay.c:2872
+#, c-format
+msgid "Mono"
+msgstr "მონო"
+
+#: aplay/aplay.c:2874
+#, c-format
+msgid "Stereo"
+msgstr "სტერეო"
+
+#: aplay/aplay.c:2876
+#, c-format
+msgid "Channels %i"
+msgstr "არხები %i"
+
+#: aplay/aplay.c:3483
+#, c-format
+msgid "You need to specify %u files"
+msgstr "საჭიროა %u ფაილის მითითება"
+
+#: aplay/aplay.c:3536
+#, c-format
+msgid "You need to specify %d files"
+msgstr "საჭიროა %d ფაილის მითითება"
+
+#: seq/aconnect/aconnect.c:56
+#, c-format
+msgid "aconnect - ALSA sequencer connection manager\n"
+msgstr "aconnect - ALSA -ის სეკვენსერთან მიერთების მმართველი\n"
+
+#: seq/aconnect/aconnect.c:57
+#, c-format
+msgid "Copyright (C) 1999-2000 Takashi Iwai\n"
+msgstr "(C) 1999-2000 Takashi Iwai, ყველა უფლება დაცულია\n"
+
+#: seq/aconnect/aconnect.c:58
+#, c-format
+msgid "Usage:\n"
+msgstr "გამოყენება:\n"
+
+#: seq/aconnect/aconnect.c:59
+#, c-format
+msgid " * Connection/disconnection between two ports\n"
+msgstr " * ორ პორტს შორის კავშირი/გათიშვა\n"
+
+#: seq/aconnect/aconnect.c:60
+#, c-format
+msgid "   aconnect [-options] sender receiver\n"
+msgstr "   aconnect [-პარამეტრები] გამგზავნი მიმღები\n"
+
+#: seq/aconnect/aconnect.c:61
+#, c-format
+msgid "     sender, receiver = client:port pair\n"
+msgstr "     გამგზავნი, მიმღები = კლიენტი:პორტი წყვილებს\n"
+
+#: seq/aconnect/aconnect.c:62
+#, c-format
+msgid "     -d,--disconnect     disconnect\n"
+msgstr "     -d,--disconnect     disconnecგათიშვაt\n"
+
+#: seq/aconnect/aconnect.c:63
+#, c-format
+msgid "     -e,--exclusive      exclusive connection\n"
+msgstr "     -e,--exclusive      ექსკლუზიური შეერთება\n"
+
+#: seq/aconnect/aconnect.c:64
+#, c-format
+msgid "     -r,--real #         convert real-time-stamp on queue\n"
+msgstr "     -r,--real #         რიგში real-time-stamp -ის გარდაქმნა\n"
+
+#: seq/aconnect/aconnect.c:65
+#, c-format
+msgid "     -t,--tick #         convert tick-time-stamp on queue\n"
+msgstr "     -t,--tick #         რიგში tick-time-stamp -ის გარდაქმნა\n"
+
+#: seq/aconnect/aconnect.c:66
+#, c-format
+msgid " * List connected ports (no subscription action)\n"
+msgstr " * მიერთებული პორტების სია (გამოწერის ქმედების გარეშე)\n"
+
+#: seq/aconnect/aconnect.c:67
+#, c-format
+msgid "   aconnect -i|-o [-options]\n"
+msgstr "   aconnect -i|-o [-პარამეტრები]\n"
+
+#: seq/aconnect/aconnect.c:68
+#, c-format
+msgid "     -i,--input          list input (readable) ports\n"
+msgstr "     -i,--input          შეტანის (წაკითხვადი) პორტების სია\n"
+
+#: seq/aconnect/aconnect.c:69
+#, c-format
+msgid "     -o,--output         list output (writable) ports\n"
+msgstr "     -o,--output         გამოტანის (ჩაწერადი) პორტების სია\n"
+
+#: seq/aconnect/aconnect.c:71
+#, fuzzy, c-format
+#| msgid "     -i,--input          list input (readable) ports\n"
+msgid "     -a,--all            show inactive ports, too\n"
+msgstr "     -i,--input          შეტანის (წაკითხვადი) პორტების სია\n"
+
+#: seq/aconnect/aconnect.c:73
+#, c-format
+msgid "     -l,--list           list current connections of each port\n"
+msgstr "     -l,--list           თითოეულ პორტზე მიმდინარე შეერთებების სია\n"
+
+#: seq/aconnect/aconnect.c:74
+#, c-format
+msgid " * Remove all exported connections\n"
+msgstr " * ყველა გატანილი შეერთების მოცილება\n"
+
+#: seq/aconnect/aconnect.c:75
+#, c-format
+msgid "     -x, --removeall\n"
+msgstr "     -x, --removeall\n"
+
+#: seq/aconnect/aconnect.c:155
+msgid "Connecting To"
+msgstr "დაკავშირების სამიზნე"
+
+#: seq/aconnect/aconnect.c:156
+msgid "Connected From"
+msgstr "დაკავშირების წყარო"
+
+#: seq/aconnect/aconnect.c:203
+#, c-format
+msgid "client %d: '%s' [type=%s"
+msgstr "კლიენტი %d: '%s' [ტიპი=%s"
+
+#: seq/aconnect/aconnect.c:207
+msgid "user"
+msgstr "მომხმარებელი"
+
+#: seq/aconnect/aconnect.c:207
+msgid "kernel"
+msgstr "ბირთვი"
+
+#: seq/aconnect/aconnect.c:385
+#, c-format
+msgid "can't open sequencer\n"
+msgstr "სეკვენსერის გახსნის შეცდომა\n"
+
+#: seq/aconnect/aconnect.c:413
+#, c-format
+msgid "can't get client id\n"
+msgstr "კლიენტის ID-ის მიღების შეცდოა\n"
+
+#: seq/aconnect/aconnect.c:420
+#, c-format
+msgid "can't set client info\n"
+msgstr "კლიენტის ინფორმაციის დაყენების შეცდომა\n"
+
+#: seq/aconnect/aconnect.c:427
+#, c-format
+msgid "invalid sender address %s\n"
+msgstr "გამგზავნის მისამართის დაყენების შეცდომა: %s\n"
+
+#: seq/aconnect/aconnect.c:432 seq/aseqnet/aseqnet.c:303
+#, c-format
+msgid "invalid destination address %s\n"
+msgstr "არასწორი სამიზნე მისამართი: %s\n"
+
+#: seq/aconnect/aconnect.c:446
+#, c-format
+msgid "No subscription is found\n"
+msgstr "გამოწერის გარეშე\n"
+
+#: seq/aconnect/aconnect.c:451
+#, c-format
+msgid "Disconnection failed (%s)\n"
+msgstr "გათიშვის შეცდომა (%s)\n"
+
+#: seq/aconnect/aconnect.c:457
+#, c-format
+msgid "Connection is already subscribed\n"
+msgstr "შეერთება უკვე გამოწერილია\n"
+
+#: seq/aconnect/aconnect.c:462
+#, c-format
+msgid "Connection failed (%s)\n"
+msgstr "შეერთების შეცდომა (%s)\n"
+
+#: seq/aseqnet/aseqnet.c:171
+#, c-format
+msgid "aseqnet - network client/server on ALSA sequencer\n"
+msgstr "aseqnet - ქსელური კლიენტ/სერვერი ALSA სეკვენსერზე\n"
+
+#: seq/aseqnet/aseqnet.c:172
+#, c-format
+msgid "  Copyright (C) 1999 Takashi Iwai\n"
+msgstr "    (C) 1999-2000 Takashi Iwai\n"
+
+#: seq/aseqnet/aseqnet.c:173
+#, c-format
+msgid "usage:\n"
+msgstr "გამოყენება:\n"
+
+#: seq/aseqnet/aseqnet.c:174
+#, c-format
+msgid "  server mode: aseqnet [-options]\n"
+msgstr "  სერვერის რეჟიმი: aseqnet [-პარამეტრები]\n"
+
+#: seq/aseqnet/aseqnet.c:175
+#, c-format
+msgid "  client mode: aseqnet [-options] server_host\n"
+msgstr "  კლიენტის რეჟიმი: aseqnet [-პარამეტრები] სერვერის_ჰოსტი\n"
+
+#: seq/aseqnet/aseqnet.c:176
+#, c-format
+msgid "options:\n"
+msgstr "პარამეტრები:\n"
+
+#: seq/aseqnet/aseqnet.c:177
+#, c-format
+msgid "  -6,--ipv6 : use IPv6 TCP protocol\n"
+msgstr "  -6,--ipv6 : IPv6 TCP პროტოკოლის გამოყენება\n"
+
+#: seq/aseqnet/aseqnet.c:178
+#, c-format
+msgid "  -p,--port # : specify TCP port (digit or service name)\n"
+msgstr "  -p,--port # : TCP პორტი. (რიცხვი ან სერვისის სახელი)\n"
+
+#: seq/aseqnet/aseqnet.c:179
+#, c-format
+msgid "  -s,--source addr : read from given addr (client:port)\n"
+msgstr ""
+"  -s,--source მისამართი : მითითბული მისამართიდან (კლიენტი:პორტი) წაკითხვა\n"
+
+#: seq/aseqnet/aseqnet.c:180
+#, c-format
+msgid "  -d,--dest addr : write to given addr (client:port)\n"
+msgstr "  -d,--dest მისამართი : მითითებულ მისამართზე ჩაწერა (კლიენტი:პორტი)\n"
+
+#: seq/aseqnet/aseqnet.c:181
+#, c-format
+msgid "  -n,--name value : use a specific midi process name\n"
+msgstr "  -n,--name value : მითითებული MIDI პროცესის გამოყენება\n"
+
+#: seq/aseqnet/aseqnet.c:182
+#, c-format
+msgid "  -v, --verbose : print verbose messages\n"
+msgstr "  -v, --verbose : დამატებითი ინფორმაციის გამოტანა\n"
+
+#: seq/aseqnet/aseqnet.c:183
+#, c-format
+msgid "  -i, --info : print certain received events\n"
+msgstr "  -i, --info : ზოგიერთი მიღებული მოვლენის გამოტანა\n"
+
+#: seq/aseqnet/aseqnet.c:197
+#, c-format
+msgid "can't malloc\n"
+msgstr "malloc -ის შეცდომა\n"
+
+#: seq/aseqnet/aseqnet.c:222
+#, c-format
+msgid "closing files..\n"
+msgstr "ფაილების დახურვა...\n"
+
+#: seq/aseqnet/aseqnet.c:285
+#, c-format
+msgid "sequencer opened: %d:%d\n"
+msgstr "სეკვენსერი გავაღე: %d:%d\n"
+
+#: seq/aseqnet/aseqnet.c:292
+#, c-format
+msgid "invalid source address %s\n"
+msgstr "წყაროს არასწორი მისამართი %s\n"
+
+#: seq/aseqnet/aseqnet.c:362
+#, c-format
+msgid "can't get address\n"
+msgstr "მისამართის მიღება შეუძლებელია\n"
+
+#: seq/aseqnet/aseqnet.c:376 seq/aseqnet/aseqnet.c:461
+#, c-format
+msgid "connecting to: %s\n"
+msgstr "მიერთება: %s\n"
+
+#: seq/aseqnet/aseqnet.c:414
+#, c-format
+msgid "too many connections!\n"
+msgstr "მეტისმეტად ბევრი მიერთება!\n"
+
+#: seq/aseqnet/aseqnet.c:425
+#, c-format
+msgid "accepted[%d]\n"
+msgstr "მიღებულია[%d]\n"
+
+#: seq/aseqnet/aseqnet.c:447
+#, c-format
+msgid "can't get address %s\n"
+msgstr "%s-ის მისამართის მიღების შეცდომა\n"
+
+#: seq/aseqnet/aseqnet.c:475
+#, c-format
+msgid "ok.. connected\n"
+msgstr "შეერთება წარმატებულია\n"
+
+#: seq/aseqnet/aseqnet.c:574
+#, c-format
+msgid "Channel %2d: Control event : %5d\n"
+msgstr "არხი %2d: საკონტროლო მოვლენა : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:578
+#, c-format
+msgid "Channel %2d: Pitchbender   : %5d\n"
+msgstr "არხი %2d: Pitchbender   : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:582
+#, c-format
+msgid "Channel %2d: Note On event : %5d\n"
+msgstr "არხი %2d: ნოტის ჩართვის მოვლენა : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:586
+#, c-format
+msgid "Channel %2d: Note Off event: %5d\n"
+msgstr "არხი %2d: ნოტის გამორთვის მოვლენა: %5d\n"
+
+#: seq/aseqnet/aseqnet.c:641
+#, c-format
+msgid "disconnected\n"
+msgstr "გათიშულია\n"
+
+#: speaker-test/speaker-test.c:130
+msgid "Front Left"
+msgstr "წინა მარცხენა"
+
+#: speaker-test/speaker-test.c:131
+msgid "Front Right"
+msgstr "წინა მარჯვენა"
+
+#: speaker-test/speaker-test.c:132
+msgid "Rear Left"
+msgstr "უკანა მარცხენა"
+
+#: speaker-test/speaker-test.c:133
+msgid "Rear Right"
+msgstr "უკანა მარკვენა"
+
+#: speaker-test/speaker-test.c:135
+msgid "LFE"
+msgstr "LFE"
+
+#: speaker-test/speaker-test.c:136
+msgid "Side Left"
+msgstr "მარცხენა მხარეს"
+
+#: speaker-test/speaker-test.c:137
+msgid "Side Right"
+msgstr "მარჯვენა მხარეს"
+
+#: speaker-test/speaker-test.c:138
+msgid "Channel 9"
+msgstr "არხი 9"
+
+#: speaker-test/speaker-test.c:139
+msgid "Channel 10"
+msgstr "არხი 10"
+
+#: speaker-test/speaker-test.c:140
+msgid "Channel 11"
+msgstr "არხი 11"
+
+#: speaker-test/speaker-test.c:141
+msgid "Channel 12"
+msgstr "არხი 12"
+
+#: speaker-test/speaker-test.c:142
+msgid "Channel 13"
+msgstr "არხი 13"
+
+#: speaker-test/speaker-test.c:143
+msgid "Channel 14"
+msgstr "არხი 14"
+
+#: speaker-test/speaker-test.c:144
+msgid "Channel 15"
+msgstr "არხი 15"
+
+#: speaker-test/speaker-test.c:145
+msgid "Channel 16"
+msgstr "არხი 16"
+
+#: speaker-test/speaker-test.c:465
+#, c-format
+msgid "Broken configuration for playback: no configurations available: %s\n"
+msgstr "დაკვრის კონფიგურაცია დაზიანებულია: კონფიგურაციის გარეშე: %s\n"
+
+#: speaker-test/speaker-test.c:472
+#, c-format
+msgid "Access type not available for playback: %s\n"
+msgstr "წვდომის ტიპი დასაკრავად ხელმიუწვდომელია: %s\n"
+
+#: speaker-test/speaker-test.c:479
+#, c-format
+msgid "Sample format not available for playback: %s\n"
+msgstr "სემპლის ტიპი დასაკრავად ხელმიუწვდომელია: %s\n"
+
+#: speaker-test/speaker-test.c:486
+#, c-format
+msgid "Channels count (%i) not available for playbacks: %s\n"
+msgstr "არხების რაოდენობა (%i) დასაკრავად ხელმიუწვდომელია: %s\n"
+
+#: speaker-test/speaker-test.c:494
+#, c-format
+msgid "Rate %iHz not available for playback: %s\n"
+msgstr "სიხშირე %iჰც დასაკრავად მიუწვდომელია: %s\n"
+
+#: speaker-test/speaker-test.c:499
+#, c-format
+msgid "Rate doesn't match (requested %iHz, get %iHz, err %d)\n"
+msgstr "სიხშირე არ ემთხვევა (მოთხოვნილი %iჰც, მიღებული %iჰც, შეცდომა %d)\n"
+
+#: speaker-test/speaker-test.c:503
+#, c-format
+msgid "Rate set to %iHz (requested %iHz)\n"
+msgstr "სიხშირე დაყენებულია %iჰც-ზე (მოთხოვნილია %iჰც)\n"
+
+#: speaker-test/speaker-test.c:509
+#, c-format
+msgid "Buffer size range from %lu to %lu\n"
+msgstr "ბუფერის ზომის დიაპაზონია %lu-დან %lu-მდე\n"
+
+#: speaker-test/speaker-test.c:510
+#, c-format
+msgid "Period size range from %lu to %lu\n"
+msgstr ""
+"პერიოდის ზომის დიაპაზონია %lu-დან %lu-მდე\n"
+"\n"
+
+#: speaker-test/speaker-test.c:514
+#, c-format
+msgid "Requested period time %u us\n"
+msgstr "მოთხოვნილი პერიოდის დროა %u მიკროწამი\n"
+
+#: speaker-test/speaker-test.c:519
+#, c-format
+msgid "Unable to set period time %u us for playback: %s\n"
+msgstr "დაკვრისთვის პერიოდის დროდ %u მკწმ-ის დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:525
+#, c-format
+msgid "Requested buffer time %u us\n"
+msgstr "მოთხოვნილი ბუფერის დროა %u მიკროწამი\n"
+
+#: speaker-test/speaker-test.c:528
+#, c-format
+msgid "Unable to set buffer time %u us for playback: %s\n"
+msgstr "დაკვრისთვის ბაფერის დროდ %u მკწმ-ის დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:537
+#, c-format
+msgid "Using max buffer size %lu\n"
+msgstr "გამოიყენება ბუფერის მაქსიმალური ზომა %lu\n"
+
+#: speaker-test/speaker-test.c:540
+#, c-format
+msgid "Unable to set buffer size %lu for playback: %s\n"
+msgstr "დაკვრისთვის ბაფერის ზომად %lu-ის დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:546
+#, c-format
+msgid "Periods = %u\n"
+msgstr "პერიოდები = %u\n"
+
+#: speaker-test/speaker-test.c:549
+#, c-format
+msgid "Unable to set nperiods %u for playback: %s\n"
+msgstr "დაკვრისთვის nperiods-ის %u-ზე დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:558
+#, c-format
+msgid "Unable to set hw params for playback: %s\n"
+msgstr "დაკვრისთვის აპარატურული პარამეტრების დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:564
+#, c-format
+msgid "was set period_size = %lu\n"
+msgstr "period_size დაყენებულ იყო= %lu\n"
+
+#: speaker-test/speaker-test.c:565
+#, c-format
+msgid "was set buffer_size = %lu\n"
+msgstr "buffer_size დაყენებული იყო = %lu\n"
+
+#: speaker-test/speaker-test.c:567
+#, c-format
+msgid "buffer to small, could not use\n"
+msgstr "ბაფერი მეტისმეტად პატარაა. ვერ გამოვიყენებ\n"
+
+#: speaker-test/speaker-test.c:580
+#, c-format
+msgid "Unable to determine current swparams for playback: %s\n"
+msgstr "დაკვრისთვის მიმდინარე პროგრამული პარამეტრების დადგენის შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:587
+#, c-format
+msgid "Unable to set start threshold mode for playback: %s\n"
+msgstr "დაკვრისთვის დასაწყისის ზღვარის რეჟიმის დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:594
+#, c-format
+msgid "Unable to set avail min for playback: %s\n"
+msgstr "დაკვრისთვის ხელმისაწვდომი მინიმუმის დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:601
+#, c-format
+msgid "Unable to set sw params for playback: %s\n"
+msgstr "დაკვრისთვის პროგრამული პარამეტრების დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:621
+#, c-format
+msgid "Unable to set channel map: %s\n"
+msgstr "არხების რუკის დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:646
+#, c-format
+msgid "Can't recovery from underrun, prepare failed: %s\n"
+msgstr "ბაფერის ვერშევსებიდან აღდგენა შეუძლებელია. მომზადების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:657
+#, c-format
+msgid "Can't recovery from suspend, prepare failed: %s\n"
+msgstr "შეჩერებიდან აღდგენა შეუძლებელია. მომზადების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:721 speaker-test/speaker-test.c:1257
+#, c-format
+msgid "No enough memory\n"
+msgstr "არასაკმარისი მეხსიერება\n"
+
+#: speaker-test/speaker-test.c:726
+#, c-format
+msgid "Cannot open WAV file %s\n"
+msgstr "WAV ფაილის გახსნის შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:730 speaker-test/speaker-test.c:759
+#, c-format
+msgid "Invalid WAV file %s\n"
+msgstr "არასწორი WAV ფაილი: %s\n"
+
+#: speaker-test/speaker-test.c:735
+#, c-format
+msgid "Not a WAV file: %s\n"
+msgstr "არასწორი WAV ფაილი: %s\n"
+
+#: speaker-test/speaker-test.c:739
+#, c-format
+msgid "Unsupported WAV format %d for %s\n"
+msgstr "WAV ფაილის არასწორი ფორმატი \"%d\" \"%s\"-სთვის\n"
+
+#: speaker-test/speaker-test.c:744
+#, c-format
+msgid "%s is not a mono stream (%d channels)\n"
+msgstr "%s მონო ნაკადს არ წარმოადგენს (%d არხი)\n"
+
+#: speaker-test/speaker-test.c:749
+#, c-format
+msgid "Sample rate doesn't match (%d) for %s\n"
+msgstr "სემპლინგის სიჩქარე არ ემთხვევა (%d) %s-სთვის\n"
+
+#: speaker-test/speaker-test.c:754
+#, c-format
+msgid "Unsupported sample format bits %d for %s\n"
+msgstr "სემპლის მხარდაუჭერელი ბიტები (%d) %s-სთვის\n"
+
+#: speaker-test/speaker-test.c:815
+#, c-format
+msgid "Undefined channel %d\n"
+msgstr "აღუწერელი არხი %d\n"
+
+#: speaker-test/speaker-test.c:866
+#, c-format
+msgid "Write error: %d,%s\n"
+msgstr "ჩაწერის შეცდომა: %d,%s\n"
+
+#: speaker-test/speaker-test.c:868
+#, c-format
+msgid "xrun_recovery failed: %d,%s\n"
+msgstr "xrun_recovery -ის შეცდომა: %d,%s\n"
+
+#: speaker-test/speaker-test.c:938
+#, c-format
+msgid "\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:982
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: speaker-test [OPTION]... \n"
+#| "-h,--help\thelp\n"
+#| "-D,--device\tplayback device\n"
+#| "-r,--rate\tstream rate in Hz\n"
+#| "-c,--channels\tcount of channels in stream\n"
+#| "-f,--frequency\tsine wave frequency in Hz\n"
+#| "-F,--format\tsample format\n"
+#| "-b,--buffer\tring buffer size in us\n"
+#| "-p,--period\tperiod size in us\n"
+#| "-P,--nperiods\tnumber of periods\n"
+#| "-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+#| "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+#| "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+#| "-w,--wavfile\tUse the given WAV file as a test sound\n"
+#| "-W,--wavdir\tSpecify the directory containing WAV files\n"
+#| "-m,--chmap\tSpecify the channel map to override\n"
+#| "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+#| "-S,--scale\tScale of generated test tones in percent (default=80)\n"
+#| "\n"
+msgid ""
+"Usage: speaker-test [OPTION]... \n"
+"-h,--help\thelp\n"
+"-D,--device\tplayback device\n"
+"-r,--rate\tstream rate in Hz\n"
+"-c,--channels\tcount of channels in stream\n"
+"-f,--frequency\tsine wave frequency in Hz\n"
+"-F,--format\tsample format\n"
+"-b,--buffer\tring buffer size in us\n"
+"-p,--period\tperiod size in us\n"
+"-P,--nperiods\tnumber of periods\n"
+"-t,--test\tpink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 "
+"noise, wav=WAV file\n"
+"-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+"-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+"-w,--wavfile\tUse the given WAV file as a test sound\n"
+"-W,--wavdir\tSpecify the directory containing WAV files\n"
+"-m,--chmap\tSpecify the channel map to override\n"
+"-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+"-S,--scale\tScale of generated test tones in percent (default=80)\n"
+"\n"
+msgstr ""
+"გამოყენება: speaker-test [პარამეტრი]... \n"
+"-h,--help\tდახმარება\n"
+"-D,--device\tდამკვრელი მოწყობილობა\n"
+"-r,--rate\tნაკადის სიხშირე ჰერცებში\n"
+"-c,--channels\tარხების რაოდენობა ნაკადში\n"
+"-f,--frequency\tსინუსოიდალური ტალღის სიხშირე ჰერცებში\n"
+"-F,--format\tსემპლის ფორმატი\n"
+"-b,--buffer\tბეჭდის ბაფერის ზომა მიკროწამებში\n"
+"-p,--period\tპერიოდის ზომა მიკროწამებში\n"
+"-P,--nperiods\tპერიოდების რიცხვი\n"
+"-t,--test\tpink=ვარდისფერი ხმაური, sine=სინუსოიდალური ტალღა, wav=WAV ფაილი\n"
+"-l,--nloops\tსატესტო მარყუჟების რაოდენობა, 0 = უსასრულო\n"
+"-s,--speaker\tერთი დინამიკის ტესტი. მნიშვნელობები 1=მარცხენა, 2=მარჯვენა, და "
+"ა.შ.\n"
+"-w,--wavfile\tსატესტო ხმად მითითებული WAV ფაილის გამოყენება\n"
+"-W,--wavdir\t WAV ფაილების შემცველი საქაღალდე\n"
+"-m,--chmap\tგადასაფარი არხების რუკა\n"
+"-X,--force-frequency\tსიხშირის ძალით მითითება 30-8000ჰც დიაპაზონის გარედან\n"
+"-S,--scale\tსატესტო ტონების გაძლიერება პროცენტებში (ნაგულისხმები=80)\n"
+"\n"
+
+#: speaker-test/speaker-test.c:1114
+#, c-format
+msgid "Invalid number of periods %d\n"
+msgstr "პერიოდების არასწორი რიცხვი: %d\n"
+
+#: speaker-test/speaker-test.c:1127 speaker-test/speaker-test.c:1137
+#: speaker-test/speaker-test.c:1141
+#, c-format
+msgid "Invalid test type %s\n"
+msgstr "ტესტის არასწორი ტიპი %s\n"
+
+#: speaker-test/speaker-test.c:1174
+#, c-format
+msgid "Unknown option '%c'\n"
+msgstr "უცნობი პარამეტრი '%c'\n"
+
+#: speaker-test/speaker-test.c:1188
+#, c-format
+msgid "Invalid parameter for -s option.\n"
+msgstr "-s პარამეტრის არასწორი მნიშვნელობა.\n"
+
+#: speaker-test/speaker-test.c:1203
+#, c-format
+msgid "Playback device is %s\n"
+msgstr "დამკვრელი მოწყობილობაა %s\n"
+
+#: speaker-test/speaker-test.c:1204
+#, c-format
+msgid "Stream parameters are %iHz, %s, %i channels\n"
+msgstr "ნაკადის პარამეტრებია %iჰც, %s, %i არხი\n"
+
+#: speaker-test/speaker-test.c:1207
+#, c-format
+msgid "Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:1210
+#, c-format
+msgid "Using 16 octaves of pink noise\n"
+msgstr "ვარდისფერი ხმაურისთვის 16 ოქტავის გამოყენება\n"
+
+#: speaker-test/speaker-test.c:1213
+#, c-format
+msgid "Sine wave rate is %.4fHz\n"
+msgstr "სინუსოიდალური ტალღის სიხშირე %.4fჰც-ა\n"
+
+#: speaker-test/speaker-test.c:1216
+#, c-format
+msgid "WAV file(s)\n"
+msgstr "WAV ფაილ(ებ)-ი\n"
+
+#: speaker-test/speaker-test.c:1226
+#, c-format
+msgid "Playback open error: %d,%s\n"
+msgstr "დაკვრის მოწყობილობის გახსნის შეცდომა: %d,%s\n"
+
+#: speaker-test/speaker-test.c:1232
+#, c-format
+msgid "Setting of hwparams failed: %s\n"
+msgstr "აპარატურული პარამეტრების დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:1236
+#, c-format
+msgid "Setting of swparams failed: %s\n"
+msgstr "პროგრამული პარამეტრების დაყენების შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:1282 speaker-test/speaker-test.c:1304
+#, c-format
+msgid "Transfer failed: %s\n"
+msgstr "გადატანის შეცდომა: %s\n"
+
+#: speaker-test/speaker-test.c:1290
+#, c-format
+msgid "Time per period = %lf\n"
+msgstr "დრო თითოეულ პერიოდში = %lf\n"
diff --git a/po/ko.gmo b/po/ko.gmo
new file mode 100644 (file)
index 0000000..cbf663e
Binary files /dev/null and b/po/ko.gmo differ
diff --git a/po/ko.po b/po/ko.po
new file mode 100644 (file)
index 0000000..a7ec81c
--- /dev/null
+++ b/po/ko.po
@@ -0,0 +1,1869 @@
+# Basque translation for alsa-utils
+# Copyright (C) 2011 The ALSA Team
+# This file is distributed under the same license as the alsa-utils package.
+# Porrumentzio <porrumentzio@riseup.net>, 2020.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: alsa-utils 1.0.23\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-06-10 09:22+0000\n"
+"PO-Revision-Date: 2023-05-25 17:58+0900\n"
+"Last-Translator: Yi Yunseok <ironyunseok@protonmail.com>\n"
+"Language-Team: Librezale <librezale@librezale.eus>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 2.4.2\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: alsamixer/card_select.c:77 alsamixer/device_name.c:127
+msgid "Sound Card"
+msgstr "사운드 카드"
+
+#: alsamixer/card_select.c:115
+msgid "(default)"
+msgstr "(기본)"
+
+#: alsamixer/card_select.c:125
+msgid "cannot enumerate sound cards"
+msgstr "사운드 카드를 열거할 수 없음"
+
+#: alsamixer/card_select.c:151
+msgid "enter device name..."
+msgstr "장치 이름 입력..."
+
+#: alsamixer/cli.c:45
+msgid "Usage: alsamixer [options]"
+msgstr "사용법: alsamixer [options]"
+
+# capture --> atzemate, hartze, kaptura(tze)...?
+#: alsamixer/cli.c:46
+#, fuzzy
+#| msgid ""
+#| "Useful options:\n"
+#| "  -h, --help              this help\n"
+#| "  -c, --card=NUMBER       sound card number or id\n"
+#| "  -D, --device=NAME       mixer device name\n"
+#| "  -V, --view=MODE         starting view mode: playback/capture/all"
+msgid ""
+"Useful options:\n"
+"  -h, --help              this help\n"
+"  -c, --card=NUMBER       sound card number or id\n"
+"  -D, --device=NAME       mixer device name\n"
+"  -m, --mouse             enable mouse\n"
+"  -M, --no-mouse          disable mouse\n"
+"  -f, --config=FILE       configuration file\n"
+"  -F, --no-config         do not load configuration file\n"
+"  -V, --view=MODE         starting view mode: playback/capture/all\n"
+"  -B, --black-background  use black background color"
+msgstr ""
+"유용한 옵션:\n"
+"  -h, --help              도움말\n"
+"  -c, --card=NUMBER       사운드 카드 번호 또는 id\n"
+"  -D, --device=NAME       믹서 장치 이름\n"
+"  -V, --view=MODE         보기 모드 시작: 재생/캡처/모두"
+
+#: alsamixer/cli.c:56
+msgid ""
+"Debugging options:\n"
+"  -g, --no-color          toggle using of colors\n"
+"  -a, --abstraction=NAME  mixer abstraction level: none/basic"
+msgstr ""
+"디버깅 옵션:\n"
+"  -g, --no-color          색상 사용 전환\n"
+"  -a, --abstraction=NAME  믹서 추상 레벨: 없음/기본"
+
+#: alsamixer/cli.c:92
+#, c-format
+msgid "invalid card index: %s\n"
+msgstr "잘못된 카드 인덱스: %s\n"
+
+#: alsamixer/cli.c:137
+#, c-format
+msgid "unknown abstraction level: %s\n"
+msgstr "알 수 없는 추상 레벨: %s\n"
+
+#: alsamixer/cli.c:142
+#, c-format
+msgid "unknown option: %c\n"
+msgstr "알 수 없는 옵션: %c\n"
+
+#: alsamixer/cli.c:144
+msgid "try `alsamixer --help' for more information\n"
+msgstr "`alsamixer --help' 명령으로 더 많은 정보 확인\n"
+
+#: alsamixer/device_name.c:177
+msgid "Device name:"
+msgstr "장치 이름:"
+
+#: alsamixer/die.c:37
+#, c-format
+msgid "%s: %s\n"
+msgstr "%s: %s\n"
+
+#: alsamixer/mixer_display.c:99
+msgid "Card:"
+msgstr "카드:"
+
+#: alsamixer/mixer_display.c:100
+msgid "Chip:"
+msgstr "칩:"
+
+#: alsamixer/mixer_display.c:101
+msgid "View:"
+msgstr "보기:"
+
+#: alsamixer/mixer_display.c:102
+msgid "Item:"
+msgstr "도구:"
+
+#: alsamixer/mixer_display.c:105
+msgid "F1:  Help"
+msgstr "F1:  도움말"
+
+#: alsamixer/mixer_display.c:106
+msgid "F2:  System information"
+msgstr "F2:  시스템 정보"
+
+#: alsamixer/mixer_display.c:107
+msgid "F6:  Select sound card"
+msgstr "F6:  사운드 카드 선택"
+
+# Esc --> Ihes / Esc
+#: alsamixer/mixer_display.c:108
+msgid "Esc: Exit"
+msgstr "Esc: 나가기"
+
+#: alsamixer/mixer_display.c:179
+msgid "(unplugged)"
+msgstr "(연결되지 않음)"
+
+#: alsamixer/mixer_display.c:197
+msgid "Playback"
+msgstr "재생"
+
+#: alsamixer/mixer_display.c:198
+msgid "Capture"
+msgstr "캡처"
+
+#: alsamixer/mixer_display.c:199
+msgid "All"
+msgstr "모두"
+
+#: alsamixer/mixer_display.c:240
+msgid "mute"
+msgstr "음소거"
+
+#: alsamixer/mixer_display.c:281 alsamixer/mixer_display.c:291
+msgid "dB gain:"
+msgstr "dB 증폭:"
+
+#: alsamixer/mixer_display.c:291
+#, c-format
+msgid " [%s %s, %s]"
+msgstr " [%s %s, %s]"
+
+#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:306
+#: alsamixer/mixer_display.c:312 alsamixer/mixer_display.c:318
+msgid "Off"
+msgstr "끄기"
+
+#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:318
+msgid "On"
+msgstr "켜기"
+
+#: alsamixer/mixer_display.c:370
+msgid "The sound device was unplugged."
+msgstr "사운드 장치 연결이 해제됐습니다."
+
+#: alsamixer/mixer_display.c:371
+msgid "Press F6 to select another sound card."
+msgstr "F6을 눌러 다른 사운드 카드를 선택하세요."
+
+#: alsamixer/mixer_display.c:386
+msgid "This sound device does not have any playback controls."
+msgstr "이 사운드 장치는 재생 제어를 할 수 없습니다."
+
+#: alsamixer/mixer_display.c:388
+msgid "This sound device does not have any capture controls."
+msgstr "이 사운드 장치는 캡처 제어를 할 수 없습니다."
+
+#: alsamixer/mixer_display.c:390
+msgid "This sound device does not have any controls."
+msgstr "이 사운드 장치는 제어할 수 없습니다."
+
+#. TRANSLATORS: playback on; one character
+#: alsamixer/mixer_display.c:523 alsamixer/mixer_display.c:528
+msgid "O"
+msgstr "O"
+
+#. TRANSLATORS: playback muted; one character
+#: alsamixer/mixer_display.c:525 alsamixer/mixer_display.c:529
+msgid "M"
+msgstr "M"
+
+#. TRANSLATORS: "left"; no more than two characters
+#: alsamixer/mixer_display.c:545
+msgid "L"
+msgstr "L"
+
+#. TRANSLATORS: "right"; no more than two characters
+#: alsamixer/mixer_display.c:551
+msgid "R"
+msgstr "R"
+
+#. TRANSLATORS: no more than eight characters
+#: alsamixer/mixer_display.c:555
+msgid "CAPTURE"
+msgstr "캡처"
+
+#: alsamixer/mixer_display.c:611
+msgid "Front"
+msgstr "전면"
+
+#: alsamixer/mixer_display.c:614
+msgid "Rear"
+msgstr "후면"
+
+#: alsamixer/mixer_display.c:617 speaker-test/speaker-test.c:134
+msgid "Center"
+msgstr "중앙"
+
+#: alsamixer/mixer_display.c:620
+msgid "Woofer"
+msgstr "우퍼"
+
+#: alsamixer/mixer_display.c:623
+msgid "Side"
+msgstr "측면"
+
+#: alsamixer/mixer_widget.c:91 alsamixer/mixer_widget.c:96
+msgid "cannot open mixer"
+msgstr "믹서를 열 수 없음"
+
+#: alsamixer/mixer_widget.c:102 alsamixer/mixer_widget.c:179
+msgid "cannot load mixer controls"
+msgstr "믹서 컨트롤을 불러올 수 없음"
+
+#: alsamixer/mixer_widget.c:169
+#, c-format
+msgid "Cannot open mixer device '%s'."
+msgstr "'%s' 믹서 장치를 열 수 없습니다."
+
+#: alsamixer/mixer_widget.c:190
+msgid "Esc     Exit"
+msgstr "Esc     나가기"
+
+#: alsamixer/mixer_widget.c:191
+msgid "F1 ? H  Help"
+msgstr "F1 ? H  도움말"
+
+#: alsamixer/mixer_widget.c:192
+msgid "F2 /    System information"
+msgstr "F2 /    시스템 정보"
+
+#: alsamixer/mixer_widget.c:193
+msgid "F3      Show playback controls"
+msgstr "F3      재생 컨트롤 표시"
+
+#: alsamixer/mixer_widget.c:194
+msgid "F4      Show capture controls"
+msgstr "F4      캡처 컨트롤 표시"
+
+#: alsamixer/mixer_widget.c:195
+msgid "F5      Show all controls"
+msgstr "F5      모든 컨트롤 표시"
+
+#: alsamixer/mixer_widget.c:196
+msgid "Tab     Toggle view mode (F3/F4/F5)"
+msgstr "Tab     보기 모드 전환 (F3/F4/F5)"
+
+#: alsamixer/mixer_widget.c:197
+msgid "F6 S    Select sound card"
+msgstr "F6 S    사운드 카드 선택"
+
+#: alsamixer/mixer_widget.c:198
+msgid "L       Redraw screen"
+msgstr "L       화면 새로고침"
+
+#: alsamixer/mixer_widget.c:200
+msgid "Left    Move to the previous control"
+msgstr "Left    이전 컨트롤로 이동"
+
+#: alsamixer/mixer_widget.c:201
+msgid "Right   Move to the next control"
+msgstr "Right   다음 컨트롤로 이동"
+
+#: alsamixer/mixer_widget.c:203
+msgid "Up/Down    Change volume"
+msgstr "Up/Down    음량 변경"
+
+#: alsamixer/mixer_widget.c:204
+msgid "+ -        Change volume"
+msgstr "+ -        음량 변경"
+
+#: alsamixer/mixer_widget.c:205
+msgid "Page Up/Dn Change volume in big steps"
+msgstr "Page Up/Dn 음량을 큰 폭으로 변경"
+
+#: alsamixer/mixer_widget.c:206
+msgid "End        Set volume to 0%"
+msgstr "End        음량을 0%로 설정"
+
+#: alsamixer/mixer_widget.c:207
+msgid "0-9        Set volume to 0%-90%"
+msgstr "0-9        음량을 0%-90%로 설정"
+
+#: alsamixer/mixer_widget.c:208
+msgid "Q W E      Increase left/both/right volumes"
+msgstr "Q W E      왼쪽/전체/오른쪽 음량 늘리기"
+
+#. TRANSLATORS: or Y instead of Z
+#: alsamixer/mixer_widget.c:210
+msgid "Z X C      Decrease left/both/right volumes"
+msgstr "Z X C      왼쪽/전체/오른쪽 음량 줄이기"
+
+#: alsamixer/mixer_widget.c:211
+msgid "B          Balance left and right volumes"
+msgstr "B          좌우 음량 밸런스"
+
+#: alsamixer/mixer_widget.c:213
+msgid "M          Toggle mute"
+msgstr "M          음소거 전환"
+
+#. TRANSLATORS: or , .
+#: alsamixer/mixer_widget.c:215
+msgid "< >        Toggle left/right mute"
+msgstr "< >        좌/우 음소거 전환"
+
+#: alsamixer/mixer_widget.c:217
+msgid "Space      Toggle capture"
+msgstr "Space      캡처 전환"
+
+#. TRANSLATORS: or Insert Delete
+#: alsamixer/mixer_widget.c:219
+msgid "; '        Toggle left/right capture"
+msgstr "; '        좌/우 캡처 전환"
+
+#: alsamixer/mixer_widget.c:221
+msgid "Authors:"
+msgstr "저자:"
+
+#: alsamixer/mixer_widget.c:222
+msgid "  Tim Janik"
+msgstr "  팀 야닉(Tim Janik)"
+
+#: alsamixer/mixer_widget.c:223
+msgid "  Jaroslav Kysela <perex@perex.cz>"
+msgstr "  야로슬라프 키셀라(Jaroslav Kysela) <perex@perex.cz>"
+
+#: alsamixer/mixer_widget.c:224
+msgid "  Clemens Ladisch <clemens@ladisch.de>"
+msgstr "  클레멘스 라디쉬(Clemens Ladisch) <clemens@ladisch.de>"
+
+#: alsamixer/mixer_widget.c:226
+msgid "Help"
+msgstr "도움말"
+
+#: alsamixer/proc_files.c:56
+msgid "Select File"
+msgstr "파일 선택"
+
+#: alsamixer/textbox.c:51 alsamixer/textbox.c:65
+msgid "Error"
+msgstr "오류"
+
+#: alsamixer/textbox.c:80
+#, c-format
+msgid "Cannot open file \"%s\"."
+msgstr "\"%s\" 파일을 열 수 없습니다."
+
+#: aplay/aplay.c:184
+msgid "raw data"
+msgstr "raw 데이터"
+
+#: aplay/aplay.c:185
+msgid "VOC"
+msgstr "VOC"
+
+#: aplay/aplay.c:187
+msgid "WAVE"
+msgstr "WAVE"
+
+#: aplay/aplay.c:188
+msgid "Sparc Audio"
+msgstr "스파크 오디오"
+
+#: aplay/aplay.c:209
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: %s [OPTION]... [FILE]...\n"
+#| "\n"
+#| "-h, --help              help\n"
+#| "    --version           print current version\n"
+#| "-l, --list-devices      list all soundcards and digital audio devices\n"
+#| "-L, --list-pcms         list device names\n"
+#| "-D, --device=NAME       select PCM by name\n"
+#| "-q, --quiet             quiet mode\n"
+#| "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+#| "-c, --channels=#        channels\n"
+#| "-f, --format=FORMAT     sample format (case insensitive)\n"
+#| "-r, --rate=#            sample rate\n"
+#| "-d, --duration=#        interrupt after # seconds\n"
+#| "-s, --samples=#         interrupt after # samples per channel\n"
+#| "-M, --mmap              mmap stream\n"
+#| "-N, --nonblock          nonblocking mode\n"
+#| "-F, --period-time=#     distance between interrupts is # microseconds\n"
+#| "-B, --buffer-time=#     buffer duration is # microseconds\n"
+#| "    --period-size=#     distance between interrupts is # frames\n"
+#| "    --buffer-size=#     buffer duration is # frames\n"
+#| "-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+#| "-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+#| "                        (relative to buffer size if <= 0)\n"
+#| "-T, --stop-delay=#      delay for automatic PCM stop is # microseconds "
+#| "from xrun\n"
+#| "-v, --verbose           show PCM structure and setup (accumulative)\n"
+#| "-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+#| "-I, --separate-channels one file for each channel\n"
+#| "-i, --interactive       allow interactive operation from stdin\n"
+#| "-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+#| "    --disable-resample  disable automatic rate resample\n"
+#| "    --disable-channels  disable automatic channel conversions\n"
+#| "    --disable-format    disable automatic format conversions\n"
+#| "    --disable-softvol   disable software volume control (softvol)\n"
+#| "    --test-position     test ring buffer position\n"
+#| "    --test-coef=#       test coefficient for ring buffer position "
+#| "(default 8)\n"
+#| "                        expression for validation is: coef * "
+#| "(buffer_size / 2)\n"
+#| "    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+#| "    --max-file-time=#   start another output file when the old file has "
+#| "recorded\n"
+#| "                        for this many seconds\n"
+#| "    --process-id-file   write the process ID here\n"
+#| "    --use-strftime      apply the strftime facility to the output file "
+#| "name\n"
+#| "    --dump-hw-params    dump hw_params of the device\n"
+#| "    --fatal-errors      treat all errors as fatal\n"
+msgid ""
+"Usage: %s [OPTION]... [FILE]...\n"
+"\n"
+"-h, --help              help\n"
+"    --version           print current version\n"
+"-l, --list-devices      list all soundcards and digital audio devices\n"
+"-L, --list-pcms         list device names\n"
+"-D, --device=NAME       select PCM by name\n"
+"-q, --quiet             quiet mode\n"
+"-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+"-c, --channels=#        channels\n"
+"-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
+"-r, --rate=#            sample rate\n"
+"-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
+"-M, --mmap              mmap stream\n"
+"-N, --nonblock          nonblocking mode\n"
+"-F, --period-time=#     distance between interrupts is # microseconds\n"
+"-B, --buffer-time=#     buffer duration is # microseconds\n"
+"    --period-size=#     distance between interrupts is # frames\n"
+"    --buffer-size=#     buffer duration is # frames\n"
+"-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+"-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+"                        (relative to buffer size if <= 0)\n"
+"-T, --stop-delay=#      delay for automatic PCM stop is # microseconds from "
+"xrun\n"
+"-v, --verbose           show PCM structure and setup (accumulative)\n"
+"-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+"-I, --separate-channels one file for each channel\n"
+"-i, --interactive       allow interactive operation from stdin\n"
+"-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+"    --disable-resample  disable automatic rate resample\n"
+"    --disable-channels  disable automatic channel conversions\n"
+"    --disable-format    disable automatic format conversions\n"
+"    --disable-softvol   disable software volume control (softvol)\n"
+"    --test-position     test ring buffer position\n"
+"    --test-coef=#       test coefficient for ring buffer position (default "
+"8)\n"
+"                        expression for validation is: coef * (buffer_size / "
+"2)\n"
+"    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+"    --max-file-time=#   start another output file when the old file has "
+"recorded\n"
+"                        for this many seconds\n"
+"    --process-id-file   write the process ID here\n"
+"    --use-strftime      apply the strftime facility to the output file name\n"
+"    --dump-hw-params    dump hw_params of the device\n"
+"    --fatal-errors      treat all errors as fatal\n"
+msgstr ""
+"사용법: %s [OPTION]... [FILE]...\n"
+"\n"
+"-h, --help              도움말\n"
+"    --version           현재 버전 출력\n"
+"-l, --list-devices      모든 디지털 오디오 장치와 사운드 카드 표시\n"
+"-L, --list-pcms         장치 이름 목록\n"
+"-D, --device=NAME       PCM 이름차순\n"
+"-q, --quiet             조용한 모드\n"
+"-t, --file-type TYPE    파일 유형 (voc, wav, raw 또는 au)\n"
+"-c, --channels=#        채널\n"
+"-f, --format=FORMAT     샘플 포맷 (대소문자 구분하지 않음)\n"
+"-r, --rate=#            샘플링 속도\n"
+"-d, --duration=#        # 초 이후 인터럽트\n"
+"-s, --samples=#         # 채널 당 샘플링 후 인터럽트\n"
+"-M, --mmap              mmap 스트림\n"
+"-N, --nonblock          비차단 모드\n"
+"-F, --period-time=#     # 마이크로초 사이로 인터럽트\n"
+"-B, --buffer-time=#     # 버퍼 지속 마이크로초\n"
+"    --period-size=#     # 프레임 사이로 인터럽트\n"
+"    --buffer-size=#     # 버퍼 지속 프레임\n"
+"-A, --avail-min=#       # 최소 웨이크업 마이크로초\n"
+"-R, --start-delay=#     # 자동 PCM 시작 지연 마이크로초 \n"
+"                        (버퍼 상대적 크기 <= 0)\n"
+"-T, --stop-delay=#      # xrun 자동 PCM 중지 지연 시간\n"
+"-v, --verbose           PCM 구조 및 설정 표시(누적)\n"
+"-V, --vumeter=TYPE      VU 미터 표시 (형태: 모노 또는 스테레오)\n"
+"-I, --separate-channels 채널 당 하나의 파일\n"
+"-i, --interactive       stdin으로부터 인터렉티브 작업 허용\n"
+"-m, --chmap=ch1,ch2,..  덮어쓰거나 따를 채널 맵 제공\n"
+"    --disable-resample  자동 리샘플 속도 비활성\n"
+"    --disable-channels  자동 채널 변환 비활성\n"
+"    --disable-format    자동 포맷 변환 비활성\n"
+"    --disable-softvol   소프트웨어 음량 제어(softvol) 비활성\n"
+"    --test-position     링 버퍼 위치 테스트\n"
+"    --test-coef=#       링 버퍼 위치 계수 테스트 (기본 8)\n"
+"                        검증 표현식: coef * (buffer_size / 2)\n"
+"    --test-nowait       링 버퍼를 기다리지 않음 - CPU 소모\n"
+"    --max-file-time=#   이전 파일이 기록되면 다른 출력 파일 시작\n"
+"                        이 수초 동안\n"
+"    --process-id-file   여기에 프로세스 ID 입력\n"
+"    --use-strftime      출력 파일 이름에 strftime 기능 적용\n"
+"    --dump-hw-params    장치의 hw_params 덤프\n"
+"    --fatal-errors      모든 오류를 치명적 오류로 취급\n"
+
+#: aplay/aplay.c:255 speaker-test/speaker-test.c:1001
+#, c-format
+msgid "Recognized sample formats are:"
+msgstr "인식되는 샘플 형식:"
+
+#: aplay/aplay.c:261
+#, c-format
+msgid ""
+"\n"
+"Some of these may not be available on selected hardware\n"
+msgstr ""
+"\n"
+"이 중 일부는 선택한 하드웨어에서 사용 불가능\n"
+
+#: aplay/aplay.c:262
+#, c-format
+msgid "The available format shortcuts are:\n"
+msgstr "사용 가능한 포맷 단축키:\n"
+
+#: aplay/aplay.c:263
+#, c-format
+msgid "-f cd (16 bit little endian, 44100, stereo)\n"
+msgstr "-f cd (16비트 리틀 엔디언, 44100, 스테레오)\n"
+
+#: aplay/aplay.c:264
+#, c-format
+msgid "-f cdr (16 bit big endian, 44100, stereo)\n"
+msgstr "-f cdr (16비트 빅 엔디언, 44100, 스테레오)\n"
+
+#: aplay/aplay.c:265
+#, c-format
+msgid "-f dat (16 bit little endian, 48000, stereo)\n"
+msgstr "-f dat (16비트 리틀 엔디언, 48000, 스테레오)\n"
+
+#: aplay/aplay.c:279
+msgid "no soundcards found..."
+msgstr "사운드 카드를 찾을 수 없음..."
+
+#: aplay/aplay.c:282
+#, c-format
+msgid "**** List of %s Hardware Devices ****\n"
+msgstr "**** %s 하드웨어 장치 목록 ****\n"
+
+#: aplay/aplay.c:311
+#, c-format
+msgid "card %i: %s [%s], device %i: %s [%s]\n"
+msgstr "카드 %i: %s [%s], 장치 %i: %s [%s]\n"
+
+#: aplay/aplay.c:317
+#, c-format
+msgid "  Subdevices: %i/%i\n"
+msgstr "  주변장치: %i/%i\n"
+
+#: aplay/aplay.c:324
+#, c-format
+msgid "  Subdevice #%i: %s\n"
+msgstr "  주변장치 #%i: %s\n"
+
+#: aplay/aplay.c:405
+#, c-format
+msgid "Aborted by signal %s...\n"
+msgstr "%s 신호로 인해 중단됨...\n"
+
+#: aplay/aplay.c:562
+msgid "command should be named either arecord or aplay"
+msgstr "명령은 aplay 또는 arecord로 지정해야 함"
+
+#: aplay/aplay.c:607
+#, c-format
+msgid "unrecognized file format %s"
+msgstr "인식할 수 없는 파일 형식 %s"
+
+#: aplay/aplay.c:614
+#, c-format
+msgid "invalid channels argument '%s'"
+msgstr "잘못된 채널 인수 '%s'"
+
+#: aplay/aplay.c:618
+#, c-format
+msgid "value %i for channels is invalid"
+msgstr "채널의 %i 값이 잘못됨"
+
+#: aplay/aplay.c:638
+#, c-format
+msgid "wrong extended format '%s'"
+msgstr "잘못된 확장 형식 '%s'"
+
+#: aplay/aplay.c:650
+#, fuzzy, c-format
+#| msgid "wrong extended format '%s'"
+msgid "wrong extended subformat '%s'"
+msgstr "잘못된 확장 형식 '%s'"
+
+#: aplay/aplay.c:657
+#, c-format
+msgid "invalid rate argument '%s'"
+msgstr "잘못된 속도 인수 '%s'"
+
+#: aplay/aplay.c:664
+#, c-format
+msgid "bad speed value %i"
+msgstr "잘못된 속도 값 %i"
+
+#: aplay/aplay.c:670
+msgid "duration and samples arguments cannot be used together"
+msgstr "샘플링과 지속시간 인수는 함께 사용할 수 없음"
+
+#: aplay/aplay.c:675
+#, c-format
+msgid "invalid duration argument '%s'"
+msgstr "잘못된 지속시간 인수 '%s'"
+
+#: aplay/aplay.c:682
+msgid "samples and duration arguments cannot be used together"
+msgstr "지속 시간과 샘플링 인수는 함께 사용할 수 없음"
+
+#: aplay/aplay.c:687
+#, c-format
+msgid "invalid samples argument '%s'"
+msgstr "잘못된 샘플링 인수 '%s'"
+
+#: aplay/aplay.c:699
+#, c-format
+msgid "invalid period time argument '%s'"
+msgstr "잘못된 주기 시간 인수 '%s'"
+
+#: aplay/aplay.c:706
+#, c-format
+msgid "invalid buffer time argument '%s'"
+msgstr "잘못된 버퍼 시간 인수 '%s'"
+
+#: aplay/aplay.c:713
+#, c-format
+msgid "invalid period size argument '%s'"
+msgstr "잘못된 주기 크기 인수 '%s'"
+
+#: aplay/aplay.c:720
+#, c-format
+msgid "invalid buffer size argument '%s'"
+msgstr "잘못된 버퍼 크기 인수 '%s'"
+
+#: aplay/aplay.c:727
+#, c-format
+msgid "invalid min available space argument '%s'"
+msgstr "잘못된 최소 사용 가능 공간 인수 '%s'"
+
+#: aplay/aplay.c:734
+#, c-format
+msgid "invalid start delay argument '%s'"
+msgstr "잘못된 시작 지연 인수 '%s'"
+
+#: aplay/aplay.c:741
+#, c-format
+msgid "invalid stop delay argument '%s'"
+msgstr "잘못된 중지 지연 인수 '%s'"
+
+#: aplay/aplay.c:796
+#, c-format
+msgid "invalid test coef argument '%s'"
+msgstr "잘못된 테스트 계수 인수 '%s'"
+
+#: aplay/aplay.c:808
+#, c-format
+msgid "invalid max file time argument '%s'"
+msgstr "잘못된 최대 파일 시간 인수 '%s'"
+
+#: aplay/aplay.c:828 speaker-test/speaker-test.c:616
+#, c-format
+msgid "Unable to parse channel map string: %s\n"
+msgstr "채널 맵 문자열 구문 분석 불가: %s\n"
+
+#: aplay/aplay.c:834
+#, c-format
+msgid "Try `%s --help' for more information.\n"
+msgstr "`%s --help' 명령으로 더 많은 정보를 확인할 수 있습니다.\n"
+
+#: aplay/aplay.c:850
+#, c-format
+msgid "audio open error: %s"
+msgstr "오디오 열기 오류: %s"
+
+#: aplay/aplay.c:855
+#, c-format
+msgid "info error: %s"
+msgstr "정보 오류: %s"
+
+#: aplay/aplay.c:862
+#, c-format
+msgid "nonblock setting error: %s"
+msgstr "비블록 설정 오류: %s"
+
+#: aplay/aplay.c:880 aplay/aplay.c:1004 aplay/aplay.c:1310 aplay/aplay.c:1526
+#: aplay/aplay.c:2106 aplay/aplay.c:2136
+msgid "not enough memory"
+msgstr "메모리 부족"
+
+#: aplay/aplay.c:904
+#, c-format
+msgid "Cannot create process ID file %s: %s"
+msgstr "%s 프로세스 ID 파일을 생성할 수 없음: %s"
+
+#: aplay/aplay.c:994
+#, c-format
+msgid "read error (called from line %i)"
+msgstr "읽기 오류 (%i 행에서 호출됨)"
+
+#: aplay/aplay.c:1062
+#, c-format
+msgid "unknown length of 'fmt ' chunk (read %u, should be %u at least)"
+msgstr "알 수 없는 'fmt ' 청크 크기 (%u 읽기는 최소한 %u 값과 같아야 함)"
+
+#: aplay/aplay.c:1073
+#, c-format
+msgid ""
+"unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"
+msgstr ""
+"알 수 없는 'fmt ' 확장 가능 청크 크기 (%u 읽기는 최소한 %u 값과 같아야 함)"
+
+#: aplay/aplay.c:1078
+msgid "wrong format tag in extensible 'fmt ' chunk"
+msgstr "잘못된 'fmt ' 확장 가능 청크 포맷 태그"
+
+#: aplay/aplay.c:1086
+#, c-format
+msgid "can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"
+msgstr "재생할 수 없는 PCM 또는 FLOAT로 인코딩되지 않은 WAVE 파일 형식 0x%04x"
+
+#: aplay/aplay.c:1091
+#, c-format
+msgid "can't play WAVE-files with %d tracks"
+msgstr "%d 트랙의 WAVE 파일 재생 불가"
+
+#: aplay/aplay.c:1096
+#, c-format
+msgid "valid bps greater than bps: %d > %d"
+msgstr ""
+
+#: aplay/aplay.c:1103 aplay/aplay.c:1239
+#, c-format
+msgid "Warning: format is changed to U8\n"
+msgstr "주의: 형식이 U8로 변경됨\n"
+
+#: aplay/aplay.c:1113 aplay/aplay.c:1126 aplay/aplay.c:1137
+#, c-format
+msgid "Warning: format is changed to %s\n"
+msgstr "주의: 형식이 %s로 변경됨\n"
+
+#: aplay/aplay.c:1142
+#, c-format
+msgid ""
+" can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"
+msgstr " %d 바이트 폭에서 %d 비트 WAVE 샘플 파일 재생 불가 (%d 채널)"
+
+#: aplay/aplay.c:1175
+#, c-format
+msgid " can't play WAVE-files with sample %d bits wide"
+msgstr " %d 비트 폭의 WAVE 샘플 파일 재생 불가"
+
+#: aplay/aplay.c:1233
+#, c-format
+msgid "Warning: format is changed to MU_LAW\n"
+msgstr "주의: 포맷이 MU_LAW로 변경됨\n"
+
+#: aplay/aplay.c:1245
+#, c-format
+msgid "Warning: format is changed to S16_BE\n"
+msgstr "주의: 포맷이 S16_BE로 변경됨\n"
+
+#: aplay/aplay.c:1258 aplay/aplay.c:2427 aplay/aplay.c:2434 aplay/aplay.c:2964
+msgid "read error"
+msgstr "읽기 오류"
+
+#: aplay/aplay.c:1288
+msgid "Channel numbers don't match between hw_params and channel map"
+msgstr "채널 맵과 hw_param 간 채널 번호가 일치하지 않음"
+
+#: aplay/aplay.c:1297
+#, c-format
+msgid "Warning: unable to get channel map\n"
+msgstr "주의: 채널 맵을 가져올 수 없음\n"
+
+#: aplay/aplay.c:1331
+#, fuzzy, c-format
+#| msgid "Channel %d doesn't match with hw_parmas"
+msgid "Channel %d doesn't match with hw_params"
+msgstr "채널 %d 및 hw_params가 일치하지 않음"
+
+#: aplay/aplay.c:1358
+msgid "Broken configuration for this PCM: no configurations available"
+msgstr "손상된 PCM 구성: 사용 가능한 구성이 없음"
+
+#: aplay/aplay.c:1362
+#, c-format
+msgid "HW Params of device \"%s\":\n"
+msgstr "\"%s\" 장치의 하드웨어 매개변수:\n"
+
+#: aplay/aplay.c:1382
+msgid "Access type not available"
+msgstr "액세스 유형을 사용할 수 없음"
+
+#: aplay/aplay.c:1387
+msgid "Sample format non available"
+msgstr "사용할 수 없는 샘플 형식"
+
+#: aplay/aplay.c:1393
+#, fuzzy
+#| msgid "Sample format non available"
+msgid "Sample subformat not available"
+msgstr "사용할 수 없는 샘플 형식"
+
+#: aplay/aplay.c:1398
+msgid "Channels count non available"
+msgstr "채널 수를 사용할 수 없음"
+
+#: aplay/aplay.c:1413
+#, c-format
+msgid "Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"
+msgstr "주의: 정확하지 않은 속도 (요청됨 = %iHz, 가져옴 = %iHz)\n"
+
+#: aplay/aplay.c:1419
+#, c-format
+msgid "         please, try the plug plugin %s\n"
+msgstr "         %s 플러그인을 연결해야 함\n"
+
+#: aplay/aplay.c:1456
+msgid "Unable to install hw params:"
+msgstr "하드웨어 매개변수 설치 불가:"
+
+#: aplay/aplay.c:1463
+#, c-format
+msgid "Can't use period equal to buffer size (%lu == %lu)"
+msgstr "버퍼 크기와 같은 주기는 사용할 수 없음 (%lu == %lu)"
+
+#: aplay/aplay.c:1469
+#, fuzzy
+#| msgid "unable to install sw params:"
+msgid "Unable to get current sw params."
+msgstr "소프트웨어 매개변수 설치 불가:"
+
+#: aplay/aplay.c:1509
+msgid "unable to install sw params:"
+msgstr "소프트웨어 매개변수 설치 불가:"
+
+#: aplay/aplay.c:1544
+#, c-format
+msgid "snd_pcm_mmap_begin problem: %s"
+msgstr "snd_pcm_mmap_begin 문제: %s"
+
+#: aplay/aplay.c:1573
+#, c-format
+msgid "stdin O_NONBLOCK flag setup failed\n"
+msgstr "stdin O_NONBLOCK 플래그 설정 실패\n"
+
+#: aplay/aplay.c:1610
+#, c-format
+msgid "\rPAUSE command ignored (no hw support)\n"
+msgstr "\r일시정지 명령이 무시됨 (하드웨어 지원 없음)\n"
+
+#: aplay/aplay.c:1618
+#, c-format
+msgid "pause push error: %s"
+msgstr "일시정지 푸시 오류: %s"
+
+#: aplay/aplay.c:1629
+#, c-format
+msgid "pause release error: %s"
+msgstr "일시정지 릴리즈 오류: %s"
+
+#: aplay/aplay.c:1645
+#, c-format
+msgid ""
+"\r=== PAUSE ===                                                            "
+msgstr ""
+"\r=== 일시정지 "
+"===                                                            "
+
+#: aplay/aplay.c:1687
+#, c-format
+msgid "status error: %s"
+msgstr "상태 오류: %s"
+
+#: aplay/aplay.c:1697 aplay/aplay.c:1708
+#, c-format
+msgid "%s!!! (at least %.3f ms long)\n"
+msgstr "%s!!! (최소 %.3f ms 길이)\n"
+
+#: aplay/aplay.c:1698 aplay/aplay.c:1701 aplay/aplay.c:1709 aplay/aplay.c:1718
+msgid "underrun"
+msgstr "언더런"
+
+#: aplay/aplay.c:1698 aplay/aplay.c:1709 aplay/aplay.c:1718
+msgid "overrun"
+msgstr "오버런"
+
+#: aplay/aplay.c:1713
+#, c-format
+msgid "Status:\n"
+msgstr "상태:\n"
+
+#: aplay/aplay.c:1717
+#, c-format
+msgid "fatal %s: %s"
+msgstr "치명적인 %s: %s"
+
+#: aplay/aplay.c:1723
+#, c-format
+msgid "xrun: prepare error: %s"
+msgstr "xrun: 준비 오류: %s"
+
+#: aplay/aplay.c:1730
+#, c-format
+msgid "Status(DRAINING):\n"
+msgstr "상태(사용 중):\n"
+
+#: aplay/aplay.c:1734
+#, c-format
+msgid "capture stream format change? attempting recover...\n"
+msgstr "스트림 형식 캡처가 변경됐나요? 복구를 시도합니다...\n"
+
+#: aplay/aplay.c:1736
+#, c-format
+msgid "xrun(DRAINING): prepare error: %s"
+msgstr "xrun(사용 중): 준비 오류: %s"
+
+#: aplay/aplay.c:1743
+#, c-format
+msgid "Status(R/W):\n"
+msgstr "상태(R/W):\n"
+
+#: aplay/aplay.c:1746
+#, c-format
+msgid "read/write error, state = %s"
+msgstr "읽기/쓰기 오류, 상태 = %s"
+
+#: aplay/aplay.c:1756
+#, c-format
+msgid "Suspended. Trying resume. "
+msgstr "중지됨. 재개합니다. "
+
+#: aplay/aplay.c:1762
+#, c-format
+msgid "Failed. Restarting stream. "
+msgstr "실패. 스트림을 재개합니다. "
+
+#: aplay/aplay.c:1765
+#, c-format
+msgid "suspend: prepare error: %s"
+msgstr "중지됨: 준비 오류: %s"
+
+#: aplay/aplay.c:1770
+#, c-format
+msgid "Done.\n"
+msgstr "완료.\n"
+
+#: aplay/aplay.c:1792
+#, c-format
+msgid " !clip  "
+msgstr " !클립  "
+
+#: aplay/aplay.c:1944
+#, c-format
+msgid "Unsupported bit size %d.\n"
+msgstr "지원되지 않는 비트 크기 %d.\n"
+
+#: aplay/aplay.c:1980
+#, c-format
+msgid "Max peak (%li samples): 0x%08x "
+msgstr "최대 피크 (%li 샘플): 0x%08x "
+
+#: aplay/aplay.c:2021
+#, c-format
+msgid ""
+"Suspicious buffer position (%li total): avail = %li, delay = %li, buffer = "
+"%li\n"
+msgstr "의심스러운 버퍼 위치 (%li 전체): 가능 = %li, 지연 = %li, 버퍼 = %li\n"
+
+#: aplay/aplay.c:2030
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position (%li total): avail = %li, delay = %li, "
+"buffer = %li\n"
+msgstr "의심스러운 버퍼 위치 (%li 전체): 가능 = %li, 지연 = %li, 버퍼 = %li\n"
+
+#: aplay/aplay.c:2034
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious buffer position avail > delay (%li total): avail = %li, delay = "
+"%li\n"
+msgstr "의심스러운 버퍼 위치 (%li 전체): 가능 = %li, 지연 = %li, 버퍼 = %li\n"
+
+#: aplay/aplay.c:2038
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position avail > delay (%li total): avail = %li, "
+"delay = %li\n"
+msgstr "의심스러운 버퍼 위치 (%li 전체): 가능 = %li, 지연 = %li, 버퍼 = %li\n"
+
+#: aplay/aplay.c:2081
+#, c-format
+msgid "Status(R/W) (standalone avail=%li delay=%li):\n"
+msgstr ""
+
+#: aplay/aplay.c:2178
+#, c-format
+msgid "write error: %s"
+msgstr "쓰기 오류: %s"
+
+#: aplay/aplay.c:2226
+#, c-format
+msgid "writev error: %s"
+msgstr "쓰기 오류: %s"
+
+#: aplay/aplay.c:2272
+#, c-format
+msgid "read error: %s"
+msgstr "읽기 오류: %s"
+
+#: aplay/aplay.c:2319
+#, c-format
+msgid "readv error: %s"
+msgstr "읽기 오류: %s"
+
+#: aplay/aplay.c:2368
+msgid "can't allocate buffer for silence"
+msgstr "무음 버퍼를 할당할 수 없음"
+
+#: aplay/aplay.c:2377 aplay/aplay.c:2606 aplay/aplay.c:2611 aplay/aplay.c:2663
+#: aplay/aplay.c:2672 aplay/aplay.c:2679 aplay/aplay.c:2689 aplay/aplay.c:2695
+#: aplay/aplay.c:2767 aplay/aplay.c:2797 aplay/aplay.c:2811
+msgid "write error"
+msgstr "쓰기 오류"
+
+#: aplay/aplay.c:2390
+#, c-format
+msgid "voc_pcm_flush - silence error"
+msgstr "voc_pcm_flush - 무음 오류"
+
+#: aplay/aplay.c:2393
+msgid "voc_pcm_flush error"
+msgstr "voc_pcm_flush 오류"
+
+#: aplay/aplay.c:2418
+msgid "malloc error"
+msgstr "malloc 오류"
+
+#: aplay/aplay.c:2422
+#, c-format
+msgid "Playing Creative Labs Channel file '%s'...\n"
+msgstr "크리에이티브 랩스 채널 파일 '%s' 재생 중...\n"
+
+#: aplay/aplay.c:2491 aplay/aplay.c:2586
+msgid "can't play packed .voc files"
+msgstr "압축된 .voc 파일은 재생 불가"
+
+#: aplay/aplay.c:2546
+#, c-format
+msgid "can't play loops; %s isn't seekable\n"
+msgstr "루프 재생 불가; %s 찾을 수 없음\n"
+
+#: aplay/aplay.c:2595
+#, c-format
+msgid "unknown blocktype %d. terminate."
+msgstr "알 수 없는 블록 유형 %d. 끝냅니다."
+
+#: aplay/aplay.c:2731
+#, c-format
+msgid "Wave doesn't support %s format..."
+msgstr "Wave는 %s 형식을 지원하지 않습니다..."
+
+#: aplay/aplay.c:2791
+#, c-format
+msgid "Sparc Audio doesn't support %s format..."
+msgstr "스파크 오디오는 %s 형식을 지원하지 않습니다..."
+
+#: aplay/aplay.c:2866
+msgid "Playing"
+msgstr "재생 중"
+
+#: aplay/aplay.c:2866
+msgid "Recording"
+msgstr "녹음 중"
+
+#: aplay/aplay.c:2870
+#, c-format
+msgid "Rate %d Hz, "
+msgstr "%d Hz 속도, "
+
+#: aplay/aplay.c:2872
+#, c-format
+msgid "Mono"
+msgstr "모노"
+
+#: aplay/aplay.c:2874
+#, c-format
+msgid "Stereo"
+msgstr "스테레오"
+
+#: aplay/aplay.c:2876
+#, c-format
+msgid "Channels %i"
+msgstr "채널 %i"
+
+#: aplay/aplay.c:3483
+#, fuzzy, c-format
+#| msgid "You need to specify %d files"
+msgid "You need to specify %u files"
+msgstr "%d 파일을 지정해야 함"
+
+#: aplay/aplay.c:3536
+#, c-format
+msgid "You need to specify %d files"
+msgstr "%d 파일을 지정해야 함"
+
+#: seq/aconnect/aconnect.c:56
+#, c-format
+msgid "aconnect - ALSA sequencer connection manager\n"
+msgstr "aconnect - ALSA 시퀀서 연결 매니저\n"
+
+#: seq/aconnect/aconnect.c:57
+#, c-format
+msgid "Copyright (C) 1999-2000 Takashi Iwai\n"
+msgstr "Copyright (C) 1999-2000 Takashi Iwai\n"
+
+#: seq/aconnect/aconnect.c:58
+#, c-format
+msgid "Usage:\n"
+msgstr "사용법:\n"
+
+#: seq/aconnect/aconnect.c:59
+#, c-format
+msgid " * Connection/disconnection between two ports\n"
+msgstr " * 두 포트 간에 연결/해제\n"
+
+#: seq/aconnect/aconnect.c:60
+#, c-format
+msgid "   aconnect [-options] sender receiver\n"
+msgstr "   aconnect [-options] sender receiver\n"
+
+#: seq/aconnect/aconnect.c:61
+#, c-format
+msgid "     sender, receiver = client:port pair\n"
+msgstr "     sender, receiver = 클라이언트:포트 연결\n"
+
+#: seq/aconnect/aconnect.c:62
+#, c-format
+msgid "     -d,--disconnect     disconnect\n"
+msgstr "     -d,--disconnect     연결 해제\n"
+
+#: seq/aconnect/aconnect.c:63
+#, c-format
+msgid "     -e,--exclusive      exclusive connection\n"
+msgstr "     -e,--exclusive      단독 연결\n"
+
+#: seq/aconnect/aconnect.c:64
+#, c-format
+msgid "     -r,--real #         convert real-time-stamp on queue\n"
+msgstr "     -r,--real #         대기열의 실시간 스탬프 변환\n"
+
+#: seq/aconnect/aconnect.c:65
+#, c-format
+msgid "     -t,--tick #         convert tick-time-stamp on queue\n"
+msgstr "     -t,--tick #         대기열의 틱-타임 스팸프 변환\n"
+
+#: seq/aconnect/aconnect.c:66
+#, c-format
+msgid " * List connected ports (no subscription action)\n"
+msgstr " * 연결된 포트 목록 (수신 행동 없음)\n"
+
+#: seq/aconnect/aconnect.c:67
+#, c-format
+msgid "   aconnect -i|-o [-options]\n"
+msgstr "   aconnect -i|-o [-options]\n"
+
+#: seq/aconnect/aconnect.c:68
+#, c-format
+msgid "     -i,--input          list input (readable) ports\n"
+msgstr "     -i,--input          인풋 (읽을 수 있는) 포트 목록\n"
+
+#: seq/aconnect/aconnect.c:69
+#, c-format
+msgid "     -o,--output         list output (writable) ports\n"
+msgstr "     -o,--output         아웃풋 (쓸 수 있는) 포트\n"
+
+#: seq/aconnect/aconnect.c:71
+#, fuzzy, c-format
+#| msgid "     -i,--input          list input (readable) ports\n"
+msgid "     -a,--all            show inactive ports, too\n"
+msgstr "     -i,--input          인풋 (읽을 수 있는) 포트 목록\n"
+
+#: seq/aconnect/aconnect.c:73
+#, c-format
+msgid "     -l,--list           list current connections of each port\n"
+msgstr "     -l,--list           각 포트에 현재 연결한 목록\n"
+
+#: seq/aconnect/aconnect.c:74
+#, c-format
+msgid " * Remove all exported connections\n"
+msgstr " * 내보낸 모든 연결 제거\n"
+
+#: seq/aconnect/aconnect.c:75
+#, c-format
+msgid "     -x, --removeall\n"
+msgstr "     -x, --removeall\n"
+
+#: seq/aconnect/aconnect.c:155
+msgid "Connecting To"
+msgstr "다음으로 연결 중"
+
+#: seq/aconnect/aconnect.c:156
+msgid "Connected From"
+msgstr "다음에 연결됨"
+
+#: seq/aconnect/aconnect.c:203
+#, c-format
+msgid "client %d: '%s' [type=%s"
+msgstr "클라이언트 %d: '%s' [유형=%s"
+
+#: seq/aconnect/aconnect.c:207
+msgid "user"
+msgstr "사용자"
+
+#: seq/aconnect/aconnect.c:207
+msgid "kernel"
+msgstr "커널"
+
+#: seq/aconnect/aconnect.c:385
+#, c-format
+msgid "can't open sequencer\n"
+msgstr "시퀀서를 열 수 없음\n"
+
+#: seq/aconnect/aconnect.c:413
+#, c-format
+msgid "can't get client id\n"
+msgstr "클라이언트 id를 가져올 수 없음\n"
+
+#: seq/aconnect/aconnect.c:420
+#, c-format
+msgid "can't set client info\n"
+msgstr "클라이언트 정보를 설정할 수 없음\n"
+
+#: seq/aconnect/aconnect.c:427
+#, c-format
+msgid "invalid sender address %s\n"
+msgstr "잘못된 전달 주소 %s\n"
+
+#: seq/aconnect/aconnect.c:432 seq/aseqnet/aseqnet.c:303
+#, c-format
+msgid "invalid destination address %s\n"
+msgstr "잘못된 대상 주소 %s\n"
+
+#: seq/aconnect/aconnect.c:446
+#, c-format
+msgid "No subscription is found\n"
+msgstr "수신을 찾을 수 없음\n"
+
+#: seq/aconnect/aconnect.c:451
+#, c-format
+msgid "Disconnection failed (%s)\n"
+msgstr "연결 해제 실패 (%s)\n"
+
+#: seq/aconnect/aconnect.c:457
+#, c-format
+msgid "Connection is already subscribed\n"
+msgstr "이미 수신 중인 연결\n"
+
+#: seq/aconnect/aconnect.c:462
+#, c-format
+msgid "Connection failed (%s)\n"
+msgstr "연결 실패 (%s)\n"
+
+#: seq/aseqnet/aseqnet.c:171
+#, c-format
+msgid "aseqnet - network client/server on ALSA sequencer\n"
+msgstr "aseqnet - ALSA 시퀀서 네트워크 클라이언트/서버\n"
+
+#: seq/aseqnet/aseqnet.c:172
+#, c-format
+msgid "  Copyright (C) 1999 Takashi Iwai\n"
+msgstr "  Copyright (C) 1999 Takashi Iwai\n"
+
+#: seq/aseqnet/aseqnet.c:173
+#, c-format
+msgid "usage:\n"
+msgstr "사용법:\n"
+
+#: seq/aseqnet/aseqnet.c:174
+#, c-format
+msgid "  server mode: aseqnet [-options]\n"
+msgstr "  서버 모드: aseqnet [-options]\n"
+
+#: seq/aseqnet/aseqnet.c:175
+#, c-format
+msgid "  client mode: aseqnet [-options] server_host\n"
+msgstr "  클라이언트 모드: aseqnet [-options] server_host\n"
+
+#: seq/aseqnet/aseqnet.c:176
+#, c-format
+msgid "options:\n"
+msgstr "옵션:\n"
+
+#: seq/aseqnet/aseqnet.c:177
+#, c-format
+msgid "  -6,--ipv6 : use IPv6 TCP protocol\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:178
+#, c-format
+msgid "  -p,--port # : specify TCP port (digit or service name)\n"
+msgstr "  -p,--port # : TCP 포트 지정 (서비스 이름 또는 숫자)\n"
+
+#: seq/aseqnet/aseqnet.c:179
+#, c-format
+msgid "  -s,--source addr : read from given addr (client:port)\n"
+msgstr "  -s,--source addr : 주어진 주소(addr)로부터 읽음 (클라이언트:포트)\n"
+
+#: seq/aseqnet/aseqnet.c:180
+#, c-format
+msgid "  -d,--dest addr : write to given addr (client:port)\n"
+msgstr "  -d,--dest addr : 주어진 주소(addr)로 쓰기 (클라이언트:포트)\n"
+
+#: seq/aseqnet/aseqnet.c:181
+#, c-format
+msgid "  -n,--name value : use a specific midi process name\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:182
+#, c-format
+msgid "  -v, --verbose : print verbose messages\n"
+msgstr "  -v, --verbose : 자세한 메시지 출력\n"
+
+#: seq/aseqnet/aseqnet.c:183
+#, c-format
+msgid "  -i, --info : print certain received events\n"
+msgstr "  -i, --info : 수신된 특정 이벤트 출력\n"
+
+#: seq/aseqnet/aseqnet.c:197
+#, c-format
+msgid "can't malloc\n"
+msgstr "malloc 불가\n"
+
+#: seq/aseqnet/aseqnet.c:222
+#, c-format
+msgid "closing files..\n"
+msgstr "파일 닫는 중..\n"
+
+#: seq/aseqnet/aseqnet.c:285
+#, c-format
+msgid "sequencer opened: %d:%d\n"
+msgstr "시퀀서 열림: %d:%d\n"
+
+#: seq/aseqnet/aseqnet.c:292
+#, c-format
+msgid "invalid source address %s\n"
+msgstr "잘못된 소스 주소 %s\n"
+
+#: seq/aseqnet/aseqnet.c:362
+#, fuzzy, c-format
+#| msgid "can't get address %s\n"
+msgid "can't get address\n"
+msgstr "가져올 수 없는 주소 %s\n"
+
+#: seq/aseqnet/aseqnet.c:376 seq/aseqnet/aseqnet.c:461
+#, fuzzy, c-format
+#| msgid "Connecting To"
+msgid "connecting to: %s\n"
+msgstr "다음으로 연결 중"
+
+#: seq/aseqnet/aseqnet.c:414
+#, c-format
+msgid "too many connections!\n"
+msgstr "연결이 너무 많아요!\n"
+
+#: seq/aseqnet/aseqnet.c:425
+#, c-format
+msgid "accepted[%d]\n"
+msgstr "승인됨[%d]\n"
+
+#: seq/aseqnet/aseqnet.c:447
+#, c-format
+msgid "can't get address %s\n"
+msgstr "가져올 수 없는 주소 %s\n"
+
+#: seq/aseqnet/aseqnet.c:475
+#, c-format
+msgid "ok.. connected\n"
+msgstr "확인.. 연결됨\n"
+
+#: seq/aseqnet/aseqnet.c:574
+#, c-format
+msgid "Channel %2d: Control event : %5d\n"
+msgstr "채널 %2d: 제어 이벤트 : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:578
+#, c-format
+msgid "Channel %2d: Pitchbender   : %5d\n"
+msgstr "채널 %2d: 피치밴더   : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:582
+#, c-format
+msgid "Channel %2d: Note On event : %5d\n"
+msgstr "채널 %2d: 노트 온 이벤트 : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:586
+#, c-format
+msgid "Channel %2d: Note Off event: %5d\n"
+msgstr "채널 %2d: 노트 오프 이벤트: %5d\n"
+
+#: seq/aseqnet/aseqnet.c:641
+#, c-format
+msgid "disconnected\n"
+msgstr "연결 해제됨\n"
+
+#: speaker-test/speaker-test.c:130
+msgid "Front Left"
+msgstr "왼쪽 전면"
+
+#: speaker-test/speaker-test.c:131
+msgid "Front Right"
+msgstr "오른쪽 전면"
+
+#: speaker-test/speaker-test.c:132
+msgid "Rear Left"
+msgstr "왼쪽 후면"
+
+#: speaker-test/speaker-test.c:133
+msgid "Rear Right"
+msgstr "오른쪽 후면"
+
+#: speaker-test/speaker-test.c:135
+msgid "LFE"
+msgstr "LFE"
+
+#: speaker-test/speaker-test.c:136
+msgid "Side Left"
+msgstr "왼쪽 측면"
+
+#: speaker-test/speaker-test.c:137
+msgid "Side Right"
+msgstr "오른쪽 측면"
+
+#: speaker-test/speaker-test.c:138
+msgid "Channel 9"
+msgstr "채널 9"
+
+#: speaker-test/speaker-test.c:139
+msgid "Channel 10"
+msgstr "채널 10"
+
+#: speaker-test/speaker-test.c:140
+msgid "Channel 11"
+msgstr "채널 11"
+
+#: speaker-test/speaker-test.c:141
+msgid "Channel 12"
+msgstr "채널 12"
+
+#: speaker-test/speaker-test.c:142
+msgid "Channel 13"
+msgstr "채널 13"
+
+#: speaker-test/speaker-test.c:143
+msgid "Channel 14"
+msgstr "채널 14"
+
+#: speaker-test/speaker-test.c:144
+msgid "Channel 15"
+msgstr "채널 15"
+
+#: speaker-test/speaker-test.c:145
+msgid "Channel 16"
+msgstr "채널 16"
+
+#: speaker-test/speaker-test.c:465
+#, c-format
+msgid "Broken configuration for playback: no configurations available: %s\n"
+msgstr "손상된 재생 구성: 사용 가능한 구성 없음: %s\n"
+
+#: speaker-test/speaker-test.c:472
+#, c-format
+msgid "Access type not available for playback: %s\n"
+msgstr "재생에 사용할 수 없는 액세스 유형: %s\n"
+
+#: speaker-test/speaker-test.c:479
+#, c-format
+msgid "Sample format not available for playback: %s\n"
+msgstr "재생에 사용할 수 없는 샘플 형식: %s\n"
+
+#: speaker-test/speaker-test.c:486
+#, c-format
+msgid "Channels count (%i) not available for playbacks: %s\n"
+msgstr "재생에 사용할 수 없는 채널 수(%i): %s\n"
+
+#: speaker-test/speaker-test.c:494
+#, c-format
+msgid "Rate %iHz not available for playback: %s\n"
+msgstr "재생에 사용할 수 없는 %iHz 샘플링 속도: %s\n"
+
+#: speaker-test/speaker-test.c:499
+#, c-format
+msgid "Rate doesn't match (requested %iHz, get %iHz, err %d)\n"
+msgstr "속도가 일치하지 않음 (%iHz 요청됨, %iHz 가져옴, 오류 %d)\n"
+
+#: speaker-test/speaker-test.c:503
+#, c-format
+msgid "Rate set to %iHz (requested %iHz)\n"
+msgstr "속도를 %iHz로 설정 (%iHz 요청됨)\n"
+
+#: speaker-test/speaker-test.c:509
+#, c-format
+msgid "Buffer size range from %lu to %lu\n"
+msgstr "%lu에서 %lu로 보내는 버퍼 크기 범위\n"
+
+#: speaker-test/speaker-test.c:510
+#, c-format
+msgid "Period size range from %lu to %lu\n"
+msgstr "%lu에서 %lu로 보내는 주기 크기 범위\n"
+
+#: speaker-test/speaker-test.c:514
+#, c-format
+msgid "Requested period time %u us\n"
+msgstr "요청된 주기 시간 %u us\n"
+
+#: speaker-test/speaker-test.c:519
+#, c-format
+msgid "Unable to set period time %u us for playback: %s\n"
+msgstr "재생에 %u us 주기 시간 설정 불가: %s\n"
+
+#: speaker-test/speaker-test.c:525
+#, c-format
+msgid "Requested buffer time %u us\n"
+msgstr "요청된 버퍼 시간 %u us\n"
+
+#: speaker-test/speaker-test.c:528
+#, c-format
+msgid "Unable to set buffer time %u us for playback: %s\n"
+msgstr "재생에 %u us 버퍼 시간 적용 불가: %s\n"
+
+#: speaker-test/speaker-test.c:537
+#, c-format
+msgid "Using max buffer size %lu\n"
+msgstr "최대 버퍼 크기 %lu 사용함\n"
+
+#: speaker-test/speaker-test.c:540
+#, c-format
+msgid "Unable to set buffer size %lu for playback: %s\n"
+msgstr "재생에 버퍼 크기 %lu 설정 불가: %s\n"
+
+#: speaker-test/speaker-test.c:546
+#, c-format
+msgid "Periods = %u\n"
+msgstr "주기 = %u\n"
+
+#: speaker-test/speaker-test.c:549
+#, c-format
+msgid "Unable to set nperiods %u for playback: %s\n"
+msgstr "재생에 nperiods %u 사용 불가: %s\n"
+
+#: speaker-test/speaker-test.c:558
+#, c-format
+msgid "Unable to set hw params for playback: %s\n"
+msgstr "재생에 하드웨어 매개변수 사용 불가: %s\n"
+
+#: speaker-test/speaker-test.c:564
+#, c-format
+msgid "was set period_size = %lu\n"
+msgstr "설정된 period_size = %lu\n"
+
+#: speaker-test/speaker-test.c:565
+#, c-format
+msgid "was set buffer_size = %lu\n"
+msgstr "설정된 buffer_size = %lu\n"
+
+#: speaker-test/speaker-test.c:567
+#, c-format
+msgid "buffer to small, could not use\n"
+msgstr "버퍼가 작아 사용할 수 없음\n"
+
+#: speaker-test/speaker-test.c:580
+#, c-format
+msgid "Unable to determine current swparams for playback: %s\n"
+msgstr "재생을 위한 현재 swparams 확인 불가: %s\n"
+
+#: speaker-test/speaker-test.c:587
+#, c-format
+msgid "Unable to set start threshold mode for playback: %s\n"
+msgstr ""
+"재생을 위한 시작 임계값 모드 설정 불가: %s\n"
+"\n"
+
+#: speaker-test/speaker-test.c:594
+#, c-format
+msgid "Unable to set avail min for playback: %s\n"
+msgstr "재생을 위한 최소 효력을 설정할 수 없음: %s\n"
+
+#: speaker-test/speaker-test.c:601
+#, c-format
+msgid "Unable to set sw params for playback: %s\n"
+msgstr "재생을 위한 소프트웨어 매개변수를 설정할 수 없음: %s\n"
+
+#: speaker-test/speaker-test.c:621
+#, c-format
+msgid "Unable to set channel map: %s\n"
+msgstr "채널 맵을 설정할 수 없음: %s\n"
+
+#: speaker-test/speaker-test.c:646
+#, c-format
+msgid "Can't recovery from underrun, prepare failed: %s\n"
+msgstr "언더런에서 복구할 수 없음, 준비 실패: %s\n"
+
+#: speaker-test/speaker-test.c:657
+#, c-format
+msgid "Can't recovery from suspend, prepare failed: %s\n"
+msgstr "중지 상태에서 복구할 수 없음, 준비 실패: %s\n"
+
+#: speaker-test/speaker-test.c:721 speaker-test/speaker-test.c:1257
+#, c-format
+msgid "No enough memory\n"
+msgstr "메모리 부족\n"
+
+#: speaker-test/speaker-test.c:726
+#, c-format
+msgid "Cannot open WAV file %s\n"
+msgstr "%s WAV 파일을 열 수 없음\n"
+
+#: speaker-test/speaker-test.c:730 speaker-test/speaker-test.c:759
+#, c-format
+msgid "Invalid WAV file %s\n"
+msgstr "잘못된 WAV 파일 %s\n"
+
+#: speaker-test/speaker-test.c:735
+#, c-format
+msgid "Not a WAV file: %s\n"
+msgstr "WAV 파일이 아님: %s\n"
+
+#: speaker-test/speaker-test.c:739
+#, c-format
+msgid "Unsupported WAV format %d for %s\n"
+msgstr "%d WAV 형식은 %s에 지원되지 않음\n"
+
+#: speaker-test/speaker-test.c:744
+#, c-format
+msgid "%s is not a mono stream (%d channels)\n"
+msgstr "%s(은)는 모노 스트림이 아님 (%d 채널)\n"
+
+#: speaker-test/speaker-test.c:749
+#, c-format
+msgid "Sample rate doesn't match (%d) for %s\n"
+msgstr "샘플링 속도 (%d)가 %s와 일치하지 않음 \n"
+
+#: speaker-test/speaker-test.c:754
+#, c-format
+msgid "Unsupported sample format bits %d for %s\n"
+msgstr "샘플 형식 비트 %d가 %s에 지원되지 않음\n"
+
+#: speaker-test/speaker-test.c:815
+#, c-format
+msgid "Undefined channel %d\n"
+msgstr "정의되지 않은 채널 %d\n"
+
+#: speaker-test/speaker-test.c:866
+#, c-format
+msgid "Write error: %d,%s\n"
+msgstr "쓰기 오류: %d,%s\n"
+
+#: speaker-test/speaker-test.c:868
+#, c-format
+msgid "xrun_recovery failed: %d,%s\n"
+msgstr "xrun_recovery 실패: %d,%s\n"
+
+#: speaker-test/speaker-test.c:938
+#, c-format
+msgid "\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:982
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: speaker-test [OPTION]... \n"
+#| "-h,--help\thelp\n"
+#| "-D,--device\tplayback device\n"
+#| "-r,--rate\tstream rate in Hz\n"
+#| "-c,--channels\tcount of channels in stream\n"
+#| "-f,--frequency\tsine wave frequency in Hz\n"
+#| "-F,--format\tsample format\n"
+#| "-b,--buffer\tring buffer size in us\n"
+#| "-p,--period\tperiod size in us\n"
+#| "-P,--nperiods\tnumber of periods\n"
+#| "-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+#| "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+#| "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+#| "-w,--wavfile\tUse the given WAV file as a test sound\n"
+#| "-W,--wavdir\tSpecify the directory containing WAV files\n"
+#| "-m,--chmap\tSpecify the channel map to override\n"
+#| "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+#| "-S,--scale\tScale of generated test tones in percent (default=80)\n"
+#| "\n"
+msgid ""
+"Usage: speaker-test [OPTION]... \n"
+"-h,--help\thelp\n"
+"-D,--device\tplayback device\n"
+"-r,--rate\tstream rate in Hz\n"
+"-c,--channels\tcount of channels in stream\n"
+"-f,--frequency\tsine wave frequency in Hz\n"
+"-F,--format\tsample format\n"
+"-b,--buffer\tring buffer size in us\n"
+"-p,--period\tperiod size in us\n"
+"-P,--nperiods\tnumber of periods\n"
+"-t,--test\tpink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 "
+"noise, wav=WAV file\n"
+"-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+"-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+"-w,--wavfile\tUse the given WAV file as a test sound\n"
+"-W,--wavdir\tSpecify the directory containing WAV files\n"
+"-m,--chmap\tSpecify the channel map to override\n"
+"-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+"-S,--scale\tScale of generated test tones in percent (default=80)\n"
+"\n"
+msgstr ""
+"사용법: speaker-test [OPTION]... \n"
+"-h,--help\t도움말\n"
+"-D,--device\t재생 장치\n"
+"-r,--rate\tHz 스트림 속도\n"
+"-c,--channels\t스트림 채널 수\n"
+"-f,--frequency\t사인파 주파수 Hz\n"
+"-F,--format\t샘플 형식\n"
+"-b,--buffer\tus 단위 링 버퍼 크기\n"
+"-p,--period\tus 단위 주기 크기\n"
+"-P,--nperiods\t주기 수\n"
+"-t,--test\tpink=핑크 노이즈, sine=사인파, wav=WAV 파일\n"
+"-l,--nloops\t테스트할 루프 수 지정, 0 = 무한\n"
+"-s,--speaker\t싱글 스피커 테스트. 1=왼쪽, 2=오른쪽, 기타\n"
+"-w,--wavfile\t주어진 WAV 파일을 테스트 사운드로 사용\n"
+"-W,--wavdir\tWAV 파일을 포함하는 디렉토리 지정\n"
+"-m,--chmap\t재정의할 채널 맵 지정\n"
+"-X,--force-frequency\t30-8000hz 범위 밖의 주파수 강제적용\n"
+"-S,--scale\t생성된 테스트 톤의 크기 비율 (기본값=80)\n"
+"\n"
+
+#: speaker-test/speaker-test.c:1114
+#, c-format
+msgid "Invalid number of periods %d\n"
+msgstr "유효하지 않은 주기 %d\n"
+
+#: speaker-test/speaker-test.c:1127 speaker-test/speaker-test.c:1137
+#: speaker-test/speaker-test.c:1141
+#, c-format
+msgid "Invalid test type %s\n"
+msgstr "잘못된 테스트 유형 %s\n"
+
+#: speaker-test/speaker-test.c:1174
+#, c-format
+msgid "Unknown option '%c'\n"
+msgstr "알 수 없는 옵션 '%c'\n"
+
+#: speaker-test/speaker-test.c:1188
+#, c-format
+msgid "Invalid parameter for -s option.\n"
+msgstr "-s 옵션 매개변수가 잘못됐습니다.\n"
+
+#: speaker-test/speaker-test.c:1203
+#, c-format
+msgid "Playback device is %s\n"
+msgstr "재생 장치 %s\n"
+
+#: speaker-test/speaker-test.c:1204
+#, c-format
+msgid "Stream parameters are %iHz, %s, %i channels\n"
+msgstr "스트림 매개변수 %iHz, %s, %i 채널\n"
+
+#: speaker-test/speaker-test.c:1207
+#, c-format
+msgid "Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:1210
+#, c-format
+msgid "Using 16 octaves of pink noise\n"
+msgstr "16 옥타브의 핑크 노이즈 사용\n"
+
+#: speaker-test/speaker-test.c:1213
+#, c-format
+msgid "Sine wave rate is %.4fHz\n"
+msgstr "%.4fHz 사인(Sine)파 속도\n"
+
+#: speaker-test/speaker-test.c:1216
+#, c-format
+msgid "WAV file(s)\n"
+msgstr "WAV 파일\n"
+
+#: speaker-test/speaker-test.c:1226
+#, c-format
+msgid "Playback open error: %d,%s\n"
+msgstr "재생 열기 오류: %d,%s\n"
+
+#: speaker-test/speaker-test.c:1232
+#, c-format
+msgid "Setting of hwparams failed: %s\n"
+msgstr "매개변수 hwparams 설정 실패: %s\n"
+
+#: speaker-test/speaker-test.c:1236
+#, c-format
+msgid "Setting of swparams failed: %s\n"
+msgstr "매개변수 swparams 설정 실패: %s\n"
+
+#: speaker-test/speaker-test.c:1282 speaker-test/speaker-test.c:1304
+#, c-format
+msgid "Transfer failed: %s\n"
+msgstr "전송 실패함: %s\n"
+
+#: speaker-test/speaker-test.c:1290
+#, c-format
+msgid "Time per period = %lf\n"
+msgstr "주기별 시간 = %lf\n"
+
+#, c-format
+#~ msgid "service '%s' is not found in /etc/services\n"
+#~ msgstr "/etc/services에서 서비스 '%s'를 찾을 수 없음 \n"
index 2436c49..8c70dfb 100644 (file)
@@ -1,6 +1,12 @@
-# Sed script that remove the POT-Creation-Date line in the header entry
+# Sed script that removes the POT-Creation-Date line in the header entry
 # from a POT file.
 #
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.  This file is offered as-is,
+# without any warranty.
+#
 # The distinction between the first and the following occurrences of the
 # pattern is achieved by looking at the hold space.
 /^"POT-Creation-Date: .*"$/{
diff --git a/po/sk.gmo b/po/sk.gmo
new file mode 100644 (file)
index 0000000..2add8ce
Binary files /dev/null and b/po/sk.gmo differ
diff --git a/po/sk.po b/po/sk.po
new file mode 100644 (file)
index 0000000..73585c1
--- /dev/null
+++ b/po/sk.po
@@ -0,0 +1,1904 @@
+# Slovak translations for the alsa-utils package.
+# Copyright (C) 2009 The ALSA Team
+# This file is distributed under the same license as the alsa-utils package.
+# Jose Riha <jose1711@gmail.com>, 2020.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: alsa-utils 1.0.23\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-06-10 09:22+0000\n"
+"PO-Revision-Date: 2020-10-18 15:13+0200\n"
+"Last-Translator: Jose Riha <jose1711@gmail.com>\n"
+"Language-Team: Slovak\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 2.4.1\n"
+
+#: alsamixer/card_select.c:77 alsamixer/device_name.c:127
+msgid "Sound Card"
+msgstr "Zvuková karta"
+
+#: alsamixer/card_select.c:115
+msgid "(default)"
+msgstr "(predvolená)"
+
+#: alsamixer/card_select.c:125
+msgid "cannot enumerate sound cards"
+msgstr "Chyba počas vyčíslovania zvukových kariet"
+
+#: alsamixer/card_select.c:151
+msgid "enter device name..."
+msgstr "zadajte názov zariadenia..."
+
+#: alsamixer/cli.c:45
+msgid "Usage: alsamixer [options]"
+msgstr "Použitie: alsamixer [možnosti]"
+
+#: alsamixer/cli.c:46
+#, fuzzy
+#| msgid ""
+#| "Useful options:\n"
+#| "  -h, --help              this help\n"
+#| "  -c, --card=NUMBER       sound card number or id\n"
+#| "  -D, --device=NAME       mixer device name\n"
+#| "  -m, --mouse             enable mouse\n"
+#| "  -M, --no-mouse          disable mouse\n"
+#| "  -f, --config=FILE       configuration file\n"
+#| "  -F, --no-config         do not load configuration file\n"
+#| "  -V, --view=MODE         starting view mode: playback/capture/all"
+msgid ""
+"Useful options:\n"
+"  -h, --help              this help\n"
+"  -c, --card=NUMBER       sound card number or id\n"
+"  -D, --device=NAME       mixer device name\n"
+"  -m, --mouse             enable mouse\n"
+"  -M, --no-mouse          disable mouse\n"
+"  -f, --config=FILE       configuration file\n"
+"  -F, --no-config         do not load configuration file\n"
+"  -V, --view=MODE         starting view mode: playback/capture/all\n"
+"  -B, --black-background  use black background color"
+msgstr ""
+"Užitočné možnosti:\n"
+"  -h, --help              tento pomocník\n"
+"  -c, --card=ČÍSLO        číslo zvukovej karty alebo id\n"
+"  -D, --device=NÁZOV      názov zariadenia mixéra\n"
+"  -m, --mouse             povoliť myš\n"
+"  -M, --no-mouse          vypnúť myš\n"
+"  -f, --config=SÚBOR      súbor s konfiguráciou\n"
+"  -F, --no-config         nenačítať súbor s konfiguráciou\n"
+"  -V, --view=REŽIM        spustiť v režime zobrazenia: playback/capture/all "
+"(prehrávanie/záznam/všetko)"
+
+#: alsamixer/cli.c:56
+msgid ""
+"Debugging options:\n"
+"  -g, --no-color          toggle using of colors\n"
+"  -a, --abstraction=NAME  mixer abstraction level: none/basic"
+msgstr ""
+"Možnosti pre ladenie:\n"
+"  -g, --no-color          bez farby\n"
+"  -a, --abstraction=NÁZOV úroveň abstrakcie mixéra: none/basic"
+
+#: alsamixer/cli.c:92
+#, c-format
+msgid "invalid card index: %s\n"
+msgstr "neplatné číslo karty: %s\n"
+
+#: alsamixer/cli.c:137
+#, c-format
+msgid "unknown abstraction level: %s\n"
+msgstr "neznáma úroveň abstrakcie: %s\n"
+
+#: alsamixer/cli.c:142
+#, c-format
+msgid "unknown option: %c\n"
+msgstr "neznáma voľba: %c\n"
+
+#: alsamixer/cli.c:144
+msgid "try `alsamixer --help' for more information\n"
+msgstr "skúste `alsamixer --help' pre viac informácií\n"
+
+#: alsamixer/device_name.c:177
+msgid "Device name:"
+msgstr "Názov zariadenia:"
+
+#: alsamixer/die.c:37
+#, c-format
+msgid "%s: %s\n"
+msgstr "%s: %s\n"
+
+#: alsamixer/mixer_display.c:99
+msgid "Card:"
+msgstr "Karta:"
+
+#: alsamixer/mixer_display.c:100
+msgid "Chip:"
+msgstr "Čip:"
+
+#: alsamixer/mixer_display.c:101
+msgid "View:"
+msgstr "Pohľad:"
+
+#: alsamixer/mixer_display.c:102
+msgid "Item:"
+msgstr "Položka:"
+
+#: alsamixer/mixer_display.c:105
+msgid "F1:  Help"
+msgstr "F1:  Pomocník"
+
+#: alsamixer/mixer_display.c:106
+msgid "F2:  System information"
+msgstr "F2:  Informácie o systéme"
+
+#: alsamixer/mixer_display.c:107
+msgid "F6:  Select sound card"
+msgstr "F6:  Výber zvukovej karty"
+
+#: alsamixer/mixer_display.c:108
+msgid "Esc: Exit"
+msgstr "Esc: Ukončiť"
+
+#: alsamixer/mixer_display.c:179
+msgid "(unplugged)"
+msgstr "(odpojená)"
+
+#: alsamixer/mixer_display.c:197
+msgid "Playback"
+msgstr "Prehrávanie"
+
+#: alsamixer/mixer_display.c:198
+msgid "Capture"
+msgstr "Záznam"
+
+#: alsamixer/mixer_display.c:199
+msgid "All"
+msgstr "Všetko"
+
+#: alsamixer/mixer_display.c:240
+msgid "mute"
+msgstr "stlmiť"
+
+#: alsamixer/mixer_display.c:281 alsamixer/mixer_display.c:291
+msgid "dB gain:"
+msgstr "dB zisk:"
+
+#: alsamixer/mixer_display.c:291
+#, c-format
+msgid " [%s %s, %s]"
+msgstr " [%s %s; %s]"
+
+#: alsamixer/mixer_display.c:300 alsamixer/mixer_display.c:306
+#: alsamixer/mixer_display.c:312 alsamixer/mixer_display.c:318
+msgid "Off"
+msgstr "Vyp"
+
+#: alsamixer/mixer_display.c:306 alsamixer/mixer_display.c:318
+msgid "On"
+msgstr "Zap"
+
+#: alsamixer/mixer_display.c:370
+msgid "The sound device was unplugged."
+msgstr "Zvukové zariadenie bolo odpojené."
+
+#: alsamixer/mixer_display.c:371
+msgid "Press F6 to select another sound card."
+msgstr "Stlačte F6 pre výber inej zvukovej karty."
+
+#: alsamixer/mixer_display.c:386
+msgid "This sound device does not have any playback controls."
+msgstr "Toto zvukové zariadenie neposkytuje ovládacie prvky pre prehrávanie."
+
+#: alsamixer/mixer_display.c:388
+msgid "This sound device does not have any capture controls."
+msgstr ""
+"Toto zvukové zariadenie neposkytuje ovládacie prvky pre zaznamenávanie."
+
+#: alsamixer/mixer_display.c:390
+msgid "This sound device does not have any controls."
+msgstr "Toto zvukové zariadenie neposkytuje žiadne ovládacie prvky."
+
+#. TRANSLATORS: playback on; one character
+#: alsamixer/mixer_display.c:523 alsamixer/mixer_display.c:528
+msgid "O"
+msgstr "O"
+
+#. TRANSLATORS: playback muted; one character
+#: alsamixer/mixer_display.c:525 alsamixer/mixer_display.c:529
+msgid "M"
+msgstr "M"
+
+#. TRANSLATORS: "left"; no more than two characters
+#: alsamixer/mixer_display.c:545
+msgid "L"
+msgstr "Ľ"
+
+#. TRANSLATORS: "right"; no more than two characters
+#: alsamixer/mixer_display.c:551
+msgid "R"
+msgstr "P"
+
+#. TRANSLATORS: no more than eight characters
+#: alsamixer/mixer_display.c:555
+msgid "CAPTURE"
+msgstr "ZÁZNAM"
+
+#: alsamixer/mixer_display.c:611
+msgid "Front"
+msgstr "Predné"
+
+#: alsamixer/mixer_display.c:614
+msgid "Rear"
+msgstr "Zadné"
+
+#: alsamixer/mixer_display.c:617 speaker-test/speaker-test.c:134
+msgid "Center"
+msgstr "Stredné"
+
+#: alsamixer/mixer_display.c:620
+msgid "Woofer"
+msgstr "Basy"
+
+#: alsamixer/mixer_display.c:623
+msgid "Side"
+msgstr "Bočné"
+
+#: alsamixer/mixer_widget.c:91 alsamixer/mixer_widget.c:96
+msgid "cannot open mixer"
+msgstr "Chyba pri otváraní mixéra"
+
+#: alsamixer/mixer_widget.c:102 alsamixer/mixer_widget.c:179
+msgid "cannot load mixer controls"
+msgstr "Chyba pri načítavaní ovládacích prvkov mixéra"
+
+#: alsamixer/mixer_widget.c:169
+#, c-format
+msgid "Cannot open mixer device '%s'."
+msgstr "Chyba pri otváraní zariadenia mixéra '%s'."
+
+#: alsamixer/mixer_widget.c:190
+msgid "Esc     Exit"
+msgstr "Esc     Ukončiť"
+
+#: alsamixer/mixer_widget.c:191
+msgid "F1 ? H  Help"
+msgstr "F1 ? H  Pomocník"
+
+#: alsamixer/mixer_widget.c:192
+msgid "F2 /    System information"
+msgstr "F2 /    Informácie o systéme"
+
+#: alsamixer/mixer_widget.c:193
+msgid "F3      Show playback controls"
+msgstr "F3      Zobraziť ovládacie prvky prehrávania"
+
+#: alsamixer/mixer_widget.c:194
+msgid "F4      Show capture controls"
+msgstr "F4      Zobraziť ovládacie prvky zaznamenávania"
+
+#: alsamixer/mixer_widget.c:195
+msgid "F5      Show all controls"
+msgstr "F5      Zobraziť všetky ovládacie prvky"
+
+#: alsamixer/mixer_widget.c:196
+msgid "Tab     Toggle view mode (F3/F4/F5)"
+msgstr "Tab     Prepnúť režim zobrazenia (F3/F4/F5)"
+
+#: alsamixer/mixer_widget.c:197
+msgid "F6 S    Select sound card"
+msgstr "F6 S    Výber zvukovej karty"
+
+#: alsamixer/mixer_widget.c:198
+msgid "L       Redraw screen"
+msgstr "L       Aktualizovať obrazovku"
+
+#: alsamixer/mixer_widget.c:200
+msgid "Left    Move to the previous control"
+msgstr "Doľava   Prejsť na predchádzajúci ovládací prvok"
+
+#: alsamixer/mixer_widget.c:201
+msgid "Right   Move to the next control"
+msgstr "Doprava  Prejsť na ďalší ovládací prvok"
+
+#: alsamixer/mixer_widget.c:203
+msgid "Up/Down    Change volume"
+msgstr "Hore/Dole   Zmena hlasitosti"
+
+#: alsamixer/mixer_widget.c:204
+msgid "+ -        Change volume"
+msgstr "+ -         Zmena hlasitosti"
+
+#: alsamixer/mixer_widget.c:205
+msgid "Page Up/Dn Change volume in big steps"
+msgstr "PageUp/Down Zmeniť hlasitosť vo veľkých skokoch"
+
+#: alsamixer/mixer_widget.c:206
+msgid "End        Set volume to 0%"
+msgstr "End         Nastaviť hlasitosť na 0%"
+
+#: alsamixer/mixer_widget.c:207
+msgid "0-9        Set volume to 0%-90%"
+msgstr "0-9         Nastaviť hlasitosť na 0%-90%"
+
+#: alsamixer/mixer_widget.c:208
+msgid "Q W E      Increase left/both/right volumes"
+msgstr "Q W E       Zvýšiť hlasitosť pre ľavý/oba/pravý kanál(y)"
+
+#. TRANSLATORS: or Y instead of Z
+#: alsamixer/mixer_widget.c:210
+msgid "Z X C      Decrease left/both/right volumes"
+msgstr "Y X C       Znížiť hlasitosť pre ľavý/oba/pravý kanál(y)"
+
+#: alsamixer/mixer_widget.c:211
+msgid "B          Balance left and right volumes"
+msgstr "B           Synchronizovať hlasitosť ľavého a pravého kanála"
+
+#: alsamixer/mixer_widget.c:213
+msgid "M          Toggle mute"
+msgstr "M           Prepnúť stlmenie"
+
+#. TRANSLATORS: or , .
+#: alsamixer/mixer_widget.c:215
+msgid "< >        Toggle left/right mute"
+msgstr ", .         Prepnúť stlmenie ľavého/pravého kanála"
+
+#: alsamixer/mixer_widget.c:217
+msgid "Space      Toggle capture"
+msgstr "Medzerník   Vypnúť/zapnúť zaznamenávanie"
+
+#. TRANSLATORS: or Insert Delete
+#: alsamixer/mixer_widget.c:219
+msgid "; '        Toggle left/right capture"
+msgstr "; '         Prepnúť zaznamenávanie ľavého/pravého kanála"
+
+#: alsamixer/mixer_widget.c:221
+msgid "Authors:"
+msgstr "Autori:"
+
+#: alsamixer/mixer_widget.c:222
+msgid "  Tim Janik"
+msgstr "  Tim Janik"
+
+#: alsamixer/mixer_widget.c:223
+msgid "  Jaroslav Kysela <perex@perex.cz>"
+msgstr "  Jaroslav Kysela <perex@perex.cz>"
+
+#: alsamixer/mixer_widget.c:224
+msgid "  Clemens Ladisch <clemens@ladisch.de>"
+msgstr "  Clemens Ladisch <clemens@ladisch.de>"
+
+#: alsamixer/mixer_widget.c:226
+msgid "Help"
+msgstr "Pomocník"
+
+#: alsamixer/proc_files.c:56
+msgid "Select File"
+msgstr "Vybrať súbor"
+
+#: alsamixer/textbox.c:51 alsamixer/textbox.c:65
+msgid "Error"
+msgstr "Chyba"
+
+#: alsamixer/textbox.c:80
+#, c-format
+msgid "Cannot open file \"%s\"."
+msgstr "Chyba pri otváraní súboru \"%s\"."
+
+#: aplay/aplay.c:184
+msgid "raw data"
+msgstr "surové dáta"
+
+#: aplay/aplay.c:185
+msgid "VOC"
+msgstr "VOC"
+
+#: aplay/aplay.c:187
+msgid "WAVE"
+msgstr "WAVE"
+
+#: aplay/aplay.c:188
+msgid "Sparc Audio"
+msgstr "Sparc-Audio"
+
+#: aplay/aplay.c:209
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: %s [OPTION]... [FILE]...\n"
+#| "\n"
+#| "-h, --help              help\n"
+#| "    --version           print current version\n"
+#| "-l, --list-devices      list all soundcards and digital audio devices\n"
+#| "-L, --list-pcms         list device names\n"
+#| "-D, --device=NAME       select PCM by name\n"
+#| "-q, --quiet             quiet mode\n"
+#| "-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+#| "-c, --channels=#        channels\n"
+#| "-f, --format=FORMAT     sample format (case insensitive)\n"
+#| "-r, --rate=#            sample rate\n"
+#| "-d, --duration=#        interrupt after # seconds\n"
+#| "-s, --samples=#         interrupt after # samples per channel\n"
+#| "-M, --mmap              mmap stream\n"
+#| "-N, --nonblock          nonblocking mode\n"
+#| "-F, --period-time=#     distance between interrupts is # microseconds\n"
+#| "-B, --buffer-time=#     buffer duration is # microseconds\n"
+#| "    --period-size=#     distance between interrupts is # frames\n"
+#| "    --buffer-size=#     buffer duration is # frames\n"
+#| "-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+#| "-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+#| "                        (relative to buffer size if <= 0)\n"
+#| "-T, --stop-delay=#      delay for automatic PCM stop is # microseconds "
+#| "from xrun\n"
+#| "-v, --verbose           show PCM structure and setup (accumulative)\n"
+#| "-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+#| "-I, --separate-channels one file for each channel\n"
+#| "-i, --interactive       allow interactive operation from stdin\n"
+#| "-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+#| "    --disable-resample  disable automatic rate resample\n"
+#| "    --disable-channels  disable automatic channel conversions\n"
+#| "    --disable-format    disable automatic format conversions\n"
+#| "    --disable-softvol   disable software volume control (softvol)\n"
+#| "    --test-position     test ring buffer position\n"
+#| "    --test-coef=#       test coefficient for ring buffer position "
+#| "(default 8)\n"
+#| "                        expression for validation is: coef * "
+#| "(buffer_size / 2)\n"
+#| "    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+#| "    --max-file-time=#   start another output file when the old file has "
+#| "recorded\n"
+#| "                        for this many seconds\n"
+#| "    --process-id-file   write the process ID here\n"
+#| "    --use-strftime      apply the strftime facility to the output file "
+#| "name\n"
+#| "    --dump-hw-params    dump hw_params of the device\n"
+#| "    --fatal-errors      treat all errors as fatal\n"
+msgid ""
+"Usage: %s [OPTION]... [FILE]...\n"
+"\n"
+"-h, --help              help\n"
+"    --version           print current version\n"
+"-l, --list-devices      list all soundcards and digital audio devices\n"
+"-L, --list-pcms         list device names\n"
+"-D, --device=NAME       select PCM by name\n"
+"-q, --quiet             quiet mode\n"
+"-t, --file-type TYPE    file type (voc, wav, raw or au)\n"
+"-c, --channels=#        channels\n"
+"-f, --format=FORMAT     sample format (case insensitive)\n"
+"    --subformat=SUBFORMAT  sample subformat (case insensitive)\n"
+"-r, --rate=#            sample rate\n"
+"-d, --duration=#        interrupt after # seconds\n"
+"-s, --samples=#         interrupt after # samples per channel\n"
+"-M, --mmap              mmap stream\n"
+"-N, --nonblock          nonblocking mode\n"
+"-F, --period-time=#     distance between interrupts is # microseconds\n"
+"-B, --buffer-time=#     buffer duration is # microseconds\n"
+"    --period-size=#     distance between interrupts is # frames\n"
+"    --buffer-size=#     buffer duration is # frames\n"
+"-A, --avail-min=#       min available space for wakeup is # microseconds\n"
+"-R, --start-delay=#     delay for automatic PCM start is # microseconds \n"
+"                        (relative to buffer size if <= 0)\n"
+"-T, --stop-delay=#      delay for automatic PCM stop is # microseconds from "
+"xrun\n"
+"-v, --verbose           show PCM structure and setup (accumulative)\n"
+"-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
+"-I, --separate-channels one file for each channel\n"
+"-i, --interactive       allow interactive operation from stdin\n"
+"-m, --chmap=ch1,ch2,..  Give the channel map to override or follow\n"
+"    --disable-resample  disable automatic rate resample\n"
+"    --disable-channels  disable automatic channel conversions\n"
+"    --disable-format    disable automatic format conversions\n"
+"    --disable-softvol   disable software volume control (softvol)\n"
+"    --test-position     test ring buffer position\n"
+"    --test-coef=#       test coefficient for ring buffer position (default "
+"8)\n"
+"                        expression for validation is: coef * (buffer_size / "
+"2)\n"
+"    --test-nowait       do not wait for ring buffer - eats whole CPU\n"
+"    --max-file-time=#   start another output file when the old file has "
+"recorded\n"
+"                        for this many seconds\n"
+"    --process-id-file   write the process ID here\n"
+"    --use-strftime      apply the strftime facility to the output file name\n"
+"    --dump-hw-params    dump hw_params of the device\n"
+"    --fatal-errors      treat all errors as fatal\n"
+msgstr ""
+"Syntax: %s [VOĽBA]... [SÚBOR]...\n"
+"\n"
+"-h, --help              pomocník\n"
+"    --version           zobraziť aktuálnu verziu\n"
+"-l, --list-devices      vypísať zoznam všetkých zvukových kariet a "
+"digitálnych zvukových zariadení na systéme\n"
+"-L, --list-pcms         vypísať zoznam s názvami zariadení\n"
+"-D, --device=NAME       vybrať zariadenie PCM podľa mena\n"
+"-q, --quiet             tichý režim\n"
+"-t, --file-type TYPE    typ súboru (voc, wav, raw alebo au)\n"
+"-c, --channels=#        kanály\n"
+"-f, --format=FORMAT     formát vzorkovania (na veľkosti znakov nezáleží)\n"
+"-r, --rate=#            formát vzorkovania\n"
+"-d, --duration=#        prerušiť po # sekundách\n"
+"-s, --samples=#         prerušiť po # vzorkách na kanál\n"
+"-M, --mmap              mmap prúd\n"
+"-N, --nonblock          režim bez blokovania\n"
+"-F, --period-time=#     vzdialenosť medzi prerušeniami je # mikrosekúnd\n"
+"-B, --buffer-time=#     dĺžka vyrovnávacej pamäte je # mikrosekúnd\n"
+"    --period-size=#     vzdialenosť medzi prerušeniami je # snímkov\n"
+"    --buffer-size=#     dĺžka vyrovnávacej pamäte je # snímkov\n"
+"-A, --avail-min=#       min. dostupný priestor pre prebudenie (wakeup) je # "
+"mikrosekúnd\n"
+"-R, --start-delay=#     oneskorenie pri automatickom štarte PCM je # "
+"mikrosekúnd \n"
+"                        (relatívne k veľkosti vyrovnávacej pamäte ak <= 0)\n"
+"-T, --stop-delay=#      oneskorenie pri automatickom zastavení PCM je # "
+"mikrosekúnd od xrun\n"
+"-v, --verbose           zobraziť štruktúru a nastavenie PCM (akumulatívne)\n"
+"-V, --vumeter=TYPE      povoliť VU meter (typ: mono alebo stereo)\n"
+"-I, --separate-channels jeden súbor pre každý kanál\n"
+"-i, --interactive       povoliť interaktívne ovládanie cez štandardný vstup "
+"(stdin)\n"
+"-m, --chmap=ch1,ch2,..  nastaviť mapu kanálov, ktorá sa má použiť alebo "
+"ignorovať\n"
+"    --disable-resample  vypnúť automatickú zmenu frekvencie vzorkovania\n"
+"    --disable-channels  vypnúť automatickú konverziu kanálov\n"
+"    --disable-format    vypnúť automatickú konverziu formátu\n"
+"    --disable-softvol   vypnúť softvérovú zmenu hlasitosti (softvol)\n"
+"    --test-position     testovať pozíciu v ring bufferi\n"
+"    --test-coef=#       testovací koeficient pre kontrolu pozície v ring "
+"bufferi (predvolené 8)\n"
+"                        vzorec pre kontrolu je: koef * (velkost_buffera / "
+"2)\n"
+"    --test-nowait       nečakať na ring buffer - zhltne celý procesorový "
+"čas\n"
+"    --max-file-time=#   začať zápis do ďalšieho súboru po tom, ako je v "
+"aktuálnom súbore zaznamenaných # sekúnd\n"
+"    --process-id-file   zapísať číslo procesu do súboru\n"
+"    --use-strftime      formátovať názov súboru funkciou strftime\n"
+"    --dump-hw-params    vypísať hardvérové parametre (hw_params) zariadenia\n"
+"    --fatal-errors      všetky chyby vyhodnotiť ako závažné\n"
+
+#: aplay/aplay.c:255 speaker-test/speaker-test.c:1001
+#, c-format
+msgid "Recognized sample formats are:"
+msgstr "Podporované formáty vzorkovania sú:"
+
+#: aplay/aplay.c:261
+#, c-format
+msgid ""
+"\n"
+"Some of these may not be available on selected hardware\n"
+msgstr ""
+"\n"
+"Niektoré z nich nemusia byť dostupné na vybranom hardvéri.\n"
+
+#: aplay/aplay.c:262
+#, c-format
+msgid "The available format shortcuts are:\n"
+msgstr "Dostupné skratky formátov sú:\n"
+
+#: aplay/aplay.c:263
+#, c-format
+msgid "-f cd (16 bit little endian, 44100, stereo)\n"
+msgstr "-f cd (16 bitov, Little Endian, 44100 Hz, stereo)\n"
+
+#: aplay/aplay.c:264
+#, c-format
+msgid "-f cdr (16 bit big endian, 44100, stereo)\n"
+msgstr "-f cdr (16 bitov, Big Endian, 44100 Hz, stereo)\n"
+
+#: aplay/aplay.c:265
+#, c-format
+msgid "-f dat (16 bit little endian, 48000, stereo)\n"
+msgstr "-f dat (16 bitov, Little Endian, 48000 Hz, stereo)\n"
+
+#: aplay/aplay.c:279
+msgid "no soundcards found..."
+msgstr "neboli nájdené žiadne zvukové karty..."
+
+#: aplay/aplay.c:282
+#, c-format
+msgid "**** List of %s Hardware Devices ****\n"
+msgstr "**** Zoznam hardvérových zariadení (%s) ****\n"
+
+#: aplay/aplay.c:311
+#, c-format
+msgid "card %i: %s [%s], device %i: %s [%s]\n"
+msgstr "karta %i: %s [%s], zariadenie %i: %s [%s]\n"
+
+#: aplay/aplay.c:317
+#, c-format
+msgid "  Subdevices: %i/%i\n"
+msgstr "  Podriadené zariadenia: %i/%i\n"
+
+#: aplay/aplay.c:324
+#, c-format
+msgid "  Subdevice #%i: %s\n"
+msgstr "  Podriadené zariadenie #%i: %s\n"
+
+#: aplay/aplay.c:405
+#, c-format
+msgid "Aborted by signal %s...\n"
+msgstr "Zrušené signálom %s ...\n"
+
+#: aplay/aplay.c:562
+msgid "command should be named either arecord or aplay"
+msgstr "príkaz by sa mal volať buď arecord alebo aplay"
+
+#: aplay/aplay.c:607
+#, c-format
+msgid "unrecognized file format %s"
+msgstr "nerozpoznaný formát súboru %s"
+
+#: aplay/aplay.c:614
+#, c-format
+msgid "invalid channels argument '%s'"
+msgstr "neplatný argument kanála '%s'"
+
+#: aplay/aplay.c:618
+#, c-format
+msgid "value %i for channels is invalid"
+msgstr "hodnota %i pre kanále je neplatná"
+
+#: aplay/aplay.c:638
+#, c-format
+msgid "wrong extended format '%s'"
+msgstr "neplatný rozšírený formát '%s'"
+
+#: aplay/aplay.c:650
+#, fuzzy, c-format
+#| msgid "wrong extended format '%s'"
+msgid "wrong extended subformat '%s'"
+msgstr "neplatný rozšírený formát '%s'"
+
+#: aplay/aplay.c:657
+#, c-format
+msgid "invalid rate argument '%s'"
+msgstr "neplatný argument frekvencie '%s'"
+
+#: aplay/aplay.c:664
+#, c-format
+msgid "bad speed value %i"
+msgstr "nesprávna hodnota rýchlosti %i"
+
+#: aplay/aplay.c:670
+msgid "duration and samples arguments cannot be used together"
+msgstr "argumenty pre trvanie a počet vzoriek nesmú byť použité spolu"
+
+#: aplay/aplay.c:675
+#, c-format
+msgid "invalid duration argument '%s'"
+msgstr "neplatný argument trvania '%s'"
+
+#: aplay/aplay.c:682
+msgid "samples and duration arguments cannot be used together"
+msgstr "argumenty pre počet vzoriek a trvanie nesmú byť použité spolu"
+
+#: aplay/aplay.c:687
+#, c-format
+msgid "invalid samples argument '%s'"
+msgstr "neplatný argument vzoriek '%s'"
+
+#: aplay/aplay.c:699
+#, c-format
+msgid "invalid period time argument '%s'"
+msgstr "neplatný argument času periódy '%s'"
+
+#: aplay/aplay.c:706
+#, c-format
+msgid "invalid buffer time argument '%s'"
+msgstr "neplatný argument času vyrovnávacej pamäte '%s'"
+
+#: aplay/aplay.c:713
+#, c-format
+msgid "invalid period size argument '%s'"
+msgstr "neplatný argument veľkosti periódy '%s'"
+
+#: aplay/aplay.c:720
+#, c-format
+msgid "invalid buffer size argument '%s'"
+msgstr "neplatný argument veľkosti vyrovnávacej pamäte '%s'"
+
+#: aplay/aplay.c:727
+#, c-format
+msgid "invalid min available space argument '%s'"
+msgstr "neplatný argument min. dostupného miesta '%s'"
+
+#: aplay/aplay.c:734
+#, c-format
+msgid "invalid start delay argument '%s'"
+msgstr "neplatný argument oneskorenia pri štarte '%s'"
+
+#: aplay/aplay.c:741
+#, c-format
+msgid "invalid stop delay argument '%s'"
+msgstr "neplatný argument oneskorenia pri zastavení '%s'"
+
+#: aplay/aplay.c:796
+#, c-format
+msgid "invalid test coef argument '%s'"
+msgstr "neplatný argument testovacieho koeficienta '%s'"
+
+#: aplay/aplay.c:808
+#, c-format
+msgid "invalid max file time argument '%s'"
+msgstr "neplatný argument pre max. čas súboru '%s'"
+
+#: aplay/aplay.c:828 speaker-test/speaker-test.c:616
+#, c-format
+msgid "Unable to parse channel map string: %s\n"
+msgstr "Chyba pri dekódovaní reťazca s mapou kanálov: %s\n"
+
+#: aplay/aplay.c:834
+#, c-format
+msgid "Try `%s --help' for more information.\n"
+msgstr "Skúste `%s --help' pre ďalšie informácie.\n"
+
+#: aplay/aplay.c:850
+#, c-format
+msgid "audio open error: %s"
+msgstr "chyba pri otváraní zariadenia: %s"
+
+#: aplay/aplay.c:855
+#, c-format
+msgid "info error: %s"
+msgstr "chyba pri čítaní informácií o zariadení: %s"
+
+#: aplay/aplay.c:862
+#, c-format
+msgid "nonblock setting error: %s"
+msgstr "chyba pri nastavovaní režimu bez blokovania: %s"
+
+#: aplay/aplay.c:880 aplay/aplay.c:1004 aplay/aplay.c:1310 aplay/aplay.c:1526
+#: aplay/aplay.c:2106 aplay/aplay.c:2136
+msgid "not enough memory"
+msgstr "nedostatok pamäte"
+
+#: aplay/aplay.c:904
+#, c-format
+msgid "Cannot create process ID file %s: %s"
+msgstr "Chyba pri vytváraní súboru s ID procesu %s: %s"
+
+#: aplay/aplay.c:994
+#, c-format
+msgid "read error (called from line %i)"
+msgstr "chyba pri čítaní (volané na riadku %i)"
+
+#: aplay/aplay.c:1062
+#, c-format
+msgid "unknown length of 'fmt ' chunk (read %u, should be %u at least)"
+msgstr "neznáma dĺžka 'fmt ' bloku (prečítané %u, malo by byť aspoň %u)"
+
+#: aplay/aplay.c:1073
+#, c-format
+msgid ""
+"unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"
+msgstr ""
+"neznáma dĺžka rozšíreného 'fmt ' bloku (prečítané %u, malo by byť aspoň %u)"
+
+#: aplay/aplay.c:1078
+msgid "wrong format tag in extensible 'fmt ' chunk"
+msgstr "neznámy formát značky rozšíreného 'fmt ' bloku"
+
+#: aplay/aplay.c:1086
+#, c-format
+msgid "can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"
+msgstr ""
+"nie je možné prehrať WAV súbor vo formáte 0x%04x, ktorý nie je kódovaný ako "
+"PCM alebo FLOAT"
+
+#: aplay/aplay.c:1091
+#, c-format
+msgid "can't play WAVE-files with %d tracks"
+msgstr "nie je možné prehrať súbory WAV s %d stopami"
+
+#: aplay/aplay.c:1096
+#, c-format
+msgid "valid bps greater than bps: %d > %d"
+msgstr ""
+
+#: aplay/aplay.c:1103 aplay/aplay.c:1239
+#, c-format
+msgid "Warning: format is changed to U8\n"
+msgstr "Varovanie: formát bol zmenený na U8\n"
+
+#: aplay/aplay.c:1113 aplay/aplay.c:1126 aplay/aplay.c:1137
+#, c-format
+msgid "Warning: format is changed to %s\n"
+msgstr "Varovanie: formát bol zmenený na %s\n"
+
+#: aplay/aplay.c:1142
+#, c-format
+msgid ""
+" can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"
+msgstr ""
+" nie je možné prehrať súbory WAV s vzorkovaním %d bitov v %d bajtoch (%d "
+"kanálov)"
+
+#: aplay/aplay.c:1175
+#, c-format
+msgid " can't play WAVE-files with sample %d bits wide"
+msgstr " nie je možné prehrať súbory WAV o šírke vzorky %d bitov"
+
+#: aplay/aplay.c:1233
+#, c-format
+msgid "Warning: format is changed to MU_LAW\n"
+msgstr "Varovanie: formát bol zmenený na MU_LAW\n"
+
+#: aplay/aplay.c:1245
+#, c-format
+msgid "Warning: format is changed to S16_BE\n"
+msgstr "Varovanie: formát bol zmenený na S16_BE\n"
+
+#: aplay/aplay.c:1258 aplay/aplay.c:2427 aplay/aplay.c:2434 aplay/aplay.c:2964
+msgid "read error"
+msgstr "chyba pri čítaní"
+
+#: aplay/aplay.c:1288
+msgid "Channel numbers don't match between hw_params and channel map"
+msgstr "Počet kanálov medzi hw_params a mapou kanálov nesedí"
+
+#: aplay/aplay.c:1297
+#, c-format
+msgid "Warning: unable to get channel map\n"
+msgstr "Varovanie: nie je možné získať mapu kanálov\n"
+
+#: aplay/aplay.c:1331
+#, c-format
+msgid "Channel %d doesn't match with hw_params"
+msgstr "Kanál %d nesedí s hardvérovými parametrami (hw_params)"
+
+#: aplay/aplay.c:1358
+msgid "Broken configuration for this PCM: no configurations available"
+msgstr ""
+"Neplatná konfigurácia pre toto zariadenie PCM: žiadne dostupné konfigurácie"
+
+#: aplay/aplay.c:1362
+#, c-format
+msgid "HW Params of device \"%s\":\n"
+msgstr "HW parametre zariadenia \"%s\":\n"
+
+#: aplay/aplay.c:1382
+msgid "Access type not available"
+msgstr "Typ prístupu nie je dostupný"
+
+#: aplay/aplay.c:1387
+msgid "Sample format non available"
+msgstr "Formát vzorkovania nie je dostupný"
+
+#: aplay/aplay.c:1393
+#, fuzzy
+#| msgid "Sample format non available"
+msgid "Sample subformat not available"
+msgstr "Formát vzorkovania nie je dostupný"
+
+#: aplay/aplay.c:1398
+msgid "Channels count non available"
+msgstr "Počet kanálov nie je dostupný"
+
+#: aplay/aplay.c:1413
+#, c-format
+msgid "Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"
+msgstr ""
+"Varovanie: frekvencia je nepresná (vyžiadané: %i Hz, obdržané: %i Hz)\n"
+
+#: aplay/aplay.c:1419
+#, c-format
+msgid "         please, try the plug plugin %s\n"
+msgstr "         vyskúšajte, prosím, doplnok plug: %s\n"
+
+#: aplay/aplay.c:1456
+msgid "Unable to install hw params:"
+msgstr "Chyba pri nastavovaní hw parametrov:"
+
+#: aplay/aplay.c:1463
+#, c-format
+msgid "Can't use period equal to buffer size (%lu == %lu)"
+msgstr ""
+"Nie je možné použiť periódu rovnakú ako veľkosť vyrovnávacej pamäte (%lu == "
+"%lu)"
+
+#: aplay/aplay.c:1469
+msgid "Unable to get current sw params."
+msgstr "chyba pri nastavovaní softvérových parametrov:"
+
+#: aplay/aplay.c:1509
+msgid "unable to install sw params:"
+msgstr "chyba pri nastavovaní sw parametrov:"
+
+#: aplay/aplay.c:1544
+#, c-format
+msgid "snd_pcm_mmap_begin problem: %s"
+msgstr "problém s snd_pcm_mmap_begin: %s"
+
+#: aplay/aplay.c:1573
+#, c-format
+msgid "stdin O_NONBLOCK flag setup failed\n"
+msgstr "chyba pri nastavovaní príznaku O_NONBLOCK\n"
+
+#: aplay/aplay.c:1610
+#, c-format
+msgid "\rPAUSE command ignored (no hw support)\n"
+msgstr "\rpríkaz PAUSE ignorovaný (chýba podpora v hardvéri)\n"
+
+#: aplay/aplay.c:1618
+#, c-format
+msgid "pause push error: %s"
+msgstr "chyba pri pozastavení: %s"
+
+#: aplay/aplay.c:1629
+#, c-format
+msgid "pause release error: %s"
+msgstr "chyba pri ukončovaní pozastavenia: %s"
+
+#: aplay/aplay.c:1645
+#, c-format
+msgid ""
+"\r=== PAUSE ===                                                            "
+msgstr ""
+"\r=== PAUZA ===                                                            "
+
+#: aplay/aplay.c:1687
+#, c-format
+msgid "status error: %s"
+msgstr "chyba stavu: %s"
+
+#: aplay/aplay.c:1697 aplay/aplay.c:1708
+#, c-format
+msgid "%s!!! (at least %.3f ms long)\n"
+msgstr "%s!!! (o dĺžke aspoň %.3f ms)\n"
+
+#: aplay/aplay.c:1698 aplay/aplay.c:1701 aplay/aplay.c:1709 aplay/aplay.c:1718
+msgid "underrun"
+msgstr "podtečenie"
+
+#: aplay/aplay.c:1698 aplay/aplay.c:1709 aplay/aplay.c:1718
+msgid "overrun"
+msgstr "pretečenie"
+
+#: aplay/aplay.c:1713
+#, c-format
+msgid "Status:\n"
+msgstr "Stav:\n"
+
+#: aplay/aplay.c:1717
+#, c-format
+msgid "fatal %s: %s"
+msgstr "fatálna %s: %s"
+
+#: aplay/aplay.c:1723
+#, c-format
+msgid "xrun: prepare error: %s"
+msgstr "xrun: chyba pri inicializácii: %s"
+
+#: aplay/aplay.c:1730
+#, c-format
+msgid "Status(DRAINING):\n"
+msgstr "Stav (VYČERPANIE):\n"
+
+#: aplay/aplay.c:1734
+#, c-format
+msgid "capture stream format change? attempting recover...\n"
+msgstr "zmena formátu prúdu zaznamenávaných dát? pokúšam sa zotaviť...\n"
+
+#: aplay/aplay.c:1736
+#, c-format
+msgid "xrun(DRAINING): prepare error: %s"
+msgstr "xrun (VYČERPANIE): chyba počas inicializácie: %s"
+
+#: aplay/aplay.c:1743
+#, c-format
+msgid "Status(R/W):\n"
+msgstr "Stav (R/W):\n"
+
+#: aplay/aplay.c:1746
+#, c-format
+msgid "read/write error, state = %s"
+msgstr "chyba čítania/zápisu, stav = %s"
+
+#: aplay/aplay.c:1756
+#, c-format
+msgid "Suspended. Trying resume. "
+msgstr "Pozastavené. Pokúšam sa prebudiť. "
+
+#: aplay/aplay.c:1762
+#, c-format
+msgid "Failed. Restarting stream. "
+msgstr "Zlyhalo. Reštartujem stream. "
+
+#: aplay/aplay.c:1765
+#, c-format
+msgid "suspend: prepare error: %s"
+msgstr "Pozastavenie: chyba pri inicializácií: %s"
+
+#: aplay/aplay.c:1770
+#, c-format
+msgid "Done.\n"
+msgstr "Hotovo.\n"
+
+#: aplay/aplay.c:1792
+#, c-format
+msgid " !clip  "
+msgstr " !orezanie  "
+
+#: aplay/aplay.c:1944
+#, c-format
+msgid "Unsupported bit size %d.\n"
+msgstr "Nepodporovaná bitová dĺžka %d.\n"
+
+#: aplay/aplay.c:1980
+#, c-format
+msgid "Max peak (%li samples): 0x%08x "
+msgstr "Max. hodnota (%li vzoriek): 0x%08x "
+
+#: aplay/aplay.c:2021
+#, c-format
+msgid ""
+"Suspicious buffer position (%li total): avail = %li, delay = %li, buffer = "
+"%li\n"
+msgstr ""
+"Podozrivá pozícia vyrovnávacej pämate (celkom %li): dostupné = %li, "
+"oneskorenie = %li, vyr. pamäť = %li\n"
+
+#: aplay/aplay.c:2030
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position (%li total): avail = %li, delay = %li, "
+"buffer = %li\n"
+msgstr ""
+"Podozrivá pozícia vyrovnávacej pämate (celkom %li): dostupné = %li, "
+"oneskorenie = %li, vyr. pamäť = %li\n"
+
+#: aplay/aplay.c:2034
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious buffer position avail > delay (%li total): avail = %li, delay = "
+"%li\n"
+msgstr ""
+"Podozrivá pozícia vyrovnávacej pämate (celkom %li): dostupné = %li, "
+"oneskorenie = %li, vyr. pamäť = %li\n"
+
+#: aplay/aplay.c:2038
+#, fuzzy, c-format
+#| msgid ""
+#| "Suspicious buffer position (%li total): avail = %li, delay = %li, buffer "
+#| "= %li\n"
+msgid ""
+"Suspicious status buffer position avail > delay (%li total): avail = %li, "
+"delay = %li\n"
+msgstr ""
+"Podozrivá pozícia vyrovnávacej pämate (celkom %li): dostupné = %li, "
+"oneskorenie = %li, vyr. pamäť = %li\n"
+
+#: aplay/aplay.c:2081
+#, c-format
+msgid "Status(R/W) (standalone avail=%li delay=%li):\n"
+msgstr ""
+
+#: aplay/aplay.c:2178
+#, c-format
+msgid "write error: %s"
+msgstr "Chyba pri zápise: %s"
+
+#: aplay/aplay.c:2226
+#, c-format
+msgid "writev error: %s"
+msgstr "Chyba pri zápise vektora: %s"
+
+#: aplay/aplay.c:2272
+#, c-format
+msgid "read error: %s"
+msgstr "Chyba pri čítaní: %s"
+
+#: aplay/aplay.c:2319
+#, c-format
+msgid "readv error: %s"
+msgstr "Chyba pri čítaní vektora: %s"
+
+#: aplay/aplay.c:2368
+msgid "can't allocate buffer for silence"
+msgstr "Nepodarilo sa alokovať vyrovnávaciu pamäť pre ticho"
+
+#: aplay/aplay.c:2377 aplay/aplay.c:2606 aplay/aplay.c:2611 aplay/aplay.c:2663
+#: aplay/aplay.c:2672 aplay/aplay.c:2679 aplay/aplay.c:2689 aplay/aplay.c:2695
+#: aplay/aplay.c:2767 aplay/aplay.c:2797 aplay/aplay.c:2811
+msgid "write error"
+msgstr "Chyba pri zápise"
+
+#: aplay/aplay.c:2390
+#, c-format
+msgid "voc_pcm_flush - silence error"
+msgstr "voc_pcm_flush - chyba pri nastavovaní ticha"
+
+#: aplay/aplay.c:2393
+msgid "voc_pcm_flush error"
+msgstr "chyba voc_pcm_flush"
+
+#: aplay/aplay.c:2418
+msgid "malloc error"
+msgstr "chyba malloc"
+
+#: aplay/aplay.c:2422
+#, c-format
+msgid "Playing Creative Labs Channel file '%s'...\n"
+msgstr "Prehrávam súbor Creative Labs Channel '%s'...\n"
+
+#: aplay/aplay.c:2491 aplay/aplay.c:2586
+msgid "can't play packed .voc files"
+msgstr "Nie je možné prehrať komprimované súbory .voc"
+
+#: aplay/aplay.c:2546
+#, c-format
+msgid "can't play loops; %s isn't seekable\n"
+msgstr "Nedokážem prehrať slučku; v %s nie je možné skákať\n"
+
+#: aplay/aplay.c:2595
+#, c-format
+msgid "unknown blocktype %d. terminate."
+msgstr "Neznámy typ bloku %d. Končím."
+
+#: aplay/aplay.c:2731
+#, c-format
+msgid "Wave doesn't support %s format..."
+msgstr "Wave nepodporuje formát %s..."
+
+#: aplay/aplay.c:2791
+#, c-format
+msgid "Sparc Audio doesn't support %s format..."
+msgstr "Sparc audio nepodporuje formát %s..."
+
+#: aplay/aplay.c:2866
+msgid "Playing"
+msgstr "Prehrávam"
+
+#: aplay/aplay.c:2866
+msgid "Recording"
+msgstr "Nahrávam"
+
+#: aplay/aplay.c:2870
+#, c-format
+msgid "Rate %d Hz, "
+msgstr "Frekvencia: %d Hz, "
+
+#: aplay/aplay.c:2872
+#, c-format
+msgid "Mono"
+msgstr "Mono"
+
+#: aplay/aplay.c:2874
+#, c-format
+msgid "Stereo"
+msgstr "Stereo"
+
+#: aplay/aplay.c:2876
+#, c-format
+msgid "Channels %i"
+msgstr "%i Kanály"
+
+#: aplay/aplay.c:3483
+#, c-format
+msgid "You need to specify %u files"
+msgstr "Musíte zadať %u súborov"
+
+#: aplay/aplay.c:3536
+#, c-format
+msgid "You need to specify %d files"
+msgstr "Musíte zadať %d súborov."
+
+#: seq/aconnect/aconnect.c:56
+#, c-format
+msgid "aconnect - ALSA sequencer connection manager\n"
+msgstr "aconnect - Správca spojení pre ALSA sekvencér\n"
+
+#: seq/aconnect/aconnect.c:57
+#, c-format
+msgid "Copyright (C) 1999-2000 Takashi Iwai\n"
+msgstr "Autorské práva © 1999-2000 Takashi Iwai\n"
+
+#: seq/aconnect/aconnect.c:58
+#, c-format
+msgid "Usage:\n"
+msgstr "Syntax:\n"
+
+#: seq/aconnect/aconnect.c:59
+#, c-format
+msgid " * Connection/disconnection between two ports\n"
+msgstr " * Vytvorenie/zrušenie spojenia dvoch prípojok (portov)\n"
+
+#: seq/aconnect/aconnect.c:60
+#, c-format
+msgid "   aconnect [-options] sender receiver\n"
+msgstr "   aconnect [-možnosti] odosielateľ prijímateľ\n"
+
+#: seq/aconnect/aconnect.c:61
+#, c-format
+msgid "     sender, receiver = client:port pair\n"
+msgstr "     odosielateľ, prijímateľ = pár klient:port\n"
+
+#: seq/aconnect/aconnect.c:62
+#, c-format
+msgid "     -d,--disconnect     disconnect\n"
+msgstr "     -d,--disconnect     zrušiť spojenie\n"
+
+#: seq/aconnect/aconnect.c:63
+#, c-format
+msgid "     -e,--exclusive      exclusive connection\n"
+msgstr "     -e,--exclusive      výhradné spojenie\n"
+
+#: seq/aconnect/aconnect.c:64
+#, c-format
+msgid "     -r,--real #         convert real-time-stamp on queue\n"
+msgstr "     -r,--real #         konvertovať príznak reálneho času zdroja\n"
+
+#: seq/aconnect/aconnect.c:65
+#, c-format
+msgid "     -t,--tick #         convert tick-time-stamp on queue\n"
+msgstr "     -t,--tick #         konvertovať príznak tiknutia času zdroja\n"
+
+#: seq/aconnect/aconnect.c:66
+#, c-format
+msgid " * List connected ports (no subscription action)\n"
+msgstr " * Zobraziť pripojené prípojky (porty), bez vytvárania spojení\n"
+
+#: seq/aconnect/aconnect.c:67
+#, c-format
+msgid "   aconnect -i|-o [-options]\n"
+msgstr "   aconnect -i|-o [-možnosti]\n"
+
+#: seq/aconnect/aconnect.c:68
+#, c-format
+msgid "     -i,--input          list input (readable) ports\n"
+msgstr ""
+"     -i,--input          zobraziť vstupné (čitateľné) prípojky (porty)\n"
+
+#: seq/aconnect/aconnect.c:69
+#, c-format
+msgid "     -o,--output         list output (writable) ports\n"
+msgstr ""
+"     -o,--output         zobraziť výstupné (zapisovateľné) prípojky (porty)\n"
+
+#: seq/aconnect/aconnect.c:71
+#, fuzzy, c-format
+#| msgid "     -i,--input          list input (readable) ports\n"
+msgid "     -a,--all            show inactive ports, too\n"
+msgstr ""
+"     -i,--input          zobraziť vstupné (čitateľné) prípojky (porty)\n"
+
+#: seq/aconnect/aconnect.c:73
+#, c-format
+msgid "     -l,--list           list current connections of each port\n"
+msgstr ""
+"     -l,--list           zobraziť aktuálne spojenia pri každej prípojke "
+"(porte)\n"
+
+#: seq/aconnect/aconnect.c:74
+#, c-format
+msgid " * Remove all exported connections\n"
+msgstr " * Odstrániť všetky exportované spojenia\n"
+
+#: seq/aconnect/aconnect.c:75
+#, c-format
+msgid "     -x, --removeall\n"
+msgstr "     -x,--removeall\n"
+
+#: seq/aconnect/aconnect.c:155
+msgid "Connecting To"
+msgstr "Pripájam k"
+
+#: seq/aconnect/aconnect.c:156
+msgid "Connected From"
+msgstr "Pripojené z"
+
+#: seq/aconnect/aconnect.c:203
+#, c-format
+msgid "client %d: '%s' [type=%s"
+msgstr "klient %d: '%s' [typ=%s"
+
+#: seq/aconnect/aconnect.c:207
+msgid "user"
+msgstr "Používateľ"
+
+#: seq/aconnect/aconnect.c:207
+msgid "kernel"
+msgstr "Jadro"
+
+#: seq/aconnect/aconnect.c:385
+#, c-format
+msgid "can't open sequencer\n"
+msgstr "Chyba pri otváraní sekvencéra\n"
+
+#: seq/aconnect/aconnect.c:413
+#, c-format
+msgid "can't get client id\n"
+msgstr "Chyba pri čítaní id klienta\n"
+
+#: seq/aconnect/aconnect.c:420
+#, c-format
+msgid "can't set client info\n"
+msgstr "Chyba pri nastavovaní informácií o klientovi\n"
+
+#: seq/aconnect/aconnect.c:427
+#, c-format
+msgid "invalid sender address %s\n"
+msgstr "Neplatná adresa odosielateľa %s\n"
+
+#: seq/aconnect/aconnect.c:432 seq/aseqnet/aseqnet.c:303
+#, c-format
+msgid "invalid destination address %s\n"
+msgstr "Neplatná adresa cieľa %s\n"
+
+#: seq/aconnect/aconnect.c:446
+#, c-format
+msgid "No subscription is found\n"
+msgstr "Spojenie sa nenašlo\n"
+
+#: seq/aconnect/aconnect.c:451
+#, c-format
+msgid "Disconnection failed (%s)\n"
+msgstr "Chyba pri rušení spojenia (%s)\n"
+
+#: seq/aconnect/aconnect.c:457
+#, c-format
+msgid "Connection is already subscribed\n"
+msgstr "Spojenie je už zaregistrované\n"
+
+#: seq/aconnect/aconnect.c:462
+#, c-format
+msgid "Connection failed (%s)\n"
+msgstr "Chyba spojenia (%s)\n"
+
+#: seq/aseqnet/aseqnet.c:171
+#, c-format
+msgid "aseqnet - network client/server on ALSA sequencer\n"
+msgstr "aseqnet - sieťový klient/server pre ALSA sekvencér\n"
+
+#: seq/aseqnet/aseqnet.c:172
+#, c-format
+msgid "  Copyright (C) 1999 Takashi Iwai\n"
+msgstr "  Autorské práva © 1999 Takashi Iwai\n"
+
+#: seq/aseqnet/aseqnet.c:173
+#, c-format
+msgid "usage:\n"
+msgstr "Syntax:\n"
+
+#: seq/aseqnet/aseqnet.c:174
+#, c-format
+msgid "  server mode: aseqnet [-options]\n"
+msgstr "  Server-Modus: aseqnet [Optionen]\n"
+
+#: seq/aseqnet/aseqnet.c:175
+#, c-format
+msgid "  client mode: aseqnet [-options] server_host\n"
+msgstr "  Client-Modus: aseqnet [Optionen] ServerHost\n"
+
+#: seq/aseqnet/aseqnet.c:176
+#, c-format
+msgid "options:\n"
+msgstr "Možnosti:\n"
+
+#: seq/aseqnet/aseqnet.c:177
+#, c-format
+msgid "  -6,--ipv6 : use IPv6 TCP protocol\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:178
+#, c-format
+msgid "  -p,--port # : specify TCP port (digit or service name)\n"
+msgstr "  -p,--port # : port TCP (číslo alebo meno služby)\n"
+
+#: seq/aseqnet/aseqnet.c:179
+#, c-format
+msgid "  -s,--source addr : read from given addr (client:port)\n"
+msgstr "  -s,--source # : čítať z adresy (klient:port)\n"
+
+#: seq/aseqnet/aseqnet.c:180
+#, c-format
+msgid "  -d,--dest addr : write to given addr (client:port)\n"
+msgstr "  -d,--dest # : zapísať na adresu (klient:port)\n"
+
+#: seq/aseqnet/aseqnet.c:181
+#, c-format
+msgid "  -n,--name value : use a specific midi process name\n"
+msgstr ""
+
+#: seq/aseqnet/aseqnet.c:182
+#, c-format
+msgid "  -v, --verbose : print verbose messages\n"
+msgstr "  -v,--verbose : zobraziť podrobnejšie hlásenia\n"
+
+#: seq/aseqnet/aseqnet.c:183
+#, c-format
+msgid "  -i, --info : print certain received events\n"
+msgstr "  -i,--info : zobraziť určité udalosti príjmu\n"
+
+#: seq/aseqnet/aseqnet.c:197
+#, c-format
+msgid "can't malloc\n"
+msgstr "chyba pri malloc\n"
+
+#: seq/aseqnet/aseqnet.c:222
+#, c-format
+msgid "closing files..\n"
+msgstr "zatváram súbory ...\n"
+
+#: seq/aseqnet/aseqnet.c:285
+#, c-format
+msgid "sequencer opened: %d:%d\n"
+msgstr "sekvencér otvorený: %d:%d\n"
+
+#: seq/aseqnet/aseqnet.c:292
+#, c-format
+msgid "invalid source address %s\n"
+msgstr "neplatná zdrojová adresa %s\n"
+
+#: seq/aseqnet/aseqnet.c:362
+#, fuzzy, c-format
+#| msgid "can't get address %s\n"
+msgid "can't get address\n"
+msgstr "nepodarilo sa získať adresu %s\n"
+
+#: seq/aseqnet/aseqnet.c:376 seq/aseqnet/aseqnet.c:461
+#, fuzzy, c-format
+#| msgid "Connecting To"
+msgid "connecting to: %s\n"
+msgstr "Pripájam k"
+
+#: seq/aseqnet/aseqnet.c:414
+#, c-format
+msgid "too many connections!\n"
+msgstr "Príliš veľa spojení!\n"
+
+#: seq/aseqnet/aseqnet.c:425
+#, c-format
+msgid "accepted[%d]\n"
+msgstr "prijaté[%d]\n"
+
+#: seq/aseqnet/aseqnet.c:447
+#, c-format
+msgid "can't get address %s\n"
+msgstr "nepodarilo sa získať adresu %s\n"
+
+#: seq/aseqnet/aseqnet.c:475
+#, c-format
+msgid "ok.. connected\n"
+msgstr "OK ... pripojené\n"
+
+#: seq/aseqnet/aseqnet.c:574
+#, c-format
+msgid "Channel %2d: Control event : %5d\n"
+msgstr "Kanál %2d: udalosť ovládania: %5d\n"
+
+#: seq/aseqnet/aseqnet.c:578
+#, c-format
+msgid "Channel %2d: Pitchbender   : %5d\n"
+msgstr "Kanál %2d: Pitchbender   : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:582
+#, c-format
+msgid "Channel %2d: Note On event : %5d\n"
+msgstr "Kanál %2d: Udalosť aktivovanej noty : %5d\n"
+
+#: seq/aseqnet/aseqnet.c:586
+#, c-format
+msgid "Channel %2d: Note Off event: %5d\n"
+msgstr "Kanál %2d: Udalosť deaktivovanej noty: %5d\n"
+
+#: seq/aseqnet/aseqnet.c:641
+#, c-format
+msgid "disconnected\n"
+msgstr "Spojenie zrušené\n"
+
+#: speaker-test/speaker-test.c:130
+msgid "Front Left"
+msgstr "Predný ľavý"
+
+#: speaker-test/speaker-test.c:131
+msgid "Front Right"
+msgstr "Predný pravý"
+
+#: speaker-test/speaker-test.c:132
+msgid "Rear Left"
+msgstr "Zadný ľavý"
+
+#: speaker-test/speaker-test.c:133
+msgid "Rear Right"
+msgstr "Zadný pravý"
+
+#: speaker-test/speaker-test.c:135
+msgid "LFE"
+msgstr "Subwoofer"
+
+#: speaker-test/speaker-test.c:136
+msgid "Side Left"
+msgstr "Stredový ľavý"
+
+#: speaker-test/speaker-test.c:137
+msgid "Side Right"
+msgstr "Stredový pravý"
+
+#: speaker-test/speaker-test.c:138
+msgid "Channel 9"
+msgstr "Kanál 9"
+
+#: speaker-test/speaker-test.c:139
+msgid "Channel 10"
+msgstr "Kanál 10"
+
+#: speaker-test/speaker-test.c:140
+msgid "Channel 11"
+msgstr "Kanál 11"
+
+#: speaker-test/speaker-test.c:141
+msgid "Channel 12"
+msgstr "Kanál 12"
+
+#: speaker-test/speaker-test.c:142
+msgid "Channel 13"
+msgstr "Kanál 13"
+
+#: speaker-test/speaker-test.c:143
+msgid "Channel 14"
+msgstr "Kanál 14"
+
+#: speaker-test/speaker-test.c:144
+msgid "Channel 15"
+msgstr "Kanál 15"
+
+#: speaker-test/speaker-test.c:145
+msgid "Channel 16"
+msgstr "Kanál 16"
+
+#: speaker-test/speaker-test.c:465
+#, c-format
+msgid "Broken configuration for playback: no configurations available: %s\n"
+msgstr "Neplatná konfigurácia prehrávania: žiadne dostupné konfigurácie: %s\n"
+
+#: speaker-test/speaker-test.c:472
+#, c-format
+msgid "Access type not available for playback: %s\n"
+msgstr "Typ prístupu nie je dostupný pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:479
+#, c-format
+msgid "Sample format not available for playback: %s\n"
+msgstr "Formát vzorkovania nie je dostupný pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:486
+#, c-format
+msgid "Channels count (%i) not available for playbacks: %s\n"
+msgstr "Počet kanálov (%i) nie je dostupný pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:494
+#, c-format
+msgid "Rate %iHz not available for playback: %s\n"
+msgstr "Frekvencia %i Hz nie je dostupná pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:499
+#, c-format
+msgid "Rate doesn't match (requested %iHz, get %iHz, err %d)\n"
+msgstr "Frekvencia nesedí (vyžiadané: %i Hz, obdržané: %i Hz, kód chyby %d)\n"
+
+#: speaker-test/speaker-test.c:503
+#, c-format
+msgid "Rate set to %iHz (requested %iHz)\n"
+msgstr "Frekvencia nastavená na %i Hz (vyžiadané: %i Hz)\n"
+
+#: speaker-test/speaker-test.c:509
+#, c-format
+msgid "Buffer size range from %lu to %lu\n"
+msgstr "Veľkosť vyrovnávacej pamäte v rozmedzí od %lu do %lu\n"
+
+#: speaker-test/speaker-test.c:510
+#, c-format
+msgid "Period size range from %lu to %lu\n"
+msgstr "Veľkosť periódy v rozmedzí od %lu do %lu\n"
+
+#: speaker-test/speaker-test.c:514
+#, c-format
+msgid "Requested period time %u us\n"
+msgstr "Vyžiadaný čas periódy %u µs\n"
+
+#: speaker-test/speaker-test.c:519
+#, c-format
+msgid "Unable to set period time %u us for playback: %s\n"
+msgstr "Chyba pri nastavovaní času periódy %u µs pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:525
+#, c-format
+msgid "Requested buffer time %u us\n"
+msgstr "Vyžiadaný čas vyrovnávacej pamäte %u µs\n"
+
+#: speaker-test/speaker-test.c:528
+#, c-format
+msgid "Unable to set buffer time %u us for playback: %s\n"
+msgstr ""
+"Chyba pri nastavovaní času vyrovnávacej pamäte %u µs pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:537
+#, c-format
+msgid "Using max buffer size %lu\n"
+msgstr "Používam max. veľkosť vyrovnávacej pamäte %lu\n"
+
+#: speaker-test/speaker-test.c:540
+#, c-format
+msgid "Unable to set buffer size %lu for playback: %s\n"
+msgstr ""
+"Chyba pri nastavovaní veľkosti vyrovnávacej pamäte %lu pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:546
+#, c-format
+msgid "Periods = %u\n"
+msgstr "Periódy = %u\n"
+
+#: speaker-test/speaker-test.c:549
+#, c-format
+msgid "Unable to set nperiods %u for playback: %s\n"
+msgstr "Chyba pri nastavovaní počtu periód %u pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:558
+#, c-format
+msgid "Unable to set hw params for playback: %s\n"
+msgstr "Chyba pri nastavovaní hw parametrov pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:564
+#, c-format
+msgid "was set period_size = %lu\n"
+msgstr "nastavené: period_size = %lu\n"
+
+#: speaker-test/speaker-test.c:565
+#, c-format
+msgid "was set buffer_size = %lu\n"
+msgstr "nastavené: buffer_size = %lu\n"
+
+#: speaker-test/speaker-test.c:567
+#, c-format
+msgid "buffer to small, could not use\n"
+msgstr "vyrovnávacia pamäť príliš malá, nedá sa použiť\n"
+
+#: speaker-test/speaker-test.c:580
+#, c-format
+msgid "Unable to determine current swparams for playback: %s\n"
+msgstr "Chyba pri zisťovaní softvérových parametrov pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:587
+#, c-format
+msgid "Unable to set start threshold mode for playback: %s\n"
+msgstr "Chyba pri nastavovaní začiatku prahového režimu pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:594
+#, c-format
+msgid "Unable to set avail min for playback: %s\n"
+msgstr "Chyba pri nastavovaní dostupného minima pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:601
+#, c-format
+msgid "Unable to set sw params for playback: %s\n"
+msgstr "Chyba pri nastavovaní softvérových parametrov pre prehrávanie: %s\n"
+
+#: speaker-test/speaker-test.c:621
+#, c-format
+msgid "Unable to set channel map: %s\n"
+msgstr "Chyba pri zostavovaní mapy kanálov: %s\n"
+
+#: speaker-test/speaker-test.c:646
+#, c-format
+msgid "Can't recovery from underrun, prepare failed: %s\n"
+msgstr ""
+"Nepodarilo sa zotaviť z podtečenia (underrun), chyba pri inicializácii: %s\n"
+
+#: speaker-test/speaker-test.c:657
+#, c-format
+msgid "Can't recovery from suspend, prepare failed: %s\n"
+msgstr "Nepodarilo sa zotaviť z pozastavenia, chyba pri inicializácii: %s\n"
+
+#: speaker-test/speaker-test.c:721 speaker-test/speaker-test.c:1257
+#, c-format
+msgid "No enough memory\n"
+msgstr "Nedostatok pamäte\n"
+
+#: speaker-test/speaker-test.c:726
+#, c-format
+msgid "Cannot open WAV file %s\n"
+msgstr "Nepodarilo sa otvoriť súbor WAV %s\n"
+
+#: speaker-test/speaker-test.c:730 speaker-test/speaker-test.c:759
+#, c-format
+msgid "Invalid WAV file %s\n"
+msgstr "Neplatný súbor WAV %s\n"
+
+#: speaker-test/speaker-test.c:735
+#, c-format
+msgid "Not a WAV file: %s\n"
+msgstr "Toto nie je súbor WAV: %s\n"
+
+#: speaker-test/speaker-test.c:739
+#, c-format
+msgid "Unsupported WAV format %d for %s\n"
+msgstr "Neplatný formát WAV súboru %d v %s\n"
+
+#: speaker-test/speaker-test.c:744
+#, c-format
+msgid "%s is not a mono stream (%d channels)\n"
+msgstr "%s nie je monofónny prúd (%d kanálov)\n"
+
+#: speaker-test/speaker-test.c:749
+#, c-format
+msgid "Sample rate doesn't match (%d) for %s\n"
+msgstr "Frekvencia vzorkovania (%d) nesedí s %s\n"
+
+#: speaker-test/speaker-test.c:754
+#, c-format
+msgid "Unsupported sample format bits %d for %s\n"
+msgstr "Nepodporovaný formát vzorkovania s %d bitmi v %s\n"
+
+#: speaker-test/speaker-test.c:815
+#, c-format
+msgid "Undefined channel %d\n"
+msgstr "Kanál %d nie je definovaný\n"
+
+#: speaker-test/speaker-test.c:866
+#, c-format
+msgid "Write error: %d,%s\n"
+msgstr "Chyba pri zápise: %d, %s\n"
+
+#: speaker-test/speaker-test.c:868
+#, c-format
+msgid "xrun_recovery failed: %d,%s\n"
+msgstr "xrun_recovery zlyhalo: %d, %s\n"
+
+#: speaker-test/speaker-test.c:938
+#, c-format
+msgid "\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:982
+#, fuzzy, c-format
+#| msgid ""
+#| "Usage: speaker-test [OPTION]... \n"
+#| "-h,--help\thelp\n"
+#| "-D,--device\tplayback device\n"
+#| "-r,--rate\tstream rate in Hz\n"
+#| "-c,--channels\tcount of channels in stream\n"
+#| "-f,--frequency\tsine wave frequency in Hz\n"
+#| "-F,--format\tsample format\n"
+#| "-b,--buffer\tring buffer size in us\n"
+#| "-p,--period\tperiod size in us\n"
+#| "-P,--nperiods\tnumber of periods\n"
+#| "-t,--test\tpink=use pink noise, sine=use sine wave, wav=WAV file\n"
+#| "-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+#| "-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+#| "-w,--wavfile\tUse the given WAV file as a test sound\n"
+#| "-W,--wavdir\tSpecify the directory containing WAV files\n"
+#| "-m,--chmap\tSpecify the channel map to override\n"
+#| "-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+#| "-S,--scale\tScale of generated test tones in percent (default=80)\n"
+#| "\n"
+msgid ""
+"Usage: speaker-test [OPTION]... \n"
+"-h,--help\thelp\n"
+"-D,--device\tplayback device\n"
+"-r,--rate\tstream rate in Hz\n"
+"-c,--channels\tcount of channels in stream\n"
+"-f,--frequency\tsine wave frequency in Hz\n"
+"-F,--format\tsample format\n"
+"-b,--buffer\tring buffer size in us\n"
+"-p,--period\tperiod size in us\n"
+"-P,--nperiods\tnumber of periods\n"
+"-t,--test\tpink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 "
+"noise, wav=WAV file\n"
+"-l,--nloops\tspecify number of loops to test, 0 = infinite\n"
+"-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
+"-w,--wavfile\tUse the given WAV file as a test sound\n"
+"-W,--wavdir\tSpecify the directory containing WAV files\n"
+"-m,--chmap\tSpecify the channel map to override\n"
+"-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
+"-S,--scale\tScale of generated test tones in percent (default=80)\n"
+"\n"
+msgstr ""
+"Syntax: speaker-test [VOĽBA]... \n"
+"-h,--help\tpomocník\n"
+"-D,--device\tzariadenie prehrávania\n"
+"-r,--rate\tfrekvencia vzorkovania v Hz\n"
+"-c,--channels\tpočet kanálov v prúde\n"
+"-f,--frequency\tfrekvencia sínusovej vlny v Hz\n"
+"-F,--format\tformát vzorkovania\n"
+"-b,--buffer\tveľkosť ring buffera v µs\n"
+"-p,--period\tveľkosť periódy v µs\n"
+"-P,--nperiods\tpočet periód\n"
+"-t,--test\tpink=použiť ružový šum, sine=použiť sínusovú vlnu, wav=súbor WAV\n"
+"-l,--nloops\tpočet slučiek pre test, 0 = nekonečno\n"
+"-s,--speaker\totestovať samostatný reproduktor. Hodnoty: 1=ľavý, 2=pravý, "
+"atď.\n"
+"-w,--wavfile\tpoužiť zadaný WAV súbor pre testovanie\n"
+"-W,--wavdir\tpoužiť adresár obsahujúci súbory WAV\n"
+"-m,--chmap\tmapa kanálov, ktorá bude použitá\n"
+"-X,--force-frequency\tvynútiť frekvencie mimo rozsahu 30-8000 Hz\n"
+"-S,--scale\tškálovanie vygenerovaných testovacích tónov v percentách "
+"(predvolené=80)\n"
+"\n"
+
+#: speaker-test/speaker-test.c:1114
+#, c-format
+msgid "Invalid number of periods %d\n"
+msgstr "Neplatný počet periód %d\n"
+
+#: speaker-test/speaker-test.c:1127 speaker-test/speaker-test.c:1137
+#: speaker-test/speaker-test.c:1141
+#, c-format
+msgid "Invalid test type %s\n"
+msgstr "Neplatný typ testu %s\n"
+
+#: speaker-test/speaker-test.c:1174
+#, c-format
+msgid "Unknown option '%c'\n"
+msgstr "Neznáma voľba '%c'\n"
+
+#: speaker-test/speaker-test.c:1188
+#, c-format
+msgid "Invalid parameter for -s option.\n"
+msgstr "Neplatný parameter pre voľbu -s.\n"
+
+#: speaker-test/speaker-test.c:1203
+#, c-format
+msgid "Playback device is %s\n"
+msgstr "Zariadenie prehrávania je %s\n"
+
+#: speaker-test/speaker-test.c:1204
+#, c-format
+msgid "Stream parameters are %iHz, %s, %i channels\n"
+msgstr "Parametre prúdu sú %i Hz, %s, %i kanály\n"
+
+#: speaker-test/speaker-test.c:1207
+#, c-format
+msgid "Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"
+msgstr ""
+
+#: speaker-test/speaker-test.c:1210
+#, c-format
+msgid "Using 16 octaves of pink noise\n"
+msgstr "Používam 16 oktáv ružového šumu\n"
+
+#: speaker-test/speaker-test.c:1213
+#, c-format
+msgid "Sine wave rate is %.4fHz\n"
+msgstr "Frekvencia sínusovej vlny je %.4f Hz\n"
+
+#: speaker-test/speaker-test.c:1216
+#, c-format
+msgid "WAV file(s)\n"
+msgstr "Súbor(y) WAV\n"
+
+#: speaker-test/speaker-test.c:1226
+#, c-format
+msgid "Playback open error: %d,%s\n"
+msgstr "Chyba pri otváraní zariadenia prehrávania: %d, %s\n"
+
+#: speaker-test/speaker-test.c:1232
+#, c-format
+msgid "Setting of hwparams failed: %s\n"
+msgstr "Chyba pri nastavovaní hardvérových parametrov (hwparams): %s\n"
+
+#: speaker-test/speaker-test.c:1236
+#, c-format
+msgid "Setting of swparams failed: %s\n"
+msgstr "Chyba pri nastavovaní softvérových parametrov (swparams): %s\n"
+
+#: speaker-test/speaker-test.c:1282 speaker-test/speaker-test.c:1304
+#, c-format
+msgid "Transfer failed: %s\n"
+msgstr "Chyba pri prenose: %s\n"
+
+#: speaker-test/speaker-test.c:1290
+#, c-format
+msgid "Time per period = %lf\n"
+msgstr "Čas na periódu = %lf\n"
+
+#, c-format
+#~ msgid "service '%s' is not found in /etc/services\n"
+#~ msgstr "Služba '%s' nebola nájdená v /etc/services\n"
index 2c84cee..b0f628a 100644 (file)
@@ -1 +1 @@
-SUBDIRS=aconnect aplaymidi aseqdump aseqnet
+SUBDIRS=aconnect aplaymidi aseqdump aseqnet aseqsend
index 68dfad3..108da8b 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -50,29 +88,45 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = seq
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -80,12 +134,33 @@ am__can_run_installinfo = \
   esac
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       distdir
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -117,7 +192,11 @@ ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -135,11 +214,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -151,27 +237,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -184,6 +280,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -192,6 +289,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -202,7 +301,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -243,6 +344,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -253,8 +356,8 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
-SUBDIRS = aconnect aplaymidi aseqdump aseqnet
+xmlto_available = @xmlto_available@
+SUBDIRS = aconnect aplaymidi aseqdump aseqnet aseqsend
 all: all-recursive
 
 .SUFFIXES:
@@ -270,14 +373,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign seq/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign seq/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -289,20 +391,25 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run 'make' without going through this Makefile.
 # To change the values of 'make' variables: instead of editing Makefiles,
 # (1) if the variable is set in 'config.status', edit 'config.status'
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        case "$@" in \
@@ -323,31 +430,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
-cscopelist-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-       done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -363,12 +452,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -380,15 +464,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -397,9 +477,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
 
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -415,7 +496,10 @@ cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -507,7 +591,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-recursive
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-recursive
        -rm -f Makefile
@@ -559,7 +643,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-recursive
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-recursive
 
@@ -571,22 +655,22 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
-       cscopelist-recursive ctags-recursive install-am install-strip \
-       tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-am clean clean-generic cscopelist \
-       cscopelist-recursive ctags ctags-recursive distclean \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-pdf install-pdf-am \
-       install-ps install-ps-am install-strip installcheck \
-       installcheck-am installdirs installdirs-am maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-       pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool cscopelist-am ctags \
+       ctags-am distclean distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 2159c30..ca378ea 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,17 +90,19 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = aconnect$(EXEEXT)
 subdir = seq/aconnect
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -74,14 +114,45 @@ aconnect_OBJECTS = $(am_aconnect_OBJECTS)
 aconnect_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 aconnect_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/aconnect.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(aconnect_SOURCES)
 DIST_SOURCES = $(aconnect_SOURCES)
 am__can_run_installinfo = \
@@ -119,15 +190,37 @@ am__uninstall_files_from_dir = { \
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -145,11 +238,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -161,27 +261,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -194,6 +304,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -202,6 +313,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -212,7 +325,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -253,6 +368,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -263,7 +380,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 EXTRA_DIST = README.aconnect aconnect.1
 LDADD = $(LIBINTL)
@@ -272,7 +389,7 @@ man_MANS = aconnect.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -285,14 +402,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign seq/aconnect/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign seq/aconnect/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -312,10 +428,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -326,8 +444,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -336,16 +454,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 aconnect$(EXEEXT): $(aconnect_OBJECTS) $(aconnect_DEPENDENCIES) $(EXTRA_aconnect_DEPENDENCIES) 
        @rm -f aconnect$(EXEEXT)
-       $(LINK) $(aconnect_OBJECTS) $(aconnect_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(aconnect_OBJECTS) $(aconnect_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -353,21 +479,43 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aconnect.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aconnect.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -412,26 +560,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -443,15 +580,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -460,9 +593,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -478,20 +612,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -560,10 +684,10 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aconnect.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -609,13 +733,14 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aconnect.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -631,9 +756,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -641,9 +767,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 2050187..5c01519 100644 (file)
@@ -120,6 +120,9 @@ List existing output (writable) ports.
 This option is exclusive to
 .B \-i.
 .TP
+.B \-a, \-\-all
+List inactive ports, too.
+.TP
 .B \-l, \-\-list
 List the current connection status.  The connected and connecting ports
 from/to each port are listed together.
index 8d6cebb..7096feb 100644 (file)
@@ -15,6 +15,7 @@
  *
  */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
 #include <locale.h>
 #include <sys/ioctl.h>
 #include <alsa/asoundlib.h>
-#include "aconfig.h"
 #include "gettext.h"
 
+#ifdef SND_SEQ_PORT_CAP_INACTIVE
+#define HANDLE_SHOW_ALL
+static int show_all;
+#else
+#define show_all 0
+#endif
+
 static void error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...)
 {
        va_list arg;
@@ -60,6 +67,9 @@ static void usage(void)
        printf(_("   aconnect -i|-o [-options]\n"));
        printf(_("     -i,--input          list input (readable) ports\n"));
        printf(_("     -o,--output         list output (writable) ports\n"));
+#ifdef HANDLE_SHOW_ALL
+       printf(_("     -a,--all            show inactive ports, too\n"));
+#endif
        printf(_("     -l,--list           list current connections of each port\n"));
        printf(_(" * Remove all exported connections\n"));
        printf(_("     -x, --removeall\n"));
@@ -72,25 +82,38 @@ static void usage(void)
 #define LIST_INPUT     1
 #define LIST_OUTPUT    2
 
-#define perm_ok(pinfo,bits) ((snd_seq_port_info_get_capability(pinfo) & (bits)) == (bits))
+#define perm_ok(cap,bits) (((cap) & (bits)) == (bits))
+
+#ifdef SND_SEQ_PORT_DIR_INPUT
+static int check_direction(snd_seq_port_info_t *pinfo, int bit)
+{
+       int dir = snd_seq_port_info_get_direction(pinfo);
+       return !dir || (dir & bit);
+}
+#else
+#define check_direction(x, y)  1
+#endif
 
 static int check_permission(snd_seq_port_info_t *pinfo, int perm)
 {
-       if (perm) {
-               if (perm & LIST_INPUT) {
-                       if (perm_ok(pinfo, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ))
-                               goto __ok;
-               }
-               if (perm & LIST_OUTPUT) {
-                       if (perm_ok(pinfo, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE))
-                               goto __ok;
-               }
+       int cap = snd_seq_port_info_get_capability(pinfo);
+
+       if (cap & SND_SEQ_PORT_CAP_NO_EXPORT)
                return 0;
+
+       if (!perm)
+               return 1;
+       if (perm & LIST_INPUT) {
+               if (perm_ok(cap, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ) &&
+                   check_direction(pinfo, SND_SEQ_PORT_DIR_INPUT))
+                       return 1;
        }
- __ok:
-       if (snd_seq_port_info_get_capability(pinfo) & SND_SEQ_PORT_CAP_NO_EXPORT)
-               return 0;
-       return 1;
+       if (perm & LIST_OUTPUT) {
+               if (perm_ok(cap, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE) &&
+                   check_direction(pinfo, SND_SEQ_PORT_DIR_OUTPUT))
+                       return 1;
+       }
+       return 0;
 }
 
 /*
@@ -151,26 +174,63 @@ static void do_search_port(snd_seq_t *seq, int perm, action_func_t do_action)
                /* reset query info */
                snd_seq_port_info_set_client(pinfo, snd_seq_client_info_get_client(cinfo));
                snd_seq_port_info_set_port(pinfo, -1);
+#ifdef HANDLE_SHOW_ALL
+               if (show_all)
+                       snd_seq_port_info_set_capability(pinfo, SND_SEQ_PORT_CAP_INACTIVE);
+#endif
                count = 0;
                while (snd_seq_query_next_port(seq, pinfo) >= 0) {
                        if (check_permission(pinfo, perm)) {
                                do_action(seq, cinfo, pinfo, count);
                                count++;
                        }
+#ifdef HANDLE_SHOW_ALL
+                       if (show_all)
+                               snd_seq_port_info_set_capability(pinfo, SND_SEQ_PORT_CAP_INACTIVE);
+#endif
                }
        }
 }
 
 
-static void print_port(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
+static void print_port(snd_seq_t *seq ATTRIBUTE_UNUSED,
+                      snd_seq_client_info_t *cinfo,
                       snd_seq_port_info_t *pinfo, int count)
 {
        if (! count) {
-               printf(_("client %d: '%s' [type=%s]\n"),
+               int card = -1, pid = -1;
+
+               printf(_("client %d: '%s' [type=%s"),
                       snd_seq_client_info_get_client(cinfo),
                       snd_seq_client_info_get_name(cinfo),
                       (snd_seq_client_info_get_type(cinfo) == SND_SEQ_USER_CLIENT ?
                        _("user") : _("kernel")));
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               switch (snd_seq_client_info_get_midi_version(cinfo)) {
+               case SND_SEQ_CLIENT_UMP_MIDI_1_0:
+                       printf(",UMP-MIDI1");
+                       break;
+               case SND_SEQ_CLIENT_UMP_MIDI_2_0:
+                       printf(",UMP-MIDI2");
+                       break;
+               }
+#endif
+#ifdef HANDLE_SHOW_ALL
+               if (snd_seq_port_info_get_capability(pinfo) & SND_SEQ_PORT_CAP_INACTIVE)
+                       printf(",INACTIVE");
+#endif
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_CARD
+               card = snd_seq_client_info_get_card(cinfo);
+#endif
+               if (card != -1)
+                       printf(",card=%d", card);
+
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_PID
+               pid = snd_seq_client_info_get_pid(cinfo);
+#endif
+               if (pid != -1)
+                       printf(",pid=%d", pid);
+               printf("]\n");
        }
        printf("  %3d '%-16s'\n",
               snd_seq_port_info_get_port(pinfo),
@@ -188,8 +248,10 @@ static void print_port_and_subs(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
 /*
  * remove all (exported) connections
  */
-static void remove_connection(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
-                             snd_seq_port_info_t *pinfo, int count)
+static void remove_connection(snd_seq_t *seq,
+                             snd_seq_client_info_t *info ATTRIBUTE_UNUSED,
+                             snd_seq_port_info_t *pinfo,
+                             int count ATTRIBUTE_UNUSED)
 {
        snd_seq_query_subscribe_t *query;
        snd_seq_port_info_t *port;
@@ -236,6 +298,12 @@ enum {
        SUBSCRIBE, UNSUBSCRIBE, LIST, REMOVE_ALL
 };
 
+#ifdef HANDLE_SHOW_ALL
+#define ACONNECT_OPTS "dior:t:elxa"
+#else
+#define ACONNECT_OPTS "dior:t:elx"
+#endif
+
 static const struct option long_option[] = {
        {"disconnect", 0, NULL, 'd'},
        {"input", 0, NULL, 'i'},
@@ -245,6 +313,9 @@ static const struct option long_option[] = {
        {"exclusive", 0, NULL, 'e'},
        {"list", 0, NULL, 'l'},
        {"removeall", 0, NULL, 'x'},
+#ifdef HANDLE_SHOW_ALL
+       {"all", 0, NULL, 'a'},
+#endif
        {NULL, 0, NULL, 0},
 };
 
@@ -265,7 +336,7 @@ int main(int argc, char **argv)
        textdomain(PACKAGE);
 #endif
 
-       while ((c = getopt_long(argc, argv, "dior:t:elx", long_option, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, ACONNECT_OPTS, long_option, NULL)) != -1) {
                switch (c) {
                case 'd':
                        command = UNSUBSCRIBE;
@@ -298,6 +369,12 @@ int main(int argc, char **argv)
                case 'x':
                        command = REMOVE_ALL;
                        break;
+#ifdef HANDLE_SHOW_ALL
+               case 'a':
+                       command = LIST;
+                       show_all = 1;
+                       break;
+#endif
                default:
                        usage();
                        exit(1);
index 861140e..ab2e07d 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,17 +90,19 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = aplaymidi$(EXEEXT) arecordmidi$(EXEEXT)
 subdir = seq/aplaymidi
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -72,17 +112,49 @@ PROGRAMS = $(bin_PROGRAMS)
 aplaymidi_SOURCES = aplaymidi.c
 aplaymidi_OBJECTS = aplaymidi.$(OBJEXT)
 aplaymidi_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
 arecordmidi_SOURCES = arecordmidi.c
 arecordmidi_OBJECTS = arecordmidi.$(OBJEXT)
 arecordmidi_LDADD = $(LDADD)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/aplaymidi.Po \
+       ./$(DEPDIR)/arecordmidi.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = aplaymidi.c arecordmidi.c
 DIST_SOURCES = aplaymidi.c arecordmidi.c
 am__can_run_installinfo = \
@@ -120,15 +192,37 @@ am__uninstall_files_from_dir = { \
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -146,11 +240,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -162,27 +263,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -195,6 +306,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -203,6 +315,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -213,7 +327,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -254,6 +370,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -264,14 +382,14 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 EXTRA_DIST = aplaymidi.1 arecordmidi.1
 man_MANS = aplaymidi.1 arecordmidi.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -284,14 +402,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign seq/aplaymidi/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign seq/aplaymidi/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -311,10 +428,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -325,8 +444,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -335,19 +454,28 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 aplaymidi$(EXEEXT): $(aplaymidi_OBJECTS) $(aplaymidi_DEPENDENCIES) $(EXTRA_aplaymidi_DEPENDENCIES) 
        @rm -f aplaymidi$(EXEEXT)
-       $(LINK) $(aplaymidi_OBJECTS) $(aplaymidi_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(aplaymidi_OBJECTS) $(aplaymidi_LDADD) $(LIBS)
+
 arecordmidi$(EXEEXT): $(arecordmidi_OBJECTS) $(arecordmidi_DEPENDENCIES) $(EXTRA_arecordmidi_DEPENDENCIES) 
        @rm -f arecordmidi$(EXEEXT)
-       $(LINK) $(arecordmidi_OBJECTS) $(arecordmidi_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(arecordmidi_OBJECTS) $(arecordmidi_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -355,22 +483,44 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aplaymidi.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arecordmidi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aplaymidi.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arecordmidi.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -415,26 +565,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -446,15 +585,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -463,9 +598,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -481,20 +617,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -563,10 +689,11 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aplaymidi.Po
+       -rm -f ./$(DEPDIR)/arecordmidi.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -612,13 +739,15 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aplaymidi.Po
+       -rm -f ./$(DEPDIR)/arecordmidi.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -634,9 +763,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -644,9 +774,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 02fef9d..0c8238d 100644 (file)
@@ -31,6 +31,12 @@ Prints a list of possible output ports.
 Sets the sequencer port(s) to which the events in the MIDI file(s) are
 sent.
 
+.TP
+.I \-u, \-\-ump=version
+Changes the sequencer client to the given MIDI version and outputs via
+the UMP packets instead of legacy sequencer events.
+As of now, the only supported version is 1.
+
 A client can be specified by its number, its name, or a prefix of its
 name. A port is specified by its number; for port 0 of a client, the
 ":0" part of the port specification can be omitted.
index ad508b3..66038e2 100644 (file)
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /* TODO: sequencer queue timer selection */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <getopt.h>
 #include <unistd.h>
 #include <alsa/asoundlib.h>
-#include "aconfig.h"
 #include "version.h"
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+#include <alsa/ump_msg.h>
+#endif
 
 /*
  * 31.25 kbaud, one start bit, eight data bits, two stop bits.
@@ -75,6 +78,9 @@ static int file_offset;               /* current offset in input file */
 static int num_tracks;
 static struct track *tracks;
 static int smpte_timing;
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+static int ump_mode;
+#endif
 
 /* prints an error message to stderr */
 static void errormsg(const char *msg, ...)
@@ -618,7 +624,7 @@ static void handle_big_sysex(snd_seq_event_t *ev)
        if (length > MIDI_BYTES_PER_SEC)
                ev->data.ext.len = MIDI_BYTES_PER_SEC;
        event_size = snd_seq_event_length(ev);
-       if (event_size + 1 > snd_seq_get_output_buffer_size(seq)) {
+       if (event_size + 1 > (ssize_t)snd_seq_get_output_buffer_size(seq)) {
                err = snd_seq_drain_output(seq);
                check_snd("drain output", err);
                err = snd_seq_set_output_buffer_size(seq, event_size + 1);
@@ -633,14 +639,136 @@ static void handle_big_sysex(snd_seq_event_t *ev)
                check_snd("sync output", err);
                if (sleep(1))
                        fatal("aborted");
-               ev->data.ext.ptr += MIDI_BYTES_PER_SEC;
+               ev->data.ext.ptr = (char *)ev->data.ext.ptr + MIDI_BYTES_PER_SEC;
                length -= MIDI_BYTES_PER_SEC;
        }
        ev->data.ext.len = length;
 }
 
+static int fill_legacy_event(struct event* event, snd_seq_event_t *ev)
+{
+       ev->type = event->type;
+       switch (ev->type) {
+       case SND_SEQ_EVENT_NOTEON:
+       case SND_SEQ_EVENT_NOTEOFF:
+       case SND_SEQ_EVENT_KEYPRESS:
+               snd_seq_ev_set_fixed(ev);
+               ev->data.note.channel = event->data.d[0];
+               ev->data.note.note = event->data.d[1];
+               ev->data.note.velocity = event->data.d[2];
+               break;
+       case SND_SEQ_EVENT_CONTROLLER:
+               snd_seq_ev_set_fixed(ev);
+               ev->data.control.channel = event->data.d[0];
+               ev->data.control.param = event->data.d[1];
+               ev->data.control.value = event->data.d[2];
+               break;
+       case SND_SEQ_EVENT_PGMCHANGE:
+       case SND_SEQ_EVENT_CHANPRESS:
+               snd_seq_ev_set_fixed(ev);
+               ev->data.control.channel = event->data.d[0];
+               ev->data.control.value = event->data.d[1];
+               break;
+       case SND_SEQ_EVENT_PITCHBEND:
+               snd_seq_ev_set_fixed(ev);
+               ev->data.control.channel = event->data.d[0];
+               ev->data.control.value = ((event->data.d[1]) |
+                                         ((event->data.d[2]) << 7)) - 0x2000;
+               break;
+       case SND_SEQ_EVENT_SYSEX:
+               snd_seq_ev_set_variable(ev, event->data.length, event->sysex);
+               handle_big_sysex(ev);
+               break;
+       default:
+               fatal("Invalid event type %d!", ev->type);
+       }
+       return 0;
+}
+
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+static unsigned char to_ump_status(unsigned char ev_type)
+{
+       switch (ev_type) {
+       case SND_SEQ_EVENT_NOTEON:
+               return SND_UMP_MSG_NOTE_ON;
+       case SND_SEQ_EVENT_NOTEOFF:
+               return SND_UMP_MSG_NOTE_OFF;
+       case SND_SEQ_EVENT_KEYPRESS:
+               return SND_UMP_MSG_POLY_PRESSURE;
+       case SND_SEQ_EVENT_CONTROLLER:
+               return SND_UMP_MSG_CONTROL_CHANGE;
+       case SND_SEQ_EVENT_PGMCHANGE:
+               return SND_UMP_MSG_PROGRAM_CHANGE;
+       case SND_SEQ_EVENT_CHANPRESS:
+               return SND_UMP_MSG_CHANNEL_PRESSURE;
+       case SND_SEQ_EVENT_PITCHBEND:
+               return SND_UMP_MSG_PITCHBEND;
+       default:
+               return 0;
+       }
+}
+
+static int fill_ump_event(struct event* event, snd_seq_ump_event_t *ump_ev,
+                         const snd_seq_event_t *ev)
+{
+       snd_ump_msg_midi1_t ump = {};
+       unsigned char status = to_ump_status(event->type);
+
+       memcpy(ump_ev, ev, sizeof(*ev));
+       if (!status)
+               return 0; /* handle as is */
+
+       ump.note_on.type = SND_UMP_MSG_TYPE_MIDI1_CHANNEL_VOICE;
+       switch (event->type) {
+       case SND_SEQ_EVENT_NOTEON:
+               /* correct the note-on with velocity 0 to note-off;
+                * UMP may handle velocity 0 differently
+                */
+               if (!ev->data.note.velocity)
+                       status = SND_UMP_MSG_NOTE_OFF;
+               /* fallthrough */
+       case SND_SEQ_EVENT_NOTEOFF:
+       case SND_SEQ_EVENT_KEYPRESS:
+               ump.note_on.status = status;
+               ump.note_on.channel = event->data.d[0];
+               ump.note_on.note = event->data.d[1];
+               ump.note_on.velocity = event->data.d[2];
+               break;
+       case SND_SEQ_EVENT_CONTROLLER:
+               ump.control_change.status = status;
+               ump.control_change.channel = event->data.d[0];
+               ump.control_change.index = event->data.d[1];
+               ump.control_change.data = event->data.d[2];
+               break;
+       case SND_SEQ_EVENT_PGMCHANGE:
+               ump.program_change.status = status;
+               ump.program_change.channel = event->data.d[0];
+               ump.program_change.program = event->data.d[1];
+               break;
+       case SND_SEQ_EVENT_CHANPRESS:
+               ump.channel_pressure.status = status;
+               ump.channel_pressure.channel = event->data.d[0];
+               ump.channel_pressure.data = event->data.d[1];
+               break;
+       case SND_SEQ_EVENT_PITCHBEND:
+               ump.pitchbend.status = status;
+               ump.pitchbend.channel = event->data.d[0];
+               ump.pitchbend.data_msb = event->data.d[2];
+               ump.pitchbend.data_lsb = event->data.d[1];
+               break;
+       default:
+               return 0; /* handle as is */
+       }
+       snd_seq_ev_set_ump_data(ump_ev, &ump, sizeof(ump));
+       return 0;
+}
+#endif /* HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION */
+
 static void play_midi(void)
 {
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+       snd_seq_ump_event_t ump_ev;
+#endif
        snd_seq_event_t ev;
        int i, max_tick, err;
 
@@ -675,7 +803,7 @@ static void play_midi(void)
                for (i = 0; i < num_tracks; ++i) {
                        struct track *track = &tracks[i];
                        struct event *e2 = track->current_event;
-                       if (e2 && e2->tick < min_tick) {
+                       if (e2 && e2->tick < (unsigned int)min_tick) {
                                min_tick = e2->tick;
                                event = e2;
                                event_track = track;
@@ -688,52 +816,30 @@ static void play_midi(void)
                event_track->current_event = event->next;
 
                /* output the event */
-               ev.type = event->type;
                ev.time.tick = event->tick;
                ev.dest = ports[event->port];
-               switch (ev.type) {
-               case SND_SEQ_EVENT_NOTEON:
-               case SND_SEQ_EVENT_NOTEOFF:
-               case SND_SEQ_EVENT_KEYPRESS:
-                       snd_seq_ev_set_fixed(&ev);
-                       ev.data.note.channel = event->data.d[0];
-                       ev.data.note.note = event->data.d[1];
-                       ev.data.note.velocity = event->data.d[2];
-                       break;
-               case SND_SEQ_EVENT_CONTROLLER:
-                       snd_seq_ev_set_fixed(&ev);
-                       ev.data.control.channel = event->data.d[0];
-                       ev.data.control.param = event->data.d[1];
-                       ev.data.control.value = event->data.d[2];
-                       break;
-               case SND_SEQ_EVENT_PGMCHANGE:
-               case SND_SEQ_EVENT_CHANPRESS:
-                       snd_seq_ev_set_fixed(&ev);
-                       ev.data.control.channel = event->data.d[0];
-                       ev.data.control.value = event->data.d[1];
-                       break;
-               case SND_SEQ_EVENT_PITCHBEND:
-                       snd_seq_ev_set_fixed(&ev);
-                       ev.data.control.channel = event->data.d[0];
-                       ev.data.control.value =
-                               ((event->data.d[1]) |
-                                ((event->data.d[2]) << 7)) - 0x2000;
-                       break;
-               case SND_SEQ_EVENT_SYSEX:
-                       snd_seq_ev_set_variable(&ev, event->data.length,
-                                               event->sysex);
-                       handle_big_sysex(&ev);
-                       break;
-               case SND_SEQ_EVENT_TEMPO:
+               if (event->type == SND_SEQ_EVENT_TEMPO) {
                        snd_seq_ev_set_fixed(&ev);
+                       ev.type = event->type;
                        ev.dest.client = SND_SEQ_CLIENT_SYSTEM;
                        ev.dest.port = SND_SEQ_PORT_SYSTEM_TIMER;
                        ev.data.queue.queue = queue;
                        ev.data.queue.param.value = event->data.tempo;
-                       break;
-               default:
-                       fatal("Invalid event type %d!", ev.type);
+               } else {
+                       err = fill_legacy_event(event, &ev);
+                       if (err < 0)
+                               continue;
                }
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               if (ump_mode) {
+                       err = fill_ump_event(event, &ump_ev, &ev);
+                       if (err < 0)
+                               continue;
+                       err = snd_seq_ump_event_output(seq, &ump_ev);
+                       check_snd("output event", err);
+                       continue;
+               }
+#endif
 
                /* this blocks when the output pool has been filled */
                err = snd_seq_event_output(seq, &ev);
@@ -851,6 +957,9 @@ static void usage(const char *argv0)
                "-V, --version               print current version\n"
                "-l, --list                  list all possible output ports\n"
                "-p, --port=client:port,...  set port(s) to play to\n"
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               "-u, --ump=version           UMP output (only version=1 is supported)\n"
+#endif
                "-d, --delay=seconds         delay after song ends\n",
                argv0);
 }
@@ -860,16 +969,26 @@ static void version(void)
        puts("aplaymidi version " SND_UTIL_VERSION_STR);
 }
 
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+#define OPTIONS        "hVlp:d:u:"
+#else
+#define OPTIONS        "hVlp:d:"
+#endif
+
+
 int main(int argc, char *argv[])
 {
-       static const char short_options[] = "hVlp:d:";
+       static const char short_options[] = OPTIONS;
        static const struct option long_options[] = {
                {"help", 0, NULL, 'h'},
                {"version", 0, NULL, 'V'},
                {"list", 0, NULL, 'l'},
                {"port", 1, NULL, 'p'},
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               {"ump", 1, NULL, 'u'},
+#endif
                {"delay", 1, NULL, 'd'},
-               {}
+               {0}
        };
        int c;
        int do_list = 0;
@@ -894,12 +1013,30 @@ int main(int argc, char *argv[])
                case 'd':
                        end_delay = atoi(optarg);
                        break;
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               case 'u':
+                       if (strcmp(optarg, "1")) {
+                               errormsg("Only MIDI 1.0 is supported");
+                               return 1;
+                       }
+                       ump_mode = 1;
+                       break;
+#endif
                default:
                        usage(argv[0]);
                        return 1;
                }
        }
 
+
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+       if (ump_mode) {
+               int err;
+               err = snd_seq_set_client_midi_version(seq, SND_SEQ_CLIENT_UMP_MIDI_1_0);
+               check_snd("set midi version", err);
+       }
+#endif
+
        if (do_list) {
                list_ports();
        } else {
index 9628086..a4c1181 100644 (file)
@@ -16,7 +16,7 @@
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /* TODO: sequencer queue timer selection */
@@ -27,7 +27,7 @@
 #include <string.h>
 #include <signal.h>
 #include <getopt.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <alsa/asoundlib.h>
 #include "aconfig.h"
 #include "version.h"
@@ -86,6 +86,25 @@ static int ts_num = 4; /* time signature: numerator */
 static int ts_div = 4; /* time signature: denominator */
 static int ts_dd = 2; /* time signature: denominator as a power of two */
 
+/* Parse a decimal number from a command line argument. */
+static long arg_parse_decimal_num(const char *str, int *err)
+{
+       long val;
+       char *endptr;
+
+       errno = 0;
+       val = strtol(str, &endptr, 0);
+       if (errno > 0) {
+               *err = -errno;
+               return 0;
+       }
+       if (*endptr != '\0') {
+               *err = -EINVAL;
+               return 0;
+       }
+
+       return val;
+}
 
 /* prints an error message to stderr, and dies */
 static void fatal(const char *msg, ...)
@@ -436,7 +455,7 @@ static void record_port_numbers(void)
 
 static void record_event(const snd_seq_event_t *ev)
 {
-       unsigned int i;
+       int i;
        struct smf_track *track;
 
        /* ignore events without proper timestamps */
@@ -564,7 +583,7 @@ static void record_event(const snd_seq_event_t *ev)
                else
                        command(track, 0xf7), i = 0;
                var_value(track, ev->data.ext.len - i);
-               for (; i < ev->data.ext.len; ++i)
+               for (; i < (int)ev->data.ext.len; ++i)
                        add_byte(track, ((unsigned char*)ev->data.ext.ptr)[i]);
                break;
        default:
@@ -612,7 +631,7 @@ static void write_file(void)
        fwrite("MThd\0\0\0\6", 1, 8, file);
        /* type 0 or 1 */
        fputc(0, file);
-       fputc(used_tracks > 1, file);
+       fputc(used_tracks > 1 ? 1 : 0, file);
        /* number of tracks */
        fputc((used_tracks >> 8) & 0xff, file);
        fputc(used_tracks & 0xff, file);
@@ -690,7 +709,8 @@ static void help(const char *argv0)
                "  -t,--ticks=ticks           resolution in ticks per beat or frame\n"
                "  -s,--split-channels        create a track for each channel\n"
                "  -m,--metronome=client:port play a metronome signal\n"
-               "  -i,--timesig=nn:dd         time signature\n",
+               "  -i,--timesig=nn:dd         time signature\n"
+               "  -n,--num-events=events     fixed number of events to record, then exit\n",
                argv0);
 }
 
@@ -699,14 +719,14 @@ static void version(void)
        fputs("arecordmidi version " SND_UTIL_VERSION_STR "\n", stderr);
 }
 
-static void sighandler(int sig)
+static void sighandler(int sig ATTRIBUTE_UNUSED)
 {
        stop = 1;
 }
 
 int main(int argc, char *argv[])
 {
-       static const char short_options[] = "hVlp:b:f:t:sdm:i:";
+       static const char short_options[] = "hVlp:b:f:t:sdm:i:n:";
        static const struct option long_options[] = {
                {"help", 0, NULL, 'h'},
                {"version", 0, NULL, 'V'},
@@ -719,7 +739,8 @@ int main(int argc, char *argv[])
                {"dump", 0, NULL, 'd'},
                {"metronome", 1, NULL, 'm'},
                {"timesig", 1, NULL, 'i'},
-               { }
+               {"num-events", 1, NULL, 'n'},
+               {0}
        };
 
        char *filename = NULL;
@@ -727,6 +748,9 @@ int main(int argc, char *argv[])
        struct pollfd *pfds;
        int npfds;
        int c, err;
+       /* If |num_events| isn't specified, leave it at 0. */
+       long num_events = 0;
+       long events_received = 0;
 
        init_seq();
 
@@ -775,6 +799,16 @@ int main(int argc, char *argv[])
                case 'i':
                        time_signature(optarg);
                        break;
+               case 'n':
+                       err = 0;
+                       num_events = arg_parse_decimal_num(optarg, &err);
+                       if (err != 0) {
+                               fatal("Couldn't parse num_events argument: %s\n",
+                                       strerror(-err));
+                       }
+                       if (num_events <= 0)
+                               fatal("num_events must be greater than 0");
+                       break;
                default:
                        help(argv[0]);
                        return 1;
@@ -864,13 +898,20 @@ int main(int argc, char *argv[])
                        err = snd_seq_event_input(seq, &event);
                        if (err < 0)
                                break;
-                       if (event)
+                       if (event) {
                                record_event(event);
+                               events_received++;
+                       }
                } while (err > 0);
                if (stop)
                        break;
+               if (num_events && (events_received == num_events))
+                       break;
        }
 
+       if (num_events && events_received < num_events)
+               fputs("Warning: Received signal before num_events\n", stdout);
+
        finish_tracks();
        write_file();
 
index 17523a7..2a4d6df 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,17 +90,19 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = aseqdump$(EXEEXT)
 subdir = seq/aseqdump
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -72,14 +112,45 @@ PROGRAMS = $(bin_PROGRAMS)
 aseqdump_SOURCES = aseqdump.c
 aseqdump_OBJECTS = aseqdump.$(OBJEXT)
 aseqdump_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/aseqdump.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = aseqdump.c
 DIST_SOURCES = aseqdump.c
 am__can_run_installinfo = \
@@ -117,15 +188,37 @@ am__uninstall_files_from_dir = { \
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -143,11 +236,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -159,27 +259,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -192,6 +302,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -200,6 +311,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -210,7 +323,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -251,6 +366,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -261,14 +378,14 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 EXTRA_DIST = aseqdump.1
 man_MANS = aseqdump.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -281,14 +398,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign seq/aseqdump/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign seq/aseqdump/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -308,10 +424,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -322,8 +440,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -332,16 +450,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 aseqdump$(EXEEXT): $(aseqdump_OBJECTS) $(aseqdump_DEPENDENCIES) $(EXTRA_aseqdump_DEPENDENCIES) 
        @rm -f aseqdump$(EXEEXT)
-       $(LINK) $(aseqdump_OBJECTS) $(aseqdump_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(aseqdump_OBJECTS) $(aseqdump_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -349,21 +475,43 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aseqdump.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aseqdump.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -408,26 +556,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -439,15 +576,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -456,9 +589,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -474,20 +608,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -556,10 +680,10 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aseqdump.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -605,13 +729,14 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aseqdump.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -627,9 +752,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -637,9 +763,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index f6f2aa9..7b389bd 100644 (file)
@@ -28,6 +28,40 @@ Prints the current version.
 Prints a list of possible input ports.
 
 .TP
+.I \-u,\-\-ump=version
+Sets the client MIDI version.
+0 is for legacy mode, 1 is UMP MIDI 1.0 mode, and 2 is UMP MIDI 2.0 mode.
+
+.TP
+.I \-r,\-\-raw
+Suppress the automatic conversion of events among UMP and legacy clients.
+
+.TP
+.I \-R,\-\-raw-view
+Shows the raw values as is.
+The channel numbers and UMP group numbers are 0-based in this mode.
+This is the default behavior.
+
+.TP
+.I \-N,\-\-normalized-view
+Shows the normalized values to be aligned with MIDI 1.0.
+The channel numbers and UMP group numbers are shown as 1-based values,
+i.e. 1 is the lowest number.
+The velocity and data values are normalized between 0 and 127.
+The values for MIDI 2.0 are shown with two digits decimal points (from
+0.00 to 127.00).
+The pitch wheel is normalized between -8192 to 8192, too.
+
+.TP
+.I \-P,\-\-percent-view
+Shows the values in percentage.
+The channel numbers and UMP group numbers are shown as 1-based values
+in this mode, too.
+The velocity and data values are normalized between 0 and 100%, shown
+with two digits decimal points.
+The pitch wheel is normalized between -100% to 100%, too.
+
+.TP
 .I \-p,\-\-port=client:port,...
 Sets the sequencer port(s) from which events are received.
 
index 24c5d21..1b2fa43 100644 (file)
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <signal.h>
 #include <getopt.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <alsa/asoundlib.h>
-#include "aconfig.h"
 #include "version.h"
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+#include <alsa/ump_msg.h>
+#endif
+
+enum {
+       VIEW_RAW, VIEW_NORMALIZED, VIEW_PERCENT
+};
 
 static snd_seq_t *seq;
 static int port_count;
 static snd_seq_addr_t *ports;
 static volatile sig_atomic_t stop = 0;
-
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+static int ump_version;
+#else
+#define ump_version    0
+#endif
+static int view_mode = VIEW_RAW;
 
 /* prints an error message to stderr, and dies */
 static void fatal(const char *msg, ...)
@@ -128,53 +140,112 @@ static void connect_ports(void)
        }
 }
 
+static int channel_number(unsigned char c)
+{
+       if (view_mode != VIEW_RAW)
+               return c + 1;
+       else
+               return c;
+}
+
+static const char *midi1_data(unsigned int v)
+{
+       static char tmp[32];
+
+       if (view_mode == VIEW_PERCENT) {
+               if (v <= 64)
+                       snprintf(tmp, sizeof(tmp), "%.2f%%",
+                                ((double)v * 50.0) / 64);
+               else
+                       snprintf(tmp, sizeof(tmp), "%.2f%%",
+                                ((double)(v - 64) * 50.0) / 63 + 50.0);
+               return tmp;
+       }
+
+       sprintf(tmp, "%d", v);
+       return tmp;
+}
+
+static const char *midi1_pitchbend(int v)
+{
+       static char tmp[32];
+
+       if (view_mode == VIEW_PERCENT) {
+               if (v < 0)
+                       snprintf(tmp, sizeof(tmp), "%.2f%%",
+                                ((double)v * 100.0) / 8192);
+               else
+                       snprintf(tmp, sizeof(tmp), "%.2f%%",
+                                ((double)v * 100.0) / 8191);
+               return tmp;
+       }
+
+       sprintf(tmp, "%d", v);
+       return tmp;
+}
+
 static void dump_event(const snd_seq_event_t *ev)
 {
        printf("%3d:%-3d ", ev->source.client, ev->source.port);
+
        switch (ev->type) {
        case SND_SEQ_EVENT_NOTEON:
                if (ev->data.note.velocity)
-                       printf("Note on                %2d, note %d, velocity %d\n",
-                              ev->data.note.channel, ev->data.note.note, ev->data.note.velocity);
+                       printf("Note on                %2d, note %d, velocity %s\n",
+                              channel_number(ev->data.note.channel),
+                              ev->data.note.note,
+                              midi1_data(ev->data.note.velocity));
                else
                        printf("Note off               %2d, note %d\n",
-                              ev->data.note.channel, ev->data.note.note);
+                              channel_number(ev->data.note.channel),
+                              ev->data.note.note);
                break;
        case SND_SEQ_EVENT_NOTEOFF:
-               printf("Note off               %2d, note %d, velocity %d\n",
-                      ev->data.note.channel, ev->data.note.note, ev->data.note.velocity);
+               printf("Note off               %2d, note %d, velocity %s\n",
+                      channel_number(ev->data.note.channel),
+                      ev->data.note.note,
+                      midi1_data(ev->data.note.velocity));
                break;
        case SND_SEQ_EVENT_KEYPRESS:
-               printf("Polyphonic aftertouch  %2d, note %d, value %d\n",
-                      ev->data.note.channel, ev->data.note.note, ev->data.note.velocity);
+               printf("Polyphonic aftertouch  %2d, note %d, value %s\n",
+                      channel_number(ev->data.note.channel),
+                      ev->data.note.note,
+                      midi1_data(ev->data.note.velocity));
                break;
        case SND_SEQ_EVENT_CONTROLLER:
                printf("Control change         %2d, controller %d, value %d\n",
-                      ev->data.control.channel, ev->data.control.param, ev->data.control.value);
+                      channel_number(ev->data.control.channel),
+                      ev->data.control.param, ev->data.control.value);
                break;
        case SND_SEQ_EVENT_PGMCHANGE:
                printf("Program change         %2d, program %d\n",
-                      ev->data.control.channel, ev->data.control.value);
+                      channel_number(ev->data.control.channel),
+                      ev->data.control.value);
                break;
        case SND_SEQ_EVENT_CHANPRESS:
-               printf("Channel aftertouch     %2d, value %d\n",
-                      ev->data.control.channel, ev->data.control.value);
+               printf("Channel aftertouch     %2d, value %s\n",
+                      channel_number(ev->data.control.channel),
+                      midi1_data(ev->data.control.value));
                break;
        case SND_SEQ_EVENT_PITCHBEND:
-               printf("Pitch bend             %2d, value %d\n",
-                      ev->data.control.channel, ev->data.control.value);
+               printf("Pitch bend             %2d, value %s\n",
+                      channel_number(ev->data.control.channel),
+                      midi1_pitchbend(ev->data.control.value));
                break;
        case SND_SEQ_EVENT_CONTROL14:
                printf("Control change         %2d, controller %d, value %5d\n",
-                      ev->data.control.channel, ev->data.control.param, ev->data.control.value);
+                      channel_number(ev->data.control.channel),
+                      ev->data.control.param, ev->data.control.value);
                break;
        case SND_SEQ_EVENT_NONREGPARAM:
                printf("Non-reg. parameter     %2d, parameter %d, value %d\n",
-                      ev->data.control.channel, ev->data.control.param, ev->data.control.value);
+                      channel_number(ev->data.control.channel),
+                      ev->data.control.param, ev->data.control.value);
                break;
        case SND_SEQ_EVENT_REGPARAM:
                printf("Reg. parameter         %2d, parameter %d, value %d\n",
-                      ev->data.control.channel, ev->data.control.param, ev->data.control.value);
+                      channel_number(ev->data.control.channel),
+                      ev->data.control.param, ev->data.control.value);
                break;
        case SND_SEQ_EVENT_SONGPOS:
                printf("Song position pointer      value %d\n",
@@ -297,6 +368,339 @@ static void dump_event(const snd_seq_event_t *ev)
        }
 }
 
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+static int group_number(unsigned char c)
+{
+       if (view_mode != VIEW_RAW)
+               return c + 1;
+       else
+               return c;
+}
+
+static const char *pitchbend_value(uint8_t msb, uint8_t lsb)
+{
+       int pb = (msb << 7) | lsb;
+
+       return midi1_pitchbend(pb - 8192);
+}
+
+static void dump_ump_midi1_event(const unsigned int *ump)
+{
+       const snd_ump_msg_midi1_t *m = (const snd_ump_msg_midi1_t *)ump;
+       unsigned char group = group_number(m->hdr.group);
+       unsigned char status = m->hdr.status;
+       unsigned char channel = channel_number(m->hdr.channel);
+
+       printf("Group %2d, ", group);
+       switch (status) {
+       case SND_UMP_MSG_NOTE_OFF:
+               printf("Note off               %2d, note %d, velocity %s",
+                      channel, m->note_off.note,
+                      midi1_data(m->note_off.velocity));
+               break;
+       case SND_UMP_MSG_NOTE_ON:
+               printf("Note on                %2d, note %d, velocity %s",
+                      channel, m->note_off.note,
+                      midi1_data(m->note_off.velocity));
+               break;
+       case SND_UMP_MSG_POLY_PRESSURE:
+               printf("Poly pressure          %2d, note %d, value %s",
+                      channel, m->poly_pressure.note,
+                      midi1_data(m->poly_pressure.data));
+               break;
+       case SND_UMP_MSG_CONTROL_CHANGE:
+               printf("Control change         %2d, controller %d, value %d",
+                      channel, m->control_change.index, m->control_change.data);
+               break;
+       case SND_UMP_MSG_PROGRAM_CHANGE:
+               printf("Program change         %2d, program %d",
+                      channel, m->program_change.program);
+               break;
+       case SND_UMP_MSG_CHANNEL_PRESSURE:
+               printf("Channel pressure       %2d, value %s",
+                      channel, midi1_data(m->channel_pressure.data));
+               break;
+       case SND_UMP_MSG_PITCHBEND:
+               printf("Pitchbend              %2d, value %s",
+                      channel, pitchbend_value(m->pitchbend.data_msb,
+                                               m->pitchbend.data_lsb));
+               break;
+       default:
+               printf("UMP MIDI1 event: status = %d, channel = %d, 0x%08x",
+                      status, channel, *ump);
+               break;
+       }
+       printf("\n");
+}
+
+static const char *midi2_velocity(unsigned int v)
+{
+       static char tmp[32];
+
+       if (view_mode == VIEW_NORMALIZED) {
+               if (v <= 0x8000)
+                       snprintf(tmp, sizeof(tmp), "%.2f",
+                                ((double)v * 64.0) / 0x8000);
+               else
+                       snprintf(tmp, sizeof(tmp), ".2%f",
+                                ((double)(v - 0x8000) * 63.0) / 0x7fff + 64.0);
+               return tmp;
+       } else if (view_mode == VIEW_PERCENT) {
+               snprintf(tmp, sizeof(tmp), "%.2f%%", ((double)v * 100.0) / 0xffff);
+               return tmp;
+       }
+
+       sprintf(tmp, "0x%x", v);
+       return tmp;
+}
+
+static const char *midi2_data(unsigned int v)
+{
+       static char tmp[32];
+
+       if (view_mode == VIEW_NORMALIZED) {
+               if (!v)
+                       return "0";
+               else if (v == 0xffffffffU)
+                       return "127";
+               if (v <= 0x80000000)
+                       snprintf(tmp, sizeof(tmp), "%.2f",
+                                ((double)v * 64.0) / 0x80000000U);
+               else
+                       snprintf(tmp, sizeof(tmp), "%.2f",
+                                ((double)(v - 0x80000000U) * 63.0) / 0x7fffffffU + 64.0);
+               return tmp;
+       } else if (view_mode == VIEW_PERCENT) {
+               snprintf(tmp, sizeof(tmp), "%.2f%%", ((double)v * 100.0) / 0xffffffffU);
+               return tmp;
+       }
+
+       sprintf(tmp, "0x%x", v);
+       return tmp;
+}
+
+static const char *midi2_pitchbend(unsigned int v)
+{
+       static char tmp[32];
+
+       if (view_mode == VIEW_NORMALIZED) {
+               if (!v)
+                       return "-8192";
+               else if (v == 0xffffffffU)
+                       return "8191";
+               if (v <= 0x80000000)
+                       snprintf(tmp, sizeof(tmp), "%.2f",
+                                ((int)(v ^ 0x80000000U) * 8192.0) / 0x80000000U);
+               else
+                       snprintf(tmp, sizeof(tmp), "%.2f",
+                                ((double)(v - 0x80000000U) * 8191.0) / 0x7fffffffU + 8192.0);
+               return tmp;
+       } else if (view_mode == VIEW_PERCENT) {
+               snprintf(tmp, sizeof(tmp), "%.2f%%", ((int)(v ^ 0x80000000U) * 100.0) / 0xffffffffU);
+               return tmp;
+       }
+
+       sprintf(tmp, "0x%x", v);
+       return tmp;
+}
+
+static void dump_ump_midi2_event(const unsigned int *ump)
+{
+       const snd_ump_msg_midi2_t *m = (const snd_ump_msg_midi2_t *)ump;
+       unsigned char group = group_number(m->hdr.group);
+       unsigned char status = m->hdr.status;
+       unsigned char channel = channel_number(m->hdr.channel);
+
+       printf("Group %2d, ", group);
+       switch (status) {
+       case SND_UMP_MSG_PER_NOTE_RCC:
+               printf("Per-note RCC           %2d, note %u, index %u, value 0x%x",
+                      channel, m->per_note_rcc.note,
+                      m->per_note_rcc.index, m->per_note_rcc.data);
+               break;
+       case SND_UMP_MSG_PER_NOTE_ACC:
+               printf("Per-note ACC           %2d, note %u, index %u, value 0x%x",
+                      channel, m->per_note_acc.note,
+                      m->per_note_acc.index, m->per_note_acc.data);
+               break;
+       case SND_UMP_MSG_RPN:
+               printf("RPN                    %2d, bank %u:%u, value 0x%x",
+                      channel, m->rpn.bank, m->rpn.index, m->rpn.data);
+               break;
+       case SND_UMP_MSG_NRPN:
+               printf("NRPN                   %2d, bank %u:%u, value 0x%x",
+                      channel, m->rpn.bank, m->rpn.index, m->rpn.data);
+               break;
+       case SND_UMP_MSG_RELATIVE_RPN:
+               printf("relative RPN           %2d, bank %u:%u, value 0x%x",
+                      channel, m->rpn.bank, m->rpn.index, m->rpn.data);
+               break;
+       case SND_UMP_MSG_RELATIVE_NRPN:
+               printf("relative NRP           %2d, bank %u:%u, value 0x%x",
+                      channel, m->rpn.bank, m->rpn.index, m->rpn.data);
+               break;
+       case SND_UMP_MSG_PER_NOTE_PITCHBEND:
+               printf("Per-note pitchbend     %2d, note %d, value %s",
+                      channel, m->per_note_pitchbend.note,
+                      midi2_pitchbend(m->per_note_pitchbend.data));
+               break;
+       case SND_UMP_MSG_NOTE_OFF:
+               printf("Note off               %2d, note %d, velocity %s, attr type = %d, data = 0x%x",
+                      channel, m->note_off.note,
+                      midi2_velocity(m->note_off.velocity),
+                      m->note_off.attr_type, m->note_off.attr_data);
+               break;
+       case SND_UMP_MSG_NOTE_ON:
+               printf("Note on                %2d, note %d, velocity %s, attr type = %d, data = 0x%x",
+                      channel, m->note_off.note,
+                      midi2_velocity(m->note_off.velocity),
+                      m->note_off.attr_type, m->note_off.attr_data);
+               break;
+       case SND_UMP_MSG_POLY_PRESSURE:
+               printf("Poly pressure          %2d, note %d, value %s",
+                      channel, m->poly_pressure.note,
+                      midi2_data(m->poly_pressure.data));
+               break;
+       case SND_UMP_MSG_CONTROL_CHANGE:
+               printf("Control change         %2d, controller %d, value 0x%x",
+                      channel, m->control_change.index, m->control_change.data);
+               break;
+       case SND_UMP_MSG_PROGRAM_CHANGE:
+               printf("Program change         %2d, program %d",
+                      channel, m->program_change.program);
+               if (m->program_change.bank_valid)
+                       printf(", Bank select %d:%d",
+                              m->program_change.bank_msb,
+                              m->program_change.bank_lsb);
+               break;
+       case SND_UMP_MSG_CHANNEL_PRESSURE:
+               printf("Channel pressure       %2d, value %s",
+                      channel,
+                      midi2_data(m->channel_pressure.data));
+               break;
+       case SND_UMP_MSG_PITCHBEND:
+               printf("Channel pressure       %2d, value %s",
+                      channel,
+                      midi2_pitchbend(m->channel_pressure.data));
+               break;
+       case SND_UMP_MSG_PER_NOTE_MGMT:
+               printf("Per-note management    %2d, value 0x%x",
+                      channel, m->per_note_mgmt.flags);
+               break;
+       default:
+               printf("UMP MIDI2 event: status = %d, channel = %d, 0x%08x",
+                      status, channel, *ump);
+               break;
+       }
+       printf("\n");
+}
+
+static void dump_ump_utility_event(const unsigned int *ump)
+{
+       unsigned char status = snd_ump_msg_status(ump);
+       unsigned int val = *ump & 0xfffff;
+
+       printf("          ");
+       switch (status) {
+       case SND_UMP_UTILITY_MSG_STATUS_NOOP:
+               printf("Noop\n");
+               break;
+       case SND_UMP_UTILITY_MSG_STATUS_JR_CLOCK:
+               printf("JR Clock               value %d\n", val);
+               break;
+       case SND_UMP_UTILITY_MSG_STATUS_JR_TSTAMP:
+               printf("JR Timestamp           value %d\n", val);
+               break;
+       case SND_UMP_UTILITY_MSG_STATUS_DCTPQ:
+               printf("DCTPQ                  value %d\n", val);
+               break;
+       case SND_UMP_UTILITY_MSG_STATUS_DC:
+               printf("DC Ticks               value %d\n", val);
+               break;
+       default:
+               printf("UMP Utility event: status = %d, 0x%08x\n",
+                      status, *ump);
+               break;
+       }
+}
+
+static void dump_ump_system_event(const unsigned int *ump)
+{
+       const snd_ump_msg_system_t *m = (const snd_ump_msg_system_t *)ump;
+
+       printf("Group %2d, ", group_number(m->group));
+       switch (m->status) {
+       case SND_UMP_MSG_MIDI_TIME_CODE:
+               printf("MIDI Time Code         value %d\n", m->parm1);
+               break;
+       case SND_UMP_MSG_SONG_POSITION:
+               printf("Song position pointer  value %d\n",
+                      ((unsigned int)m->parm2 << 7) | m->parm1);
+               break;
+       case SND_UMP_MSG_SONG_SELECT:
+               printf("Song select            value %d\n", m->parm1);
+               break;
+       case SND_UMP_MSG_TUNE_REQUEST:
+               printf("Tune request\n");
+               break;
+       case SND_UMP_MSG_TIMING_CLOCK:
+               printf("Timing clock\n");
+               break;
+       case SND_UMP_MSG_START:
+               printf("Start\n");
+               break;
+       case SND_UMP_MSG_CONTINUE:
+               printf("Continue\n");
+               break;
+       case SND_UMP_MSG_STOP:
+               printf("Stop\n");
+               break;
+       case SND_UMP_MSG_ACTIVE_SENSING:
+               printf("Active sensing\n");
+               break;
+       case SND_UMP_MSG_RESET:
+               printf("Reset\n");
+               break;
+       default:
+               printf("UMP System event: status = %d, 0x%08x\n",
+                      m->status, *ump);
+               break;
+       }
+}
+
+static void dump_ump_event(const snd_seq_ump_event_t *ev)
+{
+       if (!snd_seq_ev_is_ump(ev)) {
+               dump_event((const snd_seq_event_t *)ev);
+               return;
+       }
+
+       printf("%3d:%-3d ", ev->source.client, ev->source.port);
+
+       switch (snd_ump_msg_type(ev->ump)) {
+       case SND_UMP_MSG_TYPE_UTILITY:
+               dump_ump_utility_event(ev->ump);
+               break;
+       case SND_UMP_MSG_TYPE_SYSTEM:
+               dump_ump_system_event(ev->ump);
+               break;
+       case SND_UMP_MSG_TYPE_MIDI1_CHANNEL_VOICE:
+               dump_ump_midi1_event(ev->ump);
+               break;
+       case SND_UMP_MSG_TYPE_MIDI2_CHANNEL_VOICE:
+               dump_ump_midi2_event(ev->ump);
+               break;
+       default:
+               printf("UMP event: type = %d, group = %d, status = %d, 0x%08x\n",
+                      snd_ump_msg_type(ev->ump),
+                      snd_ump_msg_group(ev->ump),
+                      snd_ump_msg_status(ev->ump),
+                      *ev->ump);
+               break;
+       }
+}
+#endif /* HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION */
+
 static void list_ports(void)
 {
        snd_seq_client_info_t *cinfo;
@@ -335,6 +739,13 @@ static void help(const char *argv0)
                "  -h,--help                  this help\n"
                "  -V,--version               show version\n"
                "  -l,--list                  list input ports\n"
+               "  -N,--normalized-view       show normalized values\n"
+               "  -P,--percent-view          show percent values\n"
+               "  -R,--raw-view              show raw values (default)\n"
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               "  -u,--ump=version           set client MIDI version (0=legacy, 1= UMP MIDI 1.0, 2=UMP MIDI2.0)\n"
+               "  -r,--raw                   do not convert UMP and legacy events\n"
+#endif
                "  -p,--port=client:port,...  source port(s)\n",
                argv0);
 }
@@ -344,20 +755,31 @@ static void version(void)
        puts("aseqdump version " SND_UTIL_VERSION_STR);
 }
 
-static void sighandler(int sig)
+static void sighandler(int sig ATTRIBUTE_UNUSED)
 {
        stop = 1;
 }
 
 int main(int argc, char *argv[])
 {
-       static const char short_options[] = "hVlp:";
+       static const char short_options[] = "hVlp:NPR"
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               "u:r"
+#endif
+               ;
        static const struct option long_options[] = {
                {"help", 0, NULL, 'h'},
                {"version", 0, NULL, 'V'},
                {"list", 0, NULL, 'l'},
                {"port", 1, NULL, 'p'},
-               { }
+               {"normalized-view", 0, NULL, 'N'},
+               {"percent-view", 0, NULL, 'P'},
+               {"raw-view", 0, NULL, 'R'},
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               {"ump", 1, NULL, 'u'},
+               {"raw", 0, NULL, 'r'},
+#endif
+               {0}
        };
 
        int do_list = 0;
@@ -382,6 +804,24 @@ int main(int argc, char *argv[])
                case 'p':
                        parse_ports(optarg);
                        break;
+               case 'R':
+                       view_mode = VIEW_RAW;
+                       break;
+               case 'P':
+                       view_mode = VIEW_PERCENT;
+                       break;
+               case 'N':
+                       view_mode = VIEW_NORMALIZED;
+                       break;
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+               case 'u':
+                       ump_version = atoi(optarg);
+                       snd_seq_set_client_midi_version(seq, ump_version);
+                       break;
+               case 'r':
+                       snd_seq_set_client_ump_conversion(seq, 0);
+                       break;
+#endif
                default:
                        help(argv[0]);
                        return 1;
@@ -409,7 +849,8 @@ int main(int argc, char *argv[])
                printf("Waiting for data at port %d:0.",
                       snd_seq_client_id(seq));
        printf(" Press Ctrl+C to end.\n");
-       printf("Source  Event                  Ch  Data\n");
+       printf("Source  %sEvent                  Ch  Data\n",
+              ump_version ? "Group    " : "");
        
        signal(SIGINT, sighandler);
        signal(SIGTERM, sighandler);
@@ -420,14 +861,26 @@ int main(int argc, char *argv[])
                snd_seq_poll_descriptors(seq, pfds, npfds, POLLIN);
                if (poll(pfds, npfds, -1) < 0)
                        break;
-               do {
+               for (;;) {
                        snd_seq_event_t *event;
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_MIDI_VERSION
+                       snd_seq_ump_event_t *ump_ev;
+                       if (ump_version > 0) {
+                               err = snd_seq_ump_event_input(seq, &ump_ev);
+                               if (err < 0)
+                                       break;
+                               if (ump_ev)
+                                       dump_ump_event(ump_ev);
+                               continue;
+                       }
+#endif
+
                        err = snd_seq_event_input(seq, &event);
                        if (err < 0)
                                break;
                        if (event)
                                dump_event(event);
-               } while (err > 0);
+               }
                fflush(stdout);
                if (stop)
                        break;
index a84982c..4b21067 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,17 +90,19 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = aseqnet$(EXEEXT)
 subdir = seq/aseqnet
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
@@ -73,14 +113,45 @@ am_aseqnet_OBJECTS = aseqnet.$(OBJEXT)
 aseqnet_OBJECTS = $(am_aseqnet_OBJECTS)
 am__DEPENDENCIES_1 =
 aseqnet_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/aseqnet.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(aseqnet_SOURCES)
 DIST_SOURCES = $(aseqnet_SOURCES)
 am__can_run_installinfo = \
@@ -118,15 +189,37 @@ am__uninstall_files_from_dir = { \
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -144,11 +237,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -160,27 +260,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -193,6 +303,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -201,6 +312,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -211,7 +324,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -252,6 +367,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -262,7 +379,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 EXTRA_DIST = README.aseqnet aseqnet.1
 aseqnet_SOURCES = aseqnet.c
@@ -271,7 +388,7 @@ man_MANS = aseqnet.1
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -284,14 +401,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign seq/aseqnet/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign seq/aseqnet/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -311,10 +427,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -325,8 +443,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -335,16 +453,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 aseqnet$(EXEEXT): $(aseqnet_OBJECTS) $(aseqnet_DEPENDENCIES) $(EXTRA_aseqnet_DEPENDENCIES) 
        @rm -f aseqnet$(EXEEXT)
-       $(LINK) $(aseqnet_OBJECTS) $(aseqnet_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(aseqnet_OBJECTS) $(aseqnet_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -352,21 +478,43 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aseqnet.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aseqnet.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -411,26 +559,15 @@ uninstall-man1:
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -442,15 +579,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -459,9 +592,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -477,20 +611,10 @@ cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -559,10 +683,10 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aseqnet.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -608,13 +732,14 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/aseqnet.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -630,9 +755,10 @@ uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist ctags distclean distclean-compile \
-       distclean-generic distclean-tags distdir dvi dvi-am html \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-binPROGRAMS \
        install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
@@ -640,9 +766,11 @@ uninstall-man: uninstall-man1
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-man uninstall-man1
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index bd0b68e..6a627f4 100644 (file)
@@ -50,4 +50,6 @@ The available options are:
   -s addr : explicit read-subscription to the given address
             (client:addr).
   -d addr : explicit write-subscription to the given address.
+  -n name : specify the midi name of the process.
+            Default value is either 'Net Client' or 'Net Server'.
   -v      : verbose mode.
index 2cb6eb7..6ed3911 100644 (file)
@@ -70,6 +70,9 @@ Subscribe to the given address for read automatically.
 .B \-d addr
 Subscribe to the given address for write automatically.
 .TP
+.B \-n name
+Specify the midi name of the process.
+.TP
 .B \-v
 Verbose mode.
 
index 70a1cfd..aa70b50 100644 (file)
  *
  */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
+#include <arpa/inet.h>
 #include <netdb.h>
 #include <locale.h>
 #include <alsa/asoundlib.h>
 #include <getopt.h>
 #include <signal.h>
 #include <assert.h>
-#include "aconfig.h"
 #include "gettext.h"
 
 /*
@@ -37,11 +38,10 @@ static void usage(void);
 static void init_buf(void);
 static void init_pollfds(void);
 static void close_files(void);
-static void init_seq(char *source, char *dest);
-static int get_port(char *service);
+static void init_seq(char *source, char *dest, char *name);
 static void sigterm_exit(int sig);
-static void init_server(int port);
-static void init_client(char *server, int port);
+static void init_server(const char *port);
+static void init_client(const char *server, const char *port);
 static void do_loop(void);
 static int copy_local_to_remote(void);
 static int copy_remote_to_local(int fd);
@@ -49,7 +49,7 @@ static int copy_remote_to_local(int fd);
 /*
  * default TCP port number
  */
-#define DEFAULT_PORT   40002
+#define DEFAULT_PORT   "40002"
 
 /*
  * local input buffer
@@ -75,6 +75,7 @@ static int cur_connected;
 static int seq_port;
 
 static int server_mode;
+static int ipv6 = 0;
 static int verbose = 0;
 static int info = 0;
 
@@ -84,9 +85,11 @@ static int info = 0;
  */
 
 static const struct option long_option[] = {
+       {"ipv6", 0, NULL, '6'},
        {"port", 1, NULL, 'p'},
        {"source", 1, NULL, 's'},
        {"dest", 1, NULL, 'd'},
+       {"name", 1, NULL, 'n'},
        {"help", 0, NULL, 'h'},
        {"verbose", 0, NULL, 'v'},
        {"info", 0, NULL, 'i'},
@@ -96,21 +99,22 @@ static const struct option long_option[] = {
 int main(int argc, char **argv)
 {
        int c;
-       int port = DEFAULT_PORT;
+       char *port = DEFAULT_PORT;
        char *source = NULL, *dest = NULL;
+       char *name = NULL;
 
 #ifdef ENABLE_NLS
        setlocale(LC_ALL, "");
        textdomain(PACKAGE);
 #endif
 
-       while ((c = getopt_long(argc, argv, "p:s:d:vi", long_option, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "p:s:d:n:6hvi", long_option, NULL)) != -1) {
                switch (c) {
+               case '6':
+                       ipv6 = 1;
+                       break;
                case 'p':
-                       if (isdigit(*optarg))
-                               port = atoi(optarg);
-                       else
-                               port = get_port(optarg);
+                       port = optarg;
                        break;
                case 's':
                        source = optarg;
@@ -118,6 +122,9 @@ int main(int argc, char **argv)
                case 'd':
                        dest = optarg;
                        break;
+               case 'n':
+                       name = optarg;
+                       break;
                case 'v':
                        verbose++;
                        break;
@@ -134,7 +141,7 @@ int main(int argc, char **argv)
        signal(SIGTERM, sigterm_exit);
 
        init_buf();
-       init_seq(source, dest);
+       init_seq(source, dest, name);
 
        if (optind >= argc) {
                server_mode = 1;
@@ -167,9 +174,11 @@ static void usage(void)
        printf(_("  server mode: aseqnet [-options]\n"));
        printf(_("  client mode: aseqnet [-options] server_host\n"));
        printf(_("options:\n"));
+       printf(_("  -6,--ipv6 : use IPv6 TCP protocol\n"));
        printf(_("  -p,--port # : specify TCP port (digit or service name)\n"));
        printf(_("  -s,--source addr : read from given addr (client:port)\n"));
        printf(_("  -d,--dest addr : write to given addr (client:port)\n"));
+       printf(_("  -n,--name value : use a specific midi process name\n"));
        printf(_("  -v, --verbose : print verbose messages\n"));
        printf(_("  -i, --info : print certain received events\n"));
 }
@@ -223,7 +232,7 @@ static void close_files(void)
 /*
  * initialize sequencer
  */
-static void init_seq(char *source, char *dest)
+static void init_seq(char *source, char *dest, char* name)
 {
        snd_seq_addr_t addr;
        int err, counti, counto;
@@ -252,10 +261,14 @@ static void init_seq(char *source, char *dest)
        snd_seq_nonblock(handle, 1);
 
        /* set client info */
-       if (server_mode)
-               snd_seq_set_client_name(handle, "Net Server");
-       else
-               snd_seq_set_client_name(handle, "Net Client");
+       if (name)
+               snd_seq_set_client_name(handle, name);
+       else {
+               if (server_mode)
+                       snd_seq_set_client_name(handle, "Net Server");
+               else
+                       snd_seq_set_client_name(handle, "Net Client");
+       }
 
        /* create a port */
        seq_port = snd_seq_create_simple_port(handle, "Network",
@@ -297,25 +310,31 @@ static void init_seq(char *source, char *dest)
        }
 }
 
-
 /*
- * convert from string to TCP port number
+ * translate the binary network address to ASCII
  */
-static int get_port(char *service)
+static void get_net_addr(struct addrinfo *rp, char *buf, size_t buflen)
 {
-       struct servent *sp;
+       void *ptr;
 
-       if ((sp = getservbyname(service, "tcp")) == NULL){
-               fprintf(stderr, _("service '%s' is not found in /etc/services\n"), service);
-               return -1;
+       switch (rp->ai_family) {
+       case AF_INET:
+               ptr = &((struct sockaddr_in *) rp->ai_addr)->sin_addr;
+               break;
+       case AF_INET6:
+               ptr = &((struct sockaddr_in6 *) rp->ai_addr)->sin6_addr;
+               break;
+       default:
+               ptr = NULL;
        }
-       return sp->s_port;
+       buf[buflen-1] = '\0';
+       inet_ntop(rp->ai_family, ptr, buf, buflen-1);
 }
 
 /*
  * signal handler
  */
-static void sigterm_exit(int sig)
+static void sigterm_exit(int sig ATTRIBUTE_UNUSED)
 {
        close_files();
        exit(1);
@@ -325,30 +344,48 @@ static void sigterm_exit(int sig)
 /*
  * initialize network server
  */
-static void init_server(int port)
+static void init_server(const char *port)
 {
+       struct addrinfo hints;
+       struct addrinfo *result, *rp;
+       char buf[100];
        int i;
        int curstate = 1;
-       struct sockaddr_in addr;
+       int save_errno = 0;
 
-       memset(&addr, 0, sizeof(addr));
-
-       addr.sin_family = AF_INET;
-       addr.sin_addr.s_addr = INADDR_ANY;
-       addr.sin_port = htons(port);
+       memset(&hints, 0, sizeof(hints));
+       hints.ai_family = ipv6 ? AF_INET6 : AF_INET;
+       hints.ai_socktype = SOCK_STREAM;
+       hints.ai_flags = AI_PASSIVE;
 
-       sockfd = socket(AF_INET, SOCK_STREAM, 0);
-       if (sockfd < 0)  {
-               perror("create socket");
+       if (getaddrinfo(NULL, port, &hints, &result) < 0) {
+               fprintf(stderr, _("can't get address\n"));
                exit(1);
        }
-       setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate));
-       /* the return value is ignored.. */
-
-       if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0)  {
-               perror("can't bind");
+       for (rp = result; rp != NULL; rp = rp->ai_next) {
+               if ((sockfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) < 0){
+                       perror("create socket");
+                       exit(1);
+               }
+               if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate)) < 0) {
+                       perror("setsockopt");
+                       exit(1);
+               }
+               if (verbose) {
+                       get_net_addr(rp, buf, sizeof(buf));
+                       fprintf(stderr, _("connecting to: %s\n"), buf);
+               }
+               if (bind(sockfd, rp->ai_addr, rp->ai_addrlen) == 0)
+                       break;
+               save_errno = errno;
+               close(sockfd);
+       }
+       if (rp == NULL) {
+               errno = save_errno;
+               perror("bind");
                exit(1);
        }
+       freeaddrinfo(result);
 
        if (listen(sockfd, 5) < 0)  {
                perror("can't listen");
@@ -392,32 +429,48 @@ static void start_connection(void)
 /*
  * initialize network client
  */
-static void init_client(char *server, int port)
+static void init_client(const char *server, const char *port)
 {
-       struct sockaddr_in addr;
-       struct hostent *host;
+       struct addrinfo hints;
+       struct addrinfo *result, *rp;
+       char buf[100];
        int curstate = 1;
        int fd;
+       int save_errno = 0;
 
-       if ((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0){
-               perror("create socket");
-               exit(1);
-       }
-       if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate)) < 0) {
-               perror("setsockopt");
-               exit(1);
-       }
-       if ((host = gethostbyname(server)) == NULL){
+       memset(&hints, 0, sizeof(hints));
+       hints.ai_family = AF_UNSPEC;
+       hints.ai_socktype = SOCK_STREAM;
+       hints.ai_flags = AI_PASSIVE;
+
+       if (getaddrinfo(server, port, &hints, &result) < 0) {
                fprintf(stderr, _("can't get address %s\n"), server);
                exit(1);
        }
-       addr.sin_port = htons(port);
-       addr.sin_family = AF_INET;
-       memcpy(&addr.sin_addr, host->h_addr, host->h_length);
-       if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+       for (rp = result; rp != NULL; rp = rp->ai_next) {
+               if ((fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) < 0){
+                       perror("create socket");
+                       exit(1);
+               }
+               if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate)) < 0) {
+                       perror("setsockopt");
+                       exit(1);
+               }
+               if (verbose) {
+                       get_net_addr(rp, buf, sizeof(buf));
+                       fprintf(stderr, _("connecting to: %s\n"), buf);
+               }
+               if (connect(fd, rp->ai_addr, rp->ai_addrlen) == 0)
+                       break;
+               save_errno = errno;
+               close(fd);
+       }
+       if (rp == NULL) {
+               errno = save_errno;
                perror("connect");
                exit(1);
        }
+       freeaddrinfo(result);
        if (verbose)
                fprintf(stderr, _("ok.. connected\n"));
        netfd[0] = fd;
@@ -491,8 +544,11 @@ static void flush_writebuf(void)
        if (cur_wrlen) {
                int i;
                for (i = 0; i < max_connection; i++) {
-                       if (netfd[i] >= 0)
-                               write(netfd[i], writebuf, cur_wrlen);
+                       if (netfd[i] >= 0) {
+                               ssize_t wrlen = write(netfd[i], writebuf, cur_wrlen);
+                               if (wrlen != (ssize_t)cur_wrlen)
+                                       fprintf(stderr, "write error: %s", wrlen < 0 ? strerror(errno) : "short");
+                       }
                }
                cur_wrlen = 0;
        }
diff --git a/seq/aseqsend/Makefile.am b/seq/aseqsend/Makefile.am
new file mode 100644 (file)
index 0000000..62da1ef
--- /dev/null
@@ -0,0 +1,5 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+EXTRA_DIST = aseqsend.1
+
+bin_PROGRAMS = aseqsend
+man_MANS = aseqsend.1
diff --git a/seq/aseqsend/Makefile.in b/seq/aseqsend/Makefile.in
new file mode 100644 (file)
index 0000000..58b3f9a
--- /dev/null
@@ -0,0 +1,775 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = aseqsend$(EXEEXT)
+subdir = seq/aseqsend
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS)
+aseqsend_SOURCES = aseqsend.c
+aseqsend_OBJECTS = aseqsend.$(OBJEXT)
+aseqsend_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/aseqsend.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = aseqsend.c
+DIST_SOURCES = aseqsend.c
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+EXTRA_DIST = aseqsend.1
+man_MANS = aseqsend.1
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign seq/aseqsend/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign seq/aseqsend/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
+aseqsend$(EXEEXT): $(aseqsend_OBJECTS) $(aseqsend_DEPENDENCIES) $(EXTRA_aseqsend_DEPENDENCIES) 
+       @rm -f aseqsend$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(aseqsend_OBJECTS) $(aseqsend_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aseqsend.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man1: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man1dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.1[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(MANS)
+installdirs:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+               -rm -f ./$(DEPDIR)/aseqsend.Po
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+               -rm -f ./$(DEPDIR)/aseqsend.Po
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/seq/aseqsend/aseqsend.1 b/seq/aseqsend/aseqsend.1
new file mode 100644 (file)
index 0000000..340c329
--- /dev/null
@@ -0,0 +1,59 @@
+.TH ASEQSEND 1 "11 Mar 2024"
+
+.SH NAME
+.B aseqsend
+\- send arbitrary messages to selected ALSA MIDI seqencer port
+
+.SH SYNOPSIS
+aseqsend \-p client:port -s file-name|"hex encoded byte-string"
+
+.SH DESCRIPTION
+.B aseqsend
+is a command-line utility which allows one to send SysEx (system exclusive) data to ALSA MIDI seqencer port.
+It can also send any other MIDI commands.
+Messages to be send can be given in the last argument as hex encoded byte string or can be read from raw binary file.
+When sending several SysEx messages at once there is a delay of 1ms after each message as deafult and can be set to different value with option \-i.
+
+.SH OPTIONS
+
+.TP
+\-h
+Prints a list of options.
+
+.TP
+\-V
+Prints the current version.
+
+.TP
+\-l
+Prints a list of possible output ports.
+
+.TP
+\-v
+Prints number of bytes actually sent
+
+.TP
+\-p
+Target port by number or name
+
+.TP
+\-s
+Send raw binary data from given file name
+
+.TP
+\-i
+Interval between SysEx messages in miliseconds
+
+
+A client can be specified by its number, its name, or a prefix of its
+name.  A port is specified by its number; for port 0 of a client, the
+":0" part of the port specification can be omitted.
+
+.SH EXAMPLES
+
+aseqsend -p 128:0 "F0 41 10 00 00 64 12 18 00 21 06 59 41 59 4E F7"
+
+aseqsend -p 128:0 -s I7BulkDump.syx
+
+.SH AUTHOR
+Miroslav Kovac <mixxoo@gmail.com>
diff --git a/seq/aseqsend/aseqsend.c b/seq/aseqsend/aseqsend.c
new file mode 100644 (file)
index 0000000..f06e3b1
--- /dev/null
@@ -0,0 +1,478 @@
+/*
+ *  aseqsend.c - send arbitrary MIDI messages to selected ALSA MIDI seqencer port
+ *
+ *  Copyright (c) 2005 Clemens Ladisch <clemens@ladisch.de>
+ *  Copyright (c) 2024 Miroslav Kovac <mixxoo@gmail.com>
+ *
+ *
+ *   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
+ */
+
+#define _GNU_SOURCE
+#include "aconfig.h"
+#include "version.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+#include <getopt.h>
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+#include <alsa/asoundlib.h>
+
+typedef unsigned char mbyte_t;
+
+static snd_seq_t *seq;
+static char *port_name = NULL;
+static char *send_file_name = NULL;
+static char *send_hex;
+static mbyte_t *send_data;
+static snd_seq_addr_t addr;
+static int send_data_length;
+
+static void error(const char *format, ...)
+{
+       va_list ap;
+
+       va_start(ap, format);
+       vfprintf(stderr, format, ap);
+       va_end(ap);
+       putc('\n', stderr);
+}
+
+/* prints an error message to stderr, and dies */
+static void fatal(const char *msg, ...)
+{
+       va_list ap;
+
+       va_start(ap, msg);
+       vfprintf(stderr, msg, ap);
+       va_end(ap);
+       fputc('\n', stderr);
+       exit(EXIT_FAILURE);
+}
+
+static void usage(void)
+{
+       printf(
+               "\nUsage: aseqsend -p target-port -s file-name|\"hex encoded bytes\"\n\n"
+               "         -h  this help\n"
+               "         -V  print current version\n"
+               "         -v  verbose\n"
+               "         -l  list all sequencer ports\n"
+               "         -p  target port by number or name\n"
+               "         -s  send binary data from given file name\n"
+               "         -i  interval between SysEx messages in miliseconds\n\n");
+}
+
+static void version(void)
+{
+       puts("aseqsend version " SND_UTIL_VERSION_STR);
+}
+
+static void *my_malloc(size_t size)
+{
+       void *p = malloc(size);
+       if (!p) {
+               fatal("out of memory");
+               exit(EXIT_FAILURE);
+       }
+       return p;
+}
+
+static int hex_value(char c)
+{
+       if ('0' <= c && c <= '9')
+               return c - '0';
+       if ('A' <= c && c <= 'F')
+               return c - 'A' + 10;
+       if ('a' <= c && c <= 'f')
+               return c - 'a' + 10;
+       error("invalid character %c", c);
+       return -1;
+}
+
+static void parse_data(void)
+{
+       const char *p;
+       int i, value;
+
+       send_data = my_malloc(strlen(send_hex));
+       i = 0;
+       value = -1; /* value is >= 0 when the first hex digit of a byte has been read */
+       for (p = send_hex; *p; ++p) {
+               int digit;
+               if (isspace((unsigned char)*p)) {
+                       if (value >= 0) {
+                               send_data[i++] = value;
+                               value = -1;
+                       }
+                       continue;
+               }
+               digit = hex_value(*p);
+               if (digit < 0) {
+                       exit(EXIT_FAILURE);
+               }
+               if (value < 0) {
+                       value = digit;
+               } else {
+                       send_data[i++] = (value << 4) | digit;
+                       value = -1;
+               }
+       }
+       if (value >= 0)
+               send_data[i++] = value;
+       send_data_length = i;
+}
+
+static void add_send_hex_data(const char *str)
+{
+       int length;
+       char *s;
+
+       length = (send_hex ? strlen(send_hex) + 1 : 0) + strlen(str) + 1;
+       s = my_malloc(length);
+       if (send_hex) {
+               strcpy(s, send_hex);
+               strcat(s, " ");
+       } else {
+               s[0] = '\0';
+       }
+       strcat(s, str);
+       free(send_hex);
+       send_hex = s;
+}
+
+static void load_file(void)
+{
+       int fd;
+       off_t length;
+
+       fd = open(send_file_name, O_RDONLY);
+       if (fd == -1) {
+               error("cannot open %s - %s", send_file_name, strerror(errno));
+               return;
+       }
+       length = lseek(fd, 0, SEEK_END);
+       if (length == (off_t)-1) {
+               error("cannot determine length of %s: %s", send_file_name, strerror(errno));
+               goto _error;
+       }
+       send_data = my_malloc(length);
+       lseek(fd, 0, SEEK_SET);
+       if (read(fd, send_data, length) != length) {
+               error("cannot read from %s: %s", send_file_name, strerror(errno));
+               goto _error;
+       }
+       if (length >= 4 && !memcmp(send_data, "MThd", 4)) {
+               error("%s is a Standard MIDI File; use aplaymidi to send it", send_file_name);
+               goto _error;
+       }
+       send_data_length = length;
+       goto _exit;
+_error:
+       free(send_data);
+       send_data = NULL;
+_exit:
+       close(fd);
+}
+
+/* error handling for ALSA functions */
+static void check_snd(const char *operation, int err)
+{
+       if (err < 0)
+               fatal("Cannot %s - %s", operation, snd_strerror(err));
+}
+
+static void init_seq(void)
+{
+       int err;
+
+       /* open sequencer */
+       err = snd_seq_open(&seq, "default", SND_SEQ_OPEN_OUTPUT, 0);
+       check_snd("open sequencer", err);
+
+       /* set our client's name */
+       err = snd_seq_set_client_name(seq, "aseqsend");
+       check_snd("set client name", err);
+}
+
+static void create_port(void)
+{
+       int err;
+
+       err = snd_seq_create_simple_port(seq, "aseqsend",
+                                       SND_SEQ_PORT_CAP_READ,
+                                       SND_SEQ_PORT_TYPE_MIDI_GENERIC |
+                                       SND_SEQ_PORT_TYPE_APPLICATION);
+       check_snd("create port", err);
+}
+
+
+static void list_ports(void)
+{
+       snd_seq_client_info_t *cinfo;
+       snd_seq_port_info_t *pinfo;
+
+       snd_seq_client_info_alloca(&cinfo);
+       snd_seq_port_info_alloca(&pinfo);
+
+       puts(" Port    Client name                      Port name");
+
+       snd_seq_client_info_set_client(cinfo, -1);
+       while (snd_seq_query_next_client(seq, cinfo) >= 0) {
+               int client = snd_seq_client_info_get_client(cinfo);
+
+               snd_seq_port_info_set_client(pinfo, client);
+               snd_seq_port_info_set_port(pinfo, -1);
+               while (snd_seq_query_next_port(seq, pinfo) >= 0) {
+
+                       if ((snd_seq_port_info_get_capability(pinfo)
+                            & SND_SEQ_PORT_CAP_WRITE)
+                           != SND_SEQ_PORT_CAP_WRITE)
+                               continue;
+                       printf("%3d:%-3d  %-32.32s %s\n",
+                              snd_seq_port_info_get_client(pinfo),
+                              snd_seq_port_info_get_port(pinfo),
+                              snd_seq_client_info_get_name(cinfo),
+                              snd_seq_port_info_get_name(pinfo));
+               }
+       }
+}
+
+void send_midi_msg(snd_seq_event_type_t type, mbyte_t *data, int len)
+{
+               snd_seq_event_t ev;
+
+               snd_seq_ev_clear(&ev);
+               snd_seq_ev_set_source(&ev, 0);
+               snd_seq_ev_set_dest(&ev,addr.client,addr.port);
+               snd_seq_ev_set_direct(&ev);
+
+               if (type == SND_SEQ_EVENT_SYSEX) {
+
+                       snd_seq_ev_set_sysex(&ev,len,data);
+
+               } else {
+
+                       mbyte_t ch = data[0] & 0xF;
+
+                       switch (type) {
+                               case SND_SEQ_EVENT_NOTEON:
+                                       snd_seq_ev_set_noteon(&ev,ch,data[1],data[2]);
+                                       break;
+                               case SND_SEQ_EVENT_NOTEOFF:
+                                       snd_seq_ev_set_noteoff(&ev,ch,data[1],data[2]);
+                                       break;
+                               case SND_SEQ_EVENT_KEYPRESS:
+                                       snd_seq_ev_set_keypress(&ev,ch,data[1],data[2]);
+                                       break;
+                               case SND_SEQ_EVENT_CONTROLLER:
+                                       snd_seq_ev_set_controller(&ev,ch,data[1],data[2]);
+                                       break;
+                               case SND_SEQ_EVENT_PITCHBEND:
+                                       snd_seq_ev_set_pitchbend(&ev,ch,(data[1]<<7|data[2])-8192);
+                                       break;
+                               case SND_SEQ_EVENT_PGMCHANGE:
+                                       snd_seq_ev_set_pgmchange(&ev,ch,data[1]);
+                                       break;
+                               case SND_SEQ_EVENT_CHANPRESS:
+                                       snd_seq_ev_set_chanpress(&ev,ch,data[1]);
+                                       break;
+                               default:
+                                       ev.type = SND_SEQ_EVENT_NONE;
+                       }
+               }
+
+               snd_seq_event_output(seq, &ev);
+               snd_seq_drain_output(seq);
+
+}
+
+static int msg_byte_in_range(mbyte_t *data, mbyte_t len)
+{
+       for (int i=0;i<len;i++) {
+               if (data[i] > 0x7F) {
+                       error("msg byte value out of range 0-127");
+                       return 0;
+               }
+       }
+       return 1;
+}
+
+
+int main(int argc, char *argv[])
+{
+       char c = 0;
+       char do_send_file = 0;
+       char do_port_list = 0;
+       char verbose = 0;
+       int sysex_interval = 1000; //us
+
+       while ((c = getopt(argc, argv, "hi:Vvlp:s:")) != -1) {
+               switch (c) {
+               case 'h':
+                       usage();
+                       return 0;
+               case 'V':
+                       version();
+                       return 0;
+               case 'v':
+                       verbose = 1;
+                       break;
+               case 'l':
+                       do_port_list = 1;
+                       break;
+               case 'p':
+                       port_name = optarg;
+                       break;
+               case 's':
+                       send_file_name = optarg;
+                       do_send_file = 1;
+                       break;
+               case 'i':
+                       sysex_interval = atoi(optarg) * 1000; //ms--->us
+                       break;
+               default:
+                       error("Try 'aseqsend -h' for more information.");
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if (argc < 2) {
+               usage();
+               exit(EXIT_FAILURE);
+       }
+
+       if (do_port_list){
+               init_seq();
+               list_ports();
+               exit(EXIT_SUCCESS);
+       }
+
+       if (port_name == NULL)
+               fatal("Output port must be specified!");
+
+       if (do_send_file) {
+               load_file();
+       } else {
+               /* no file specified ---> send hex bytes from cmd arguments*/
+               /* data for send can be specified as multiple arguments */
+               for (; argv[optind]; ++optind) {
+                       add_send_hex_data(argv[optind]);
+               }
+               if (send_hex) parse_data();
+       }
+
+       if (send_data) {
+
+               init_seq();
+               create_port();
+
+               if (snd_seq_parse_address(seq,&addr,port_name) == 0) {
+
+                       int sent_data_c = 0;//counter of actually sent bytes
+
+                       int k = 0;
+
+                       while (k < send_data_length) {
+
+                               if (send_data[k] == 0xF0) {
+
+                                       int c1 = k;
+                                       while (c1 < send_data_length)
+                                       {
+                                               if (send_data[c1] == 0xF7) break;
+                                               c1++;
+                                       }
+
+                                       if (c1 == send_data_length)
+                                               fatal("SysEx is missing terminating byte (0xF7)");
+
+                                       int sl = c1-k+1;
+                                       sent_data_c += sl;
+
+                                       send_midi_msg(SND_SEQ_EVENT_SYSEX, send_data+k,sl);
+
+                                       usleep(sysex_interval);
+
+                                       k = c1+1;
+
+                               } else {
+
+                                       mbyte_t tp = send_data[k] >> 4;
+
+                                       if (tp == 0x8) {
+                                               if (msg_byte_in_range(send_data + k + 1, 2)) {
+                                                       send_midi_msg(SND_SEQ_EVENT_NOTEOFF, send_data+k,3);
+                                                       sent_data_c += 3;
+                                               }
+                                               k = k+3;
+                                       } else if (tp == 0x9) {
+                                               if (msg_byte_in_range(send_data + k + 1, 2)) {
+                                                       send_midi_msg(SND_SEQ_EVENT_NOTEON, send_data+k,3);
+                                                       sent_data_c += 3;
+                                               }
+                                               k = k+3;
+                                       } else if (tp == 0xA) {
+                                               if (msg_byte_in_range(send_data + k + 1, 2)) {
+                                                       send_midi_msg(SND_SEQ_EVENT_KEYPRESS, send_data+k,3);
+                                                       sent_data_c += 3;
+                                               }
+                                               k = k+3;
+                                       } else if (tp == 0xB) {
+                                               if (msg_byte_in_range(send_data + k + 1, 2)) {
+                                                       send_midi_msg(SND_SEQ_EVENT_CONTROLLER, send_data+k,3);
+                                                       sent_data_c += 3;
+                                               }
+                                               k = k+3;
+                                       } else if (tp == 0xC) {
+                                               if (msg_byte_in_range(send_data + k + 1, 1)) {
+                                                       send_midi_msg(SND_SEQ_EVENT_PGMCHANGE, send_data+k,2);
+                                                       sent_data_c += 2;
+                                               }
+                                               k = k+2;
+                                       } else if (tp == 0xD) {
+                                               if (msg_byte_in_range(send_data + k + 1, 1)) {
+                                                       send_midi_msg(SND_SEQ_EVENT_CHANPRESS, send_data+k,2);
+                                                       sent_data_c += 2;
+                                               }
+                                               k = k+2;
+                                       } else if (tp == 0xE) {
+                                               if (msg_byte_in_range(send_data + k + 1, 2)) {
+                                                       send_midi_msg(SND_SEQ_EVENT_PITCHBEND, send_data+k,3);
+                                                       sent_data_c += 3;
+                                               }
+                                               k = k+3;
+                                       } else k++;
+                               }
+                       }
+
+                       if (verbose)
+                               printf("Sent : %u bytes\n",sent_data_c);
+
+               } else {
+
+                       error("Unable to parse port name!");
+                       exit(EXIT_FAILURE);
+
+               }
+               snd_seq_close(seq);
+       }
+
+       exit(EXIT_SUCCESS);
+}
index d53dbd6..b21919b 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS= samples
 LDADD = $(LIBINTL) -lm
 
 bin_PROGRAMS = speaker-test
-speaker_test_SOURCES = speaker-test.c pink.c
+speaker_test_SOURCES = speaker-test.c pink.c st2095.c
 man_MANS = speaker-test.1
-EXTRA_DIST = readme.txt speaker-test.1 pink.h
+EXTRA_DIST = readme.txt speaker-test.1 pink.h st2095.h
 
index 9d911e4..793d0d1 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -52,45 +90,81 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = speaker-test$(EXEEXT)
 subdir = speaker-test
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_speaker_test_OBJECTS = speaker-test.$(OBJEXT) pink.$(OBJEXT)
+am_speaker_test_OBJECTS = speaker-test.$(OBJEXT) pink.$(OBJEXT) \
+       st2095.$(OBJEXT)
 speaker_test_OBJECTS = $(am_speaker_test_OBJECTS)
 speaker_test_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 speaker_test_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/pink.Po ./$(DEPDIR)/speaker-test.Po \
+       ./$(DEPDIR)/st2095.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(speaker_test_SOURCES)
 DIST_SOURCES = $(speaker_test_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -128,12 +202,33 @@ NROFF = nroff
 MANS = $(man_MANS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       distdir
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -165,7 +260,11 @@ ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -183,11 +282,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -199,27 +305,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -232,6 +348,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -240,6 +357,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -250,7 +369,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -291,6 +412,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -301,17 +424,17 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 SUBDIRS = samples
 LDADD = $(LIBINTL) -lm
-speaker_test_SOURCES = speaker-test.c pink.c
+speaker_test_SOURCES = speaker-test.c pink.c st2095.c
 man_MANS = speaker-test.1
-EXTRA_DIST = readme.txt speaker-test.1 pink.h
+EXTRA_DIST = readme.txt speaker-test.1 pink.h st2095.h
 all: all-recursive
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -324,14 +447,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign speaker-test/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign speaker-test/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -351,10 +473,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -365,8 +489,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
        while read type dir files; do \
            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
            test -z "$$files" || { \
-             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
            } \
        ; done
 
@@ -375,16 +499,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
 speaker-test$(EXEEXT): $(speaker_test_OBJECTS) $(speaker_test_DEPENDENCIES) $(EXTRA_speaker_test_DEPENDENCIES) 
        @rm -f speaker-test$(EXEEXT)
-       $(LINK) $(speaker_test_OBJECTS) $(speaker_test_LDADD) $(LIBS)
+       $(AM_V_CCLD)$(LINK) $(speaker_test_OBJECTS) $(speaker_test_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -392,22 +524,45 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speaker-test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speaker-test.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/st2095.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
        @list1=''; \
@@ -458,14 +613,13 @@ uninstall-man1:
 # (1) if the variable is set in 'config.status', edit 'config.status'
 #     (which will cause the Makefiles to be regenerated when you run 'make');
 # (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        case "$@" in \
@@ -486,31 +640,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
-cscopelist-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-       done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -526,12 +662,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -543,15 +674,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -560,9 +687,10 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
 
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -578,20 +706,10 @@ cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically 'make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -686,10 +804,12 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-recursive
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-recursive
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/pink.Po
+       -rm -f ./$(DEPDIR)/speaker-test.Po
+       -rm -f ./$(DEPDIR)/st2095.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -735,13 +855,16 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/pink.Po
+       -rm -f ./$(DEPDIR)/speaker-test.Po
+       -rm -f ./$(DEPDIR)/st2095.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-recursive
 
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
 
 pdf: pdf-recursive
 
@@ -755,25 +878,26 @@ uninstall-am: uninstall-binPROGRAMS uninstall-man
 
 uninstall-man: uninstall-man1
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
-       cscopelist-recursive ctags-recursive install-am install-strip \
-       tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic cscopelist cscopelist-recursive ctags \
-       ctags-recursive distclean distclean-compile distclean-generic \
-       distclean-tags distdir dvi dvi-am html html-am info info-am \
-       install install-am install-binPROGRAMS install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-man1 install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs installdirs-am \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-       tags tags-recursive uninstall uninstall-am \
-       uninstall-binPROGRAMS uninstall-man uninstall-man1
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--depfiles check check-am clean clean-binPROGRAMS \
+       clean-generic clean-libtool cscopelist-am ctags ctags-am \
+       distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am uninstall-binPROGRAMS uninstall-man \
+       uninstall-man1
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index ef30755..63fe296 100644 (file)
@@ -24,6 +24,7 @@
   Copyleft 1999 Phil Burk - No rights reserved.
 */
 
+#include "aconfig.h"
 #include <stdio.h>
 #include <math.h>
 #include "pink.h"
index 8cc3546..d024baa 100644 (file)
@@ -10,11 +10,6 @@ wav_files = Front_Left.wav \
        Side_Left.wav  
 sound_DATA = $(wav_files)
 
-alsadir = $(datadir)/alsa/speaker-test
-cfg_files = sample_map.csv
-
-alsa_DATA = $(cfg_files)
-
 EXTRA_DIST = \
        $(wav_files) \
        $(cfg_files)
index 4019b8e..5bdf7e0 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,20 +89,35 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = speaker-test/samples
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -99,15 +152,21 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(alsadir)" "$(DESTDIR)$(sounddir)"
-DATA = $(alsa_DATA) $(sound_DATA)
+am__installdirs = "$(DESTDIR)$(sounddir)"
+DATA = $(sound_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -125,11 +184,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -141,27 +207,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -174,6 +250,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -182,6 +259,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -192,7 +271,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -233,6 +314,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -243,7 +326,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 sounddir = $(datadir)/sounds/alsa
 wav_files = Front_Left.wav \
        Rear_Center.wav \
@@ -256,9 +339,6 @@ wav_files = Front_Left.wav \
        Side_Left.wav  
 
 sound_DATA = $(wav_files)
-alsadir = $(datadir)/alsa/speaker-test
-cfg_files = sample_map.csv
-alsa_DATA = $(cfg_files)
 EXTRA_DIST = \
        $(wav_files) \
        $(cfg_files)
@@ -278,14 +358,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign speaker-test/samples/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign speaker-test/samples/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -296,27 +375,12 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-install-alsaDATA: $(alsa_DATA)
-       @$(NORMAL_INSTALL)
-       @list='$(alsa_DATA)'; test -n "$(alsadir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(alsadir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(alsadir)" || exit 1; \
-       fi; \
-       for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         echo "$$d$$p"; \
-       done | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(alsadir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(alsadir)" || exit $$?; \
-       done
 
-uninstall-alsaDATA:
-       @$(NORMAL_UNINSTALL)
-       @list='$(alsa_DATA)'; test -n "$(alsadir)" || list=; \
-       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(alsadir)'; $(am__uninstall_files_from_dir)
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
 install-soundDATA: $(sound_DATA)
        @$(NORMAL_INSTALL)
        @list='$(sound_DATA)'; test -n "$(sounddir)" || list=; \
@@ -338,16 +402,17 @@ uninstall-soundDATA:
        @list='$(sound_DATA)'; test -n "$(sounddir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        dir='$(DESTDIR)$(sounddir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
+tags TAGS:
 
-ctags: CTAGS
-CTAGS:
+ctags CTAGS:
 
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -381,7 +446,7 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(DATA)
 installdirs:
-       for dir in "$(DESTDIR)$(alsadir)" "$(DESTDIR)$(sounddir)"; do \
+       for dir in "$(DESTDIR)$(sounddir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
@@ -416,7 +481,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
@@ -434,7 +499,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-alsaDATA install-soundDATA
+install-data-am: install-soundDATA
 
 install-dvi: install-dvi-am
 
@@ -468,7 +533,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -478,21 +543,23 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-alsaDATA uninstall-soundDATA
+uninstall-am: uninstall-soundDATA
 
 .MAKE: install-am install-strip
 
-.PHONY: all all-am check check-am clean clean-generic distclean \
-       distclean-generic distdir dvi dvi-am html html-am info info-am \
-       install install-alsaDATA install-am install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-pdf install-pdf-am \
-       install-ps install-ps-am install-soundDATA install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-       pdf-am ps ps-am uninstall uninstall-alsaDATA uninstall-am \
-       uninstall-soundDATA
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       cscopelist-am ctags-am distclean distclean-generic \
+       distclean-libtool distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-soundDATA install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am tags-am uninstall uninstall-am uninstall-soundDATA
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/speaker-test/samples/sample_map.csv b/speaker-test/samples/sample_map.csv
deleted file mode 100644 (file)
index 20d8ed2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-0, "Front Left", "/usr/share/alsa/samples/Front_Left.wav"
-1, "Front Right", "/usr/share/alsa/samples/Front_Right.wav"
index add6b21..f375e19 100644 (file)
@@ -94,11 +94,17 @@ Use number of periods.  The default value is 4.
 stream of \fIRATE\fP Hz
 
 .TP
-\fB\-t\fP | \fB\-\-test\fP \fBpink\fP|\fBsine\fP|\fBwav\fP
+\fB\-t\fP | \fB\-\-test\fP \fBpink\fP|\fBst2095\fP|\fBsine\fP|\fBwav\fP
 \fB\-t pink\fP means use pink noise (default).
 
 Pink noise is perceptually uniform noise -- that is, it sounds like every frequency at once.  If you can hear any tone it may indicate resonances in your speaker system or room.
 
+\fB\-t st2095\fP means use bandlimited pink noise at -18.5dB AES FS, generated according to SMPTE ST-2095:1-2015.
+In addition to speaker localization it may be used for system calibration, for example 85dB for thater drivers, with an extra +10dB for subwoofers.
+Per the spec, it is intended "to be used in calibrating the sound pressure level and
+electroacoustic response of a cinema B-chain system."
+Note that sampling rates less than 48KHz are outside the scope of the spec, and an attempt will be made to construct a reduced rate filter.
+
 \fB\-t sine\fP means to use sine wave.
 
 \fB\-t wav\fP means to play WAV files, either pre-defined files or given via \fB\-w\fP option.
@@ -180,3 +186,4 @@ Play in the order of front\-right and front-left from the front PCM
 The speaker\-test program was written by James Courtier-Dutton.
 Pink noise support was added by Nathan Hurst.
 Further extensions by Takashi Iwai.
+SMPTE ST-2095:1 band-limited pink noise added by Rick Sayre.
index ccf2671..d3fec2b 100644 (file)
  * Some cleanup from Daniel Caujolle-Bert <segfault@club-internet.fr>
  * Pink noise option added Nathan Hurst, 
  *   based on generator by Phil Burk (pink.c)
+ * ST-2095 noise option added Rick Sayre,
+ *   based on generator specified by SMPTE ST-2095:1-2015
+ *   Also switched to stable harmonic oscillator for sine
  *
  * Changelog:
+ *   0.0.9 Added support for ST-2095 band-limited pink noise output, switched to harmonic oscillator for sine
+ * Changelog:
  *   0.0.8 Added support for pink noise output.
  * Changelog:
  *   0.0.7 Added support for more than 6 channels.
@@ -36,6 +41,8 @@
  * $Id: speaker_test.c,v 1.00 2003/11/26 19:43:38 jcdutton Exp $
  */
 
+#include "aconfig.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -44,7 +51,8 @@
 #include <getopt.h>
 #include <inttypes.h>
 #include <ctype.h>
-#include <byteswap.h>
+#include <limits.h>
+#include "bswap.h"
 #include <signal.h>
 
 #define ALSA_PCM_NEW_HW_PARAMS_API
 #include <sys/time.h>
 #include <math.h>
 #include "pink.h"
-#include "aconfig.h"
+#include "st2095.h"
 #include "gettext.h"
 #include "version.h"
+#include "os_compat.h"
 
 #ifdef ENABLE_NLS
 #include <locale.h>
@@ -69,6 +78,7 @@ enum {
   TEST_PINK_NOISE = 1,
   TEST_SINE,
   TEST_WAV,
+  TEST_ST2095_NOISE,
   TEST_PATTERN,
 };
 
@@ -96,11 +106,11 @@ static unsigned int       rate        = 48000;                 /* stream rate */
 static unsigned int       channels    = 1;                 /* count of channels */
 static unsigned int       speaker     = 0;                 /* count of channels */
 static unsigned int       buffer_time = 0;                 /* ring buffer length in us */
-static unsigned int       period_time = 0;                 /* period time in us */
+static unsigned int      period_time = UINT_MAX;                   /* period time in us */
 static unsigned int       nperiods    = 4;                  /* number of periods */
 static double             freq        = 440.0;              /* sinusoidal wave frequency in Hz */
 static int                test_type   = TEST_PINK_NOISE;    /* Test type. 1 = noise, 2 = sine wave */
-static pink_noise_t pink;
+static float              generator_scale  = 0.8;           /* Scale to use for sine volume */
 static snd_pcm_uframes_t  buffer_size;
 static snd_pcm_uframes_t  period_size;
 static const char *given_test_wav_file = NULL;
@@ -225,7 +235,7 @@ static int *order_channels(void)
 {
   /* create a (playback order => channel number) table with channels ordered
    * according to channel_order[] values */
-  int i;
+  unsigned int i;
   int *ordered_chs;
 
   ordered_chs = calloc(channel_map->channels, sizeof(*ordered_chs));
@@ -244,7 +254,7 @@ static int *order_channels(void)
 static int get_speaker_channel(int chn)
 {
 #ifdef CONFIG_SUPPORT_CHMAP
-  if (channel_map_set || (ordered_channels && chn >= channel_map->channels))
+  if (channel_map_set || (ordered_channels && (unsigned int)chn >= channel_map->channels))
     return chn;
   if (ordered_channels)
     return ordered_channels[chn];
@@ -270,7 +280,7 @@ static const char *get_channel_name(int chn)
 #ifdef CONFIG_SUPPORT_CHMAP
   if (channel_map) {
     const char *name = NULL;
-    if (chn < channel_map->channels)
+    if ((unsigned int)chn < channel_map->channels)
       name = snd_pcm_chmap_long_name(channel_map->pos[chn]);
     return name ? name : "Unknown";
   }
@@ -283,19 +293,25 @@ static const int  supported_formats[] = {
   SND_PCM_FORMAT_S16_LE,
   SND_PCM_FORMAT_S16_BE,
   SND_PCM_FORMAT_FLOAT_LE,
+  SND_PCM_FORMAT_S24_3LE,
+  SND_PCM_FORMAT_S24_3BE,
+  SND_PCM_FORMAT_S24_LE,
+  SND_PCM_FORMAT_S24_BE,
   SND_PCM_FORMAT_S32_LE,
   SND_PCM_FORMAT_S32_BE,
   -1
 };
 
-static void generate_sine(uint8_t *frames, int channel, int count, double *_phase) {
-  double phase = *_phase;
-  double max_phase = 1.0 / freq;
-  double step = 1.0 / (double)rate;
-  double res;
-  float fres;
-  int    chn;
-  int32_t  ires;
+typedef union {
+  float f;
+  int32_t i;
+} value_t;
+
+static void do_generate(uint8_t *frames, int channel, int count,
+                       value_t (*generate)(void *), void *arg)
+{
+  value_t res;
+  unsigned int chn;
   int8_t *samp8 = (int8_t*) frames;
   int16_t *samp16 = (int16_t*) frames;
   int32_t *samp32 = (int32_t*) frames;
@@ -303,205 +319,136 @@ static void generate_sine(uint8_t *frames, int channel, int count, double *_phas
 
   while (count-- > 0) {
     for(chn=0;chn<channels;chn++) {
+      if (chn==(unsigned int)channel) {
+       res = generate(arg);
+      } else {
+       res.i = 0;
+      }
+
       switch (format) {
       case SND_PCM_FORMAT_S8:
-        if (chn==channel) {
-          res = (sin((phase * 2 * M_PI) / max_phase - M_PI)) * 0x03fffffff; /* Don't use MAX volume */
-          ires = res;
-          *samp8++ = ires >> 24;
-        } else {
-          *samp8++ = 0;
-        }
+       *samp8++ = res.i >> 24;
         break;
       case SND_PCM_FORMAT_S16_LE:
-        if (chn==channel) {
-          res = (sin((phase * 2 * M_PI) / max_phase - M_PI)) * 0x03fffffff; /* Don't use MAX volume */
-          ires = res;
-          *samp16++ = LE_SHORT(ires >> 16);
-        } else {
-          *samp16++ = 0;
-        }
+       *samp16++ = LE_SHORT(res.i >> 16);
         break;
       case SND_PCM_FORMAT_S16_BE:
-        if (chn==channel) {
-          res = (sin((phase * 2 * M_PI) / max_phase - M_PI)) * 0x03fffffff; /* Don't use MAX volume */
-          ires = res;
-          *samp16++ = BE_SHORT(ires >> 16);
-        } else {
-          *samp16++ = 0;
-        }
+       *samp16++ = BE_SHORT(res.i >> 16);
         break;
       case SND_PCM_FORMAT_FLOAT_LE:
-        if (chn==channel) {
-          res = (sin((phase * 2 * M_PI) / max_phase - M_PI)) * 0.75 ; /* Don't use MAX volume */
-          fres = res;
-         *samp_f++ = fres;
-        } else {
-         *samp_f++ = 0.0;
-        }
+       *samp_f++ = res.f;
+        break;
+      case SND_PCM_FORMAT_S24_3LE:
+        res.i >>= 8;
+        *samp8++ = LE_INT(res.i);
+        *samp8++ = LE_INT(res.i) >> 8;
+        *samp8++ = LE_INT(res.i) >> 16;
+        break;
+      case SND_PCM_FORMAT_S24_3BE:
+        res.i >>= 8;
+        *samp8++ = BE_INT(res.i);
+        *samp8++ = BE_INT(res.i) >> 8;
+        *samp8++ = BE_INT(res.i) >> 16;
+        break;
+      case SND_PCM_FORMAT_S24_LE:
+        res.i >>= 8;
+        *samp8++ = LE_INT(res.i);
+        *samp8++ = LE_INT(res.i) >> 8;
+        *samp8++ = LE_INT(res.i) >> 16;
+        *samp8++ = 0;
+        break;
+      case SND_PCM_FORMAT_S24_BE:
+        res.i >>= 8;
+        *samp8++ = 0;
+        *samp8++ = BE_INT(res.i);
+        *samp8++ = BE_INT(res.i) >> 8;
+        *samp8++ = BE_INT(res.i) >> 16;
         break;
       case SND_PCM_FORMAT_S32_LE:
-        if (chn==channel) {
-          res = (sin((phase * 2 * M_PI) / max_phase - M_PI)) * 0x03fffffff; /* Don't use MAX volume */
-          ires = res;
-          *samp32++ = LE_INT(ires);
-        } else {
-          *samp32++ = 0;
-        }
+       *samp32++ = LE_INT(res.i);
         break;
       case SND_PCM_FORMAT_S32_BE:
-        if (chn==channel) {
-          res = (sin((phase * 2 * M_PI) / max_phase - M_PI)) * 0x03fffffff; /* Don't use MAX volume */
-          ires = res;
-          *samp32++ = BE_INT(ires);
-        } else {
-          *samp32++ = 0;
-        }
+       *samp32++ = BE_INT(res.i);
         break;
       default:
         ;
       }
     }
-
-    phase += step;
-    if (phase >= max_phase)
-      phase -= max_phase;
   }
+}
+
+/*
+ * Sine generator
+ */
+typedef struct {
+  double a;
+  double s;
+  double c;
+} sine_t;
+
+static void init_sine(sine_t *sine)
+{
+  // symplectic integration for fast, stable harmonic oscillator
+  sine->a = 2.0*M_PI * freq / rate;
+  sine->c = 1.0;
+  sine->s = 0.0;
+}
+
+static value_t generate_sine(void *arg)
+{
+  sine_t *sine = arg;
+  value_t res;
+
+  res.f = sine->s * generator_scale;
+  if (format != SND_PCM_FORMAT_FLOAT_LE)
+    res.i = res.f * INT32_MAX;
 
-  *_phase = phase;
+  // update the oscillator
+  sine->c -= sine->a * sine->s;
+  sine->s += sine->a * sine->c;
+  return res;
 }
 
 /* Pink noise is a better test than sine wave because we can tell
  * where pink noise is coming from more easily that a sine wave.
  */
+static value_t generate_pink_noise(void *arg)
+{
+  pink_noise_t *pink = arg;
+  value_t res;
 
+  res.f = generate_pink_noise_sample(pink) * generator_scale;
+  if (format != SND_PCM_FORMAT_FLOAT_LE)
+    res.i = res.f * INT32_MAX;
+  return res;
+}
 
-static void generate_pink_noise( uint8_t *frames, int channel, int count) {
-  double   res;
-  int      chn;
-  int32_t  ires;
-  int8_t  *samp8 = (int8_t*) frames;
-  int16_t *samp16 = (int16_t*) frames;
-  int32_t *samp32 = (int32_t*) frames;
+/* Band-Limited Pink Noise, per SMPTE ST 2095-1
+ * beyond speaker localization, this can be used for setting loudness to standard
+ */
+static value_t generate_st2095_noise(void *arg)
+{
+  st2095_noise_t *st2095 = arg;
+  value_t res;
 
-  while (count-- > 0) {
-    for(chn=0;chn<channels;chn++) {
-      switch (format) {
-      case SND_PCM_FORMAT_S8:
-        if (chn==channel) {
-         res = generate_pink_noise_sample(&pink) * 0x03fffffff; /* Don't use MAX volume */
-         ires = res;
-         *samp8++ = ires >> 24;
-        } else {
-         *samp8++ = 0;
-        }
-        break;
-      case SND_PCM_FORMAT_S16_LE:
-        if (chn==channel) {
-         res = generate_pink_noise_sample(&pink) * 0x03fffffff; /* Don't use MAX volume */
-         ires = res;
-          *samp16++ = LE_SHORT(ires >> 16);
-        } else {
-         *samp16++ = 0;
-        }
-        break;
-      case SND_PCM_FORMAT_S16_BE:
-        if (chn==channel) {
-          res = generate_pink_noise_sample(&pink) * 0x03fffffff; /* Don't use MAX volume */
-          ires = res;
-          *samp16++ = BE_SHORT(ires >> 16);
-        } else {
-          *samp16++ = 0;
-        }
-        break;
-      case SND_PCM_FORMAT_S32_LE:
-        if (chn==channel) {
-          res = generate_pink_noise_sample(&pink) * 0x03fffffff; /* Don't use MAX volume */
-          ires = res;
-          *samp32++ = LE_INT(ires);
-        } else {
-          *samp32++ = 0;
-        }
-        break;
-      case SND_PCM_FORMAT_S32_BE:
-        if (chn==channel) {
-         res = generate_pink_noise_sample(&pink) * 0x03fffffff; /* Don't use MAX volume */
-         ires = res;
-         *samp32++ = BE_INT(ires);
-        } else {
-         *samp32++ = 0;
-        }
-        break;
-      default:
-        ;
-      }
-    }
-  }
+  res.f = generate_st2095_noise_sample(st2095);
+  if (format != SND_PCM_FORMAT_FLOAT_LE)
+    res.i = res.f * INT32_MAX;
+  return res;
 }
 
 /*
  * useful for tests
  */
-static void generate_pattern(uint8_t *frames, int channel, int count, int *_pattern) {
-  int pattern = *_pattern;
-  int    chn;
-  int8_t *samp8 = (int8_t*) frames;
-  int16_t *samp16 = (int16_t*) frames;
-  int32_t *samp32 = (int32_t*) frames;
-  float   *samp_f = (float*) frames;
-
-  while (count-- > 0) {
-    for(chn=0;chn<channels;chn++,pattern++) {
-      switch (format) {
-      case SND_PCM_FORMAT_S8:
-        if (chn==channel) {
-          *samp8++ = pattern & 0xff;
-        } else {
-          *samp8++ = 0;
-        }
-        break;
-      case SND_PCM_FORMAT_S16_LE:
-        if (chn==channel) {
-          *samp16++ = LE_SHORT(pattern & 0xfffff);
-        } else {
-          *samp16++ = 0;
-        }
-        break;
-      case SND_PCM_FORMAT_S16_BE:
-        if (chn==channel) {
-          *samp16++ = BE_SHORT(pattern & 0xffff);
-        } else {
-          *samp16++ = 0;
-        }
-        break;
-      case SND_PCM_FORMAT_FLOAT_LE:
-        if (chn==channel) {
-         *samp_f++ = LE_INT(((double)pattern) / INT32_MAX);
-        } else {
-         *samp_f++ = 0.0;
-        }
-        break;
-      case SND_PCM_FORMAT_S32_LE:
-        if (chn==channel) {
-          *samp32++ = LE_INT(pattern);
-        } else {
-          *samp32++ = 0;
-        }
-        break;
-      case SND_PCM_FORMAT_S32_BE:
-        if (chn==channel) {
-          *samp32++ = BE_INT(pattern);
-        } else {
-          *samp32++ = 0;
-        }
-        break;
-      default:
-        ;
-      }
-    }
-  }
+static value_t generate_pattern(void *arg)
+{
+  value_t res;
 
-  *_pattern = pattern;
+  res.i = *(int *)arg;
+  *(int *)arg = res.i + 1;
+  if (format != SND_PCM_FORMAT_FLOAT_LE)
+    res.f = (float)res.i / (float)INT32_MAX;
+  return res;
 }
 
 static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, snd_pcm_access_t access) {
@@ -562,11 +509,15 @@ static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, snd_pcm_
   printf(_("Buffer size range from %lu to %lu\n"),buffer_size_min, buffer_size_max);
   printf(_("Period size range from %lu to %lu\n"),period_size_min, period_size_max);
   if (period_time > 0) {
-    printf(_("Requested period time %u us\n"), period_time);
-    err = snd_pcm_hw_params_set_period_time_near(handle, params, &period_time, NULL);
+    unsigned int tmp = period_time;
+    if (period_time > 0 && period_time < UINT_MAX)
+      printf(_("Requested period time %u us\n"), period_time);
+    else
+      tmp = 250000; /* 0.25 second */
+    err = snd_pcm_hw_params_set_period_time_near(handle, params, &tmp, NULL);
     if (err < 0) {
       fprintf(stderr, _("Unable to set period time %u us for playback: %s\n"),
-            period_time, snd_strerror(err));
+            tmp, snd_strerror(err));
       return err;
     }
   }
@@ -842,7 +793,7 @@ static int setup_wav_file(int chn)
     return check_wav_file(chn, given_test_wav_file);
 
 #ifdef CONFIG_SUPPORT_CHMAP
-  if (channel_map_set && chn < channel_map->channels) {
+  if (channel_map && (unsigned int)chn < channel_map->channels) {
     int channel = channel_map->pos[chn] - SND_CHMAP_FL;
     if (channel >= 0 && channel < MAX_CHANNELS)
       return check_wav_file(chn, wavs[channel]);
@@ -881,9 +832,9 @@ static int read_wav(uint16_t *buf, int channel, int offset, int bufsize)
     bufsize = wav_file_size[channel] - offset;
   bufsize /= channels;
   for (size = 0; size < bufsize; size += 2) {
-    int chn;
+    unsigned int chn;
     for (chn = 0; chn < channels; chn++) {
-      if (chn == channel) {
+      if (chn == (unsigned int)channel) {
        if (fread(buf, 2, 1, wavfp) != 1)
          return size;
       }
@@ -926,23 +877,46 @@ static int write_buffer(snd_pcm_t *handle, uint8_t *ptr, int cptr)
   return 0;
 }
 
+static int pattern;
+static sine_t sine;
+static pink_noise_t pink;
+static st2095_noise_t st2095;
+
+static void init_loop(void)
+{
+  switch (test_type) {
+  case TEST_ST2095_NOISE:
+    initialize_st2095_noise(&st2095, rate);
+    break;
+  case TEST_PINK_NOISE:
+    initialize_pink_noise(&pink, 16);
+    break;
+  case TEST_SINE:
+    init_sine(&sine);
+    break;
+  case TEST_PATTERN:
+    pattern = 0;
+    break;
+  }
+}
+
 static int write_loop(snd_pcm_t *handle, int channel, int periods, uint8_t *frames)
 {
-  double phase = 0;
-  int   pattern = 0;
-  int    err, n;
+  unsigned int cnt;
+  int n;
+  int err;
 
   fflush(stdout);
   if (test_type == TEST_WAV) {
     int bufsize = snd_pcm_frames_to_bytes(handle, period_size);
-    n = 0;
-    while ((err = read_wav((uint16_t *)frames, channel, n, bufsize)) > 0 && !in_aborting) {
-      n += err;
+    cnt = 0;
+    while ((err = read_wav((uint16_t *)frames, channel, cnt, bufsize)) > 0 && !in_aborting) {
+      cnt += err;
       if ((err = write_buffer(handle, frames,
                              snd_pcm_bytes_to_frames(handle, err * channels))) < 0)
        break;
     }
-    if (buffer_size > n && !in_aborting) {
+    if (buffer_size > cnt && !in_aborting) {
       snd_pcm_drain(handle);
       snd_pcm_prepare(handle);
     }
@@ -955,11 +929,16 @@ static int write_loop(snd_pcm_t *handle, int channel, int periods, uint8_t *fram
 
   for(n = 0; n < periods && !in_aborting; n++) {
     if (test_type == TEST_PINK_NOISE)
-      generate_pink_noise(frames, channel, period_size);
+      do_generate(frames, channel, period_size, generate_pink_noise, &pink);
     else if (test_type == TEST_PATTERN)
-      generate_pattern(frames, channel, period_size, &pattern);
-    else
-      generate_sine(frames, channel, period_size, &phase);
+      do_generate(frames, channel, period_size, generate_pattern, &pattern);
+    else if (test_type == TEST_ST2095_NOISE) {
+      reset_st2095_noise_measurement(&st2095);
+      do_generate(frames, channel, period_size, generate_st2095_noise, &st2095);
+      printf(_("\tSMPTE ST-2095 noise batch was %2.2fdB RMS\n"),
+       compute_st2095_noise_measurement(&st2095, period_size));
+    } else
+      do_generate(frames, channel, period_size, generate_sine, &sine);
 
     if ((err = write_buffer(handle, frames, period_size)) < 0)
       return err;
@@ -1010,13 +989,14 @@ static void help(void)
           "-b,--buffer ring buffer size in us\n"
           "-p,--period period size in us\n"
           "-P,--nperiods       number of periods\n"
-          "-t,--test   pink=use pink noise, sine=use sine wave, wav=WAV file\n"
+          "-t,--test   pink=use pink noise, sine=use sine wave, st2095=use SMPTE ST-2095 noise, wav=WAV file\n"
           "-l,--nloops specify number of loops to test, 0 = infinite\n"
           "-s,--speaker        single speaker test. Values 1=Left, 2=right, etc\n"
           "-w,--wavfile        Use the given WAV file as a test sound\n"
           "-W,--wavdir Specify the directory containing WAV files\n"
           "-m,--chmap  Specify the channel map to override\n"
           "-X,--force-frequency        force frequencies outside the 30-8000hz range\n"
+          "-S,--scale  Scale of generated test tones in percent (default=80)\n"
           "\n"));
   printf(_("Recognized sample formats are:"));
   for (fmt = supported_formats; *fmt >= 0; fmt++) {
@@ -1034,11 +1014,12 @@ int main(int argc, char *argv[]) {
   snd_pcm_hw_params_t  *hwparams;
   snd_pcm_sw_params_t  *swparams;
   uint8_t              *frames;
-  int                   chn;
+  unsigned int          chn;
   const int           *fmt;
   double               time1,time2,time3;
   unsigned int         n, nloops;
   struct   timeval     tv1,tv2;
+  int                  speakeroptset = 0;
 #ifdef CONFIG_SUPPORT_CHMAP
   const char *chmap = NULL;
 #endif
@@ -1060,6 +1041,7 @@ int main(int argc, char *argv[]) {
     {"wavdir",    1, NULL, 'W'},
     {"debug",    0, NULL, 'd'},
     {"force-frequency",          0, NULL, 'X'},
+    {"scale",    1, NULL, 'S'},
 #ifdef CONFIG_SUPPORT_CHMAP
     {"chmap",    1, NULL, 'm'},
 #endif
@@ -1081,7 +1063,7 @@ int main(int argc, char *argv[]) {
   while (1) {
     int c;
     
-    if ((c = getopt_long(argc, argv, "hD:r:c:f:F:b:p:P:t:l:s:w:W:d:X"
+    if ((c = getopt_long(argc, argv, "hD:r:c:f:F:b:p:P:t:l:s:w:W:d:XS:"
 #ifdef CONFIG_SUPPORT_CHMAP
                         "m:"
 #endif
@@ -1108,7 +1090,7 @@ int main(int argc, char *argv[]) {
     case 'r':
       rate = atoi(optarg);
       rate = rate < 4000 ? 4000 : rate;
-      rate = rate > 384000 ? 384000 : rate;
+      rate = rate > 768000 ? 768000 : rate;
       break;
     case 'c':
       channels = atoi(optarg);
@@ -1120,11 +1102,11 @@ int main(int argc, char *argv[]) {
       break;
     case 'b':
       buffer_time = atoi(optarg);
-      buffer_time = buffer_time > 1000000 ? 1000000 : buffer_time;
+      buffer_time = buffer_time > 100000000 ? 100000000 : buffer_time;
       break;
     case 'p':
       period_time = atoi(optarg);
-      period_time = period_time > 1000000 ? 1000000 : period_time;
+      period_time = period_time > 100000000 ? 100000000 : period_time;
       break;
     case 'P':
       nperiods = atoi(optarg);
@@ -1136,9 +1118,16 @@ int main(int argc, char *argv[]) {
     case 't':
       if (*optarg == 'p')
        test_type = TEST_PINK_NOISE;
-      else if (*optarg == 's')
-       test_type = TEST_SINE;
-      else if (*optarg == 'w')
+      else if (*optarg == 's') {
+       if (optarg[1] == 'i')
+         test_type = TEST_SINE;
+       else if (optarg[1] == 't')
+         test_type = TEST_ST2095_NOISE;
+       else {
+         fprintf(stderr, _("Invalid test type %s\n"), optarg);
+         exit(1);
+       }
+      } else if (*optarg == 'w')
        test_type = TEST_WAV;
       else if (*optarg == 't')
        test_type = TEST_PATTERN;
@@ -1159,11 +1148,7 @@ int main(int argc, char *argv[]) {
     case 's':
       speaker = atoi(optarg);
       speaker = speaker < 1 ? 0 : speaker;
-      speaker = speaker > channels ? 0 : speaker;
-      if (speaker==0) {
-        fprintf(stderr, _("Invalid parameter for -s option.\n"));
-        exit(EXIT_FAILURE);
-      }  
+      speakeroptset = 1;
       break;
     case 'w':
       given_test_wav_file = optarg;
@@ -1182,6 +1167,9 @@ int main(int argc, char *argv[]) {
       chmap = optarg;
       break;
 #endif
+    case 'S':
+      generator_scale = atoi(optarg) / 100.0;
+      break;
     default:
       fprintf(stderr, _("Unknown option '%c'\n"), c);
       exit(EXIT_FAILURE);
@@ -1194,6 +1182,14 @@ int main(int argc, char *argv[]) {
     exit(EXIT_SUCCESS);
   }
 
+  if (speakeroptset) {
+    speaker = speaker > channels ? 0 : speaker;
+    if (speaker==0) {
+      fprintf(stderr, _("Invalid parameter for -s option.\n"));
+      exit(EXIT_FAILURE);
+    }
+  }
+
   if (!force_frequency) {
     freq = freq < 30.0 ? 30.0 : freq;
     freq = freq > 8000.0 ? 8000.0 : freq;
@@ -1207,6 +1203,9 @@ int main(int argc, char *argv[]) {
   printf(_("Playback device is %s\n"), device);
   printf(_("Stream parameters are %iHz, %s, %i channels\n"), rate, snd_pcm_format_name(format), channels);
   switch (test_type) {
+  case TEST_ST2095_NOISE:
+    printf(_("Using SMPTE ST-2095 -18.5dB AES FS band-limited pink noise\n"));
+    break;
   case TEST_PINK_NOISE:
     printf(_("Using 16 octaves of pink noise\n"));
     break;
@@ -1254,14 +1253,13 @@ int main(int argc, char *argv[]) {
   }
 
   frames = malloc(snd_pcm_frames_to_bytes(handle, period_size));
-  if (test_type == TEST_PINK_NOISE)
-    initialize_pink_noise(&pink, 16);
-  
   if (frames == NULL) {
     fprintf(stderr, _("No enough memory\n"));
     prg_exit(EXIT_FAILURE);
   }
 
+  init_loop();
+
   if (speaker==0) {
 
     if (test_type == TEST_WAV) {
diff --git a/speaker-test/st2095.c b/speaker-test/st2095.c
new file mode 100644 (file)
index 0000000..f036074
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+  st2095.c
+
+  Generate Bandlimited Pink Noise (-18.5dB AES FS)
+  Using the SMPTE ST 2095:1-2015 standard
+
+  Based on pseudo-code from the above SMPTE standard, which bore the credit
+  "Revised 2015-01-04 by Calvert Dayton"
+
+  Copyleft 2023 Rick Sayre - No rights reserved.
+*/
+
+#include "aconfig.h"
+#include <stdio.h>
+#include <math.h>
+#include "st2095.h"
+
+/************************************************************/
+
+
+void reset_st2095_noise_measurement( st2095_noise_t *st2095 ) {
+    st2095->accum = 0.;
+}
+
+float compute_st2095_noise_measurement( st2095_noise_t *st2095, int period ) {
+    return(10. * log10f(st2095->accum / (float)period) + 3.01);
+}
+
+void initialize_st2095_noise( st2095_noise_t *st2095, int sample_rate) {
+    // Periodicity in samples must be a power of two, <= 2^31
+    // Typical values are 524288, 1048576, 2097152 or 4194304
+    if (sample_rate > 48000) {
+       // Special case LCG step for 1024K samples @ 88.2K or 96k
+       st2095->samplesPerPeriod = 1048576;
+       st2095->randStep = 163841;
+    } else {
+       st2095->samplesPerPeriod = 524288;
+       st2095->randStep = 52737;
+    }
+
+    // set up LCG PRNG
+    st2095->randMax = st2095->samplesPerPeriod - 1;
+    st2095->seed = 0;
+    st2095->scaleFactor = 2.0 / (float)st2095->randMax;
+
+    st2095->maxAmp = powf(10.0, ST2095_MAX_PEAK / 20.0);
+
+    // Calculate omegaT for matched Z transform highpass filters
+    st2095->w0t = 2.0 * M_PI * ST2095_HPFC / (float)sample_rate;
+
+    //  Limit LpFc <= Nyquist (actually lower, based on 48 vs 22.4 KHz spec cutoff)
+    //          The spec says the filter begins at 22.4KHz, if we ask for a Nyquist-impossible
+    //          sampling rate, compute something with the same relationship
+    st2095->LpFc = ST2095_LPFC;
+    float rateratio = 48000. / ST2095_LPFC;
+    if (st2095->LpFc > sample_rate/rateratio)
+       st2095->LpFc = sample_rate/rateratio;
+
+    // Calculate k and k^2 for bilinear transform lowpass filters
+    st2095->k = tanf(( 2.0 * M_PI * st2095->LpFc / (float)sample_rate ) / 2.0);
+    st2095->k2 = st2095->k * st2095->k;
+
+    // Calculate biquad coefficients for bandpass filter components
+    st2095->hp1_a1 = -2.0 * expf(-0.3826835 * st2095->w0t) * cosf(0.9238795 * st2095->w0t);
+    st2095->hp1_a2 = expf(2.0 * -0.3826835 * st2095->w0t);
+    st2095->hp1_b0 = (1.0 - st2095->hp1_a1 + st2095->hp1_a2) / 4.0;
+    st2095->hp1_b1 = -2.0 * st2095->hp1_b0;
+    st2095->hp1_b2 = st2095->hp1_b0;
+
+    st2095->hp2_a1 = -2.0 * expf(-0.9238795 * st2095->w0t) * cosf(0.3826835 * st2095->w0t);
+    st2095->hp2_a2 = expf(2.0 * -0.9238795 * st2095->w0t);
+    st2095->hp2_b0 = (1.0 - st2095->hp2_a1 + st2095->hp2_a2) / 4.0;
+    st2095->hp2_b1 = -2.0 * st2095->hp2_b0;
+    st2095->hp2_b2 = st2095->hp2_b0;
+
+    st2095->lp1_a1 = (2.0 * (st2095->k2 - 1.0)) / (st2095->k2 + (st2095->k / 1.306563) + 1.0);
+    st2095->lp1_a2 = (st2095->k2 - (st2095->k / 1.306563) + 1.0) / (st2095->k2 + (st2095->k / 1.306563) + 1.0);
+    st2095->lp1_b0 = st2095->k2 / (st2095->k2 + (st2095->k / 1.306563) + 1.0);
+    st2095->lp1_b1 = 2.0 * st2095->lp1_b0;
+    st2095->lp1_b2 = st2095->lp1_b0;
+
+    st2095->lp2_a1 = (2.0 * (st2095->k2 - 1.0)) / (st2095->k2 + (st2095->k / 0.541196) + 1.0);
+    st2095->lp2_a2 = (st2095->k2 - (st2095->k / 0.541196) + 1.0) / (st2095->k2 + (st2095->k / 0.541196) + 1.0);
+    st2095->lp2_b0 = st2095->k2 / (st2095->k2 + (st2095->k / 0.541196) + 1.0);
+    st2095->lp2_b1 = 2.0 * st2095->lp2_b0;
+    st2095->lp2_b2 = st2095->lp2_b0;
+
+    // initialize delay lines for bandpass filter
+    st2095->hp1w1 = 0.0;
+    st2095->hp1w2 = 0.0;
+    st2095->hp2w1 = 0.0;
+    st2095->hp2w2 = 0.0;
+    st2095->lp1w1 = 0.0;
+    st2095->lp1w2 = 0.0;
+    st2095->lp2w1 = 0.0;
+    st2095->lp2w2 = 0.0;
+
+    // initialize delay lines for pink filter network
+    st2095->lp1 = 0.0;
+    st2095->lp2 = 0.0;
+    st2095->lp3 = 0.0;
+    st2095->lp4 = 0.0;
+    st2095->lp5 = 0.0;
+    st2095->lp6 = 0.0;
+
+    // cycle the generator for one complete time series to populate filter-bank delay lines
+    for (int i=0; i<st2095->samplesPerPeriod; i++)
+       generate_st2095_noise_sample(st2095);
+    st2095->accum = 0.0;
+}
+
+float generate_st2095_noise_sample( st2095_noise_t *st2095 ) {
+    float white, w, pink;
+
+    // Generate a pseudorandom integer in the range 0 <= seed <= randMax.
+    //# Bitwise AND with randMax zeroes out any unwanted high order bits.
+    st2095->seed = (1664525 * st2095->seed + st2095->randStep) & st2095->randMax;
+    // Scale to a real number in the range -1.0 <= white <= 1.0
+    white = (float)st2095->seed * st2095->scaleFactor - 1.0;
+
+    // Run pink filter; a parallel network of first-order LP filters, scaled to
+    // produce an output signal with target RMS = -21.5 dB FS (-18.5 dB AES FS)
+    // when bandpass filter cutoff frequencies are 10 Hz and 22.4 kHz.
+    st2095->lp1 = 0.9994551 * st2095->lp1 + 0.00198166688621989 * white;
+    st2095->lp2 = 0.9969859 * st2095->lp2 + 0.00263702334184061 * white;
+    st2095->lp3 = 0.9844470 * st2095->lp3 + 0.00643213710202331 * white;
+    st2095->lp4 = 0.9161757 * st2095->lp4 + 0.01438952538362820 * white;
+    st2095->lp5 = 0.6563399 * st2095->lp5 + 0.02698408541064610 * white;
+    pink = st2095->lp1 + st2095->lp2 + st2095->lp3 +
+       st2095->lp4 + st2095->lp5 + st2095->lp6 + white * 0.0342675832159306;
+    st2095->lp6 = white * 0.0088766118009356;
+
+    // Run bandpass filter; a series network of 4 biquad filters
+    // Biquad filters implemented in Direct Form II
+    w = pink - st2095->hp1_a1 * st2095->hp1w1 - st2095->hp1_a2 * st2095->hp1w2;
+    pink = st2095->hp1_b0 * w + st2095->hp1_b1 * st2095->hp1w1 + st2095->hp1_b2 * st2095->hp1w2;
+    st2095->hp1w2 = st2095->hp1w1;
+    st2095->hp1w1 = w;
+
+    w = pink - st2095->hp2_a1 * st2095->hp2w1 - st2095->hp2_a2 * st2095->hp2w2;
+    pink = st2095->hp2_b0 * w + st2095->hp2_b1 * st2095->hp2w1 + st2095->hp2_b2 * st2095->hp2w2;
+    st2095->hp2w2 = st2095->hp2w1;
+    st2095->hp2w1 = w;
+
+    w = pink - st2095->lp1_a1 * st2095->lp1w1 - st2095->lp1_a2 * st2095->lp1w2;
+    pink = st2095->lp1_b0 * w + st2095->lp1_b1 * st2095->lp1w1 + st2095->lp1_b2 * st2095->lp1w2;
+    st2095->lp1w2 = st2095->lp1w1;
+    st2095->lp1w1 = w;
+
+    w = pink - st2095->lp2_a1 * st2095->lp2w1 - st2095->lp2_a2 * st2095->lp2w2;
+    pink = st2095->lp2_b0 * w + st2095->lp2_b1 * st2095->lp2w1 + st2095->lp2_b2 * st2095->lp2w2;
+    st2095->lp2w2 = st2095->lp2w1;
+    st2095->lp2w1 = w;
+
+    // Limit peaks to +/-MaxAmp
+    if (pink > st2095->maxAmp)
+       pink = st2095->maxAmp;
+    else if (pink < -st2095->maxAmp)
+       pink = -st2095->maxAmp;
+
+    // accumulate squared amplitude for RMS computation
+    st2095->accum += (pink * pink);
+    return(pink);
+}
diff --git a/speaker-test/st2095.h b/speaker-test/st2095.h
new file mode 100644 (file)
index 0000000..32083da
--- /dev/null
@@ -0,0 +1,41 @@
+#define ST2095_MAX_PEAK -9.5    // dB
+#define ST2095_HPFC     10.0    // Highpass filter cutoff in Hz
+#define ST2095_LPFC     22400.0 // Lowpass filter cutoff in Hz
+
+typedef struct
+{
+  float maxAmp;
+  int samplesPerPeriod;
+  int randStep;
+  int randMax;
+  int seed;
+  float scaleFactor;
+  float w0t;
+  float k;
+  float k2;
+  float LpFc;
+  // biquad coefficients
+  float hp1_a1, hp1_a2;
+  float hp1_b0, hp1_b1, hp1_b2;
+  float hp2_a1, hp2_a2;
+  float hp2_b0, hp2_b1, hp2_b2;
+  float lp1_a1, lp1_a2;
+  float lp1_b0, lp1_b1, lp1_b2;
+  float lp2_a1, lp2_a2;
+  float lp2_b0, lp2_b1, lp2_b2;
+  // delay-line variables for bandpass filter
+  float hp1w1, hp1w2;
+  float hp2w1, hp2w2;
+  float lp1w1, lp1w2;
+  float lp2w1, lp2w2;
+  // delay-line variables for pink filter network
+  float lp1, lp2, lp3, lp4, lp5, lp6;
+  // statistics accumulator
+  float accum;
+} st2095_noise_t;
+
+void initialize_st2095_noise( st2095_noise_t *st2095, int sample_rate );
+float generate_st2095_noise_sample( st2095_noise_t *st2095 );
+
+void reset_st2095_noise_measurement( st2095_noise_t *st2095 );
+float compute_st2095_noise_measurement( st2095_noise_t *st2095, int period );
diff --git a/test-driver b/test-driver
new file mode 100755 (executable)
index 0000000..89dba1e
--- /dev/null
@@ -0,0 +1,148 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <<END
+Usage:
+  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+              [--expect-failure={yes|no}] [--color-tests={yes|no}]
+              [--enable-hard-errors={yes|no}] [--]
+              TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file=  # Where to save the output of the test script.
+trs_file=  # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+  case $1 in
+  --help) print_usage; exit $?;;
+  --version) echo "test-driver $scriptversion"; exit $?;;
+  --test-name) test_name=$2; shift;;
+  --log-file) log_file=$2; shift;;
+  --trs-file) trs_file=$2; shift;;
+  --color-tests) color_tests=$2; shift;;
+  --expect-failure) expect_failure=$2; shift;;
+  --enable-hard-errors) enable_hard_errors=$2; shift;;
+  --) shift; break;;
+  -*) usage_error "invalid option: '$1'";;
+   *) break;;
+  esac
+  shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file"  = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file"  = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+  usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+  usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+  # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+  red='\e[0;31m' # Red.
+  grn='\e[0;32m' # Green.
+  lgn='\e[1;32m' # Light green.
+  blu='\e[1;34m' # Blue.
+  mgn='\e[0;35m' # Magenta.
+  std='\e[m'     # No color.
+else
+  red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  tweaked_estatus=1
+else
+  tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/topology/Makefile.am b/topology/Makefile.am
new file mode 100644 (file)
index 0000000..61055d8
--- /dev/null
@@ -0,0 +1,25 @@
+SUBDIRS = nhlt
+
+bin_PROGRAMS = \
+       alsatplg
+
+if USE_RST2MAN
+man_MANS = alsatplg.1
+endif
+
+%.1: %.rst
+       rst2man $< > $@
+
+alsatplg_SOURCES = topology.c pre-processor.c pre-process-class.c pre-process-object.c \
+                   pre-process-dapm.c pre-process-dai.c
+
+noinst_HEADERS = topology.h pre-processor.h pre-process-external.h
+
+AM_CPPFLAGS = \
+         -Wall -I$(top_srcdir)/include -DALSA_TOPOLOGY_PLUGIN_DIR=\"@ALSA_TOPOLOGY_PLUGIN_DIR@\"
+
+alsatplg_LDADD = $(ALSA_TOPOLOGY_LIBS)
+
+EXTRA_DIST = alsatplg.rst
+
+CLEANFILES = alsatplg.1
diff --git a/topology/Makefile.in b/topology/Makefile.in
new file mode 100644 (file)
index 0000000..730975d
--- /dev/null
@@ -0,0 +1,929 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = alsatplg$(EXEEXT)
+subdir = topology
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_alsatplg_OBJECTS = topology.$(OBJEXT) pre-processor.$(OBJEXT) \
+       pre-process-class.$(OBJEXT) pre-process-object.$(OBJEXT) \
+       pre-process-dapm.$(OBJEXT) pre-process-dai.$(OBJEXT)
+alsatplg_OBJECTS = $(am_alsatplg_OBJECTS)
+am__DEPENDENCIES_1 =
+alsatplg_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/pre-process-class.Po \
+       ./$(DEPDIR)/pre-process-dai.Po ./$(DEPDIR)/pre-process-dapm.Po \
+       ./$(DEPDIR)/pre-process-object.Po ./$(DEPDIR)/pre-processor.Po \
+       ./$(DEPDIR)/topology.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(alsatplg_SOURCES)
+DIST_SOURCES = $(alsatplg_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+HEADERS = $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+SUBDIRS = nhlt
+@USE_RST2MAN_TRUE@man_MANS = alsatplg.1
+alsatplg_SOURCES = topology.c pre-processor.c pre-process-class.c pre-process-object.c \
+                   pre-process-dapm.c pre-process-dai.c
+
+noinst_HEADERS = topology.h pre-processor.h pre-process-external.h
+AM_CPPFLAGS = \
+         -Wall -I$(top_srcdir)/include -DALSA_TOPOLOGY_PLUGIN_DIR=\"@ALSA_TOPOLOGY_PLUGIN_DIR@\"
+
+alsatplg_LDADD = $(ALSA_TOPOLOGY_LIBS)
+EXTRA_DIST = alsatplg.rst
+CLEANFILES = alsatplg.1
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign topology/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign topology/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
+alsatplg$(EXEEXT): $(alsatplg_OBJECTS) $(alsatplg_DEPENDENCIES) $(EXTRA_alsatplg_DEPENDENCIES) 
+       @rm -f alsatplg$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(alsatplg_OBJECTS) $(alsatplg_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre-process-class.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre-process-dai.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre-process-dapm.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre-process-object.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre-processor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/topology.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man1: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man1dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.1[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
+           dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+           $(am__relativize); \
+           new_distdir=$$reldir; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+               -rm -f ./$(DEPDIR)/pre-process-class.Po
+       -rm -f ./$(DEPDIR)/pre-process-dai.Po
+       -rm -f ./$(DEPDIR)/pre-process-dapm.Po
+       -rm -f ./$(DEPDIR)/pre-process-object.Po
+       -rm -f ./$(DEPDIR)/pre-processor.Po
+       -rm -f ./$(DEPDIR)/topology.Po
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+               -rm -f ./$(DEPDIR)/pre-process-class.Po
+       -rm -f ./$(DEPDIR)/pre-process-dai.Po
+       -rm -f ./$(DEPDIR)/pre-process-dapm.Po
+       -rm -f ./$(DEPDIR)/pre-process-object.Po
+       -rm -f ./$(DEPDIR)/pre-processor.Po
+       -rm -f ./$(DEPDIR)/topology.Po
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--depfiles check check-am clean clean-binPROGRAMS \
+       clean-generic clean-libtool cscopelist-am ctags ctags-am \
+       distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am uninstall-binPROGRAMS uninstall-man \
+       uninstall-man1
+
+.PRECIOUS: Makefile
+
+
+%.1: %.rst
+       rst2man $< > $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/topology/alsatplg.rst b/topology/alsatplg.rst
new file mode 100644 (file)
index 0000000..56324d5
--- /dev/null
@@ -0,0 +1,102 @@
+==========
+ alsatplg
+==========
+
+----------------------
+ALSA Topology Compiler
+----------------------
+
+:Author: Jaroslav Kysela <perex@perex.cz>
+:Date:   2018-10-09
+:Copyright: GPLv2+
+:Manual section: 1
+:Manual group: General Commands Manual
+
+SYNOPSIS
+========
+
+*alsatplg* <options> [command]
+
+DESCRIPTION
+===========
+
+alsatplg (ALSA Topology compiler) is a program to compile topology
+configuration file to the binary file for the kernel drivers.
+
+Current audio drivers typically hard code topology information
+in the driver sources: This tightly couples the audio driver
+to the development board making it time consuming to modify
+a driver to work on a different devices. The driver is also
+tightly coupled to the DSP firmware version meaning extra care
+is needed to keep the driver and firmware version in sync.
+New firmware features also mean driver updates.
+
+The ALSA topology project removes the need for re-writing or
+porting audio drivers to different devices or different firmwares:
+Drivers have no hard coded topology data meaning a single driver
+can be used on different devices by updating the topology data
+from the file system. Firmware updates can be pushed without
+having to update the drivers. The new firmware just needs
+to include an updated topology file describing the update.
+
+OPTIONS
+=======
+
+Available options:
+
+  **-h**, **--help**
+    this help
+
+  **-V**, **--version**
+    show the utility version and versions of used libraries
+
+  **-c**, **--compile** `FILE`
+    source configuration file for the compilation
+
+  **-d**, **--decode** `FILE`
+    source binary topology file for the decode
+
+  **-n**, **--normalize** `FILE`
+    parse and save the configuration file in the normalized format
+
+  **-u**, **--dump** `FILE`
+    parse and save the configuration file in the specified format
+
+  **-o**, **--output** `FILE`
+    output file
+
+  **-v**, **--verbose** `LEVEL`
+    set verbose level
+
+  **-s**, **--sort**
+    sort the configuration identifiers (set for normalization)
+
+  **-x**, **--nocheck**
+    save the configuration without additional integrity check
+
+  **-z**, **--dapm-nosort**
+    do not sort DAPM graph items (like in version 1.2.1-)
+
+
+FILES
+=====
+
+The master topology files for each supported sound card are in
+``/usr/share/alsa/topology``.
+
+For example, the master use case file for the `broadwell` card is in
+``/usr/share/alsa/topology/broadwell/broadwell.conf``, this file
+describes the audio hardware for the driver.
+
+For more details on the syntax of UCM files, see the alsa-lib source code:
+http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/topology/parser.c
+
+SEE ALSO
+========
+
+* Topology Interface: http://www.alsa-project.org/alsa-doc/alsa-lib/group__topology.html
+
+BUGS
+====
+
+None known.
diff --git a/topology/nhlt/Makefile.am b/topology/nhlt/Makefile.am
new file mode 100644 (file)
index 0000000..1b68382
--- /dev/null
@@ -0,0 +1,29 @@
+alsatplg_module_nhlt_LTLIBRARIES = libalsatplg_module_nhlt.la
+
+alsatplg_module_nhltdir = @ALSA_TOPOLOGY_PLUGIN_DIR@
+
+AM_CFLAGS = -Wall -fvisibility=hidden -I$(top_srcdir)/include -I$(top_srcdir)/topology
+AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+
+libalsatplg_module_nhlt_la_SOURCES = nhlt-processor.c \
+                               intel/intel-nhlt.c \
+                               intel/dmic-nhlt.c \
+                               intel/dmic/dmic-debug.c intel/dmic/dmic-process.c \
+                               intel/ssp-nhlt.c \
+                               intel/ssp/ssp-debug.c intel/ssp/ssp-process.c
+
+noinst_HEADERS = nhlt.h \
+               intel/intel-nhlt.h \
+               intel/dmic-nhlt.h \
+               intel/dmic/dmic-intel.h \
+               intel/dmic/dmic-process.h \
+               intel/dmic/dmic-debug.h \
+               intel/dmic/dmic-internal.h \
+               intel/dmic/pdm-decim-fir.h \
+               intel/ssp-nhlt.h \
+               intel/ssp/ssp-debug.h \
+               intel/ssp/ssp-intel.h \
+               intel/ssp/ssp-process.h \
+               intel/ssp/ssp-internal.h
+
+libalsatplg_module_nhlt_la_LIBADD = @ALSA_LIBS@
diff --git a/topology/nhlt/Makefile.in b/topology/nhlt/Makefile.in
new file mode 100644 (file)
index 0000000..b54be3b
--- /dev/null
@@ -0,0 +1,819 @@
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = topology/nhlt
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/aconfig.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(alsatplg_module_nhltdir)"
+LTLIBRARIES = $(alsatplg_module_nhlt_LTLIBRARIES)
+libalsatplg_module_nhlt_la_DEPENDENCIES =
+am__dirstamp = $(am__leading_dot)dirstamp
+am_libalsatplg_module_nhlt_la_OBJECTS = nhlt-processor.lo \
+       intel/intel-nhlt.lo intel/dmic-nhlt.lo \
+       intel/dmic/dmic-debug.lo intel/dmic/dmic-process.lo \
+       intel/ssp-nhlt.lo intel/ssp/ssp-debug.lo \
+       intel/ssp/ssp-process.lo
+libalsatplg_module_nhlt_la_OBJECTS =  \
+       $(am_libalsatplg_module_nhlt_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/nhlt-processor.Plo \
+       intel/$(DEPDIR)/dmic-nhlt.Plo intel/$(DEPDIR)/intel-nhlt.Plo \
+       intel/$(DEPDIR)/ssp-nhlt.Plo \
+       intel/dmic/$(DEPDIR)/dmic-debug.Plo \
+       intel/dmic/$(DEPDIR)/dmic-process.Plo \
+       intel/ssp/$(DEPDIR)/ssp-debug.Plo \
+       intel/ssp/$(DEPDIR)/ssp-process.Plo
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(libalsatplg_module_nhlt_la_SOURCES)
+DIST_SOURCES = $(libalsatplg_module_nhlt_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+HEADERS = $(noinst_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
+ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
+ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSESINC = @CURSESINC@
+CURSESLIB = @CURSESLIB@
+CURSES_CFLAGS = @CURSES_CFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBRT = @LIBRT@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_UTIL_MAJOR = @SND_UTIL_MAJOR@
+SND_UTIL_MINOR = @SND_UTIL_MINOR@
+SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
+SND_UTIL_VERSION = @SND_UTIL_VERSION@
+STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+TESTSOUND = @TESTSOUND@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+mydatadir = @mydatadir@
+ncurses5_config = @ncurses5_config@
+ncursesw5_config = @ncursesw5_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevrulesdir = @udevrulesdir@
+xmlto_available = @xmlto_available@
+alsatplg_module_nhlt_LTLIBRARIES = libalsatplg_module_nhlt.la
+alsatplg_module_nhltdir = @ALSA_TOPOLOGY_PLUGIN_DIR@
+AM_CFLAGS = -Wall -fvisibility=hidden -I$(top_srcdir)/include -I$(top_srcdir)/topology
+AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+libalsatplg_module_nhlt_la_SOURCES = nhlt-processor.c \
+                               intel/intel-nhlt.c \
+                               intel/dmic-nhlt.c \
+                               intel/dmic/dmic-debug.c intel/dmic/dmic-process.c \
+                               intel/ssp-nhlt.c \
+                               intel/ssp/ssp-debug.c intel/ssp/ssp-process.c
+
+noinst_HEADERS = nhlt.h \
+               intel/intel-nhlt.h \
+               intel/dmic-nhlt.h \
+               intel/dmic/dmic-intel.h \
+               intel/dmic/dmic-process.h \
+               intel/dmic/dmic-debug.h \
+               intel/dmic/dmic-internal.h \
+               intel/dmic/pdm-decim-fir.h \
+               intel/ssp-nhlt.h \
+               intel/ssp/ssp-debug.h \
+               intel/ssp/ssp-intel.h \
+               intel/ssp/ssp-process.h \
+               intel/ssp/ssp-internal.h
+
+libalsatplg_module_nhlt_la_LIBADD = @ALSA_LIBS@
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign topology/nhlt/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign topology/nhlt/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-alsatplg_module_nhltLTLIBRARIES: $(alsatplg_module_nhlt_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       @list='$(alsatplg_module_nhlt_LTLIBRARIES)'; test -n "$(alsatplg_module_nhltdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(MKDIR_P) '$(DESTDIR)$(alsatplg_module_nhltdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(alsatplg_module_nhltdir)" || exit 1; \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(alsatplg_module_nhltdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(alsatplg_module_nhltdir)"; \
+       }
+
+uninstall-alsatplg_module_nhltLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(alsatplg_module_nhlt_LTLIBRARIES)'; test -n "$(alsatplg_module_nhltdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(alsatplg_module_nhltdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(alsatplg_module_nhltdir)/$$f"; \
+       done
+
+clean-alsatplg_module_nhltLTLIBRARIES:
+       -test -z "$(alsatplg_module_nhlt_LTLIBRARIES)" || rm -f $(alsatplg_module_nhlt_LTLIBRARIES)
+       @list='$(alsatplg_module_nhlt_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }
+intel/$(am__dirstamp):
+       @$(MKDIR_P) intel
+       @: > intel/$(am__dirstamp)
+intel/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) intel/$(DEPDIR)
+       @: > intel/$(DEPDIR)/$(am__dirstamp)
+intel/intel-nhlt.lo: intel/$(am__dirstamp) \
+       intel/$(DEPDIR)/$(am__dirstamp)
+intel/dmic-nhlt.lo: intel/$(am__dirstamp) \
+       intel/$(DEPDIR)/$(am__dirstamp)
+intel/dmic/$(am__dirstamp):
+       @$(MKDIR_P) intel/dmic
+       @: > intel/dmic/$(am__dirstamp)
+intel/dmic/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) intel/dmic/$(DEPDIR)
+       @: > intel/dmic/$(DEPDIR)/$(am__dirstamp)
+intel/dmic/dmic-debug.lo: intel/dmic/$(am__dirstamp) \
+       intel/dmic/$(DEPDIR)/$(am__dirstamp)
+intel/dmic/dmic-process.lo: intel/dmic/$(am__dirstamp) \
+       intel/dmic/$(DEPDIR)/$(am__dirstamp)
+intel/ssp-nhlt.lo: intel/$(am__dirstamp) \
+       intel/$(DEPDIR)/$(am__dirstamp)
+intel/ssp/$(am__dirstamp):
+       @$(MKDIR_P) intel/ssp
+       @: > intel/ssp/$(am__dirstamp)
+intel/ssp/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) intel/ssp/$(DEPDIR)
+       @: > intel/ssp/$(DEPDIR)/$(am__dirstamp)
+intel/ssp/ssp-debug.lo: intel/ssp/$(am__dirstamp) \
+       intel/ssp/$(DEPDIR)/$(am__dirstamp)
+intel/ssp/ssp-process.lo: intel/ssp/$(am__dirstamp) \
+       intel/ssp/$(DEPDIR)/$(am__dirstamp)
+
+libalsatplg_module_nhlt.la: $(libalsatplg_module_nhlt_la_OBJECTS) $(libalsatplg_module_nhlt_la_DEPENDENCIES) $(EXTRA_libalsatplg_module_nhlt_la_DEPENDENCIES) 
+       $(AM_V_CCLD)$(LINK) -rpath $(alsatplg_module_nhltdir) $(libalsatplg_module_nhlt_la_OBJECTS) $(libalsatplg_module_nhlt_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+       -rm -f intel/*.$(OBJEXT)
+       -rm -f intel/*.lo
+       -rm -f intel/dmic/*.$(OBJEXT)
+       -rm -f intel/dmic/*.lo
+       -rm -f intel/ssp/*.$(OBJEXT)
+       -rm -f intel/ssp/*.lo
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nhlt-processor.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/dmic-nhlt.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/intel-nhlt.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/$(DEPDIR)/ssp-nhlt.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/dmic/$(DEPDIR)/dmic-debug.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/dmic/$(DEPDIR)/dmic-process.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/ssp/$(DEPDIR)/ssp-debug.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@intel/ssp/$(DEPDIR)/ssp-process.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+       -rm -rf intel/.libs intel/_libs
+       -rm -rf intel/dmic/.libs intel/dmic/_libs
+       -rm -rf intel/ssp/.libs intel/ssp/_libs
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(alsatplg_module_nhltdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+       -rm -f intel/$(DEPDIR)/$(am__dirstamp)
+       -rm -f intel/$(am__dirstamp)
+       -rm -f intel/dmic/$(DEPDIR)/$(am__dirstamp)
+       -rm -f intel/dmic/$(am__dirstamp)
+       -rm -f intel/ssp/$(DEPDIR)/$(am__dirstamp)
+       -rm -f intel/ssp/$(am__dirstamp)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-alsatplg_module_nhltLTLIBRARIES clean-generic \
+       clean-libtool mostlyclean-am
+
+distclean: distclean-am
+               -rm -f ./$(DEPDIR)/nhlt-processor.Plo
+       -rm -f intel/$(DEPDIR)/dmic-nhlt.Plo
+       -rm -f intel/$(DEPDIR)/intel-nhlt.Plo
+       -rm -f intel/$(DEPDIR)/ssp-nhlt.Plo
+       -rm -f intel/dmic/$(DEPDIR)/dmic-debug.Plo
+       -rm -f intel/dmic/$(DEPDIR)/dmic-process.Plo
+       -rm -f intel/ssp/$(DEPDIR)/ssp-debug.Plo
+       -rm -f intel/ssp/$(DEPDIR)/ssp-process.Plo
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-alsatplg_module_nhltLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+               -rm -f ./$(DEPDIR)/nhlt-processor.Plo
+       -rm -f intel/$(DEPDIR)/dmic-nhlt.Plo
+       -rm -f intel/$(DEPDIR)/intel-nhlt.Plo
+       -rm -f intel/$(DEPDIR)/ssp-nhlt.Plo
+       -rm -f intel/dmic/$(DEPDIR)/dmic-debug.Plo
+       -rm -f intel/dmic/$(DEPDIR)/dmic-process.Plo
+       -rm -f intel/ssp/$(DEPDIR)/ssp-debug.Plo
+       -rm -f intel/ssp/$(DEPDIR)/ssp-process.Plo
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-alsatplg_module_nhltLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-alsatplg_module_nhltLTLIBRARIES clean-generic \
+       clean-libtool cscopelist-am ctags ctags-am distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-alsatplg_module_nhltLTLIBRARIES install-am \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall \
+       uninstall-alsatplg_module_nhltLTLIBRARIES uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/topology/nhlt/intel/dmic-nhlt.c b/topology/nhlt/intel/dmic-nhlt.c
new file mode 100644 (file)
index 0000000..de659cf
--- /dev/null
@@ -0,0 +1,523 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#include "aconfig.h"
+#include <stdint.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <alsa/global.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/conf.h>
+#include <alsa/error.h>
+#include "dmic-nhlt.h"
+#include "dmic/dmic-process.h"
+
+static int set_dmic_data(struct intel_nhlt_params *nhlt, snd_config_t *dai_cfg, snd_config_t *top)
+{
+       long unmute_ramp_time_ms = 0;
+       long fifo_word_length = 0;
+       long driver_version = 0;
+       long num_pdm_active = 0;
+       long sample_rate = 0;
+       long dai_index_t = 0;
+       long duty_min = 0;
+       long duty_max = 0;
+       long clk_min = 0;
+       long clk_max = 0;
+       long io_clk = 0;
+       int ret;
+
+       struct dai_values dmic_data[] = {
+               { "driver_version", SND_CONFIG_TYPE_INTEGER, NULL, &driver_version, NULL},
+               { "io_clk", SND_CONFIG_TYPE_INTEGER, NULL, &io_clk, NULL},
+               { "dai_index", SND_CONFIG_TYPE_INTEGER, NULL, &dai_index_t, NULL},
+               { "num_pdm_active", SND_CONFIG_TYPE_INTEGER, NULL, &num_pdm_active, NULL},
+               { "fifo_word_length", SND_CONFIG_TYPE_INTEGER, NULL, &fifo_word_length, NULL},
+               { "clk_min", SND_CONFIG_TYPE_INTEGER, NULL, &clk_min, NULL},
+               { "clk_max", SND_CONFIG_TYPE_INTEGER, NULL, &clk_max, NULL},
+               { "duty_min", SND_CONFIG_TYPE_INTEGER, NULL, &duty_min, NULL},
+               { "duty_max", SND_CONFIG_TYPE_INTEGER, NULL, &duty_max, NULL},
+               { "sample_rate", SND_CONFIG_TYPE_INTEGER, NULL, &sample_rate, NULL},
+               { "unmute_ramp_time_ms", SND_CONFIG_TYPE_INTEGER, NULL, &unmute_ramp_time_ms, NULL},
+       };
+
+       ret = find_set_values(&dmic_data[0], ARRAY_SIZE(dmic_data), dai_cfg, top, "Class.Dai.DMIC");
+       if (ret < 0)
+               return ret;
+
+       return dmic_set_params(nhlt, dai_index_t, driver_version, io_clk, num_pdm_active,
+                              fifo_word_length, clk_min, clk_max, duty_min, duty_max, sample_rate,
+                              unmute_ramp_time_ms);
+}
+
+static int set_pdm_data(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long mic_a_enable = 0;
+       long mic_b_enable = 0;
+       long polarity_a = 0;
+       long polarity_b = 0;
+       long clk_edge = 0;
+       long ctrl_id = 0;
+       long skew = 0;
+       int ret;
+
+       struct dai_values dmic_pdm_data[] = {
+               { "mic_a_enable", SND_CONFIG_TYPE_INTEGER, NULL, &mic_a_enable, NULL},
+               { "mic_b_enable", SND_CONFIG_TYPE_INTEGER, NULL, &mic_b_enable, NULL},
+               { "polarity_a", SND_CONFIG_TYPE_INTEGER, NULL, &polarity_a, NULL},
+               { "polarity_b", SND_CONFIG_TYPE_INTEGER, NULL, &polarity_b, NULL},
+               { "clk_edge", SND_CONFIG_TYPE_INTEGER, NULL, &clk_edge, NULL},
+               { "ctrl_id", SND_CONFIG_TYPE_INTEGER, NULL, &ctrl_id, NULL},
+               { "skew", SND_CONFIG_TYPE_INTEGER, NULL, &skew, NULL},
+       };
+
+       ret = find_set_values(&dmic_pdm_data[0], ARRAY_SIZE(dmic_pdm_data), cfg, top,
+                             "Class.Base.pdm_config");
+       if (ret < 0)
+               return ret;
+
+       return dmic_set_pdm_params(nhlt, ctrl_id, mic_a_enable, mic_b_enable, polarity_a,
+                                  polarity_b, clk_edge, skew);
+}
+
+static int set_mic_data(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long sensitivity = 0;
+       long snr = 0;
+       int ret;
+
+       struct dai_values dmic_mic_data[] = {
+               { "snr", SND_CONFIG_TYPE_INTEGER, NULL, &snr, NULL},
+               { "sensitivity", SND_CONFIG_TYPE_INTEGER, NULL, &snr, NULL},
+       };
+
+       ret = find_set_values(&dmic_mic_data[0], ARRAY_SIZE(dmic_mic_data), cfg, top,
+                             "Class.Base.mic_extension");
+       if (ret < 0)
+               return ret;
+
+       return dmic_set_ext_params(nhlt, snr, sensitivity);
+}
+
+static int set_vendor_mic_data(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long speaker_position_distance = 0;
+       long horizontal_angle_begin = 0;
+       long horizontal_angle_end = 0;
+       long vertical_angle_begin = 0;
+       long vertical_angle_end = 0;
+       long frequency_high_band = 0;
+       long frequency_low_band = 0;
+       long horizontal_offset = 0;
+       long vertical_offset = 0;
+       long direction_angle = 0;
+       long elevation_angle = 0;
+       long mic_type = 0;
+       long location = 0;
+       long mic_id = 0;
+       int ret;
+
+       struct dai_values dmic_vendor_data[] = {
+               { "mic_id", SND_CONFIG_TYPE_INTEGER, NULL, &mic_id, NULL},
+               { "mic_type", SND_CONFIG_TYPE_INTEGER, NULL, &mic_type, NULL},
+               { "location", SND_CONFIG_TYPE_INTEGER, NULL, &location, NULL},
+               { "speaker_position_distance", SND_CONFIG_TYPE_INTEGER, NULL,
+                 &speaker_position_distance, NULL},
+               { "horizontal_offset", SND_CONFIG_TYPE_INTEGER, NULL, &horizontal_offset, NULL},
+               { "vertical_offset", SND_CONFIG_TYPE_INTEGER, NULL, &vertical_offset, NULL},
+               { "frequency_low_band", SND_CONFIG_TYPE_INTEGER, NULL, &frequency_low_band, NULL},
+               { "frequency_high_band", SND_CONFIG_TYPE_INTEGER, NULL, &frequency_high_band, NULL},
+               { "direction_angle", SND_CONFIG_TYPE_INTEGER, NULL, &direction_angle, NULL},
+               { "elevation_angle", SND_CONFIG_TYPE_INTEGER, NULL, &elevation_angle, NULL},
+               { "vertical_angle_begin", SND_CONFIG_TYPE_INTEGER, NULL, &vertical_angle_begin,
+                 NULL},
+               { "vertical_angle_end", SND_CONFIG_TYPE_INTEGER, NULL, &vertical_angle_end, NULL},
+               { "horizontal_angle_begin", SND_CONFIG_TYPE_INTEGER, NULL, &horizontal_angle_begin,
+                 NULL},
+               { "horizontal_angle_end", SND_CONFIG_TYPE_INTEGER, NULL, &horizontal_angle_end,
+                 NULL},
+       };
+
+       ret = find_set_values(&dmic_vendor_data[0], ARRAY_SIZE(dmic_vendor_data), cfg, top,
+                             "Class.Base.vendor_mic_config");
+       if (ret < 0)
+               return ret;
+
+       return dmic_set_mic_params(nhlt, mic_id, mic_type, location, speaker_position_distance,
+                                  horizontal_offset, vertical_offset, frequency_low_band,
+                                  frequency_high_band, direction_angle, elevation_angle,
+                                  vertical_angle_begin, vertical_angle_end, horizontal_angle_begin,
+                                  horizontal_angle_end);
+}
+
+static int set_bytes_data(struct intel_nhlt_params *nhlt ATTRIBUTE_UNUSED, snd_config_t *cfg)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *n;
+       const char *bytes;
+       const char *id;
+
+       if (snd_config_get_id(cfg, &id) < 0)
+               return -EINVAL;
+
+       if (strcmp(id, "fir_coeffs"))
+               return 0;
+
+       snd_config_for_each(i, next, cfg) {
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_string(n, &bytes))
+                       return -EINVAL;
+       }
+
+       return 0;
+}
+
+/* init dmic parameters, should be called before parsing dais */
+int nhlt_dmic_init_params(struct intel_nhlt_params *nhlt)
+{
+       return dmic_init_params(nhlt);
+}
+
+/* get dmic endpoint count */
+int nhlt_dmic_get_ep_count(struct intel_nhlt_params *nhlt)
+{
+       return dmic_get_vendor_blob_count(nhlt);
+}
+
+int nhlt_dmic_get_ep(struct intel_nhlt_params *nhlt, struct endpoint_descriptor **eps,
+                    int index)
+{
+       struct endpoint_descriptor ep;
+       struct mic_array_device_specific_config mic_s_conf;
+       struct mic_array_device_specific_vendor_config mic_v_conf;
+       struct mic_snr_sensitivity_extension mic_ext;
+       struct mic_vendor_config mic_conf;
+       struct formats_config f_conf;
+       struct format_config f_conf1;
+       uint8_t *ep_target;
+       size_t blob_size;
+       int ret;
+       int i;
+
+       size_t mic_config_size;
+       uint32_t sample_rate;
+       uint16_t channel_count;
+       uint32_t bits_per_sample;
+       uint8_t array_type;
+       uint8_t extension;
+       uint8_t num_mics;
+       uint32_t snr;
+       uint32_t sensitivity;
+
+       uint8_t type;
+       uint8_t panel;
+       uint32_t speaker_position_distance;
+       uint32_t horizontal_offset;
+       uint32_t vertical_offset;
+       uint8_t frequency_low_band;
+       uint8_t frequency_high_band;
+       uint16_t direction_angle;
+       uint16_t elevation_angle;
+       uint16_t vertical_angle_begin;
+       uint16_t vertical_angle_end;
+       uint16_t horizontal_angle_begin;
+       uint16_t horizontal_angle_end;
+
+       /*
+        * nhlt dmic structure:
+        *
+        * endpoint_descriptor, sizeof(struct endpoint_descriptor)
+        *
+        * device_specific_config (mic), sizeof(mic_array_device_specific_config)
+        * or
+        * device_specific_config (mic), sizeof(mic_array_device_specific_vendor_config)
+        *
+        * formats_config (formats_count), sizeof(struct formats_config)
+        * format_config (waveex), sizeof(struct format_config)
+        * vendor_blob sizeof(vendor_blob)
+        */
+
+       /* dmic ep */
+       ep.link_type = NHLT_LINK_TYPE_PDM;
+       ep.instance_id = 0;
+       ep.vendor_id = NHLT_VENDOR_ID_INTEL;
+       ep.device_id = NHLT_DEVICE_ID_INTEL_PDM_DMIC;
+       ep.revision_id = 0;
+       ep.subsystem_id = 0;
+       ep.device_type = 0;
+       ep.direction = NHLT_ENDPOINT_DIRECTION_CAPTURE;
+       ep.virtualbus_id = index;
+
+       ret = dmic_get_params(nhlt, index, &sample_rate, &channel_count, &bits_per_sample,
+                             &array_type, &num_mics, &extension, &snr, &sensitivity);
+
+       if (ret) {
+               fprintf(stderr, "nhlt_dmic_get_ep: dmic_get_params failed\n");
+               return ret;
+       }
+
+       if (array_type == NHLT_MIC_ARRAY_TYPE_VENDOR_DEFINED) {
+               mic_v_conf.config.capabilities_size = 4 + num_mics *
+                       sizeof(struct mic_vendor_config);
+               mic_v_conf.device_config.virtual_slot = 0; /* always 0 for dmic */
+               mic_v_conf.device_config.config_type = NHLT_DEVICE_CONFIG_TYPE_MICARRAY;
+               mic_v_conf.number_of_microphones = num_mics;
+               mic_v_conf.array_type_ex = array_type;
+               /* precense of extension struct is coded into lower 4 bits of array_type */
+               if (extension) {
+                       mic_v_conf.array_type_ex = (array_type & ~0x0F) | (0x01 & 0x0F);
+                       mic_v_conf.config.capabilities_size +=
+                               sizeof(struct mic_snr_sensitivity_extension);
+               }
+       } else {
+               mic_s_conf.config.capabilities_size = 3;
+               mic_s_conf.device_config.virtual_slot = 0; /* always 0 for dmic */
+               mic_s_conf.device_config.config_type = NHLT_DEVICE_CONFIG_TYPE_MICARRAY;
+               mic_s_conf.array_type_ex = array_type;
+               /* presense of extension struct coded into lower 4 bits of array_type */
+               if (extension) {
+                       mic_s_conf.array_type_ex = (array_type & ~0x0F) | (0x01 & 0x0F);
+                       mic_s_conf.config.capabilities_size +=
+                               sizeof(struct mic_snr_sensitivity_extension);
+               }
+       }
+
+       /* formats_config */
+       f_conf.formats_count = 1;
+
+       /* fill in wave format extensible types */
+       f_conf1.format.wFormatTag = 0xFFFE;
+       f_conf1.format.nSamplesPerSec = sample_rate;
+       f_conf1.format.nChannels = channel_count;
+       f_conf1.format.wBitsPerSample = bits_per_sample;
+       f_conf1.format.nBlockAlign = channel_count * bits_per_sample / 8;
+       f_conf1.format.nAvgBytesPerSec = f_conf1.format.nSamplesPerSec * f_conf1.format.nBlockAlign;
+
+       /* bytes after this value in this struct */
+       f_conf1.format.cbSize = 22;
+       /* actual bits in container */
+       f_conf1.format.wValidBitsPerSample = bits_per_sample;
+       /* channel map not used at this time */
+       f_conf1.format.dwChannelMask = 0;
+       /* WAVE_FORMAT_PCM guid (0x0001) ? */
+       f_conf1.format.SubFormat[0] = 0;
+       f_conf1.format.SubFormat[1] = 0;
+       f_conf1.format.SubFormat[2] = 0;
+       f_conf1.format.SubFormat[3] = 0;
+
+       ret = dmic_get_vendor_blob_size(nhlt, &blob_size);
+       if (ret) {
+               fprintf(stderr, "nhlt_dmic_get_ep: dmic_get_vendor_blob_size failed\n");
+               return ret;
+       }
+
+       f_conf1.vendor_blob.capabilities_size = blob_size;
+
+       if (array_type == NHLT_MIC_ARRAY_TYPE_VENDOR_DEFINED)
+               mic_config_size = sizeof(struct mic_array_device_specific_vendor_config) +
+                       num_mics * sizeof(struct mic_vendor_config);
+       else
+               mic_config_size = sizeof(struct mic_array_device_specific_config);
+
+       if (extension)
+               mic_config_size = sizeof(struct mic_snr_sensitivity_extension);
+
+       ep.length = sizeof(struct endpoint_descriptor) +
+               mic_config_size +
+               sizeof(struct formats_config) +
+               sizeof(struct format_config) +
+               blob_size;
+
+       /* allocate the final variable length ep struct */
+       ep_target = calloc(ep.length, sizeof(uint8_t));
+       if (!ep_target)
+               return -ENOMEM;
+
+       *eps = (struct endpoint_descriptor *)ep_target;
+
+       /* copy all parsed sub arrays into the top level array */
+       memcpy(ep_target, &ep, sizeof(struct endpoint_descriptor));
+
+       ep_target += sizeof(struct endpoint_descriptor);
+
+       if (array_type == NHLT_MIC_ARRAY_TYPE_VENDOR_DEFINED) {
+               memcpy(ep_target, &mic_v_conf,
+                      sizeof(struct mic_array_device_specific_vendor_config));
+               ep_target += sizeof(struct mic_array_device_specific_vendor_config);
+               for (i = 0; i < num_mics; i++) {
+                       ret = dmic_get_mic_params(nhlt, i, &type,
+                                                 &panel, &speaker_position_distance,
+                                                 &horizontal_offset, &vertical_offset,
+                                                 &frequency_low_band, &frequency_high_band,
+                                                 &direction_angle, &elevation_angle,
+                                                 &vertical_angle_begin, &vertical_angle_end,
+                                                 &horizontal_angle_begin, &horizontal_angle_end);
+
+                       if (ret) {
+                               fprintf(stderr, "nhlt_dmic_get_ep: dmic_get_mic_params failed\n");
+                               return ret;
+                       }
+
+                       mic_conf.type = type;
+                       mic_conf.panel = panel;
+                       mic_conf.speaker_position_distance = speaker_position_distance;
+                       mic_conf.horizontal_offset = horizontal_offset;
+                       mic_conf.vertical_offset = vertical_offset;
+                       mic_conf.frequency_low_band = frequency_low_band;
+                       mic_conf.frequency_high_band = frequency_high_band;
+                       mic_conf.direction_angle = direction_angle;
+                       mic_conf.elevation_angle = elevation_angle;
+                       mic_conf.vertical_angle_begin = vertical_angle_begin;
+                       mic_conf.vertical_angle_end = vertical_angle_end;
+                       mic_conf.horizontal_angle_begin = horizontal_angle_begin;
+                       mic_conf.horizontal_angle_end = horizontal_angle_end;
+
+                       memcpy(ep_target, &mic_conf, sizeof(struct mic_vendor_config));
+                       ep_target += sizeof(struct mic_vendor_config);
+               }
+       } else {
+               memcpy(ep_target, &mic_s_conf, sizeof(struct mic_array_device_specific_config));
+               ep_target += sizeof(struct mic_array_device_specific_config);
+       }
+
+       if (extension) {
+               mic_ext.snr = snr;
+               mic_ext.sensitivity = sensitivity;
+               memcpy(ep_target, &mic_ext, sizeof(struct mic_snr_sensitivity_extension));
+               ep_target += sizeof(struct mic_snr_sensitivity_extension);
+       }
+
+       memcpy(ep_target, &f_conf, sizeof(struct formats_config));
+       ep_target += sizeof(struct formats_config);
+
+       memcpy(ep_target, &f_conf1, sizeof(struct format_config));
+       ep_target += sizeof(struct format_config);
+
+       ret = dmic_get_vendor_blob(nhlt, ep_target);
+       if (ret) {
+               fprintf(stderr, "nhlt_dmic_get_ep: dmic_get_vendor_blob failed\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * Set dmic parameters from topology for dmic coefficient calculation.
+ *
+ * Coefficients are recalculated in case of multiple DAIs in topology and might affect each other.
+ *
+ * You can see an example of topology v2 config of dmic below. In this example the default
+ * object parameters are spelled out for clarity. General parameters like clk_min are parsed with
+ * set_dmic_data and pdm object data with set_pdm_data. Number of pdm's can vary from 1 to 2. Values
+ * are saved into intermediate structs and the vendor specific blob is calculated at the end of
+ * parsing with dmic_calculate.
+ *
+ *     DMIC."0" {
+ *             name NoCodec-6
+ *             id 6
+ *             index 0
+ *             driver_version          1
+ *             io_clk                  38400000
+ *             clk_min                 500000
+ *             clk_max                 4800000
+ *             duty_min                40
+ *             duty_max                60
+ *             sample_rate             48000
+ *             fifo_word_length        16
+ *             unmute_ramp_time_ms     200
+ *             num_pdm_active          2
+ *
+ *             # PDM controller config
+ *             Object.Base.pdm_config."0" {
+ *                     ctrl_id 0
+ *                     mic_a_enable    1
+ *                     mic_b_enable    1
+ *                     polarity_a      0
+ *                     polarity_b      0
+ *                     clk_edge        0
+ *                     skew            0
+ *             }
+ *      }
+ */
+int nhlt_dmic_set_params(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       snd_config_t *items;
+       int ret;
+       snd_config_iterator_t i, next;
+       snd_config_t *n;
+       const char *id;
+
+       /* set basic dmic data */
+       ret = set_dmic_data(nhlt, cfg, top);
+       if (ret < 0)
+               return ret;
+
+       /* we need to have at least one pdm object */
+       ret = snd_config_search(cfg, "Object.Base.pdm_config", &items);
+       if (ret < 0)
+               return ret;
+
+       snd_config_for_each(i, next, items) {
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               ret = set_pdm_data(nhlt, n, top);
+               if (ret < 0)
+                       return ret;
+       }
+
+       /* check for microphone parameter configuration */
+       ret = snd_config_search(cfg, "Object.Base.mic_extension", &items);
+       if (!ret) {
+               snd_config_for_each(i, next, items) {
+                       n = snd_config_iterator_entry(i);
+
+                       if (snd_config_get_id(n, &id) < 0)
+                               continue;
+
+                       ret = set_mic_data(nhlt, n, top);
+                       if (ret < 0)
+                               return ret;
+               }
+       }
+
+       /* check for microphone parameter configuration */
+       ret = snd_config_search(cfg, "Object.Base.vendor_mic_config", &items);
+       if (!ret) {
+               snd_config_for_each(i, next, items) {
+                       n = snd_config_iterator_entry(i);
+
+                       if (snd_config_get_id(n, &id) < 0)
+                               continue;
+
+                       set_vendor_mic_data(nhlt, n, top);
+               }
+       }
+
+       /* check for optional filter coeffs */
+       ret = snd_config_search(cfg, "Object.Base.data", &items);
+       if (!ret) {
+               snd_config_for_each(i, next, items) {
+                       n = snd_config_iterator_entry(i);
+
+                       if (snd_config_get_id(n, &id) < 0)
+                               continue;
+
+                       set_bytes_data(nhlt, n);
+               }
+       }
+
+       ret = dmic_calculate(nhlt);
+
+       return ret;
+}
diff --git a/topology/nhlt/intel/dmic-nhlt.h b/topology/nhlt/intel/dmic-nhlt.h
new file mode 100644 (file)
index 0000000..73aaad5
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __DMIC_NHLT_H
+#define __DMIC_NHLT_H
+
+#include "intel-nhlt.h"
+#include "../nhlt.h"
+
+int nhlt_dmic_init_params(struct intel_nhlt_params *nhlt);
+int nhlt_dmic_set_params(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top);
+int nhlt_dmic_get_ep(struct intel_nhlt_params *nhlt, struct endpoint_descriptor **eps,
+                    int index);
+int nhlt_dmic_get_ep_count(struct intel_nhlt_params *nhlt);
+
+#endif
diff --git a/topology/nhlt/intel/dmic/dmic-debug.c b/topology/nhlt/intel/dmic/dmic-debug.c
new file mode 100644 (file)
index 0000000..a977c93
--- /dev/null
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#include "aconfig.h"
+#include <stdio.h>
+#include <stdint.h>
+#include <alsa/global.h>
+#include "dmic-debug.h"
+
+#ifdef NHLT_DEBUG
+
+/* print blob as bytes hex string like: 0x11,0xff,0xff,0xff etc. */
+void dmic_print_bytes_as_hex(uint8_t *src, size_t size)
+{
+       int i, j, lines, remain;
+
+       fprintf(stdout, "printing dmic vendor blob as bytes:\n");
+
+       lines = size / 8;
+       remain = size % 8;
+       for (i = 0; i < lines; i++) {
+               for (j = 0; j < 8; j++) {
+                       fprintf(stdout, "0x%02x,", *src);
+                       src++;
+               }
+               fprintf(stdout, "\n");
+       }
+       for (i = 0; i < remain; i++) {
+               fprintf(stdout, "0x%02x,", *src);
+               src++;
+       }
+
+       fprintf(stdout, "\n");
+}
+
+/* print blob as 32 bit integer hex string like: 0xffffffff,0x00000010 etc. */
+void dmic_print_integers_as_hex(uint32_t *src, size_t size)
+{
+       int i, j, lines, remain;
+
+       fprintf(stdout, "printing dmic vendor blob as integers:\n");
+
+       lines = size / 8;
+       remain = size % 8;
+       for (i = 0; i < lines; i++) {
+               for (j = 0; j < 8; j++) {
+                       fprintf(stdout, "0x%08x,", *src);
+                       src++;
+               }
+               fprintf(stdout, "\n");
+       }
+       for (i = 0; i < remain; i++) {
+               fprintf(stdout, "0x%08x,", *src);
+               src++;
+       }
+
+       fprintf(stdout, "\n");
+}
+
+void dmic_print_internal(struct intel_dmic_params *dmic)
+{
+       int i, j, line, lines, remain;
+
+       fprintf(stdout, "printing dmic nhlt internal data:\n");
+
+       /* top level struct */
+       fprintf(stdout, "gateway attributes: 0x%08x\n", dmic->dmic_blob.gateway_attributes);
+
+       fprintf(stdout, "ts_group: 0x%08x 0x%08x 0x%08x 0x%08x\n", dmic->dmic_blob.ts_group[0],
+               dmic->dmic_blob.ts_group[1], dmic->dmic_blob.ts_group[2],
+               dmic->dmic_blob.ts_group[3]);
+
+       fprintf(stdout, "clock_on_delay: 0x%08x\n", dmic->dmic_blob.clock_on_delay);
+
+       fprintf(stdout, "channel_ctrl_mask: 0x%08x\n", dmic->dmic_blob.channel_ctrl_mask);
+
+       fprintf(stdout, "chan_ctrl_cfg: 0x%08x 0x%08x\n", dmic->dmic_blob.chan_ctrl_cfg[0],
+               dmic->dmic_blob.chan_ctrl_cfg[1]);
+
+       fprintf(stdout, "channel_pdm_mask: 0x%08x\n", dmic->dmic_blob.channel_pdm_mask);
+
+       /* first pdm struct */
+       fprintf(stdout, "pdm_ctrl_cfg 0\n");
+       fprintf(stdout, "cic_control: 0x%08x\n", dmic->dmic_blob_pdm[0].cic_control);
+       fprintf(stdout, "cic_config: 0x%08x\n", dmic->dmic_blob_pdm[0].cic_config);
+       fprintf(stdout, "mic_control: 0x%08x\n", dmic->dmic_blob_pdm[0].mic_control);
+       fprintf(stdout, "pdmsm: 0x%08x\n", dmic->dmic_blob_pdm[0].pdmsm);
+       fprintf(stdout, "reuse_fir_from_pdm: 0x%08x\n", dmic->dmic_blob_pdm[0].reuse_fir_from_pdm);
+
+       /* first pdm struct, first fir */
+       fprintf(stdout, "fir_config 0\n");
+       fprintf(stdout, "fir_control: 0x%08x\n", dmic->dmic_blob_fir[0][0].fir_control);
+       fprintf(stdout, "fir_config: 0x%08x\n", dmic->dmic_blob_fir[0][0].fir_config);
+       fprintf(stdout, "dc_offset_left: 0x%08x\n", dmic->dmic_blob_fir[0][0].dc_offset_left);
+       fprintf(stdout, "dc_offset_right: 0x%08x\n", dmic->dmic_blob_fir[0][0].dc_offset_right);
+       fprintf(stdout, "out_gain_left: 0x%08x\n", dmic->dmic_blob_fir[0][0].out_gain_left);
+       fprintf(stdout, "out_gain_right: 0x%08x\n", dmic->dmic_blob_fir[0][0].out_gain_right);
+
+       /* first pdm struct, second fir */
+       fprintf(stdout, "fir_config 1\n");
+       fprintf(stdout, "fir_control: 0x%08x\n", dmic->dmic_blob_fir[0][1].fir_control);
+       fprintf(stdout, "fir_config: 0x%08x\n", dmic->dmic_blob_fir[0][1].fir_config);
+       fprintf(stdout, "dc_offset_left: 0x%08x\n", dmic->dmic_blob_fir[0][1].dc_offset_left);
+       fprintf(stdout, "dc_offset_right: 0x%08x\n", dmic->dmic_blob_fir[0][1].dc_offset_right);
+       fprintf(stdout, "out_gain_left: 0x%08x\n", dmic->dmic_blob_fir[0][1].out_gain_left);
+       fprintf(stdout, "out_gain_right: 0x%08x\n", dmic->dmic_blob_fir[0][1].out_gain_right);
+
+       /* first pdm struct, fir coeffs */
+       for (j = 0; j < DMIC_HW_CONTROLLERS; j++) {
+               fprintf(stdout, "fir_coeffs a length %u:\n", dmic->dmic_fir_array.fir_len[0]);
+               lines = dmic->dmic_fir_array.fir_len[0] / 8;
+               remain = dmic->dmic_fir_array.fir_len[0] % 8;
+               for (i = 0; i < lines; i++) {
+                       line = i * 8;
+                       fprintf(stdout, "%d %d %d %d %d %d %d %d %d\n", i,
+                               dmic->dmic_fir_array.fir_coeffs[j][0][line],
+                               dmic->dmic_fir_array.fir_coeffs[j][0][line + 1],
+                               dmic->dmic_fir_array.fir_coeffs[j][0][line + 2],
+                               dmic->dmic_fir_array.fir_coeffs[j][0][line + 3],
+                               dmic->dmic_fir_array.fir_coeffs[j][0][line + 4],
+                               dmic->dmic_fir_array.fir_coeffs[j][0][line + 5],
+                               dmic->dmic_fir_array.fir_coeffs[j][0][line + 6],
+                               dmic->dmic_fir_array.fir_coeffs[j][0][line + 7]);
+               }
+               line += 1;
+               for (i = 0; i < remain; i++)
+                       fprintf(stdout, "%d ", dmic->dmic_fir_array.fir_coeffs[j][0][line + i]);
+       }
+
+       /* second pdm struct */
+       fprintf(stdout, "pdm_ctrl_cfg 1\n");
+       fprintf(stdout, "cic_control: 0x%08x\n", dmic->dmic_blob_pdm[1].cic_control);
+       fprintf(stdout, "cic_config: 0x%08x\n", dmic->dmic_blob_pdm[1].cic_config);
+       fprintf(stdout, "mic_control: 0x%08x\n", dmic->dmic_blob_pdm[1].mic_control);
+       fprintf(stdout, "pdmsm: 0x%08x\n", dmic->dmic_blob_pdm[1].pdmsm);
+       fprintf(stdout, "reuse_fir_from_pdm: 0x%08x\n", dmic->dmic_blob_pdm[1].reuse_fir_from_pdm);
+
+       /* second pdm struct, first fir */
+       fprintf(stdout, "fir_config 0\n");
+       fprintf(stdout, "fir_control: 0x%08x\n", dmic->dmic_blob_fir[1][0].fir_control);
+       fprintf(stdout, "fir_config: 0x%08x\n", dmic->dmic_blob_fir[1][0].fir_config);
+       fprintf(stdout, "dc_offset_left: 0x%08x\n", dmic->dmic_blob_fir[1][0].dc_offset_left);
+       fprintf(stdout, "dc_offset_right: 0x%08x\n", dmic->dmic_blob_fir[1][0].dc_offset_right);
+       fprintf(stdout, "out_gain_left: 0x%08x\n", dmic->dmic_blob_fir[1][0].out_gain_left);
+       fprintf(stdout, "out_gain_right: 0x%08x\n", dmic->dmic_blob_fir[1][0].out_gain_right);
+
+       /* second pdm struct, second fir */
+       fprintf(stdout, "fir_config 1\n");
+       fprintf(stdout, "fir_control: 0x%08x\n", dmic->dmic_blob_fir[1][1].fir_control);
+       fprintf(stdout, "fir_config: 0x%08x\n", dmic->dmic_blob_fir[1][1].fir_config);
+       fprintf(stdout, "dc_offset_left: 0x%08x\n", dmic->dmic_blob_fir[1][1].dc_offset_left);
+       fprintf(stdout, "dc_offset_right: 0x%08x\n", dmic->dmic_blob_fir[1][1].dc_offset_right);
+       fprintf(stdout, "out_gain_left: 0x%08x\n", dmic->dmic_blob_fir[1][1].out_gain_left);
+       fprintf(stdout, "out_gain_right: 0x%08x\n", dmic->dmic_blob_fir[1][1].out_gain_right);
+
+       for (j = 0; j < DMIC_HW_CONTROLLERS; j++) {
+               fprintf(stdout, "fir_coeffs b length %u:\n", dmic->dmic_fir_array.fir_len[1]);
+               lines = dmic->dmic_fir_array.fir_len[1] / 8;
+               remain = dmic->dmic_fir_array.fir_len[1] % 8;
+               for (i = 0; i < lines; i++) {
+                       line = i * 8;
+                       fprintf(stdout, "%d %d %d %d %d %d %d %d %d\n", i,
+                               dmic->dmic_fir_array.fir_coeffs[j][1][line],
+                               dmic->dmic_fir_array.fir_coeffs[j][1][line + 1],
+                               dmic->dmic_fir_array.fir_coeffs[j][1][line + 2],
+                               dmic->dmic_fir_array.fir_coeffs[j][1][line + 3],
+                               dmic->dmic_fir_array.fir_coeffs[j][1][line + 4],
+                               dmic->dmic_fir_array.fir_coeffs[j][1][line + 5],
+                               dmic->dmic_fir_array.fir_coeffs[j][1][line + 6],
+                               dmic->dmic_fir_array.fir_coeffs[j][1][line + 7]);
+               }
+               line += 1;
+               for (i = 0; i < remain; i++)
+                       fprintf(stdout, "%d ", dmic->dmic_fir_array.fir_coeffs[j][1][line + i]);
+       }
+
+       fprintf(stdout, "\n");
+}
+
+#else /* NHLT_DEBUG */
+void dmic_print_bytes_as_hex(uint8_t *src ATTRIBUTE_UNUSED, size_t size ATTRIBUTE_UNUSED) {}
+void dmic_print_integers_as_hex(uint32_t *src ATTRIBUTE_UNUSED, size_t size ATTRIBUTE_UNUSED) {}
+void dmic_print_internal(struct intel_dmic_params *dmic ATTRIBUTE_UNUSED) {}
+#endif
diff --git a/topology/nhlt/intel/dmic/dmic-debug.h b/topology/nhlt/intel/dmic/dmic-debug.h
new file mode 100644 (file)
index 0000000..858b65d
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __DMIC_DEBUG_H
+#define __DMIC_DEBUG_H
+
+#include "dmic-internal.h"
+
+void dmic_print_bytes_as_hex(uint8_t *src, size_t size);
+void dmic_print_integers_as_hex(uint32_t *src, size_t size);
+void dmic_print_internal(struct intel_dmic_params *dmic);
+
+#endif
diff --git a/topology/nhlt/intel/dmic/dmic-intel.h b/topology/nhlt/intel/dmic/dmic-intel.h
new file mode 100644 (file)
index 0000000..253aca9
--- /dev/null
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __DMIC_INTEL_H
+#define __DMIC_INTEL_H
+
+#include <stdint.h>
+
+#define DMIC_TS_GROUP_SIZE 4
+
+/* structs for intel dmic nhlt vendor specific blob generation */
+struct dmic_intel_fir_config {
+       uint32_t fir_control;
+       uint32_t fir_config;
+       uint32_t dc_offset_left;
+       uint32_t dc_offset_right;
+       uint32_t out_gain_left;
+       uint32_t out_gain_right;
+       uint32_t reserved2[2];
+       uint32_t fir_coeffs[];
+} __attribute__((packed));
+
+struct dmic_intel_pdm_ctrl_cfg {
+       uint32_t cic_control;
+       uint32_t cic_config;
+       uint32_t reserved0;
+       uint32_t mic_control;
+       uint32_t pdmsm;
+       uint32_t reuse_fir_from_pdm;
+       uint32_t reserved1[2];
+       struct dmic_intel_fir_config fir_config[];
+} __attribute__((packed));
+
+struct dmic_intel_config_data {
+       uint32_t gateway_attributes;
+       uint32_t ts_group[DMIC_TS_GROUP_SIZE];
+       uint32_t clock_on_delay;
+       uint32_t channel_ctrl_mask;
+       uint32_t chan_ctrl_cfg[2];
+       uint32_t channel_pdm_mask;
+       struct dmic_intel_pdm_ctrl_cfg pdm_ctrl_cfg[];
+} __attribute__((packed));
+
+#endif /* __DMIC_INTEL_H */
diff --git a/topology/nhlt/intel/dmic/dmic-internal.h b/topology/nhlt/intel/dmic/dmic-internal.h
new file mode 100644 (file)
index 0000000..bbdfd34
--- /dev/null
@@ -0,0 +1,335 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __DMIC_MACROS_H
+#define __DMIC_MACROS_H
+
+#include "dmic-intel.h"
+
+#define DMIC_HW_CONTROLLERS    2
+#define DMIC_HW_FIFOS          2
+#define DMIC_HW_FIR_LENGTH_MAX 250
+
+/* Get max and min signed integer values for N bits word length */
+#define INT_MAX(N)     ((int64_t)((1ULL << ((N) - 1)) - 1))
+
+/* Fractional multiplication with shift and round
+ * Note that the parameters px and py must be cast to (int64_t) if other type.
+ */
+#define Q_MULTSR_32X32(px, py, qx, qy, qp) \
+       ((((px) * (py) >> ((qx) + (qy) - (qp) - 1)) + 1) >> 1)
+
+/* Convert a float number to fractional Qnx.ny format. Note that there is no
+ * check for nx+ny number of bits to fit the word length of int. The parameter
+ * qy must be 31 or less.
+ */
+#define Q_CONVERT_FLOAT(f, qy) \
+       ((int32_t)(((const double)f) * ((int64_t)1 << (const int)qy) + 0.5))
+
+/* Saturation */
+#define SATP_INT32(x) (((x) > INT32_MAX) ? INT32_MAX : (x))
+
+#define DMIC_MAX_MODES 50
+#define DMIC_FIR_PIPELINE_OVERHEAD 5
+
+/* Minimum OSR is always applied for 48 kHz and less sample rates */
+#define DMIC_MIN_OSR  50
+
+/* These are used as guideline for configuring > 48 kHz sample rates. The
+ * minimum OSR can be relaxed down to 40 (use 3.84 MHz clock for 96 kHz).
+ */
+#define DMIC_HIGH_RATE_MIN_FS  64000
+#define DMIC_HIGH_RATE_OSR_MIN 40
+
+/* Used for scaling FIR coefficients for HW */
+#define DMIC_HW_FIR_COEF_MAX ((1 << (DMIC_HW_BITS_FIR_COEF - 1)) - 1)
+#define DMIC_HW_FIR_COEF_Q (DMIC_HW_BITS_FIR_COEF - 1)
+
+/* Internal precision in gains computation, e.g. Q4.28 in int32_t */
+#define DMIC_FIR_SCALE_Q 28
+
+/* Parameters used in modes computation */
+#define DMIC_HW_BITS_CIC               26
+#define DMIC_HW_BITS_FIR_COEF          20
+#define DMIC_HW_BITS_FIR_GAIN          20
+#define DMIC_HW_BITS_FIR_INPUT         22
+#define DMIC_HW_BITS_FIR_OUTPUT                24
+#define DMIC_HW_BITS_FIR_INTERNAL      26
+#define DMIC_HW_BITS_GAIN_OUTPUT       22
+#define DMIC_HW_CIC_SHIFT_MIN          -8
+#define DMIC_HW_CIC_SHIFT_MAX          4
+#define DMIC_HW_FIR_SHIFT_MIN          0
+#define DMIC_HW_FIR_SHIFT_MAX          8
+#define DMIC_HW_CIC_DECIM_MIN          5
+#define DMIC_HW_CIC_DECIM_MAX          31 /* Note: Limited by BITS_CIC */
+#define DMIC_HW_FIR_DECIM_MIN          2
+#define DMIC_HW_FIR_DECIM_MAX          20 /* Note: Practical upper limit */
+#define DMIC_HW_SENS_Q28               Q_CONVERT_FLOAT(1.0, 28) /* Q1.28 */
+#define DMIC_HW_PDM_CLK_MIN            100000 /* Note: Practical min value */
+#define DMIC_HW_DUTY_MIN               20 /* Note: Practical min value */
+#define DMIC_HW_DUTY_MAX               80 /* Note: Practical max value */
+
+/* OUTCONTROL0 bits */
+#define OUTCONTROL0_TIE_BIT    BIT(27)
+#define OUTCONTROL0_SIP_BIT    BIT(26)
+#define OUTCONTROL0_FINIT_BIT  BIT(25)
+#define OUTCONTROL0_FCI_BIT    BIT(24)
+#define OUTCONTROL0_TIE(x)     SET_BIT(27, x)
+#define OUTCONTROL0_SIP(x)     SET_BIT(26, x)
+#define OUTCONTROL0_FINIT(x)   SET_BIT(25, x)
+#define OUTCONTROL0_FCI(x)     SET_BIT(24, x)
+#define OUTCONTROL0_BFTH(x)    SET_BITS(23, 20, x)
+#define OUTCONTROL0_OF(x)      SET_BITS(19, 18, x)
+#define OUTCONTROL0_TH(x)      SET_BITS(5, 0, x)
+
+/* OUTCONTROL1 bits */
+#define OUTCONTROL1_TIE_BIT    BIT(27)
+#define OUTCONTROL1_SIP_BIT    BIT(26)
+#define OUTCONTROL1_FINIT_BIT  BIT(25)
+#define OUTCONTROL1_FCI_BIT    BIT(24)
+#define OUTCONTROL1_TIE(x)     SET_BIT(27, x)
+#define OUTCONTROL1_SIP(x)     SET_BIT(26, x)
+#define OUTCONTROL1_FINIT(x)   SET_BIT(25, x)
+#define OUTCONTROL1_FCI(x)     SET_BIT(24, x)
+#define OUTCONTROL1_BFTH(x)    SET_BITS(23, 20, x)
+#define OUTCONTROL1_OF(x)      SET_BITS(19, 18, x)
+#define OUTCONTROL1_TH(x)      SET_BITS(5, 0, x)
+
+/* OUTCONTROL0 bits ver1*/
+#define OUTCONTROL0_IPM_VER1(x)        SET_BITS(17, 16, x)
+/* OUTCONTROL1 bits ver1 */
+#define OUTCONTROL1_IPM_VER1(x)        SET_BITS(17, 16, x)
+
+/* OUTCONTROL0 bits */
+#define OUTCONTROL0_IPM_VER2(x)                        SET_BITS(17, 15, x)
+#define OUTCONTROL0_IPM_SOURCE_1(x)            SET_BITS(14, 13, x)
+#define OUTCONTROL0_IPM_SOURCE_2(x)            SET_BITS(12, 11, x)
+#define OUTCONTROL0_IPM_SOURCE_3(x)            SET_BITS(10, 9, x)
+#define OUTCONTROL0_IPM_SOURCE_4(x)            SET_BITS(8, 7, x)
+#define OUTCONTROL0_IPM_SOURCE_MODE(x)         SET_BIT(6, x)
+
+/* OUTCONTROL1 bits */
+#define OUTCONTROL1_IPM_VER2(x)                        SET_BITS(17, 15, x)
+#define OUTCONTROL1_IPM_SOURCE_1(x)            SET_BITS(14, 13, x)
+#define OUTCONTROL1_IPM_SOURCE_2(x)            SET_BITS(12, 11, x)
+#define OUTCONTROL1_IPM_SOURCE_3(x)            SET_BITS(10, 9, x)
+#define OUTCONTROL1_IPM_SOURCE_4(x)            SET_BITS(8, 7, x)
+#define OUTCONTROL1_IPM_SOURCE_MODE(x)         SET_BIT(6, x)
+
+#define OUTCONTROLX_IPM_NUMSOURCES             4
+
+/* CIC_CONTROL bits */
+#define CIC_CONTROL_SOFT_RESET_BIT     BIT(16)
+#define CIC_CONTROL_CIC_START_B_BIT    BIT(15)
+#define CIC_CONTROL_CIC_START_A_BIT    BIT(14)
+#define CIC_CONTROL_MIC_B_POLARITY_BIT BIT(3)
+#define CIC_CONTROL_MIC_A_POLARITY_BIT BIT(2)
+#define CIC_CONTROL_MIC_MUTE_BIT       BIT(1)
+#define CIC_CONTROL_STEREO_MODE_BIT    BIT(0)
+
+#define CIC_CONTROL_SOFT_RESET(x)      SET_BIT(16, x)
+#define CIC_CONTROL_CIC_START_B(x)     SET_BIT(15, x)
+#define CIC_CONTROL_CIC_START_A(x)     SET_BIT(14, x)
+#define CIC_CONTROL_MIC_B_POLARITY(x)  SET_BIT(3, x)
+#define CIC_CONTROL_MIC_A_POLARITY(x)  SET_BIT(2, x)
+#define CIC_CONTROL_MIC_MUTE(x)                SET_BIT(1, x)
+#define CIC_CONTROL_STEREO_MODE(x)     SET_BIT(0, x)
+
+/* CIC_CONFIG bits */
+#define CIC_CONFIG_CIC_SHIFT(x)                SET_BITS(27, 24, x)
+#define CIC_CONFIG_COMB_COUNT(x)       SET_BITS(15, 8, x)
+
+/* CIC_CONFIG masks */
+#define CIC_CONFIG_CIC_SHIFT_MASK      MASK(27, 24)
+#define CIC_CONFIG_COMB_COUNT_MASK     MASK(15, 8)
+
+/* MIC_CONTROL bits */
+#define MIC_CONTROL_PDM_EN_B_BIT       BIT(1)
+#define MIC_CONTROL_PDM_EN_A_BIT       BIT(0)
+#define MIC_CONTROL_PDM_CLKDIV(x)      SET_BITS(15, 8, x)
+#define MIC_CONTROL_PDM_SKEW(x)                SET_BITS(7, 4, x)
+#define MIC_CONTROL_CLK_EDGE(x)                SET_BIT(3, x)
+#define MIC_CONTROL_PDM_EN_B(x)                SET_BIT(1, x)
+#define MIC_CONTROL_PDM_EN_A(x)                SET_BIT(0, x)
+
+/* MIC_CONTROL masks */
+#define MIC_CONTROL_PDM_CLKDIV_MASK    MASK(15, 8)
+
+/* FIR_CONTROL_A bits */
+#define FIR_CONTROL_A_START_BIT                        BIT(7)
+#define FIR_CONTROL_A_ARRAY_START_EN_BIT       BIT(6)
+#define FIR_CONTROL_A_MUTE_BIT                 BIT(1)
+#define FIR_CONTROL_A_START(x)                 SET_BIT(7, x)
+#define FIR_CONTROL_A_ARRAY_START_EN(x)                SET_BIT(6, x)
+#define FIR_CONTROL_A_DCCOMP(x)                        SET_BIT(4, x)
+#define FIR_CONTROL_A_MUTE(x)                  SET_BIT(1, x)
+#define FIR_CONTROL_A_STEREO(x)                        SET_BIT(0, x)
+
+/* FIR_CONFIG_A bits */
+#define FIR_CONFIG_A_FIR_DECIMATION(x)         SET_BITS(20, 16, x)
+#define FIR_CONFIG_A_FIR_SHIFT(x)              SET_BITS(11, 8, x)
+#define FIR_CONFIG_A_FIR_LENGTH(x)             SET_BITS(7, 0, x)
+
+/* DC offset compensation time constants */
+#define DCCOMP_TC0     0
+#define DCCOMP_TC1     1
+#define DCCOMP_TC2     2
+#define DCCOMP_TC3     3
+#define DCCOMP_TC4     4
+#define DCCOMP_TC5     5
+#define DCCOMP_TC6     6
+#define DCCOMP_TC7     7
+
+/* DC_OFFSET_LEFT_A bits */
+#define DC_OFFSET_LEFT_A_DC_OFFS(x)            SET_BITS(21, 0, x)
+
+/* DC_OFFSET_RIGHT_A bits */
+#define DC_OFFSET_RIGHT_A_DC_OFFS(x)           SET_BITS(21, 0, x)
+
+/* OUT_GAIN_LEFT_A bits */
+#define OUT_GAIN_LEFT_A_GAIN(x)                        SET_BITS(19, 0, x)
+
+/* OUT_GAIN_RIGHT_A bits */
+#define OUT_GAIN_RIGHT_A_GAIN(x)               SET_BITS(19, 0, x)
+
+/* FIR_CONTROL_B bits */
+#define FIR_CONTROL_B_START_BIT                        BIT(7)
+#define FIR_CONTROL_B_ARRAY_START_EN_BIT       BIT(6)
+#define FIR_CONTROL_B_MUTE_BIT                 BIT(1)
+#define FIR_CONTROL_B_START(x)                 SET_BIT(7, x)
+#define FIR_CONTROL_B_ARRAY_START_EN(x)                SET_BIT(6, x)
+#define FIR_CONTROL_B_DCCOMP(x)                        SET_BIT(4, x)
+#define FIR_CONTROL_B_MUTE(x)                  SET_BIT(1, x)
+#define FIR_CONTROL_B_STEREO(x)                        SET_BIT(0, x)
+
+/* FIR_CONFIG_B bits */
+#define FIR_CONFIG_B_FIR_DECIMATION(x)         SET_BITS(20, 16, x)
+#define FIR_CONFIG_B_FIR_SHIFT(x)              SET_BITS(11, 8, x)
+#define FIR_CONFIG_B_FIR_LENGTH(x)             SET_BITS(7, 0, x)
+
+/* DC_OFFSET_LEFT_B bits */
+#define DC_OFFSET_LEFT_B_DC_OFFS(x)            SET_BITS(21, 0, x)
+
+/* DC_OFFSET_RIGHT_B bits */
+#define DC_OFFSET_RIGHT_B_DC_OFFS(x)           SET_BITS(21, 0, x)
+
+/* OUT_GAIN_LEFT_B bits */
+#define OUT_GAIN_LEFT_B_GAIN(x)                        SET_BITS(19, 0, x)
+
+/* OUT_GAIN_RIGHT_B bits */
+#define OUT_GAIN_RIGHT_B_GAIN(x)               SET_BITS(19, 0, x)
+
+/* FIR coefficients */
+#define FIR_COEF_A(x)                          SET_BITS(19, 0, x)
+#define FIR_COEF_B(x)                          SET_BITS(19, 0, x)
+
+/* structs for dmic internal calculations */
+struct dmic_calc_decim_modes {
+       int16_t clkdiv[DMIC_MAX_MODES];
+       int16_t mcic[DMIC_MAX_MODES];
+       int16_t mfir[DMIC_MAX_MODES];
+       int num_of_modes;
+};
+
+struct dmic_calc_matched_modes {
+       int16_t clkdiv[DMIC_MAX_MODES];
+       int16_t mcic[DMIC_MAX_MODES];
+       int16_t mfir_a[DMIC_MAX_MODES];
+       int16_t mfir_b[DMIC_MAX_MODES];
+       int num_of_modes;
+};
+
+struct dmic_calc_configuration {
+       struct pdm_decim *fir_a;
+       struct pdm_decim *fir_b;
+       int clkdiv;
+       int mcic;
+       int mfir_a;
+       int mfir_b;
+       int cic_shift;
+       int fir_a_shift;
+       int fir_b_shift;
+       int fir_a_length;
+       int fir_b_length;
+       int32_t fir_a_scale;
+       int32_t fir_b_scale;
+};
+
+/* structs for gathering the parameters from topology */
+struct dmic_config_pdm {
+       uint16_t id;
+       uint16_t enable_mic_a;
+       uint16_t enable_mic_b;
+       uint16_t polarity_mic_a;
+       uint16_t polarity_mic_b;
+       uint16_t clk_edge;
+       uint16_t skew;
+};
+
+struct dmic_config_dai {
+       uint32_t driver_version;
+       uint32_t io_clk;
+       uint32_t pdmclk_min;
+       uint32_t pdmclk_max;
+       uint32_t fifo_fs;
+       uint16_t fifo_bits;
+       uint16_t fifo_bits_b;
+       uint16_t duty_min;
+       uint16_t duty_max;
+       uint32_t num_pdm_active;
+       uint32_t wake_up_time;
+       uint32_t min_clock_on_time;
+       uint32_t unmute_ramp_time;
+       struct dmic_config_pdm pdm[DMIC_HW_CONTROLLERS];
+};
+
+/* every pdm controller has separate fir filter for output fifos */
+struct dmic_calc_fir_coeffs_array {
+       uint32_t fir_len[DMIC_HW_CONTROLLERS];
+       int32_t fir_coeffs[DMIC_HW_CONTROLLERS][DMIC_HW_FIFOS][DMIC_HW_FIR_LENGTH_MAX];
+};
+
+struct dmic_config_mic_vendor {
+       uint8_t type;
+       uint8_t panel;
+       uint32_t speaker_position_distance;
+       uint32_t horizontal_offset;
+       uint32_t vertical_offset;
+       uint8_t frequency_low_band;
+       uint8_t frequency_high_band;
+       uint16_t direction_angle;
+       uint16_t elevation_angle;
+       uint16_t vertical_angle_begin;
+       uint16_t vertical_angle_end;
+       uint16_t horizontal_angle_begin;
+       uint16_t horizontal_angle_end;
+};
+
+struct dmic_config_mic {
+       uint8_t num_mics;
+       uint8_t extension;
+       int8_t array_type;
+       uint32_t snr;
+       uint32_t sensitivity;
+       struct dmic_config_mic_vendor vendor[8];
+};
+
+struct intel_dmic_params {
+       /* structs to gather dmic params before calculations */
+       struct dmic_config_dai dmic_prm[DMIC_HW_FIFOS];
+       uint32_t dmic_dai_index;
+       int dmic_count;
+
+       /* dmic vendor blob structs */
+       struct dmic_intel_config_data dmic_blob;
+       struct dmic_intel_pdm_ctrl_cfg dmic_blob_pdm[DMIC_HW_CONTROLLERS];
+       struct dmic_intel_fir_config dmic_blob_fir[DMIC_HW_CONTROLLERS][DMIC_HW_FIFOS];
+       struct dmic_calc_fir_coeffs_array dmic_fir_array;
+       struct dmic_config_mic dmic_mic_config;
+};
+
+#endif /* __DMIC_MACROS_H */
diff --git a/topology/nhlt/intel/dmic/dmic-process.c b/topology/nhlt/intel/dmic/dmic-process.c
new file mode 100644 (file)
index 0000000..15b8c10
--- /dev/null
@@ -0,0 +1,1369 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#include "aconfig.h"
+#include <stdint.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/conf.h>
+#include <alsa/error.h>
+#include "../intel-nhlt.h"
+#include "dmic-process.h"
+#include "dmic-internal.h"
+#include "pdm-decim-fir.h"
+#include "dmic-debug.h"
+
+/* Note 1: Higher spec filter must be before lower spec filter if there are multiple filters for a
+ * decimation factor. The first filter is skipped if the length is too much vs. overrun limit. If
+ * other order the better filter would be never selected.
+ *
+ * Note 2: The introduction order of FIR decimation factors is the selection preference order.
+ * The decimation factor 5 and 10 (2*5) cause a often less compatible output sample rate for CIC so
+ * they are not used if there other suitable nearby values.
+ *
+ * The naming scheme of coefficients set is:
+ * <type>_<decim factor>_<rel passband>_<rel stopband>_<ripple>_<attenuation>
+ */
+struct pdm_decim *fir_list[] = {
+       &pdm_decim_int32_02_4375_5100_010_095,
+       &pdm_decim_int32_02_4323_5100_010_095,
+       &pdm_decim_int32_03_4375_5100_010_095,
+       &pdm_decim_int32_04_4318_5100_010_095,
+       &pdm_decim_int32_06_4172_5100_010_095,
+       &pdm_decim_int32_05_4325_5100_010_095,
+       &pdm_decim_int32_08_4156_5301_010_090,
+       &pdm_decim_int32_12_4156_5345_010_090,
+       &pdm_decim_int32_10_4156_5345_010_090,
+       NULL, /* This marks the end of coefficients */
+};
+
+/* This is a divide function that returns ceil of the quotient. E.g. ceil_divide(9, 3) returns 3,
+ * ceil_divide(10, 3) returns 4.
+ */
+static int ceil_divide(int a, int b)
+{
+       int c;
+
+       c = a / b;
+
+       if (!((a ^ b) & (1U << ((sizeof(int) * 8) - 1))) && c * b != a)
+               c++;
+
+       return c;
+}
+
+/* This function searches from vec[] (of length vec_length) integer values of n. The indices to
+ * equal values is returned in idx[]. The function returns the number of found matches.
+ * The max_results should be set to 0 (or negative) or vec_length to get all matches. The
+ * max_result can be set to 1 to receive only the first match in ascending order. It avoids need for
+ * an array for idx.
+ */
+static int find_equal_int16(int16_t idx[], int16_t vec[], int n, int vec_length,
+                           int max_results)
+{
+       int nresults = 0;
+       int i;
+
+       for (i = 0; i < vec_length; i++) {
+               if (vec[i] == n) {
+                       idx[nresults++] = i;
+                       if (nresults == max_results)
+                               break;
+               }
+       }
+
+       return nresults;
+}
+
+/* Return the largest absolute value found in the vector. Note that smallest negative value need to
+ * be saturated to preset as int32_t.
+ */
+static int32_t find_max_abs_int32(int32_t vec[], int vec_length)
+{
+       int i;
+       int64_t amax = (vec[0] > 0) ? vec[0] : -vec[0];
+
+       for (i = 1; i < vec_length; i++) {
+               amax = (vec[i] > amax) ? vec[i] : amax;
+               amax = (-vec[i] > amax) ? -vec[i] : amax;
+       }
+
+       return SATP_INT32(amax); /* Amax is always a positive value */
+}
+
+/* Count the left shift amount to normalize a 32 bit signed integer value without causing overflow.
+ * Input value 0 will result to 31.
+ */
+static int norm_int32(int32_t val)
+{
+       int c = 0;
+
+       /* count number of bits c that val can be right-shifted arithmetically
+        * until there is -1 (if val is negative) or 0 (if val is positive)
+        * norm of val will be 31-c
+        */
+       for (; val != -1 && val != 0; c++)
+               val >>= 1;
+
+       return 31 - c;
+}
+
+/* This function returns a raw list of potential microphone clock and decimation modes for achieving
+ * requested sample rates. The search is constrained by decimation HW capabililies and setup
+ * parameters. The parameters such as microphone clock min/max and duty cycle requirements need be
+ * checked from used microphone component datasheet.
+ */
+static void find_modes(struct intel_dmic_params *dmic, struct dmic_calc_decim_modes *modes,
+                      uint32_t fs)
+{
+       int di = dmic->dmic_dai_index;
+       int clkdiv_min;
+       int clkdiv_max;
+       int clkdiv;
+       int c1;
+       int du_min;
+       int du_max;
+       int pdmclk;
+       int osr;
+       int mfir;
+       int mcic;
+       unsigned int ioclk_test;
+       int osr_min = DMIC_MIN_OSR;
+       int j;
+       int i = 0;
+
+       /* Defaults, empty result */
+       modes->num_of_modes = 0;
+
+       /* The FIFO is not requested if sample rate is set to zero. Just return in such case with
+        * num_of_modes as zero.
+        */
+       if (fs == 0) {
+               return;
+       }
+
+       /* Override DMIC_MIN_OSR for very high sample rates, use as minimum the nominal clock for
+        * the high rates.
+        */
+       if (fs >= DMIC_HIGH_RATE_MIN_FS)
+               osr_min = DMIC_HIGH_RATE_OSR_MIN;
+
+       /* Check for sane pdm clock, min 100 kHz, max ioclk/2 */
+       if (dmic->dmic_prm[di].pdmclk_max < DMIC_HW_PDM_CLK_MIN ||
+           dmic->dmic_prm[di].pdmclk_max > dmic->dmic_prm[di].io_clk / 2) {
+               fprintf(stderr, "%s: pdm clock max %d not in range\n", __func__,
+                       dmic->dmic_prm[di].pdmclk_max);
+               return;
+       }
+       if (dmic->dmic_prm[di].pdmclk_min < DMIC_HW_PDM_CLK_MIN ||
+           dmic->dmic_prm[di].pdmclk_min > dmic->dmic_prm[di].pdmclk_max) {
+               fprintf(stderr, "%s: pdm clock min %d not in range\n", __func__,
+                       dmic->dmic_prm[di].pdmclk_min);
+               return;
+       }
+
+       /* Check for sane duty cycle */
+       if (dmic->dmic_prm[di].duty_min > dmic->dmic_prm[di].duty_max) {
+               fprintf(stderr, "%s: duty cycle min > max: %d > %d\n", __func__,
+                       dmic->dmic_prm[di].duty_min, dmic->dmic_prm[di].duty_max);
+               return;
+       }
+       if (dmic->dmic_prm[di].duty_min < DMIC_HW_DUTY_MIN ||
+           dmic->dmic_prm[di].duty_min > DMIC_HW_DUTY_MAX) {
+               fprintf(stderr, "%s: pdm clock min %d not in range\n", __func__,
+                       dmic->dmic_prm[di].duty_min);
+               return;
+       }
+       if (dmic->dmic_prm[di].duty_max < DMIC_HW_DUTY_MIN ||
+           dmic->dmic_prm[di].duty_max > DMIC_HW_DUTY_MAX) {
+               fprintf(stderr, "%s: pdm clock max %d not in range\n", __func__,
+                       dmic->dmic_prm[di].duty_max);
+               return;
+       }
+
+       /* Min and max clock dividers */
+       clkdiv_min = ceil_divide(dmic->dmic_prm[di].io_clk, dmic->dmic_prm[di].pdmclk_max);
+       clkdiv_min = MAX(clkdiv_min, DMIC_HW_CIC_DECIM_MIN);
+       clkdiv_max = dmic->dmic_prm[di].io_clk / dmic->dmic_prm[di].pdmclk_min;
+
+       /* Loop possible clock dividers and check based on resulting oversampling ratio that CIC and
+        * FIR decimation ratios are feasible. The ratios need to be integers. Also the mic clock
+        * duty cycle need to be within limits.
+        */
+       for (clkdiv = clkdiv_min; clkdiv <= clkdiv_max; clkdiv++) {
+               /* Calculate duty cycle for this clock divider. Note that odd dividers cause non-50%
+                * duty cycle.
+                */
+               c1 = clkdiv >> 1;
+               du_min = 100 * c1 / clkdiv;
+               du_max = 100 - du_min;
+
+               /* Calculate PDM clock rate and oversampling ratio. */
+               pdmclk = dmic->dmic_prm[di].io_clk / clkdiv;
+               osr = pdmclk / fs;
+
+               /* Check that OSR constraints is met and clock duty cycle does not exceed microphone
+                * specification. If exceed proceed to next clkdiv.
+                */
+               if (osr < osr_min || du_min < dmic->dmic_prm[di].duty_min ||
+                   du_max > dmic->dmic_prm[di].duty_max)
+                       continue;
+
+               /* Loop FIR decimation factors candidates. If the integer divided decimation factors
+                * and clock dividers as multiplied with sample rate match the IO clock rate the
+                * division was exact and such decimation mode is possible. Then check that CIC
+                * decimation constraints are met. The passed decimation modes are added to array.
+                */
+               for (j = 0; fir_list[j]; j++) {
+                       mfir = fir_list[j]->decim_factor;
+
+                       /* Skip if previous decimation factor was the same */
+                       if (j > 1 && fir_list[j - 1]->decim_factor == mfir)
+                               continue;
+
+                       mcic = osr / mfir;
+                       ioclk_test = fs * mfir * mcic * clkdiv;
+
+                       if (ioclk_test == dmic->dmic_prm[di].io_clk &&
+                           mcic >= DMIC_HW_CIC_DECIM_MIN &&
+                           mcic <= DMIC_HW_CIC_DECIM_MAX &&
+                           i < DMIC_MAX_MODES) {
+                               modes->clkdiv[i] = clkdiv;
+                               modes->mcic[i] = mcic;
+                               modes->mfir[i] = mfir;
+                               i++;
+                       }
+               }
+       }
+
+       modes->num_of_modes = i;
+}
+
+/* The previous raw modes list contains sane configuration possibilities. When there is request for
+ * both FIFOs A and B operation this function returns list of compatible settings.
+ */
+static void match_modes(struct dmic_calc_matched_modes *c, struct dmic_calc_decim_modes *a,
+                       struct dmic_calc_decim_modes *b)
+{
+       int16_t idx[DMIC_MAX_MODES];
+       int idx_length;
+       int i;
+       int n;
+       int m;
+
+       /* Check if previous search got results. */
+       c->num_of_modes = 0;
+       if (a->num_of_modes == 0 && b->num_of_modes == 0) {
+               /* Nothing to do */
+               return;
+       }
+
+       /* Ensure that num_of_modes is sane. */
+       if (a->num_of_modes > DMIC_MAX_MODES ||
+           b->num_of_modes > DMIC_MAX_MODES)
+               return;
+
+       /* Check for request only for FIFO A or B. In such case pass list for A or B as such. */
+       if (b->num_of_modes == 0) {
+               c->num_of_modes = a->num_of_modes;
+               for (i = 0; i < a->num_of_modes; i++) {
+                       c->clkdiv[i] = a->clkdiv[i];
+                       c->mcic[i] = a->mcic[i];
+                       c->mfir_a[i] = a->mfir[i];
+                       c->mfir_b[i] = 0; /* Mark FIR B as non-used */
+               }
+               return;
+       }
+
+       if (a->num_of_modes == 0) {
+               c->num_of_modes = b->num_of_modes;
+               for (i = 0; i < b->num_of_modes; i++) {
+                       c->clkdiv[i] = b->clkdiv[i];
+                       c->mcic[i] = b->mcic[i];
+                       c->mfir_b[i] = b->mfir[i];
+                       c->mfir_a[i] = 0; /* Mark FIR A as non-used */
+               }
+               return;
+       }
+
+       /* Merge a list of compatible modes */
+       i = 0;
+       for (n = 0; n < a->num_of_modes; n++) {
+               /* Find all indices of values a->clkdiv[n] in b->clkdiv[] */
+               idx_length = find_equal_int16(idx, b->clkdiv, a->clkdiv[n],
+                                             b->num_of_modes, 0);
+               for (m = 0; m < idx_length; m++) {
+                       if (b->mcic[idx[m]] == a->mcic[n]) {
+                               c->clkdiv[i] = a->clkdiv[n];
+                               c->mcic[i] = a->mcic[n];
+                               c->mfir_a[i] = a->mfir[n];
+                               c->mfir_b[i] = b->mfir[idx[m]];
+                               i++;
+                       }
+               }
+               c->num_of_modes = i;
+       }
+}
+
+/* Finds a suitable FIR decimation filter from the included set */
+static struct pdm_decim *get_fir(struct intel_dmic_params *dmic,
+                                struct dmic_calc_configuration *cfg, int mfir)
+{
+       int i = 0;
+       int fs;
+       int cic_fs;
+       int fir_max_length;
+       struct pdm_decim *fir = NULL;
+       int di = dmic->dmic_dai_index;
+
+       if (mfir <= 0)
+               return fir;
+
+       cic_fs = dmic->dmic_prm[di].io_clk / cfg->clkdiv / cfg->mcic;
+       fs = cic_fs / mfir;
+       /* FIR max. length depends on available cycles and coef RAM length. Exceeding this length
+        * sets HW overrun status and overwrite of other register.
+        */
+       fir_max_length = MIN(DMIC_HW_FIR_LENGTH_MAX,
+                            (int)dmic->dmic_prm[di].io_clk / fs / 2 -
+                            DMIC_FIR_PIPELINE_OVERHEAD);
+
+       /* Loop until NULL */
+       while (fir_list[i]) {
+               if (fir_list[i]->decim_factor == mfir) {
+                       if (fir_list[i]->length <= fir_max_length) {
+                               /* Store pointer, break from loop to avoid a possible other mode
+                                * with lower FIR length.
+                                */
+                               fir = fir_list[i];
+                               break;
+                       }
+               }
+               i++;
+       }
+
+       return fir;
+}
+
+/* Calculate scale and shift to use for FIR coefficients. Scale is applied before write to HW coef
+ * RAM. Shift will be programmed to HW register.
+ */
+static int fir_coef_scale(int32_t *fir_scale, int *fir_shift, int add_shift,
+                         const int32_t coef[], int coef_length, int32_t gain)
+{
+       int32_t amax;
+       int32_t new_amax;
+       int32_t fir_gain;
+       int shift;
+
+       /* Multiply gain passed from CIC with output full scale. */
+       fir_gain = Q_MULTSR_32X32((int64_t)gain, DMIC_HW_SENS_Q28,
+                                 DMIC_FIR_SCALE_Q, 28, DMIC_FIR_SCALE_Q);
+
+       /* Find the largest FIR coefficient value. */
+       amax = find_max_abs_int32((int32_t *)coef, coef_length);
+
+       /* Scale max. tap value with FIR gain. */
+       new_amax = Q_MULTSR_32X32((int64_t)amax, fir_gain, 31,
+                                 DMIC_FIR_SCALE_Q, DMIC_FIR_SCALE_Q);
+       if (new_amax <= 0)
+               return -EINVAL;
+
+       /* Get left shifts count to normalize the fractional value as 32 bit. We need right shifts
+        * count for scaling so need to invert. The difference of Q31 vs. used Q format is added to
+        * get the correct normalization right shift value.
+        */
+       shift = 31 - DMIC_FIR_SCALE_Q - norm_int32(new_amax);
+
+       /* Add to shift for coef raw Q31 format shift and store to configuration. Ensure range (fail
+        * should not happen with OK coefficient set).
+        */
+       *fir_shift = -shift + add_shift;
+       if (*fir_shift < DMIC_HW_FIR_SHIFT_MIN ||
+           *fir_shift > DMIC_HW_FIR_SHIFT_MAX)
+               return -EINVAL;
+
+       /* Compensate shift into FIR coef scaler and store as Q4.20. */
+       if (shift < 0)
+               *fir_scale = fir_gain << -shift;
+       else
+               *fir_scale = fir_gain >> shift;
+
+       return 0;
+}
+
+/* This function selects with a simple criteria one mode to set up the decimator. For the settings
+ * chosen for FIFOs A and B output a lookup is done for FIR coefficients from the included
+ * coefficients tables. For some decimation factors there may be several length coefficient sets. It
+ * is due to possible restruction of decimation engine cycles per given sample rate. If the
+ * coefficients length is exceeded the lookup continues. Therefore the list of coefficient set must
+ * present the filters for a decimation factor in decreasing length order.
+ *
+ * Note: If there is no filter available an error is returned. The parameters should be reviewed for
+ * such case. If still a filter is missing it should be added into the included set. FIR decimation
+ * with a high factor usually needs compromizes into specifications and is not desirable.
+ */
+static int select_mode(struct intel_dmic_params *dmic, struct dmic_calc_configuration *cfg,
+                      struct dmic_calc_matched_modes *modes)
+{
+       int32_t g_cic;
+       int32_t fir_in_max;
+       int32_t cic_out_max;
+       int32_t gain_to_fir;
+       int16_t idx[DMIC_MAX_MODES];
+       int16_t *mfir;
+       int mcic;
+       int bits_cic;
+       int ret;
+       int n;
+       int found = 0;
+
+       /* If there are more than one possibilities select a mode with a preferred FIR decimation
+        * factor. If there are several select mode with highest ioclk divider to minimize
+        * microphone power consumption. The highest clock divisors are in the end of list so select
+        * the last of list. The minimum OSR criteria used in previous ensures that quality in the
+        * candidates should be sufficient.
+        */
+       if (modes->num_of_modes == 0) {
+               fprintf(stderr, "%s: no modes available\n", __func__);
+               return -EINVAL;
+       }
+
+       /* Valid modes presence is indicated with non-zero decimation factor in 1st element. If FIR
+        * A is not used get decimation factors from FIR B instead.
+        */
+       if (modes->mfir_a[0] > 0)
+               mfir = modes->mfir_a;
+       else
+               mfir = modes->mfir_b;
+
+       /* Search fir_list[] decimation factors from start towards end. The found last configuration
+        * entry with searched decimation factor will be used.
+        */
+       for (n = 0; fir_list[n]; n++) {
+               found = find_equal_int16(idx, mfir, fir_list[n]->decim_factor,
+                                        modes->num_of_modes, 0);
+               if (found)
+                       break;
+       }
+
+       if (!found) {
+               fprintf(stderr, "%s: No filter for decimation found\n", __func__);
+               return -EINVAL;
+       }
+       n = idx[found - 1]; /* Option with highest clock divisor and lowest mic clock rate */
+
+       /* Get microphone clock and decimation parameters for used mode from the list. */
+       cfg->clkdiv = modes->clkdiv[n];
+       cfg->mfir_a = modes->mfir_a[n];
+       cfg->mfir_b = modes->mfir_b[n];
+       cfg->mcic = modes->mcic[n];
+       cfg->fir_a = NULL;
+       cfg->fir_b = NULL;
+
+       /* Find raw FIR coefficients to match the decimation factors of FIR A and B. */
+       if (cfg->mfir_a > 0) {
+               cfg->fir_a = get_fir(dmic, cfg, cfg->mfir_a);
+               if (!cfg->fir_a) {
+                       fprintf(stderr, "%s: can't find FIR coefficients, mfir_a = %d\n",
+                               __func__, cfg->mfir_a);
+                       return -EINVAL;
+               }
+       }
+
+       if (cfg->mfir_b > 0) {
+               cfg->fir_b = get_fir(dmic, cfg, cfg->mfir_b);
+               if (!cfg->fir_b) {
+                       fprintf(stderr, "%s: can't find FIR coefficients, mfir_b = %d\n",
+                               __func__, cfg->mfir_b);
+                       return -EINVAL;
+               }
+       }
+
+       /* Calculate CIC shift from the decimation factor specific gain. The gain of HW decimator
+        * equals decimation factor to power of 5.
+        */
+       mcic = cfg->mcic;
+       g_cic = mcic * mcic * mcic * mcic * mcic;
+       if (g_cic < 0) {
+               /* Erroneous decimation factor and CIC gain */
+               fprintf(stderr, "%s: erroneous decimation factor and CIC gain\n");
+               return -EINVAL;
+       }
+
+       bits_cic = 32 - norm_int32(g_cic);
+       cfg->cic_shift = bits_cic - DMIC_HW_BITS_FIR_INPUT;
+
+       /* Calculate remaining gain to FIR in Q format used for gain values. */
+       fir_in_max = INT_MAX(DMIC_HW_BITS_FIR_INPUT);
+       if (cfg->cic_shift >= 0)
+               cic_out_max = g_cic >> cfg->cic_shift;
+       else
+               cic_out_max = g_cic << -cfg->cic_shift;
+
+       gain_to_fir = (int32_t)((((int64_t)fir_in_max) << DMIC_FIR_SCALE_Q) /
+               cic_out_max);
+
+       /* Calculate FIR scale and shift */
+       if (cfg->mfir_a > 0) {
+               cfg->fir_a_length = cfg->fir_a->length;
+               ret = fir_coef_scale(&cfg->fir_a_scale, &cfg->fir_a_shift,
+                                    cfg->fir_a->shift, cfg->fir_a->coef,
+                                    cfg->fir_a->length, gain_to_fir);
+               if (ret < 0) {
+                       /* Invalid coefficient set found, should not happen. */
+                       fprintf(stderr, "%s: invalid coefficient set found\n");
+                       return -EINVAL;
+               }
+       } else {
+               cfg->fir_a_scale = 0;
+               cfg->fir_a_shift = 0;
+               cfg->fir_a_length = 0;
+       }
+
+       if (cfg->mfir_b > 0) {
+               cfg->fir_b_length = cfg->fir_b->length;
+               ret = fir_coef_scale(&cfg->fir_b_scale, &cfg->fir_b_shift,
+                                    cfg->fir_b->shift, cfg->fir_b->coef,
+                                    cfg->fir_b->length, gain_to_fir);
+               if (ret < 0) {
+                       /* Invalid coefficient set found, should not happen. */
+                       fprintf(stderr, "%s: invalid coefficient set found\n", __func__);
+                       return -EINVAL;
+               }
+       } else {
+               cfg->fir_b_scale = 0;
+               cfg->fir_b_shift = 0;
+               cfg->fir_b_length = 0;
+       }
+
+       return 0;
+}
+
+/* The FIFO input packer mode (IPM) settings are somewhat different in HW versions. This helper
+ * function returns a suitable IPM bit field value to use.
+ */
+static void ipm_helper1(struct intel_dmic_params *dmic, int *ipm)
+{
+       int di = dmic->dmic_dai_index;
+       int pdm[DMIC_HW_CONTROLLERS];
+       int i;
+
+       /* Loop number of PDM controllers in the configuration. If mic A or B is enabled then a pdm
+        * controller is marked as active for this DAI.
+        */
+       for (i = 0; i < DMIC_HW_CONTROLLERS; i++) {
+               if (dmic->dmic_prm[di].pdm[i].enable_mic_a ||
+                   dmic->dmic_prm[di].pdm[i].enable_mic_b)
+                       pdm[i] = 1;
+               else
+                       pdm[i] = 0;
+       }
+
+       /* Set IPM to match active pdm controllers. */
+       *ipm = 0;
+
+       if (pdm[0] == 0 && pdm[1] > 0)
+               *ipm = 1;
+
+       if (pdm[0] > 0 && pdm[1] > 0)
+               *ipm = 2;
+}
+
+static void ipm_helper2(struct intel_dmic_params *dmic, int source[], int *ipm)
+{
+       int di = dmic->dmic_dai_index;
+       int pdm[DMIC_HW_CONTROLLERS];
+       int i;
+       int n = 0;
+
+       for (i = 0; i < OUTCONTROLX_IPM_NUMSOURCES; i++)
+               source[i] = 0;
+
+       /* Loop number of PDM controllers in the configuration. If mic A or B is enabled then a pdm
+        * controller is marked as active. The function returns in array source[] the indice of
+        * enabled pdm controllers to be used for IPM configuration.
+        */
+       for (i = 0; i < DMIC_HW_CONTROLLERS; i++) {
+               if (dmic->dmic_prm[di].pdm[i].enable_mic_a ||
+                   dmic->dmic_prm[di].pdm[i].enable_mic_b) {
+                       pdm[i] = 1;
+                       source[n] = i;
+                       n++;
+               } else {
+                       pdm[i] = 0;
+               }
+       }
+
+       /* IPM bit field is set to count of active pdm controllers. */
+       *ipm = pdm[0];
+       for (i = 1; i < DMIC_HW_CONTROLLERS; i++)
+               *ipm += pdm[i];
+}
+
+/* Loop number of PDM controllers in the configuration. The function checks if the controller should
+ * operate as stereo or mono left (A) or mono right (B) mode. Mono right mode is setup as channel
+ * swapped mono left.
+ */
+static int stereo_helper(struct intel_dmic_params *dmic, int stereo[], int swap[])
+{
+       int cnt;
+       int i;
+       int swap_check;
+       int ret = 0;
+
+       for (i = 0; i < DMIC_HW_CONTROLLERS; i++) {
+               cnt = 0;
+               if (dmic->dmic_prm[0].pdm[i].enable_mic_a ||
+                   dmic->dmic_prm[1].pdm[i].enable_mic_a)
+                       cnt++;
+
+               if (dmic->dmic_prm[0].pdm[i].enable_mic_b ||
+                   dmic->dmic_prm[1].pdm[i].enable_mic_b)
+                       cnt++;
+
+               /* Set stereo mode if both mic A anc B are enabled. */
+               cnt >>= 1;
+               stereo[i] = cnt;
+
+               /* Swap channels if only mic B is used for mono processing. */
+               swap[i] = (dmic->dmic_prm[0].pdm[i].enable_mic_b ||
+                          dmic->dmic_prm[1].pdm[i].enable_mic_b) && !cnt;
+
+               /* Check that swap does not conflict with other DAI request */
+               swap_check = (dmic->dmic_prm[1].pdm[i].enable_mic_a ||
+                             dmic->dmic_prm[0].pdm[i].enable_mic_a);
+
+               if (swap_check && swap[i]) {
+                       ret = -EINVAL;
+                       break;
+               }
+       }
+       return ret;
+}
+
+static int configure_registers(struct intel_dmic_params *dmic, struct dmic_calc_configuration *cfg)
+{
+       int stereo[DMIC_HW_CONTROLLERS];
+       int swap[DMIC_HW_CONTROLLERS];
+       uint32_t val = 0;
+       int32_t ci;
+       uint32_t cu;
+       int ipm;
+       int of0;
+       int of1;
+       int fir_decim;
+       int fir_length;
+       int length;
+       int edge;
+       int soft_reset;
+       int cic_mute;
+       int fir_mute;
+       unsigned int i;
+       int j;
+       int ret;
+       int mic;
+       int chmap_bits;
+       int di = dmic->dmic_dai_index;
+       int dccomp = 1;
+       int array_a = 0;
+       int array_b = 0;
+       int bfth = 3; /* Should be 3 for 8 entries, 1 is 2 entries */
+       int th = 3; /* Used with TIE=1 */
+       int source[OUTCONTROLX_IPM_NUMSOURCES];
+
+       /*
+        * ts_group value describes which audio channels in the hw fifo are enabled. A 32 bit
+        * value is divided into 8 x 4 bit nibbles corresponding to 8 audio channels. Hex value 0xF
+        * means "not in use", any other value means the channel is enabled. For example 0xFFFFFFFF
+        * means no channels are enabled, 0xFFFFFF10 means channels 1 and 2 are enabled.
+        *
+        * ts_group array index corresponds to dmic hw fifos, that gather audio samples from pdm
+        * controllers. 1 pdm controller can host 2 mono dmics and usually pdm controllers are
+        * connected to 2 hw fifos -> we can for example run the dmics simultaneously with different
+        * sampling rates.
+        *
+        * Currently there is no evidence we would ever have more than 2 hw fifos, so ts_group[2]
+        * and ts_group[3] are not used for anything. Also the nibbles could be used for channel
+        * mapping the pdm channels arbitrarely into hw fifos, however currently it is used as
+        * binary not_enabled/enabled setting.
+        *
+        * if we have 2 dmics (stereo) it means we are using 1 pdm controller with possibly 2 hw
+        * fifos:
+        *        mic1      fifo0(2ch)
+        *            \    /
+        *             pdm0
+        *            /    \
+        *        mic2      fifo1(2ch)
+        *
+        * So in this case it makes only sense to control ts_group indexes 0 and 1 and their last 2
+        * nibbles (as we have only 2 channels).
+        *
+        * if we have 4 dmics, it means we are using 2 pdm controller with possibly 2 x 4 channel hw
+        * fifos:
+        *
+        *        mic1      fifo0(4ch)
+        *            \    /    /
+        *             pdm0    /
+        *            /    \  /
+        *        mic2      \/
+        *        mic3      /\
+        *            \    /  \
+        *             pdm1    \
+        *            /    \    \
+        *        mic4      fifo1(4ch)
+        *
+        * So it makes sense to control ts_group indexes 0 and 1 and their last 4 nibbles.
+        *
+        * channel_pdm_mask defines which existing pdm controllers will be taken into use. So if
+        * either of mic a or b is enabled -> that particular pdm controller is in use. For example
+        * pdm0 in use/not_in_use is defined by setting bit 0 in channel_pdm_mask to 1/0.
+        *
+        * channel_ctrl_mask defines what mic channels are available in hw for a pdm controller. in
+        * theory pdm controller could have only 1 channel enabled, in practice there's always 2
+        * channels which are both enabled -> set bits 0 and 1.
+        */
+
+       for (i = 0, mic = 0, chmap_bits = 4; i < DMIC_HW_CONTROLLERS; i++) {
+               /* enable fifo channels (ts_group) based on mic_enable in dai definition */
+               if (dmic->dmic_prm[di].pdm[i].enable_mic_a) {
+                       dmic->dmic_blob.ts_group[di] &= ~(0xF << (chmap_bits * mic));
+                       dmic->dmic_blob.ts_group[di] |= 0x0 << (chmap_bits * mic);
+               }
+               mic++;
+               if (dmic->dmic_prm[di].pdm[i].enable_mic_b) {
+                       dmic->dmic_blob.ts_group[di] &= ~(0xF << (chmap_bits * mic));
+                       dmic->dmic_blob.ts_group[di] |= 0x1 << (chmap_bits * mic);
+               }
+               mic++;
+       }
+
+       /* set channel_pdm_mask to describe what pdm controllers are in use */
+       for (i = 0; i < dmic->dmic_prm[di].num_pdm_active; i++)
+               dmic->dmic_blob.channel_pdm_mask |= 1 << i;
+
+       /* set always both mic channels enabled */
+       dmic->dmic_blob.channel_ctrl_mask = 0x3;
+
+       /* Normal start sequence */
+       soft_reset = 0;
+       cic_mute = 0;
+       fir_mute = 0;
+
+       /* OUTCONTROL0 and OUTCONTROL1 */
+       of0 = (dmic->dmic_prm[0].fifo_bits == 32) ? 2 : 0;
+       of1 = (dmic->dmic_prm[1].fifo_bits == 32) ? 2 : 0;
+
+       if (dmic->dmic_prm[di].driver_version == 1) {
+               if (di == 0) {
+                       ipm_helper1(dmic, &ipm);
+                       val = OUTCONTROL0_TIE(0) |
+                               OUTCONTROL0_SIP(0) |
+                               OUTCONTROL0_FINIT(0) |
+                               OUTCONTROL0_FCI(0) |
+                               OUTCONTROL0_BFTH(bfth) |
+                               OUTCONTROL0_OF(of0) |
+                               OUTCONTROL0_IPM_VER1(ipm) |
+                               OUTCONTROL0_TH(th);
+               } else {
+                       ipm_helper1(dmic, &ipm);
+                       val = OUTCONTROL1_TIE(0) |
+                               OUTCONTROL1_SIP(0) |
+                               OUTCONTROL1_FINIT(0) |
+                               OUTCONTROL1_FCI(0) |
+                               OUTCONTROL1_BFTH(bfth) |
+                               OUTCONTROL1_OF(of1) |
+                               OUTCONTROL1_IPM_VER1(ipm) |
+                               OUTCONTROL1_TH(th);
+               }
+       }
+
+       if (dmic->dmic_prm[di].driver_version >= 2) {
+               if (dmic->dmic_prm[di].driver_version >= 4)
+                       bfth = 0;
+
+               if (di == 0) {
+                       ipm_helper2(dmic, source, &ipm);
+                       val = OUTCONTROL0_TIE(0) |
+                               OUTCONTROL0_SIP(0) |
+                               OUTCONTROL0_FINIT(0) |
+                               OUTCONTROL0_FCI(0) |
+                               OUTCONTROL0_BFTH(bfth) |
+                               OUTCONTROL0_OF(of0) |
+                               OUTCONTROL0_IPM_VER2(ipm) |
+                               OUTCONTROL0_IPM_SOURCE_1(source[0]) |
+                               OUTCONTROL0_IPM_SOURCE_2(source[1]) |
+                               OUTCONTROL0_IPM_SOURCE_3(source[2]) |
+                               OUTCONTROL0_IPM_SOURCE_4(source[3]) |
+                               OUTCONTROL0_IPM_SOURCE_MODE(1) |
+                               OUTCONTROL0_TH(th);
+               } else {
+                       ipm_helper2(dmic, source, &ipm);
+                       val = OUTCONTROL1_TIE(0) |
+                               OUTCONTROL1_SIP(0) |
+                               OUTCONTROL1_FINIT(0) |
+                               OUTCONTROL1_FCI(0) |
+                               OUTCONTROL1_BFTH(bfth) |
+                               OUTCONTROL1_OF(of1) |
+                               OUTCONTROL1_IPM_VER2(ipm) |
+                               OUTCONTROL1_IPM_SOURCE_1(source[0]) |
+                               OUTCONTROL1_IPM_SOURCE_2(source[1]) |
+                               OUTCONTROL1_IPM_SOURCE_3(source[2]) |
+                               OUTCONTROL1_IPM_SOURCE_4(source[3]) |
+                               OUTCONTROL1_IPM_SOURCE_MODE(1) |
+                               OUTCONTROL1_TH(th);
+               }
+       }
+
+       dmic->dmic_blob.chan_ctrl_cfg[di] = val;
+
+       ret = stereo_helper(dmic, stereo, swap);
+       if (ret < 0) {
+               fprintf(stderr, "%s: enable conflict\n", __func__);
+               return ret;
+       }
+
+       for (i = 0; i < DMIC_HW_CONTROLLERS; i++) {
+               /* CIC */
+               val = CIC_CONTROL_SOFT_RESET(soft_reset) |
+                       CIC_CONTROL_CIC_START_B(1) |
+                       CIC_CONTROL_CIC_START_A(1) |
+                       CIC_CONTROL_MIC_B_POLARITY(dmic->dmic_prm[di].pdm[i].polarity_mic_b) |
+                       CIC_CONTROL_MIC_A_POLARITY(dmic->dmic_prm[di].pdm[i].polarity_mic_a) |
+                       CIC_CONTROL_MIC_MUTE(cic_mute);
+
+               if (dmic->dmic_prm[di].driver_version == 1)
+                       val |= CIC_CONTROL_STEREO_MODE(stereo[i]);
+
+               dmic->dmic_blob_pdm[i].cic_control = val;
+
+               val = CIC_CONFIG_CIC_SHIFT(cfg->cic_shift + 8) |
+                       CIC_CONFIG_COMB_COUNT(cfg->mcic - 1);
+               dmic->dmic_blob_pdm[i].cic_config = val;
+
+               /* Mono right channel mic usage requires swap of PDM channels
+                * since the mono decimation is done with only left channel
+                * processing active.
+                */
+               edge = dmic->dmic_prm[di].pdm[i].clk_edge;
+               if (swap[i])
+                       edge = !edge;
+
+               val = MIC_CONTROL_PDM_CLKDIV(cfg->clkdiv - 2) |
+                       MIC_CONTROL_PDM_SKEW(dmic->dmic_prm[di].pdm[i].skew) |
+                       MIC_CONTROL_CLK_EDGE(edge) |
+                       MIC_CONTROL_PDM_EN_B(1) |
+                       MIC_CONTROL_PDM_EN_A(1);
+               dmic->dmic_blob_pdm[i].mic_control = val;
+
+               /*
+                * Here we have to check the both FIRs if they are
+                * configured as the later configured DAI may have changed
+                * the configuration of the DAI configured earlier.
+                */
+               if (cfg->mfir_a) {
+                       /* FIR A */
+                       fir_decim = MAX(cfg->mfir_a - 1, 0);
+                       fir_length = MAX(cfg->fir_a_length - 1, 0);
+                       val = FIR_CONTROL_A_START(1) |
+                               FIR_CONTROL_A_ARRAY_START_EN(array_a) |
+                               FIR_CONTROL_A_DCCOMP(dccomp) |
+                               FIR_CONTROL_A_MUTE(fir_mute) |
+                               FIR_CONTROL_A_STEREO(stereo[i]);
+                       dmic->dmic_blob_fir[i][0].fir_control = val;
+
+                       val = FIR_CONFIG_A_FIR_DECIMATION(fir_decim) |
+                               FIR_CONFIG_A_FIR_SHIFT(cfg->fir_a_shift) |
+                               FIR_CONFIG_A_FIR_LENGTH(fir_length);
+                       dmic->dmic_blob_fir[i][0].fir_config = val;
+
+                       val = DC_OFFSET_LEFT_A_DC_OFFS(DCCOMP_TC0);
+                       dmic->dmic_blob_fir[i][0].dc_offset_left = val;
+
+                       val = DC_OFFSET_RIGHT_A_DC_OFFS(DCCOMP_TC0);
+                       dmic->dmic_blob_fir[i][0].dc_offset_right = val;
+
+                       val = OUT_GAIN_LEFT_A_GAIN(0);
+                       dmic->dmic_blob_fir[i][0].out_gain_left = val;
+
+                       val = OUT_GAIN_RIGHT_A_GAIN(0);
+                       dmic->dmic_blob_fir[i][0].out_gain_right = val;
+
+                       /* Write coef RAM A with scaled coefficient in reverse order */
+                       length = cfg->fir_a_length;
+                       for (j = 0; j < length; j++) {
+                               ci = (int32_t)Q_MULTSR_32X32((int64_t)cfg->fir_a->coef[j],
+                                                            cfg->fir_a_scale, 31,
+                                                            DMIC_FIR_SCALE_Q, DMIC_HW_FIR_COEF_Q);
+                               cu = FIR_COEF_A(ci);
+                               /* blob_pdm[i].fir_coeffs[0][j] = cu; */
+                               dmic->dmic_fir_array.fir_coeffs[i][0][j] = cu;
+                       }
+                       dmic->dmic_fir_array.fir_len[0] = length;
+               } else {
+                       dmic->dmic_fir_array.fir_len[0] = 0;
+               }
+
+               if (cfg->mfir_b) {
+                       /* FIR B */
+                       fir_decim = MAX(cfg->mfir_b - 1, 0);
+                       fir_length = MAX(cfg->fir_b_length - 1, 0);
+                       val = FIR_CONTROL_B_START(1) |
+                               FIR_CONTROL_B_ARRAY_START_EN(array_b) |
+                               FIR_CONTROL_B_DCCOMP(dccomp) |
+                               FIR_CONTROL_B_MUTE(fir_mute) |
+                               FIR_CONTROL_B_STEREO(stereo[i]);
+                       dmic->dmic_blob_fir[i][1].fir_control = val;
+
+                       val = FIR_CONFIG_B_FIR_DECIMATION(fir_decim) |
+                               FIR_CONFIG_B_FIR_SHIFT(cfg->fir_b_shift) |
+                               FIR_CONFIG_B_FIR_LENGTH(fir_length);
+                       dmic->dmic_blob_fir[i][1].fir_config = val;
+                       val = DC_OFFSET_LEFT_B_DC_OFFS(DCCOMP_TC0);
+                       dmic->dmic_blob_fir[i][1].dc_offset_left = val;
+
+                       val = DC_OFFSET_RIGHT_B_DC_OFFS(DCCOMP_TC0);
+                       dmic->dmic_blob_fir[i][1].dc_offset_right = val;
+
+                       val = OUT_GAIN_LEFT_B_GAIN(0);
+                       dmic->dmic_blob_fir[i][1].out_gain_left = val;
+
+                       val = OUT_GAIN_RIGHT_B_GAIN(0);
+                       dmic->dmic_blob_fir[i][1].out_gain_right = val;
+
+                       /* Write coef RAM B with scaled coefficient in reverse order */
+                       length = cfg->fir_b_length;
+                       for (j = 0; j < length; j++) {
+                               ci = (int32_t)Q_MULTSR_32X32((int64_t)cfg->fir_b->coef[j],
+                                                            cfg->fir_b_scale, 31,
+                                                            DMIC_FIR_SCALE_Q, DMIC_HW_FIR_COEF_Q);
+                               cu = FIR_COEF_B(ci);
+                               /* blob_pdm[i].fir_coeffs[1][j] = cu; */
+                               dmic->dmic_fir_array.fir_coeffs[i][1][j] = cu;
+                       }
+                       dmic->dmic_fir_array.fir_len[1] = length;
+               } else {
+                       dmic->dmic_fir_array.fir_len[1] = 0;
+               }
+       }
+
+       return 0;
+}
+
+/* The decimation for PDM (pulse density modulation) stream is done in a programmable HW filter
+ * engine. The input to configuration algorithm is needed sample rate, channels/enabled microphones,
+ * microphone clock range, microphone clock duty cycle range, and system clock rate.
+ *
+ * The PDM bus clock divider, CIC and FIR decimation ratios are searched and configuration for
+ * optimal power consumption, filtering requirements, and HW constraints is chosen. The FIR filter
+ * for the chosen decimation is looked up from table and scaled to match the other decimation path
+ * sensitivity.
+ */
+int dmic_calculate(struct intel_nhlt_params *nhlt)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+       struct dmic_calc_matched_modes modes_ab;
+       struct dmic_calc_decim_modes modes_a;
+       struct dmic_calc_decim_modes modes_b;
+       struct dmic_calc_configuration cfg;
+       int ret = 0;
+       int di;
+
+       if (!dmic)
+               return -EINVAL;
+
+       di = dmic->dmic_dai_index;
+
+       if (di >= DMIC_HW_FIFOS) {
+               fprintf(stderr, "%s: dai->index %d exceeds number of FIFOs\n", __func__, di);
+               ret = -EINVAL;
+               goto out;
+       }
+
+       if (dmic->dmic_prm[di].num_pdm_active > DMIC_HW_CONTROLLERS) {
+               fprintf(stderr, "%s: controller count %d exceeds platform capability\n",
+                       __func__, dmic->dmic_prm[di].num_pdm_active);
+               ret = -EINVAL;
+               goto out;
+       }
+
+       /* fifo bits 0 means fifo disabled */
+       switch (dmic->dmic_prm[di].fifo_bits) {
+       case 0:
+       case 16:
+       case 32:
+               break;
+       default:
+               fprintf(stderr, "%s: Bad fifo_bits %d\n", __func__,
+                       dmic->dmic_prm[di].fifo_bits);
+               ret = -EINVAL;
+               goto out;
+       }
+
+       /* Match and select optimal decimators configuration for FIFOs A and B paths. This setup
+        * phase is still abstract. Successful completion points struct cfg to FIR coefficients and
+        * contains the scale value to use for FIR coefficient RAM write as well as the CIC and FIR
+        * shift values.
+        */
+       find_modes(dmic, &modes_a, dmic->dmic_prm[0].fifo_fs);
+       if (modes_a.num_of_modes == 0 && dmic->dmic_prm[0].fifo_fs > 0) {
+               fprintf(stderr, "%s: No modes found for FIFO A\n", __func__);
+               ret = -EINVAL;
+               goto out;
+       }
+
+       find_modes(dmic, &modes_b, dmic->dmic_prm[1].fifo_fs);
+       if (modes_b.num_of_modes == 0 && dmic->dmic_prm[1].fifo_fs > 0) {
+               fprintf(stderr, "%s: No modes found for FIFO B\n", __func__);
+               ret = -EINVAL;
+               goto out;
+       }
+
+       match_modes(&modes_ab, &modes_a, &modes_b);
+       ret = select_mode(dmic, &cfg, &modes_ab);
+       if (ret < 0) {
+               fprintf(stderr, "%s: select_mode() failed %d\n", __func__, ret);
+               ret = -EINVAL;
+               goto out;
+       }
+
+       /* Struct reg contains a mirror of actual HW registers. Determine register bits
+        * configuration from decimator configuration and the requested parameters.
+        */
+       ret = configure_registers(dmic, &cfg);
+       if (ret < 0) {
+               fprintf(stderr, "%s: cannot configure registers %d\n", __func__, ret);
+               ret = -EINVAL;
+               goto out;
+       }
+
+       dmic_print_internal(dmic);
+
+       dmic->dmic_count++;
+
+out:
+       return ret;
+}
+
+int dmic_get_params(struct intel_nhlt_params *nhlt, int index, uint32_t *sample_rate,
+                   uint16_t *channel_count, uint32_t *bits_per_sample, uint8_t *array_type,
+                   uint8_t *num_mics, uint8_t *extension, uint32_t *snr, uint32_t *sensitivity)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+       uint32_t channels = 0;
+
+       if (!dmic)
+               return -EINVAL;
+
+       /* check all pdm's for enabled mics */
+       *channel_count = 0;
+       if (dmic->dmic_prm[index].pdm[0].enable_mic_a)
+               channels++;
+
+       if (dmic->dmic_prm[index].pdm[0].enable_mic_b)
+               channels++;
+
+       if (dmic->dmic_prm[index].pdm[1].enable_mic_a)
+               channels++;
+
+       if (dmic->dmic_prm[index].pdm[1].enable_mic_b)
+               channels++;
+
+       *sample_rate = dmic->dmic_prm[index].fifo_fs;
+       *channel_count = channels;
+       *bits_per_sample = dmic->dmic_prm[index].fifo_bits;
+       *num_mics = dmic->dmic_mic_config.num_mics;
+       *extension = dmic->dmic_mic_config.extension;
+       *array_type = dmic->dmic_mic_config.array_type;
+       *snr = dmic->dmic_mic_config.snr;
+       *sensitivity = dmic->dmic_mic_config.sensitivity;
+
+       return 0;
+}
+
+int dmic_get_mic_params(struct intel_nhlt_params *nhlt, int index,
+                       uint8_t *type, uint8_t *panel, uint32_t *speaker_position_distance,
+                       uint32_t *horizontal_offset, uint32_t *vertical_offset,
+                       uint8_t *frequency_low_band, uint8_t *frequency_high_band,
+                       uint16_t *direction_angle, uint16_t *elevation_angle,
+                       uint16_t *vertical_angle_begin, uint16_t *vertical_angle_end,
+                       uint16_t *horizontal_angle_begin, uint16_t *horizontal_angle_end)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+
+       if (!dmic)
+               return -EINVAL;
+
+       *type = dmic->dmic_mic_config.vendor[index].type;
+       *panel = dmic->dmic_mic_config.vendor[index].panel;
+       *speaker_position_distance = dmic->dmic_mic_config.vendor[index].speaker_position_distance;
+       *horizontal_offset = dmic->dmic_mic_config.vendor[index].horizontal_offset;
+       *vertical_offset = dmic->dmic_mic_config.vendor[index].vertical_offset;
+       *frequency_low_band = dmic->dmic_mic_config.vendor[index].frequency_low_band;
+       *frequency_high_band = dmic->dmic_mic_config.vendor[index].frequency_high_band;
+       *direction_angle = dmic->dmic_mic_config.vendor[index].direction_angle;
+       *elevation_angle = dmic->dmic_mic_config.vendor[index].elevation_angle;
+       *vertical_angle_begin = dmic->dmic_mic_config.vendor[index].vertical_angle_begin;
+       *vertical_angle_end = dmic->dmic_mic_config.vendor[index].vertical_angle_end;
+       *horizontal_angle_begin = dmic->dmic_mic_config.vendor[index].horizontal_angle_begin;
+       *horizontal_angle_end = dmic->dmic_mic_config.vendor[index].horizontal_angle_end;
+
+       return 0;
+}
+
+int dmic_get_vendor_blob_size(struct intel_nhlt_params *nhlt, size_t *size)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+       int i, fir_index_0, fir_index_1;
+
+       if (!dmic || !dmic->dmic_count)
+               return -EINVAL;
+
+       *size = sizeof(struct dmic_intel_config_data);
+
+       /* if either of the fir is 0 length, copy the existing fir twice */
+       fir_index_0 = 0;
+       fir_index_1 = 1;
+       if (dmic->dmic_fir_array.fir_len[0] == 0) {
+               fir_index_0 = 1;
+               fir_index_1 = 1;
+       }
+       if (dmic->dmic_fir_array.fir_len[1] == 0) {
+               fir_index_0 = 0;
+               fir_index_1 = 0;
+       }
+
+       /* variable amount of pdm's */
+       for (i = 0; i < DMIC_HW_CONTROLLERS; i++) {
+               /* only copy the pdm data if it is enabled */
+               if ((dmic->dmic_blob.channel_pdm_mask & BIT(i)) == 0)
+                       continue;
+
+               *size += sizeof(struct dmic_intel_pdm_ctrl_cfg);
+               *size += sizeof(struct dmic_intel_fir_config) * DMIC_HW_FIFOS;
+
+               *size += dmic->dmic_fir_array.fir_len[fir_index_0] * sizeof(uint32_t);
+               *size += dmic->dmic_fir_array.fir_len[fir_index_1] * sizeof(uint32_t);
+       }
+
+       return 0;
+}
+
+int dmic_get_vendor_blob_count(struct intel_nhlt_params *nhlt)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+
+       if (!dmic || !dmic->dmic_count)
+               return 0;
+
+       return dmic->dmic_count;
+}
+
+int dmic_get_vendor_blob(struct intel_nhlt_params *nhlt, uint8_t *vendor_blob)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+       int i, fir_index_0, fir_index_1;
+       uint8_t *orig_blob = vendor_blob;
+       size_t blob_size;
+
+       if (!dmic || !dmic->dmic_count)
+               return -EINVAL;
+
+       /* top level struct */
+       memcpy(vendor_blob, &dmic->dmic_blob, sizeof(struct dmic_intel_config_data));
+       vendor_blob += sizeof(struct dmic_intel_config_data);
+
+       /* if either of the fir is 0 length, copy the existing fir twice */
+       fir_index_0 = 0;
+       fir_index_1 = 1;
+       if (dmic->dmic_fir_array.fir_len[0] == 0) {
+               fir_index_0 = 1;
+               fir_index_1 = 1;
+       }
+       if (dmic->dmic_fir_array.fir_len[1] == 0) {
+               fir_index_0 = 0;
+               fir_index_1 = 0;
+       }
+
+       /* variable amount of pdm's */
+       for (i = 0; i < DMIC_HW_CONTROLLERS; i++) {
+               /* only copy the pdm data if it is enabled */
+               if ((dmic->dmic_blob.channel_pdm_mask & BIT(i)) == 0)
+                       continue;
+
+               /* top level struct first pdm data */
+               memcpy(vendor_blob, (uint8_t *)&dmic->dmic_blob_pdm[i],
+                      sizeof(struct dmic_intel_pdm_ctrl_cfg));
+               vendor_blob += sizeof(struct dmic_intel_pdm_ctrl_cfg);
+
+               /* top level struct first pdm data first fir */
+               memcpy(vendor_blob, (uint8_t *)&dmic->dmic_blob_fir[i][fir_index_0],
+                      sizeof(struct dmic_intel_fir_config));
+               vendor_blob += sizeof(struct dmic_intel_fir_config);
+
+               /* top level struct first pdm data second fir */
+               memcpy(vendor_blob, (uint8_t *)&dmic->dmic_blob_fir[i][fir_index_1],
+                      sizeof(struct dmic_intel_fir_config));
+               vendor_blob += sizeof(struct dmic_intel_fir_config);
+
+               /* fir coeffs a */
+               memcpy(vendor_blob, (uint8_t *)&dmic->dmic_fir_array.fir_coeffs[i][fir_index_0][0],
+                      dmic->dmic_fir_array.fir_len[fir_index_0] * sizeof(uint32_t));
+               vendor_blob += dmic->dmic_fir_array.fir_len[fir_index_0] * sizeof(uint32_t);
+
+               /* fir coeffs b */
+               memcpy(vendor_blob, (uint8_t *)&dmic->dmic_fir_array.fir_coeffs[i][fir_index_1][0],
+                      dmic->dmic_fir_array.fir_len[fir_index_1] * sizeof(uint32_t));
+               vendor_blob += dmic->dmic_fir_array.fir_len[fir_index_1] * sizeof(uint32_t);
+       }
+
+       dmic_get_vendor_blob_size(nhlt, &blob_size);
+       dmic_print_bytes_as_hex((uint8_t *)orig_blob, blob_size);
+       dmic_print_integers_as_hex((uint32_t *)orig_blob, blob_size / 4);
+
+       return 0;
+}
+
+int dmic_set_params(struct intel_nhlt_params *nhlt, int dai_index, int driver_version,
+                   int io_clk, int num_pdm_active, int fifo_word_length, int clk_min, int clk_max,
+                   int duty_min, int duty_max, int sample_rate, int unmute_ramp_time)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+
+       if (!dmic)
+               return -EINVAL;
+
+       if (dai_index >= DMIC_HW_FIFOS) {
+               fprintf(stderr, "%s: illegal dai index %d \n", __func__, dai_index);
+               return -EINVAL;
+       }
+
+       if (driver_version < 1 || driver_version > 5) {
+               fprintf(stderr, "%s: illegal driver version %d\n", __func__, driver_version);
+               return -EINVAL;
+       }
+
+       dmic->dmic_dai_index = dai_index;
+       dmic->dmic_prm[dai_index].driver_version = driver_version;
+       dmic->dmic_prm[dai_index].io_clk = io_clk;
+       dmic->dmic_prm[dai_index].num_pdm_active = num_pdm_active;
+       dmic->dmic_prm[dai_index].fifo_bits = fifo_word_length;
+       dmic->dmic_prm[dai_index].pdmclk_min = clk_min;
+       dmic->dmic_prm[dai_index].pdmclk_max = clk_max;
+       dmic->dmic_prm[dai_index].duty_min = duty_min;
+       dmic->dmic_prm[dai_index].duty_max = duty_max;
+       dmic->dmic_prm[dai_index].fifo_fs = sample_rate;
+       dmic->dmic_prm[dai_index].unmute_ramp_time = unmute_ramp_time;
+
+       return 0;
+}
+
+int dmic_set_pdm_params(struct intel_nhlt_params *nhlt, int pdm_index, int enable_a,
+                       int enable_b, int polarity_a, int polarity_b, int clk_edge, int skew)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+       int di;
+
+       if (!dmic)
+               return -EINVAL;
+
+       if (pdm_index >= DMIC_HW_CONTROLLERS) {
+               fprintf(stderr, "%s: illegal pdm_index %d\n", __func__, pdm_index);
+               return -EINVAL;
+       }
+
+       di = dmic->dmic_dai_index;
+
+       dmic->dmic_prm[di].pdm[pdm_index].enable_mic_a = enable_a;
+       dmic->dmic_prm[di].pdm[pdm_index].enable_mic_b = enable_b;
+       dmic->dmic_prm[di].pdm[pdm_index].polarity_mic_a = polarity_a;
+       dmic->dmic_prm[di].pdm[pdm_index].polarity_mic_b = polarity_b;
+       dmic->dmic_prm[di].pdm[pdm_index].clk_edge = clk_edge;
+       dmic->dmic_prm[di].pdm[pdm_index].skew = skew;
+
+       return 0;
+}
+
+int dmic_set_ext_params(struct intel_nhlt_params *nhlt, uint32_t snr, uint32_t sensitivity)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+
+       if (!dmic)
+               return -EINVAL;
+
+       dmic->dmic_mic_config.extension = 1;
+       dmic->dmic_mic_config.snr = snr;
+       dmic->dmic_mic_config.sensitivity = sensitivity;
+
+       return 0;
+}
+
+int dmic_set_mic_params(struct intel_nhlt_params *nhlt, int index,
+                       uint8_t type, uint8_t panel, uint32_t speaker_position_distance,
+                       uint32_t horizontal_offset, uint32_t vertical_offset,
+                       uint8_t frequency_low_band, uint8_t frequency_high_band,
+                       uint16_t direction_angle, uint16_t elevation_angle,
+                       uint16_t vertical_angle_begin, uint16_t vertical_angle_end,
+                       uint16_t horizontal_angle_begin, uint16_t horizontal_angle_end)
+{
+       struct intel_dmic_params *dmic = (struct intel_dmic_params *)nhlt->dmic_params;
+
+       if (!dmic)
+               return -EINVAL;
+
+       dmic->dmic_mic_config.vendor[index].type = type;
+       dmic->dmic_mic_config.vendor[index].panel = panel;
+       dmic->dmic_mic_config.vendor[index].speaker_position_distance = speaker_position_distance;
+       dmic->dmic_mic_config.vendor[index].horizontal_offset = horizontal_offset;
+       dmic->dmic_mic_config.vendor[index].vertical_offset = vertical_offset;
+       dmic->dmic_mic_config.vendor[index].frequency_low_band = frequency_low_band;
+       dmic->dmic_mic_config.vendor[index].frequency_high_band = frequency_high_band;
+       dmic->dmic_mic_config.vendor[index].direction_angle = direction_angle;
+       dmic->dmic_mic_config.vendor[index].elevation_angle = elevation_angle;
+       dmic->dmic_mic_config.vendor[index].vertical_angle_begin = vertical_angle_begin;
+       dmic->dmic_mic_config.vendor[index].vertical_angle_end = vertical_angle_end;
+       dmic->dmic_mic_config.vendor[index].horizontal_angle_begin = horizontal_angle_begin;
+       dmic->dmic_mic_config.vendor[index].horizontal_angle_end = horizontal_angle_end;
+
+       dmic->dmic_mic_config.num_mics++;
+
+       return 0;
+}
+
+/* init dmic parameters, should be called before parsing dais */
+int dmic_init_params(struct intel_nhlt_params *nhlt)
+{
+       struct intel_dmic_params *dmic;
+       int i;
+
+       dmic = calloc(1, sizeof(struct intel_dmic_params));
+       if (!dmic)
+               return -ENOMEM;
+
+       nhlt->dmic_params = dmic;
+       /* set always to 1, some fw variants use this for choosing memory type */
+       dmic->dmic_blob.gateway_attributes = 1;
+       /* delay in ms to unmute mics after clock is started */
+       dmic->dmic_blob.clock_on_delay = 16;
+
+       for (i = 0; i < DMIC_TS_GROUP_SIZE; i++)
+               dmic->dmic_blob.ts_group[i] = 0xFFFFFFFF; /* not enabled */
+
+       dmic->dmic_count = 0;
+
+       dmic->dmic_mic_config.num_mics = 0;
+       dmic->dmic_mic_config.extension = 0;
+       dmic->dmic_mic_config.array_type = 0;
+       dmic->dmic_mic_config.snr = 0;
+       dmic->dmic_mic_config.sensitivity = 0;
+
+       return 0;
+}
diff --git a/topology/nhlt/intel/dmic/dmic-process.h b/topology/nhlt/intel/dmic/dmic-process.h
new file mode 100644 (file)
index 0000000..e67f473
--- /dev/null
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __DMIC_PROCESS_H
+#define __DMIC_PROCESS_H
+
+#include <stdint.h>
+
+/* initialize and set default values before parsing */
+int dmic_init_params(struct intel_nhlt_params *nhlt);
+
+/* set parameters when parsing topology2 conf */
+int dmic_set_params(struct intel_nhlt_params *nhlt, int dai_index, int driver_version,
+                   int io_clk, int num_pdm_active, int fifo_word_length, int clk_min, int clk_max,
+                   int duty_min, int duty_max, int sample_rate, int unmute_ramp_time);
+int dmic_set_pdm_params(struct intel_nhlt_params *nhlt, int pdm_index, int enable_a,
+                       int enable_b, int polarity_a, int polarity_b, int clk_edge, int skew);
+int dmic_set_ext_params(struct intel_nhlt_params *nhlt, uint32_t snr, uint32_t sensitivity);
+int dmic_set_mic_params(struct intel_nhlt_params *nhlt, int index,
+                       uint8_t type, uint8_t panel, uint32_t speaker_position_distance,
+                       uint32_t horizontal_offset, uint32_t vertical_offset,
+                       uint8_t frequency_low_band, uint8_t frequency_high_band,
+                       uint16_t direction_angle, uint16_t elevation_angle,
+                       uint16_t vertical_angle_begin, uint16_t vertical_angle_end,
+                       uint16_t horizontal_angle_begin, uint16_t horizontal_angle_end);
+
+/* calculate the blob after parsing the values*/
+int dmic_calculate(struct intel_nhlt_params *nhlt);
+
+/* get spec parameters when building the nhlt endpoint */
+int dmic_get_params(struct intel_nhlt_params *nhlt, int index, uint32_t *sample_rate,
+                   uint16_t *channel_count, uint32_t *bits_per_sample, uint8_t *array_type,
+                   uint8_t *num_mics, uint8_t *extension, uint32_t *snr, uint32_t *sensitivity);
+int dmic_get_mic_params(struct intel_nhlt_params *nhlt, int index,
+                       uint8_t *type, uint8_t *panel, uint32_t *speaker_position_distance,
+                       uint32_t *horizontal_offset, uint32_t *vertical_offset,
+                       uint8_t *frequency_low_band, uint8_t *frequency_high_band,
+                       uint16_t *direction_angle, uint16_t *elevation_angle,
+                       uint16_t *vertical_angle_begin, uint16_t *vertical_angle_end,
+                       uint16_t *horizontal_angle_begin, uint16_t *horizontal_angle_end);
+
+/* get vendor specific blob when building the nhlt endpoint */
+int dmic_get_vendor_blob_count(struct intel_nhlt_params *nhlt);
+int dmic_get_vendor_blob_size(struct intel_nhlt_params *nhlt, size_t *size);
+int dmic_get_vendor_blob(struct intel_nhlt_params *nhlt, uint8_t *vendor_blob);
+
+#endif
diff --git a/topology/nhlt/intel/dmic/pdm-decim-fir.h b/topology/nhlt/intel/dmic/pdm-decim-fir.h
new file mode 100644 (file)
index 0000000..7f165ae
--- /dev/null
@@ -0,0 +1,448 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021-2023 Intel Corporation. All rights reserved.
+//
+// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __SOF_AUDIO_COEFFICIENTS_PDM_DECIM_PDM_DECIM_FIR_H__
+#define __SOF_AUDIO_COEFFICIENTS_PDM_DECIM_PDM_DECIM_FIR_H__
+
+#include <stdint.h>
+
+struct pdm_decim {
+       int decim_factor;
+       int length;
+       int shift;
+       int relative_passband;
+       int relative_stopband;
+       int passband_ripple;
+       int stopband_ripple;
+       const int32_t *coef;
+};
+
+const int32_t fir_int32_10_4156_5345_010_090[250] = {
+       1523665, 1033186, 1237912, 1334775, 1259136,
+       945771, 330804, -639430, -2007230, -3782603,
+       -5951062, -8464725, -11233139, -14135396, -17013193,
+       -19685639, -21953913, -23620153, -24499971, -24438406,
+       -23328862, -21124651, -17851431, -13614282, -8597813,
+       -3061758, 2673313, 8241850, 13260214, 17352951,
+       20183225, 21483036, 21079871, 18918865, 15076270,
+       9764507, 3325641, -3786831, -11034844, -17834361,
+       -23598518, -27786005, -29948197, -29773031, -27120493,
+       -22045821, -14809184, -5868041, 4147420, 14474606,
+       24273606, 32691772, 38934943, 42337380, 42426833,
+       38977193, 32043932, 21978645, 9419218, -4744590,
+       -19429341, -33436251, -45544284, -54611932, -59678078,
+       -60055175, -55404949, -45789928, -31694490, -14011800,
+       6004287, 26821132, 46737621, 64015881, 77024918,
+       84384267, 85096503, 78655977, 65124057, 45161629,
+       20014065, -8553289, -38367257, -66999907, -91952963,
+       -110860336, -121693302, -122951962, -113826153, -94311463,
+       -65267325, -28409399, 13767679, 58135590, 101138413,
+       139047421, 168247614, 185536046, 188409622, 175319624,
+       145872050, 100954938, 42779310, -25174601, -98307054,
+       -171138928, -237629824, -291555223, -326919157, -338374861,
+       -321624361, -273768560, -193581379, -81686484, 59379271,
+       225223665, 409778420, 605591661, 804217132, 996677146,
+       1173970423, 1327592623, 1450036054, 1535235882, 1578933611,
+       1578933611, 1535235882, 1450036054, 1327592623, 1173970423,
+       996677146, 804217132, 605591661, 409778420, 225223665,
+       59379271, -81686484, -193581379, -273768560, -321624361,
+       -338374861, -326919157, -291555223, -237629824, -171138928,
+       -98307054, -25174601, 42779310, 100954938, 145872050,
+       175319624, 188409622, 185536046, 168247614, 139047421,
+       101138413, 58135590, 13767679, -28409399, -65267325,
+       -94311463, -113826153, -122951962, -121693302, -110860336,
+       -91952963, -66999907, -38367257, -8553289, 20014065,
+       45161629, 65124057, 78655977, 85096503, 84384267,
+       77024918, 64015881, 46737621, 26821132, 6004287,
+       -14011800, -31694490, -45789928, -55404949, -60055175,
+       -59678078, -54611932, -45544284, -33436251, -19429341,
+       -4744590, 9419218, 21978645, 32043932, 38977193,
+       42426833, 42337380, 38934943, 32691772, 24273606,
+       14474606, 4147420, -5868041, -14809184, -22045821,
+       -27120493, -29773031, -29948197, -27786005, -23598518,
+       -17834361, -11034844, -3786831, 3325641, 9764507,
+       15076270, 18918865, 21079871, 21483036, 20183225,
+       17352951, 13260214, 8241850, 2673313, -3061758,
+       -8597813, -13614282, -17851431, -21124651, -23328862,
+       -24438406, -24499971, -23620153, -21953913, -19685639,
+       -17013193, -14135396, -11233139, -8464725, -5951062,
+       -3782603, -2007230, -639430, 330804, 945771,
+       1259136, 1334775, 1237912, 1033186, 1523665
+};
+
+struct pdm_decim pdm_decim_int32_10_4156_5345_010_090 = {
+       10, 250, 3, 4156, 5345, 10, 90, fir_int32_10_4156_5345_010_090
+};
+
+const int32_t fir_int32_05_4325_5100_010_095[249] = {
+       -207469, -340409, -498144, -558705, -409384,
+       55040, 891125, 2067198, 3439775, 4759611,
+       5714914, 6006588, 5438767, 3999938, 1904139,
+       -429386, -2461501, -3672469, -3715731, -2543409,
+       -455850, 1949813, 3931230, 4816572, 4223058,
+       2208032, -705100, -3649781, -5664341, -5997954,
+       -4379534, -1155856, 2760627, 6138124, 7803235,
+       7038238, 3865643, -886573, -5783539, -9205487,
+       -9873081, -7309023, -2074085, 4324112, 9849851,
+       12575185, 11338304, 6203771, -1449001, -9273272,
+       -14659745, -15592551, -11379919, -3001447, 7079011,
+       15617750, 19618936, 17365380, 9103870, -2875883,
+       -14845719, -22779047, -23684744, -16699479, -3549687,
+       11824128, 24420688, 29781202, 25536278, 12369331,
+       -5975020, -23715313, -34825066, -35046780, -23465500,
+       -3076561, 19921841, 37971240, 44596949, 36675890,
+       15750350, -12128842, -38090537, -53213360, -51529430,
+       -32269554, -535756, 33948414, 59741809, 67400482,
+       52822241, 19070165, -24058950, -62761384, -83526757,
+       -77707237, -44854657, 6391470, 60372631, 99010031,
+       107635426, 80237884, 22341840, -49653145, -112793869,
+       -144502927, -130123093, -68698546, 25049444, 123586766,
+       193887099, 207405271, 149914650, 28201854, -128717667,
+       -274782040, -357589632, -332094228, -173714910, 112793207,
+       491412574, 900833942, 1267184732, 1520519220, 1610979079,
+       1520519220, 1267184732, 900833942, 491412574, 112793207,
+       -173714910, -332094228, -357589632, -274782040, -128717667,
+       28201854, 149914650, 207405271, 193887099, 123586766,
+       25049444, -68698546, -130123093, -144502927, -112793869,
+       -49653145, 22341840, 80237884, 107635426, 99010031,
+       60372631, 6391470, -44854657, -77707237, -83526757,
+       -62761384, -24058950, 19070165, 52822241, 67400482,
+       59741809, 33948414, -535756, -32269554, -51529430,
+       -53213360, -38090537, -12128842, 15750350, 36675890,
+       44596949, 37971240, 19921841, -3076561, -23465500,
+       -35046780, -34825066, -23715313, -5975020, 12369331,
+       25536278, 29781202, 24420688, 11824128, -3549687,
+       -16699479, -23684744, -22779047, -14845719, -2875883,
+       9103870, 17365380, 19618936, 15617750, 7079011,
+       -3001447, -11379919, -15592551, -14659745, -9273272,
+       -1449001, 6203771, 11338304, 12575185, 9849851,
+       4324112, -2074085, -7309023, -9873081, -9205487,
+       -5783539, -886573, 3865643, 7038238, 7803235,
+       6138124, 2760627, -1155856, -4379534, -5997954,
+       -5664341, -3649781, -705100, 2208032, 4223058,
+       4816572, 3931230, 1949813, -455850, -2543409,
+       -3715731, -3672469, -2461501, -429386, 1904139,
+       3999938, 5438767, 6006588, 5714914, 4759611,
+       3439775, 2067198, 891125, 55040, -409384,
+       -558705, -498144, -340409, -207469
+};
+
+struct pdm_decim pdm_decim_int32_05_4325_5100_010_095 = {
+       5, 249, 2, 4325, 5100, 10, 95, fir_int32_05_4325_5100_010_095
+};
+
+const int32_t fir_int32_12_4156_5345_010_090[250] = {
+       3388064, 2103678, 2588621, 3003201, 3289311,
+       3375616, 3187681, 2654590, 1715972, 309000,
+       -1610211, -4055571, -7035886, -10511174, -14426105,
+       -18683424, -23158811, -27697959, -32125744, -36244313,
+       -39850668, -42739502, -44716782, -45614286, -45293362,
+       -43663492, -40685637, -36382432, -30840569, -24214188,
+       -16719141, -8631481, -273616, 7996830, 15802429,
+       22766807, 28531588, 32779134, 35250465, 35763733,
+       34227329, 30653000, 25158397, 17970176, 9416017,
+       -86479, -10047026, -19926252, -29162149, -37200047,
+       -43523733, -47686853, -49340539, -48260145, -44362718,
+       -37720992, -28567244, -17289156, -4416600, 9400589,
+       23423041, 36858656, 48904650, 58793401, 65836995,
+       69472264, 69298737, 65111461, 56923398, 44977350,
+       29744904, 11913285, -7641844, -27894994, -47720356,
+       -65950400, -81438916, -93127908, -100112283, -101700449,
+       -97465921, -87287745, -71375413, -50277965, -24873838,
+       3657557, 33882414, 64176403, 92802029, 117997525,
+       138071930, 151502587, 157029100, 153740023, 141145505,
+       119233461, 88503690, 49978361, 5186664, -43876910,
+       -94819563, -144940463, -191340721, -231048840, -261155504,
+       -278952672, -282068987, -268596392, -237200378, -187208906,
+       -118674579, -32406655, 70029801, 186348178, 313607557,
+       448310730, 586528751, 724047761, 856530828, 979688864,
+       1089452098, 1182135271, 1254588364, 1304326765, 1329634160,
+       1329634160, 1304326765, 1254588364, 1182135271, 1089452098,
+       979688864, 856530828, 724047761, 586528751, 448310730,
+       313607557, 186348178, 70029801, -32406655, -118674579,
+       -187208906, -237200378, -268596392, -282068987, -278952672,
+       -261155504, -231048840, -191340721, -144940463, -94819563,
+       -43876910, 5186664, 49978361, 88503690, 119233461,
+       141145505, 153740023, 157029100, 151502587, 138071930,
+       117997525, 92802029, 64176403, 33882414, 3657557,
+       -24873838, -50277965, -71375413, -87287745, -97465921,
+       -101700449, -100112283, -93127908, -81438916, -65950400,
+       -47720356, -27894994, -7641844, 11913285, 29744904,
+       44977350, 56923398, 65111461, 69298737, 69472264,
+       65836995, 58793401, 48904650, 36858656, 23423041,
+       9400589, -4416600, -17289156, -28567244, -37720992,
+       -44362718, -48260145, -49340539, -47686853, -43523733,
+       -37200047, -29162149, -19926252, -10047026, -86479,
+       9416017, 17970176, 25158397, 30653000, 34227329,
+       35763733, 35250465, 32779134, 28531588, 22766807,
+       15802429, 7996830, -273616, -8631481, -16719141,
+       -24214188, -30840569, -36382432, -40685637, -43663492,
+       -45293362, -45614286, -44716782, -42739502, -39850668,
+       -36244313, -32125744, -27697959, -23158811, -18683424,
+       -14426105, -10511174, -7035886, -4055571, -1610211,
+       309000, 1715972, 2654590, 3187681, 3375616,
+       3289311, 3003201, 2588621, 2103678, 3388064
+};
+
+struct pdm_decim pdm_decim_int32_12_4156_5345_010_090 = {
+       12, 250, 3, 4156, 5345, 10, 90, fir_int32_12_4156_5345_010_090
+};
+
+const int32_t fir_int32_03_4375_5100_010_095[157] = {
+       350908, 1127906, 2233575, 3059598, 2752218,
+       818077, -2252677, -4944563, -5550761, -3466262,
+       53093, 2496787, 1904133, -1421749, -4818616,
+       -5204506, -1721103, 3155344, 5311508, 2454543,
+       -3518663, -7589567, -5713379, 1327838, 7901439,
+       7958184, 527907, -8634105, -11354937, -4214569,
+       7627213, 13970417, 8263468, -5862019, -16549858,
+       -13530131, 2213952, 17870989, 19056458, 2854116,
+       -18029944, -24979416, -9860304, 16175288, 30546328,
+       18606151, -11894439, -35172976, -28918520, 4746588,
+       38201563, 40591159, 5825487, -38713444, -53159813,
+       -20283635, 35723701, 66121349, 39266346, -27911327,
+       -78796917, -63664545, 13459132, 90417174, 95194527,
+       10755265, -99898306, -137498952, -51076476, 105458775,
+       200050300, 124562550, -101613472, -313388303, -297347454,
+       53702567, 639689683, 1187815441, 1411068556, 1187815441,
+       639689683, 53702567, -297347454, -313388303, -101613472,
+       124562550, 200050300, 105458775, -51076476, -137498952,
+       -99898306, 10755265, 95194527, 90417174, 13459132,
+       -63664545, -78796917, -27911327, 39266346, 66121349,
+       35723701, -20283635, -53159813, -38713444, 5825487,
+       40591159, 38201563, 4746588, -28918520, -35172976,
+       -11894439, 18606151, 30546328, 16175288, -9860304,
+       -24979416, -18029944, 2854116, 19056458, 17870989,
+       2213952, -13530131, -16549858, -5862019, 8263468,
+       13970417, 7627213, -4214569, -11354937, -8634105,
+       527907, 7958184, 7901439, 1327838, -5713379,
+       -7589567, -3518663, 2454543, 5311508, 3155344,
+       -1721103, -5204506, -4818616, -1421749, 1904133,
+       2496787, 53093, -3466262, -5550761, -4944563,
+       -2252677, 818077, 2752218, 3059598, 2233575,
+       1127906, 350908
+};
+
+struct pdm_decim pdm_decim_int32_03_4375_5100_010_095 = {
+       3, 157, 1, 4375, 5100, 10, 95, fir_int32_03_4375_5100_010_095
+};
+
+const int32_t fir_int32_02_4375_5100_010_095[101] = {
+       -587830, -2653881, -5154608, -4845367, -226474,
+       4220832, 2571159, -3184700, -4043579, 2206821,
+       5554546, -750495, -6923897, -1268580, 8073364,
+       4085184, -8546479, -7505366, 8176184, 11533751,
+       -6471060, -15704257, 3359705, 19852407, 1635592,
+       -23144509, -8252640, 25285011, 16574477, -25723227,
+       -26663303, 23549736, 38139662, -17943368, -50446982,
+       8141045, 63090266, 7051348, -75166961, -29039893,
+       85772628, 60568976, -93167361, -106799777, 94198977,
+       180962817, -78385599, -324820256, -12243140, 742491464,
+       1151461314, 742491464, -12243140, -324820256, -78385599,
+       180962817, 94198977, -106799777, -93167361, 60568976,
+       85772628, -29039893, -75166961, 7051348, 63090266,
+       8141045, -50446982, -17943368, 38139662, 23549736,
+       -26663303, -25723227, 16574477, 25285011, -8252640,
+       -23144509, 1635592, 19852407, 3359705, -15704257,
+       -6471060, 11533751, 8176184, -7505366, -8546479,
+       4085184, 8073364, -1268580, -6923897, -750495,
+       5554546, 2206821, -4043579, -3184700, 2571159,
+       4220832, -226474, -4845367, -5154608, -2653881,
+       -587830
+};
+
+struct pdm_decim pdm_decim_int32_02_4375_5100_010_095 = {
+       2, 101, 0, 4375, 5100, 10, 95, fir_int32_02_4375_5100_010_095
+};
+
+const int32_t fir_int32_08_4156_5301_010_090[249] = {
+       -436533, -30097, 185136, 599151, 1249127,
+       2156309, 3316125, 4690126, 6201703, 7736149,
+       9146691, 10266194, 10924643, 10970009, 10291237,
+       8839410, 6645091, 3827796, 595625, -2767301,
+       -5925074, -8524488, -10235869, -10797193, -10055131,
+       -7997758, -4771108, -678235, 3841448, 8252025,
+       11985305, 14503017, 15375105, 14342998, 11370408,
+       6669744, 697166, -5883789, -12270613, -17614188,
+       -21126754, -22191034, -20457484, -15913860, -8916788,
+       -176408, 9306801, 18349873, 25728753, 30337331,
+       31343834, 28324134, 21351665, 11028693, -1551253,
+       -14908738, -27343830, -37144407, -42813431, -43283070,
+       -38091954, -27492154, -12471488, 5321162, 23744416,
+       40410795, 52985294, 59498920, 58637630, 49965561,
+       34048834, 12455105, -12379340, -37407904, -59331472,
+       -75016381, -81921345, -78477412, -64367569, -40661743,
+       -9779029, 24730505, 58569248, 87201632, 106433026,
+       112987295, 105007254, 82406938, 47020690, 2512109,
+       -45960354, -92298012, -130180961, -153871591, -159007197,
+       -143278921, -106903512, -52811885, 13489989, 84396518,
+       150980417, 204001696, 235041565, 237634873, 208265018,
+       147093489, 58319704, -49897266, -165975625, -275876513,
+       -364417203, -416806765, -420248734, -365439450, -247794421,
+       -68258347, 166406038, 443903891, 747260153, 1056170460,
+       1348727100, 1603354585, 1800763975, 1925728602, 1968501522,
+       1925728602, 1800763975, 1603354585, 1348727100, 1056170460,
+       747260153, 443903891, 166406038, -68258347, -247794421,
+       -365439450, -420248734, -416806765, -364417203, -275876513,
+       -165975625, -49897266, 58319704, 147093489, 208265018,
+       237634873, 235041565, 204001696, 150980417, 84396518,
+       13489989, -52811885, -106903512, -143278921, -159007197,
+       -153871591, -130180961, -92298012, -45960354, 2512109,
+       47020690, 82406938, 105007254, 112987295, 106433026,
+       87201632, 58569248, 24730505, -9779029, -40661743,
+       -64367569, -78477412, -81921345, -75016381, -59331472,
+       -37407904, -12379340, 12455105, 34048834, 49965561,
+       58637630, 59498920, 52985294, 40410795, 23744416,
+       5321162, -12471488, -27492154, -38091954, -43283070,
+       -42813431, -37144407, -27343830, -14908738, -1551253,
+       11028693, 21351665, 28324134, 31343834, 30337331,
+       25728753, 18349873, 9306801, -176408, -8916788,
+       -15913860, -20457484, -22191034, -21126754, -17614188,
+       -12270613, -5883789, 697166, 6669744, 11370408,
+       14342998, 15375105, 14503017, 11985305, 8252025,
+       3841448, -678235, -4771108, -7997758, -10055131,
+       -10797193, -10235869, -8524488, -5925074, -2767301,
+       595625, 3827796, 6645091, 8839410, 10291237,
+       10970009, 10924643, 10266194, 9146691, 7736149,
+       6201703, 4690126, 3316125, 2156309, 1249127,
+       599151, 185136, -30097, -436533
+};
+
+struct pdm_decim pdm_decim_int32_08_4156_5301_010_090 = {
+       8, 249, 3, 4156, 5301, 10, 90, fir_int32_08_4156_5301_010_090
+};
+
+const int32_t fir_int32_02_4323_5100_010_095[95] = {
+       178179, -158757, -2195582, -5296650, -5737416,
+       -1057695, 4405719, 3336648, -3249588, -5061179,
+       1984305, 6895125, 68826, -8433396, -2933479,
+       9499107, 6882087, -9330152, -11397510, 7807097,
+       16376076, -4402338, -21239788, -1118085, 25423993,
+       9062534, -27935015, -19203927, 28049586, 31500423,
+       -24524863, -45191501, 16582731, 59861920, -2808306,
+       -74639091, -18696113, 88054673, 50505898, -98266320,
+       -97865783, 101816481, 173879965, -88042495, -320187025,
+       -1193013, 740698712, 1139586920, 740698712, -1193013,
+       -320187025, -88042495, 173879965, 101816481, -97865783,
+       -98266320, 50505898, 88054673, -18696113, -74639091,
+       -2808306, 59861920, 16582731, -45191501, -24524863,
+       31500423, 28049586, -19203927, -27935015, 9062534,
+       25423993, -1118085, -21239788, -4402338, 16376076,
+       7807097, -11397510, -9330152, 6882087, 9499107,
+       -2933479, -8433396, 68826, 6895125, 1984305,
+       -5061179, -3249588, 3336648, 4405719, -1057695,
+       -5737416, -5296650, -2195582, -158757, 178179
+};
+
+struct pdm_decim pdm_decim_int32_02_4323_5100_010_095 = {
+       2, 95, 0, 4323, 5100, 10, 95, fir_int32_02_4323_5100_010_095
+};
+
+const int32_t fir_int32_06_4172_5100_010_095[247] = {
+       -128631, -59503, 27031, 238532, 615330,
+       1180314, 1925562, 2802417, 3717924, 4540883,
+       5118361, 5301921, 4979167, 4105027, 2725204,
+       985420, -879357, -2576519, -3805386, -4316122,
+       -3967965, -2772550, -910853, 1284237, 3378600,
+       4918468, 5523902, 4978553, 3294183, 731440,
+       -2230675, -4978319, -6884321, -7446349, -6411064,
+       -3855969, -204877, 3832625, 7392494, 9635125,
+       9936780, 8050664, 4198358, -936188, -6317705,
+       -10761140, -13185684, -12868530, -9640702, -3974823,
+       3065204, 10012726, 15295833, 17583895, 16110094,
+       10893000, 2799002, -6583053, -15241642, -21163671,
+       -22790698, -19409646, -11383158, -154530, 11992615,
+       22384784, 28533872, 28715941, 22422705, 10572525,
+       -4585611, -19877670, -31851611, -37538237, -35161448,
+       -24633854, -7707813, 12278124, 31031785, 44204723,
+       48372136, 41880203, 25359325, 1761603, -24122660,
+       -46601256, -60293649, -61370947, -48545937, -23571586,
+       8902814, 42136842, 68639354, 81788695, 77395612,
+       54857291, 17613243, -27256826, -70277333, -101463585,
+       -112494642, -98725143, -60586317, -4019284, 60240464,
+       118482133, 156662559, 163400089, 132736532, 66085166,
+       -27098212, -130164932, -221605671, -278535815, -280760534,
+       -214700503, -76443585, 126687932, 376420234, 645703534,
+       902480880, 1114453256, 1254049394, 1302754294, 1254049394,
+       1114453256, 902480880, 645703534, 376420234, 126687932,
+       -76443585, -214700503, -280760534, -278535815, -221605671,
+       -130164932, -27098212, 66085166, 132736532, 163400089,
+       156662559, 118482133, 60240464, -4019284, -60586317,
+       -98725143, -112494642, -101463585, -70277333, -27256826,
+       17613243, 54857291, 77395612, 81788695, 68639354,
+       42136842, 8902814, -23571586, -48545937, -61370947,
+       -60293649, -46601256, -24122660, 1761603, 25359325,
+       41880203, 48372136, 44204723, 31031785, 12278124,
+       -7707813, -24633854, -35161448, -37538237, -31851611,
+       -19877670, -4585611, 10572525, 22422705, 28715941,
+       28533872, 22384784, 11992615, -154530, -11383158,
+       -19409646, -22790698, -21163671, -15241642, -6583053,
+       2799002, 10893000, 16110094, 17583895, 15295833,
+       10012726, 3065204, -3974823, -9640702, -12868530,
+       -13185684, -10761140, -6317705, -936188, 4198358,
+       8050664, 9936780, 9635125, 7392494, 3832625,
+       -204877, -3855969, -6411064, -7446349, -6884321,
+       -4978319, -2230675, 731440, 3294183, 4978553,
+       5523902, 4918468, 3378600, 1284237, -910853,
+       -2772550, -3967965, -4316122, -3805386, -2576519,
+       -879357, 985420, 2725204, 4105027, 4979167,
+       5301921, 5118361, 4540883, 3717924, 2802417,
+       1925562, 1180314, 615330, 238532, 27031,
+       -59503, -128631
+};
+
+struct pdm_decim pdm_decim_int32_06_4172_5100_010_095 = {
+       6, 247, 2, 4172, 5100, 10, 95, fir_int32_06_4172_5100_010_095
+};
+
+const int32_t fir_int32_04_4318_5100_010_095[195] = {
+       111466, 733409, 1749250, 3319696, 5129378,
+       6676209, 7309490, 6506584, 4154756, 734975,
+       -2729377, -4998637, -5126868, -2945573, 726080,
+       4306371, 6084832, 5022201, 1343898, -3405897,
+       -6962146, -7384707, -4083477, 1706504, 7322247,
+       9858386, 7634375, 1218279, -6584983, -11909667,
+       -11705999, -5426216, 4387589, 13057254, 15953274,
+       10914694, -336708, -12649310, -19740590, -17350504,
+       -5691816, 10168034, 22423979, 24315225, 13770305,
+       -5012695, -23099234, -30992981, -23541145, -3074594,
+       21044646, 36602258, 34627991, 14410179, -15304906,
+       -39942350, -46136506, -28837515, 5227124, 39904111,
+       57125295, 46160603, 9951610, -35069112, -66221384,
+       -65802058, -30833475, 23892424, 71729303, 86873627,
+       57925919, -4643620, -71630929, -108312985, -91957579,
+       -25024430, 63233146, 128873180, 134384678, 69003997,
+       -42277605, -146972769, -188542432, -135065835, 625004,
+       160544910, 263771211, 243538822, 83417905, -164654723,
+       -391259178, -468017530, -299941690, 129616412, 741218294,
+       1378462855, 1858765025, 2037199780, 1858765025, 1378462855,
+       741218294, 129616412, -299941690, -468017530, -391259178,
+       -164654723, 83417905, 243538822, 263771211, 160544910,
+       625004, -135065835, -188542432, -146972769, -42277605,
+       69003997, 134384678, 128873180, 63233146, -25024430,
+       -91957579, -108312985, -71630929, -4643620, 57925919,
+       86873627, 71729303, 23892424, -30833475, -65802058,
+       -66221384, -35069112, 9951610, 46160603, 57125295,
+       39904111, 5227124, -28837515, -46136506, -39942350,
+       -15304906, 14410179, 34627991, 36602258, 21044646,
+       -3074594, -23541145, -30992981, -23099234, -5012695,
+       13770305, 24315225, 22423979, 10168034, -5691816,
+       -17350504, -19740590, -12649310, -336708, 10914694,
+       15953274, 13057254, 4387589, -5426216, -11705999,
+       -11909667, -6584983, 1218279, 7634375, 9858386,
+       7322247, 1706504, -4083477, -7384707, -6962146,
+       -3405897, 1343898, 5022201, 6084832, 4306371,
+       726080, -2945573, -5126868, -4998637, -2729377,
+       734975, 4154756, 6506584, 7309490, 6676209,
+       5129378, 3319696, 1749250, 733409, 111466
+};
+
+struct pdm_decim pdm_decim_int32_04_4318_5100_010_095 = {
+       4, 195, 2, 4318, 5100, 10, 95, fir_int32_04_4318_5100_010_095
+};
+
+#endif /* __SOF_AUDIO_COEFFICIENTS_PDM_DECIM_PDM_DECIM_FIR_H__ */
diff --git a/topology/nhlt/intel/intel-nhlt.c b/topology/nhlt/intel/intel-nhlt.c
new file mode 100644 (file)
index 0000000..b245afc
--- /dev/null
@@ -0,0 +1,127 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#include "aconfig.h"
+#include "intel-nhlt.h"
+
+static int get_int_val(snd_config_t *input, long *int_val, snd_config_t *top)
+{
+       char tplg_define[128] = "Define.";
+       snd_config_t *n;
+       const char *s;
+       int ret;
+
+       if (snd_config_get_string(input, &s) < 0)
+               return snd_config_get_integer(input, int_val);
+
+       if (*s != '$')
+               return 0;
+
+       strcat(tplg_define, s + 1);
+
+       ret = snd_config_search(top, tplg_define, &n);
+       if (ret < 0)
+               return ret;
+
+       return snd_config_get_integer(n, int_val);
+}
+
+static int get_string_val(snd_config_t *input, const char **string_val, snd_config_t *top)
+{
+       char tplg_define[128] = "Define.";
+       snd_config_t *n;
+       int ret;
+
+       if (snd_config_get_string(input, string_val) < 0)
+               return -EINVAL;
+
+       if (**string_val != '$')
+               return 0;
+
+       strcat(tplg_define, *string_val + 1);
+
+       ret = snd_config_search(top, tplg_define, &n);
+       if (ret < 0)
+               return ret;
+
+       return snd_config_get_string(n, string_val);
+}
+
+#ifdef NHLT_DEBUG
+static void print_array_values(struct dai_values *values, int size)
+{
+       int i;
+
+       fprintf(stdout, "print parsed array:\n");
+       for (i = 0; i < size; i++, values++) {
+               if (values->type == SND_CONFIG_TYPE_INTEGER)
+                       fprintf(stdout, "%s %ld\n", values->name, *values->int_val);
+               else
+                       fprintf(stdout, "%s %s\n", values->name, *values->string_val);
+       }
+       fprintf(stdout, "\n");
+}
+#endif
+
+int find_set_values(struct dai_values *values, int size, snd_config_t *dai_cfg,
+                   snd_config_t *top, const char *class_name)
+{
+       snd_config_iterator_t i, next;
+       struct dai_values *temp_val;
+       snd_config_t *class_cfg;
+       snd_config_t *n;
+       const char *id;
+       int ret;
+       int j;
+
+       /* get default values from class definition */
+       ret = snd_config_search(top, class_name, &class_cfg);
+       if (ret < 0)
+               return ret;
+
+       snd_config_for_each(i, next, class_cfg) {
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               for (j = 0, temp_val = values; j < size; j++, temp_val++) {
+                       if (!strcmp(id, temp_val->name)) {
+                               temp_val->data = n;
+                               break;
+                       }
+               }
+       }
+
+       /* set instance specific values */
+       snd_config_for_each(i, next, dai_cfg) {
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               for (j = 0, temp_val = values; j < size; j++, temp_val++) {
+                       if (!strcmp(id, temp_val->name)) {
+                               temp_val->data = n;
+                               break;
+                       }
+               }
+       }
+
+       for (j = 0, temp_val = values; j < size; j++, temp_val++) {
+               if (!temp_val->data)
+                       continue;
+               if (temp_val->type == SND_CONFIG_TYPE_INTEGER)
+                       get_int_val(temp_val->data, temp_val->int_val, top);
+               else
+                       get_string_val(temp_val->data, temp_val->string_val, top);
+       }
+
+#ifdef NHLT_DEBUG
+       print_array_values(values, size);
+#endif
+       return 0;
+}
diff --git a/topology/nhlt/intel/intel-nhlt.h b/topology/nhlt/intel/intel-nhlt.h
new file mode 100644 (file)
index 0000000..72e61fb
--- /dev/null
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __INTEL_NHLT_H
+#define __INTEL_NHLT_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/conf.h>
+#include <alsa/error.h>
+
+#define MIN(a, b) ({           \
+       typeof(a) __a = (a);    \
+       typeof(b) __b = (b);    \
+       __a > __b ? __b : __a;  \
+})
+#define MAX(a, b) ({           \
+       typeof(a) __a = (a);    \
+       typeof(b) __b = (b);    \
+       __a < __b ? __b : __a;  \
+})
+
+#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a)[0])
+
+#define BIT(b)                  (1UL << (b))
+#define MASK(b_hi, b_lo)        (((1ULL << ((b_hi) - (b_lo) + 1ULL)) - 1ULL) << (b_lo))
+#define SET_BIT(b, x)           (((x) & 1) << (b))
+#define SET_BITS(b_hi, b_lo, x) (((x) & ((1ULL << ((b_hi) - (b_lo) + 1ULL)) - 1ULL)) << (b_lo))
+
+struct intel_nhlt_params {
+       void *dmic_params;
+       void *ssp_params;
+};
+
+struct dai_values {
+       char name[32];
+       snd_config_type_t type;
+       snd_config_t *data;
+       long *int_val;
+       const char **string_val;
+};
+
+int find_set_values(struct dai_values *values, int size, snd_config_t *dai_cfg,
+                   snd_config_t *top, const char *class_name);
+
+#endif /* __INTEL_NHLT_H */
diff --git a/topology/nhlt/intel/ssp-nhlt.c b/topology/nhlt/intel/ssp-nhlt.c
new file mode 100644 (file)
index 0000000..1137819
--- /dev/null
@@ -0,0 +1,649 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#include "aconfig.h"
+#include <stdint.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/conf.h>
+#include <alsa/error.h>
+#include "intel-nhlt.h"
+#include "ssp-nhlt.h"
+#include "ssp/ssp-process.h"
+#include "ssp/ssp-internal.h"
+
+static int set_mn_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long m_div;
+       long n_div;
+       long ret;
+
+       struct dai_values ssp_mn_data[] = {
+               {"m_div", SND_CONFIG_TYPE_INTEGER, NULL, &m_div, NULL},
+               {"n_div", SND_CONFIG_TYPE_INTEGER, NULL, &n_div, NULL},
+       };
+
+       ret = find_set_values(&ssp_mn_data[0], ARRAY_SIZE(ssp_mn_data), cfg, top,
+                             "Class.Base.mn_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_mn_set_params(nhlt, m_div, n_div);
+}
+
+static int set_clk_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long clock_warm_up;
+       long mclk;
+       long warm_up_ovr;
+       long clock_stop_delay;
+       long keep_running;
+       long clock_stop_ovr;
+       long ret;
+
+       struct dai_values ssp_clk_data[] = {
+               {"clock_warm_up", SND_CONFIG_TYPE_INTEGER, NULL, &clock_warm_up, NULL},
+               {"mclk", SND_CONFIG_TYPE_INTEGER, NULL, &mclk, NULL},
+               {"warm_up_ovr", SND_CONFIG_TYPE_INTEGER, NULL, &warm_up_ovr, NULL},
+               {"clock_stop_delay", SND_CONFIG_TYPE_INTEGER, NULL, &clock_stop_delay, NULL},
+               {"keep_running", SND_CONFIG_TYPE_INTEGER, NULL, &keep_running, NULL},
+               {"clock_stop_ovr", SND_CONFIG_TYPE_INTEGER, NULL, &clock_stop_ovr, NULL},
+       };
+
+       ret = find_set_values(&ssp_clk_data[0], ARRAY_SIZE(ssp_clk_data), cfg, top,
+                             "Class.Base.clk_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_clk_set_params(nhlt, clock_warm_up, mclk, warm_up_ovr, clock_stop_delay,
+                                 keep_running, clock_stop_ovr);
+}
+
+static int set_tr_start_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long sampling_frequency;
+       long bit_depth;
+       long channel_map;
+       long channel_config;
+       long interleaving_style;
+       long number_of_channels;
+       long valid_bit_depth;
+       long sample_type;
+       long ret;
+
+       struct dai_values ssp_tr_data[] = {
+               {"sampling_frequency", SND_CONFIG_TYPE_INTEGER, NULL, &sampling_frequency, NULL},
+               {"bit_depth", SND_CONFIG_TYPE_INTEGER, NULL, &bit_depth, NULL},
+               {"channel_map", SND_CONFIG_TYPE_INTEGER, NULL, &channel_map, NULL},
+               {"channel_config", SND_CONFIG_TYPE_INTEGER, NULL, &channel_config, NULL},
+               {"interleaving_style", SND_CONFIG_TYPE_INTEGER, NULL, &interleaving_style, NULL},
+               {"number_of_channels", SND_CONFIG_TYPE_INTEGER, NULL, &number_of_channels, NULL},
+               {"valid_bit_depth", SND_CONFIG_TYPE_INTEGER, NULL, &valid_bit_depth, NULL},
+               {"sample_type", SND_CONFIG_TYPE_INTEGER, NULL, &sample_type, NULL},
+       };
+
+       ret = find_set_values(&ssp_tr_data[0], ARRAY_SIZE(ssp_tr_data), cfg, top,
+                             "Class.Base.tr_start_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_tr_start_set_params(nhlt, sampling_frequency, bit_depth, channel_map,
+                                      channel_config, interleaving_style, number_of_channels,
+                                      valid_bit_depth,sample_type);
+}
+
+static int set_tr_stop_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long sampling_frequency;
+       long bit_depth;
+       long channel_map;
+       long channel_config;
+       long interleaving_style;
+       long number_of_channels;
+       long valid_bit_depth;
+       long sample_type;
+       long ret;
+
+       struct dai_values ssp_tr_data[] = {
+               {"sampling_frequency", SND_CONFIG_TYPE_INTEGER, NULL, &sampling_frequency, NULL},
+               {"bit_depth", SND_CONFIG_TYPE_INTEGER, NULL, &bit_depth, NULL},
+               {"channel_map", SND_CONFIG_TYPE_INTEGER, NULL, &channel_map, NULL},
+               {"channel_config", SND_CONFIG_TYPE_INTEGER, NULL, &channel_config, NULL},
+               {"interleaving_style", SND_CONFIG_TYPE_INTEGER, NULL, &interleaving_style, NULL},
+               {"number_of_channels", SND_CONFIG_TYPE_INTEGER, NULL, &number_of_channels, NULL},
+               {"valid_bit_depth", SND_CONFIG_TYPE_INTEGER, NULL, &valid_bit_depth, NULL},
+               {"sample_type", SND_CONFIG_TYPE_INTEGER, NULL, &sample_type, NULL},
+       };
+
+       ret = find_set_values(&ssp_tr_data[0], ARRAY_SIZE(ssp_tr_data), cfg, top,
+                             "Class.Base.tr_stop_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_tr_stop_set_params(nhlt, sampling_frequency, bit_depth, channel_map,
+                                     channel_config, interleaving_style, number_of_channels,
+                                     valid_bit_depth,sample_type);
+}
+
+static int set_run_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long always_run;
+       long ret;
+
+       struct dai_values ssp_run_data[] = {
+               {"always_run", SND_CONFIG_TYPE_INTEGER, NULL, &always_run, NULL},
+       };
+
+       ret = find_set_values(&ssp_run_data[0], ARRAY_SIZE(ssp_run_data), cfg, top,
+                             "Class.Base.run_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_run_set_params(nhlt, always_run);
+}
+
+static int set_node_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long sampling_rate;
+       long node_id;
+       long ret;
+
+       struct dai_values ssp_node_data[] = {
+               {"node_id", SND_CONFIG_TYPE_INTEGER, NULL, &node_id, NULL},
+               {"sampling_rate", SND_CONFIG_TYPE_INTEGER, NULL, &sampling_rate, NULL},
+       };
+
+       ret = find_set_values(&ssp_node_data[0], ARRAY_SIZE(ssp_node_data), cfg, top,
+                             "Class.Base.node_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_node_set_params(nhlt, node_id, sampling_rate);
+}
+
+static int set_sync_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long sync_denominator;
+       long ret;
+
+       struct dai_values ssp_sync_data[] = {
+               {"sync_denominator", SND_CONFIG_TYPE_INTEGER, NULL, &sync_denominator, NULL},
+       };
+
+       ret = find_set_values(&ssp_sync_data[0], ARRAY_SIZE(ssp_sync_data), cfg, top,
+                             "Class.Base.sync_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_sync_set_params(nhlt, sync_denominator);
+}
+
+static int set_ext_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long mclk_policy_override;
+       long mclk_always_running;
+       long mclk_starts_on_gtw_init;
+       long mclk_starts_on_run;
+       long mclk_starts_on_pause;
+       long mclk_stops_on_pause;
+       long mclk_stops_on_reset;
+
+       long bclk_policy_override;
+       long bclk_always_running;
+       long bclk_starts_on_gtw_init;
+       long bclk_starts_on_run;
+       long bclk_starts_on_pause;
+       long bclk_stops_on_pause;
+       long bclk_stops_on_reset;
+
+       long sync_policy_override;
+       long sync_always_running;
+       long sync_starts_on_gtw_init;
+       long sync_starts_on_run;
+       long sync_starts_on_pause;
+       long sync_stops_on_pause;
+       long sync_stops_on_reset;
+       long ret;
+
+       struct dai_values ssp_ext_data[] = {
+               {"mclk_policy_override", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_policy_override, NULL},
+               {"mclk_always_running", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_always_running, NULL},
+               {"mclk_starts_on_gtw_init", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_starts_on_gtw_init, NULL},
+               {"mclk_starts_on_run", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_starts_on_run, NULL},
+               {"mclk_starts_on_pause", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_starts_on_pause, NULL},
+               {"mclk_stops_on_pause", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_stops_on_pause, NULL},
+               {"mclk_stops_on_reset", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_stops_on_reset, NULL},
+               {"bclk_policy_override", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_policy_override, NULL},
+               {"bclk_always_running", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_always_running, NULL},
+               {"bclk_starts_on_gtw_init", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_starts_on_gtw_init, NULL},
+               {"bclk_starts_on_run", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_starts_on_run, NULL},
+               {"bclk_starts_on_pause", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_starts_on_pause, NULL},
+               {"bclk_stops_on_pause", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_stops_on_pause, NULL},
+               {"bclk_stops_on_reset", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_stops_on_reset, NULL},
+               {"sync_policy_override", SND_CONFIG_TYPE_INTEGER, NULL, &sync_policy_override, NULL},
+               {"sync_always_running", SND_CONFIG_TYPE_INTEGER, NULL, &sync_always_running, NULL},
+               {"sync_starts_on_gtw_init", SND_CONFIG_TYPE_INTEGER, NULL, &sync_starts_on_gtw_init, NULL},
+               {"sync_starts_on_run", SND_CONFIG_TYPE_INTEGER, NULL, &sync_starts_on_run, NULL},
+               {"sync_starts_on_pause", SND_CONFIG_TYPE_INTEGER, NULL, &sync_starts_on_pause, NULL},
+               {"sync_stops_on_pause", SND_CONFIG_TYPE_INTEGER, NULL, &sync_stops_on_pause, NULL},
+               {"sync_stops_on_reset", SND_CONFIG_TYPE_INTEGER, NULL, &sync_stops_on_reset, NULL},
+       };
+
+       ret = find_set_values(&ssp_ext_data[0], ARRAY_SIZE(ssp_ext_data), cfg, top,
+                             "Class.Base.ext_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_ext_set_params(nhlt, mclk_policy_override, mclk_always_running,
+                                 mclk_starts_on_gtw_init, mclk_starts_on_run, mclk_starts_on_pause,
+                                 mclk_stops_on_pause, mclk_stops_on_reset,
+                                 bclk_policy_override, bclk_always_running,
+                                 bclk_starts_on_gtw_init, bclk_starts_on_run, bclk_starts_on_pause,
+                                 bclk_stops_on_pause, bclk_stops_on_reset,
+                                 sync_policy_override, sync_always_running,
+                                 sync_starts_on_gtw_init, sync_starts_on_run, sync_starts_on_pause,
+                                 sync_stops_on_pause, sync_stops_on_reset);
+}
+
+static int set_link_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       long clock_source;
+       long ret;
+
+       struct dai_values ssp_link_data[] = {
+               {"clock_source", SND_CONFIG_TYPE_INTEGER, NULL, &clock_source, NULL},
+       };
+
+       ret = find_set_values(&ssp_link_data[0], ARRAY_SIZE(ssp_link_data), cfg, top,
+                             "Class.Base.link_config");
+       if (ret < 0)
+               return ret;
+
+       return ssp_link_set_params(nhlt, clock_source);
+}
+
+static int set_aux_params(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       struct aux_map {
+               const char *name;
+               int id;
+       };
+
+       struct aux_map aux_maps[] = {
+               { "Object.Base.mn_config", SSP_MN_DIVIDER_CONTROLS },
+               {"Object.Base.clk_config", SSP_DMA_CLK_CONTROLS },
+               {"Object.Base.tr_start_config", SSP_DMA_TRANSMISSION_START },
+               {"Object.Base.tr_stop_config", SSP_DMA_TRANSMISSION_STOP },
+               {"Object.Base.run_config", SSP_DMA_ALWAYS_RUNNING_MODE} ,
+               {"Object.Base.sync_config", SSP_DMA_SYNC_DATA },
+               {"Object.Base.ext_config", SSP_DMA_CLK_CONTROLS_EXT },
+               {"Object.Base.link_config", SSP_LINK_CLK_SOURCE },
+               {"Object.Base.node_config", SSP_DMA_SYNC_NODE },
+       };
+
+       snd_config_iterator_t iter, next;
+       snd_config_t *items, *n;
+       const char *id;
+       unsigned int i;
+       int ret = 0;
+
+       for (i = 0; i < ARRAY_SIZE(aux_maps); i++) {
+               if (snd_config_search(cfg, aux_maps[i].name, &items) < 0)
+                       continue;
+
+               snd_config_for_each(iter, next, items) {
+                       n = snd_config_iterator_entry(iter);
+
+                       if (snd_config_get_id(n, &id) < 0)
+                               continue;
+
+                       switch(aux_maps[i].id) {
+                       case SSP_MN_DIVIDER_CONTROLS:
+                               ret = set_mn_config(nhlt, n, top);
+                               break;
+                       case SSP_DMA_CLK_CONTROLS:
+                               ret = set_clk_config(nhlt, n, top);
+                               break;
+                       case SSP_DMA_TRANSMISSION_START:
+                               ret = set_tr_start_config(nhlt, n, top);
+                               break;
+                       case SSP_DMA_TRANSMISSION_STOP:
+                               ret = set_tr_stop_config(nhlt, n, top);
+                               break;
+                       case SSP_DMA_ALWAYS_RUNNING_MODE:
+                               ret = set_run_config(nhlt, n, top);
+                               break;
+                       case SSP_DMA_SYNC_DATA:
+                               ret = set_sync_config(nhlt, n, top);
+                               break;
+                       case SSP_DMA_CLK_CONTROLS_EXT:
+                               ret = set_ext_config(nhlt, n, top);
+                               break;
+                       case SSP_LINK_CLK_SOURCE:
+                               ret = set_link_config(nhlt, n, top);
+                               break;
+                       case SSP_DMA_SYNC_NODE:
+                               ret = set_node_config(nhlt, n, top);
+                               break;
+                       default:
+                               ret = -EINVAL;
+                       }
+
+                       if (ret < 0)
+                               return ret;
+               }
+       }
+
+       return ret;
+}
+
+static int set_hw_config(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       const char *format = NULL;
+       const char *mclk = NULL;
+       const char *bclk = NULL;
+       const char *bclk_invert = NULL;
+       const char *fsync = NULL;
+       const char *fsync_invert = NULL;
+       long mclk_freq = 0;
+       long bclk_freq = 0;
+       long fsync_freq = 0;
+       long tdm_slots = 0;
+       long tdm_slot_width = 0;
+       long tx_slots = 0;
+       long rx_slots = 0;
+       long ret;
+
+       struct dai_values ssp_hw_data[] = {
+               {"format", SND_CONFIG_TYPE_STRING, NULL, NULL, &format},
+               {"mclk", SND_CONFIG_TYPE_STRING, NULL, NULL, &mclk},
+               {"bclk", SND_CONFIG_TYPE_STRING, NULL, NULL, &bclk},
+               {"fsync", SND_CONFIG_TYPE_STRING, NULL, NULL, &fsync},
+               {"bclk_invert", SND_CONFIG_TYPE_STRING, NULL, NULL, &bclk_invert},
+               {"fsync_invert", SND_CONFIG_TYPE_STRING, NULL, NULL, &fsync_invert},
+               {"fsync_freq", SND_CONFIG_TYPE_INTEGER, NULL, &fsync_freq, NULL},
+               {"bclk_freq", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_freq, NULL},
+               {"mclk_freq", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_freq, NULL},
+               {"tdm_slots", SND_CONFIG_TYPE_INTEGER, NULL, &tdm_slots, NULL},
+               {"tdm_slot_width", SND_CONFIG_TYPE_INTEGER, NULL, &tdm_slot_width, NULL},
+               {"tx_slots", SND_CONFIG_TYPE_INTEGER, NULL, &tx_slots, NULL},
+               {"rx_slots", SND_CONFIG_TYPE_INTEGER, NULL, &rx_slots, NULL},
+       };
+
+       ret = find_set_values(&ssp_hw_data[0], ARRAY_SIZE(ssp_hw_data), cfg, top,
+                             "Class.Base.hw_config");
+       if (ret < 0)
+               return ret;
+
+       ret = set_aux_params(nhlt, cfg, top);
+       if (ret < 0)
+               return ret;
+
+       return ssp_hw_set_params(nhlt, format, mclk, bclk, bclk_invert, fsync, fsync_invert,
+                                mclk_freq, bclk_freq, fsync_freq, tdm_slots, tdm_slot_width,
+                                tx_slots, rx_slots);
+}
+
+static int set_ssp_data(struct intel_nhlt_params *nhlt, snd_config_t *dai_cfg, snd_config_t *top)
+{
+       const char *tdm_padding_per_slot = NULL;
+       const char *direction = NULL;
+       const char *quirks = NULL;
+       long frame_pulse_width = 0;
+       long clks_control = 0;
+       long sample_bits = 0;
+       long bclk_delay = 0;
+       long version = 0;
+       long dai_index = 0;
+       long mclk_id = 0;
+       long io_clk = 0;
+       int ret;
+
+       struct dai_values ssp_data[] = {
+               { "io_clk",  SND_CONFIG_TYPE_INTEGER, NULL, &io_clk, NULL},
+               { "direction", SND_CONFIG_TYPE_STRING, NULL, NULL, &direction},
+               { "quirks", SND_CONFIG_TYPE_STRING, NULL, NULL, &quirks},
+               { "dai_index", SND_CONFIG_TYPE_INTEGER, NULL, &dai_index, NULL},
+               { "sample_bits", SND_CONFIG_TYPE_INTEGER, NULL, &sample_bits, NULL},
+               { "bclk_delay", SND_CONFIG_TYPE_INTEGER, NULL, &bclk_delay, NULL},
+               { "mclk_id", SND_CONFIG_TYPE_INTEGER, NULL, &mclk_id, NULL},
+               { "clks_control", SND_CONFIG_TYPE_INTEGER, NULL, &clks_control, NULL},
+               { "frame_pulse_width", SND_CONFIG_TYPE_INTEGER, NULL, &frame_pulse_width, NULL},
+               { "tdm_padding_per_slot", SND_CONFIG_TYPE_STRING, NULL, NULL,
+                 &tdm_padding_per_slot},
+               { "version", SND_CONFIG_TYPE_INTEGER, NULL, &version, NULL},
+       };
+
+       ret = find_set_values(&ssp_data[0], ARRAY_SIZE(ssp_data), dai_cfg, top, "Class.Dai.SSP");
+       if (ret < 0)
+               return ret;
+
+       return ssp_set_params(nhlt, direction, dai_index, io_clk, bclk_delay, sample_bits, mclk_id,
+                             clks_control, frame_pulse_width, tdm_padding_per_slot, quirks,
+                             version);
+}
+
+/* init ssp parameters, should be called before parsing dais */
+int nhlt_ssp_init_params(struct intel_nhlt_params *nhlt)
+{
+       return ssp_init_params(nhlt);
+}
+
+int nhlt_ssp_get_ep_count(struct intel_nhlt_params *nhlt)
+{
+       return ssp_get_vendor_blob_count(nhlt);
+}
+
+int nhlt_ssp_get_dir(struct intel_nhlt_params *nhlt, int dai_index, uint8_t *dir)
+{
+       return ssp_get_dir(nhlt, dai_index, dir);
+}
+
+int nhlt_ssp_get_ep(struct intel_nhlt_params *nhlt, struct endpoint_descriptor **eps,
+                   int dai_index, uint8_t dir)
+{
+       struct endpoint_descriptor ep;
+       struct ssp_device_specific_config ssp_conf;
+       struct formats_config f_conf;
+       struct format_config f_conf1[8];
+       uint32_t sample_rate;
+       uint16_t channel_count;
+       uint32_t bits_per_sample;
+       uint32_t virtualbus_id;
+       uint32_t formats_count;
+       uint32_t device_type;
+       uint32_t direction = dir;
+       uint8_t *ep_target;
+       size_t blob_size;
+       int ret;
+       int i;
+
+       /*
+        * nhlt ssp structure:
+        *
+        * endpoint_descriptor, sizeof(struct endpoint_descriptor)
+        * device_specific_config (headset), sizeof(struct ssp_device_specific_config)
+        * formats_config (formats_count), sizeof(struct formats_config)
+        * format_config (waveex), sizeof(struct format_config)
+        * vendor_blob sizeof(vendor_blob)
+        */
+
+       ret = ssp_get_params(nhlt, dai_index, &virtualbus_id, &formats_count,
+                            &device_type, &direction);
+       if (ret < 0) {
+               fprintf(stderr, "nhlt_ssp_get_ep: ssp_get_params failed\n");
+               return ret;
+       }
+
+       ep.link_type = NHLT_LINK_TYPE_SSP;
+       ep.instance_id = 0;
+       ep.vendor_id = NHLT_VENDOR_ID_INTEL;
+       ep.device_id = NHLT_DEVICE_ID_INTEL_I2S_TDM;
+       ep.revision_id = 0;
+       ep.subsystem_id = 0;
+       ep.device_type = device_type;
+
+       ep.direction = direction;
+       /* ssp device index */
+       ep.virtualbus_id = virtualbus_id;
+       /* ssp config */
+       ssp_conf.config.capabilities_size = 2;
+       ssp_conf.device_config.virtual_slot = 0;
+       ssp_conf.device_config.config_type = 0;
+
+       /* formats_config */
+       f_conf.formats_count = formats_count;
+
+       for (i = 0; i < f_conf.formats_count; i++) {
+               /* fill in wave format extensible types */
+               f_conf1[i].format.wFormatTag = 0xFFFE;
+
+               ret = ssp_get_hw_params(nhlt, dai_index, i, &sample_rate, &channel_count,
+                                       &bits_per_sample);
+
+               if (ret < 0) {
+                       fprintf(stderr, "nhlt_ssp_get_ep: ssp_get_hw_params failed\n");
+                       return ret;
+               }
+
+               f_conf1[i].format.nChannels = channel_count;
+               f_conf1[i].format.nSamplesPerSec = sample_rate;
+               f_conf1[i].format.wBitsPerSample = bits_per_sample;
+               f_conf1[i].format.nBlockAlign = channel_count * bits_per_sample / 8;
+               f_conf1[i].format.nAvgBytesPerSec = sample_rate * f_conf1[i].format.nBlockAlign;
+
+               /* bytes after this value in this struct */
+               f_conf1[i].format.cbSize = 22;
+               /* actual bits in container */
+               f_conf1[i].format.wValidBitsPerSample = bits_per_sample;
+               /* channel map not used at this time */
+               f_conf1[i].format.dwChannelMask = 0;
+               /* WAVE_FORMAT_PCM guid (0x0001) ? */
+               f_conf1[i].format.SubFormat[0] = 0;
+               f_conf1[i].format.SubFormat[1] = 0;
+               f_conf1[i].format.SubFormat[2] = 0;
+               f_conf1[i].format.SubFormat[3] = 0;
+
+               ret = ssp_get_vendor_blob_size(nhlt, dai_index, i, &blob_size);
+               if (ret < 0) {
+                       fprintf(stderr, "nhlt_ssp_get_ep: dmic_get_vendor_blob_size failed\n");
+                       return ret;
+               }
+               f_conf1[i].vendor_blob.capabilities_size = blob_size;
+       }
+
+       ep.length = sizeof(struct endpoint_descriptor) +
+               sizeof(struct ssp_device_specific_config) +
+               sizeof(struct formats_config) +
+               sizeof(struct format_config) * f_conf.formats_count +
+               blob_size * f_conf.formats_count;
+
+       /* allocate the final variable length ep struct */
+       ep_target = calloc(ep.length, sizeof(uint8_t));
+       if (!ep_target)
+               return -ENOMEM;
+
+       *eps = (struct endpoint_descriptor *)ep_target;
+
+       /* copy all parsed sub arrays into the top level array */
+       memcpy(ep_target, &ep, sizeof(struct endpoint_descriptor));
+
+       ep_target += sizeof(struct endpoint_descriptor);
+
+       memcpy(ep_target, &ssp_conf, sizeof(struct ssp_device_specific_config));
+       ep_target += sizeof(struct ssp_device_specific_config);
+
+       memcpy(ep_target, &f_conf, sizeof(struct formats_config));
+       ep_target += sizeof(struct formats_config);
+
+       /* copy all hw configs */
+       for (i = 0; i < f_conf.formats_count; i++) {
+               memcpy(ep_target, &f_conf1[i], sizeof(struct format_config));
+               ep_target += sizeof(struct format_config);
+               ret = ssp_get_vendor_blob(nhlt, ep_target, dai_index, i);
+               if (ret < 0) {
+                       fprintf(stderr, "nhlt_sso_get_ep: ssp_get_vendor_blob failed\n");
+                       return ret;
+               }
+               ep_target += blob_size;
+       }
+
+       return 0;
+}
+
+/* Set ssp parameters from topology for ssp coefficient calculation.
+ *
+ * You can see an example of topology v2 config of ssp below. In this example the default
+ * object parameters are spelled out for clarity. General parameters like sample_bits are parsed
+ * with set_ssp_data and hw_config object data with set_hw_data. Ssp can have multiple hw_configs.
+ * Values are saved into intermediate structs and the vendor specific blob is calculated at the end
+ * of parsing with ssp_calculate.
+ *
+ *     SSP."0" {
+ *             id                      0
+ *             direction               "duplex"
+ *             name                    NoCodec-0
+ *             io_clk                  38400000
+ *             default_hw_conf_id      0
+ *             sample_bits             16
+ *             quirks                  "lbm_mode"
+ *             bclk_delay              0
+ *             mclk_id                 0
+ *             clks_control            0
+ *             frame_pulse_width       0
+ *             tdm_padding_per_slot    false
+ *
+ *             Object.Base.hw_config."SSP0" {
+ *                     id      0
+ *                     mclk_freq       24576000
+ *                     bclk_freq       3072000
+ *                     tdm_slot_width  32
+ *                     format          "I2S"
+ *                     mclk            "codec_mclk_in"
+ *                     bclk            "codec_consumer"
+ *                     fsync           "codec_consumer"
+ *                     fsync_freq      48000
+ *                     tdm_slots       2
+ *                     tx_slots        3
+ *                     rx_slots        3
+ *             }
+ *     }
+ */
+int nhlt_ssp_set_params(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *items;
+       snd_config_t *n;
+       const char *id;
+       int ret;
+
+       ret = set_ssp_data(nhlt, cfg, top);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_search(cfg, "Object.Base.hw_config", &items);
+       if (ret < 0)
+               return ret;
+
+       snd_config_for_each(i, next, items) {
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               ret = set_hw_config(nhlt, n, top);
+               if (ret < 0)
+                       return ret;
+       }
+
+       ret = ssp_calculate(nhlt);
+
+       return ret;
+}
diff --git a/topology/nhlt/intel/ssp-nhlt.h b/topology/nhlt/intel/ssp-nhlt.h
new file mode 100644 (file)
index 0000000..456bfca
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __SSP_NHLT_H
+#define __SSP_NHLT_H
+
+#include "intel-nhlt.h"
+#include "../nhlt.h"
+
+int nhlt_ssp_init_params(struct intel_nhlt_params *nhlt);
+int nhlt_ssp_set_params(struct intel_nhlt_params *nhlt, snd_config_t *cfg, snd_config_t *top);
+int nhlt_ssp_get_ep(struct intel_nhlt_params *nhlt, struct endpoint_descriptor **eps,
+                   int dai_index, uint8_t dir);
+int nhlt_ssp_get_ep_count(struct intel_nhlt_params *nhlt);
+int nhlt_ssp_get_dir(struct intel_nhlt_params *nhlt, int dai_index, uint8_t *dir);
+#endif
diff --git a/topology/nhlt/intel/ssp/ssp-debug.c b/topology/nhlt/intel/ssp/ssp-debug.c
new file mode 100644 (file)
index 0000000..2d2f6b0
--- /dev/null
@@ -0,0 +1,258 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#include "aconfig.h"
+#include <stdio.h>
+#include <stdint.h>
+#include <alsa/global.h>
+#include "ssp-debug.h"
+#include "../intel-nhlt.h"
+
+#ifdef NHLT_DEBUG
+
+void ssp_print_calculated(struct intel_ssp_params *ssp)
+{
+       struct ssp_intel_config_data *blob;
+       struct ssp_intel_config_data_1_5 *blob15;
+       struct ssp_aux_blob *blob_aux;
+       int ssp_index = ssp->ssp_count;
+       uint32_t *ptr;
+       int i, j;
+
+       fprintf(stdout, "printing ssp nhlt calculated data:\n");
+
+       /* top level struct */
+       fprintf(stdout, "ssp index %d\n", ssp_index);
+
+       fprintf(stdout, "ssp %d dai_index: %u\n", ssp_index, ssp->ssp_dai_index[ssp_index]);
+
+       fprintf(stdout, "ssp blob version %u\n", ssp->ssp_prm[ssp_index].version);
+
+       fprintf(stdout, "ssp %d hw_config_count: %u\n", ssp_index,
+               ssp->ssp_hw_config_count[ssp_index]);
+
+       fprintf(stdout, "\n");
+
+       for (i = 0; i < ssp->ssp_hw_config_count[ssp_index]; i++) {
+               fprintf(stdout, "ssp blob %d hw_config %d\n", ssp->ssp_count, i);
+               if (ssp->ssp_prm[ssp_index].version == SSP_BLOB_VER_1_5) {
+                       blob15 = &ssp->ssp_blob_1_5[ssp_index][i];
+                       fprintf(stdout, "gateway_attributes %u\n", blob15->gateway_attributes);
+                       fprintf(stdout, "version %u\n", blob15->version);
+                       fprintf(stdout, "size %u\n", blob15->size);
+                       fprintf(stdout, "ts_group[0] 0x%08x\n", blob15->ts_group[0]);
+                       fprintf(stdout, "ts_group[1] 0x%08x\n", blob15->ts_group[1]);
+                       fprintf(stdout, "ts_group[2] 0x%08x\n", blob15->ts_group[2]);
+                       fprintf(stdout, "ts_group[3] 0x%08x\n", blob15->ts_group[3]);
+                       fprintf(stdout, "ts_group[4] 0x%08x\n", blob15->ts_group[4]);
+                       fprintf(stdout, "ts_group[5] 0x%08x\n", blob15->ts_group[5]);
+                       fprintf(stdout, "ts_group[6] 0x%08x\n", blob15->ts_group[6]);
+                       fprintf(stdout, "ts_group[7] 0x%08x\n", blob15->ts_group[7]);
+                       fprintf(stdout, "ssc0 0x%08x\n", blob15->ssc0);
+                       fprintf(stdout, "ssc1 0x%08x\n", blob15->ssc1);
+                       fprintf(stdout, "sscto 0x%08x\n", blob15->sscto);
+                       fprintf(stdout, "sspsp 0x%08x\n", blob15->sspsp);
+                       fprintf(stdout, "sstsa 0x%08x\n", blob15->sstsa);
+                       fprintf(stdout, "ssrsa 0x%08x\n", blob15->ssrsa);
+                       fprintf(stdout, "ssc2 0x%08x\n", blob15->ssc2);
+                       fprintf(stdout, "sspsp2 0x%08x\n", blob15->sspsp2);
+                       fprintf(stdout, "ssc3 0x%08x\n", blob15->ssc3);
+                       fprintf(stdout, "ssioc 0x%08x\n", blob15->ssioc);
+                       fprintf(stdout, "mdivc 0x%08x\n", blob15->mdivctlr);
+                       fprintf(stdout, "mdivr count 0x%08x\n", blob15->mdivrcnt);
+                       for (j = 0; j < blob15->mdivrcnt; j++)
+                               fprintf(stdout, "mdivr 0x%08x\n",
+                                       ssp->ssp_prm[ssp_index].mdivr[i].mdivrs[j]);
+               } else {
+                       blob = &ssp->ssp_blob[ssp_index][i];
+                       fprintf(stdout, "gateway_attributes %u\n", blob->gateway_attributes);
+                       fprintf(stdout, "ts_group[0] 0x%08x\n", blob->ts_group[0]);
+                       fprintf(stdout, "ts_group[1] 0x%08x\n", blob->ts_group[1]);
+                       fprintf(stdout, "ts_group[2] 0x%08x\n", blob->ts_group[2]);
+                       fprintf(stdout, "ts_group[3] 0x%08x\n", blob->ts_group[3]);
+                       fprintf(stdout, "ts_group[4] 0x%08x\n", blob->ts_group[4]);
+                       fprintf(stdout, "ts_group[5] 0x%08x\n", blob->ts_group[5]);
+                       fprintf(stdout, "ts_group[6] 0x%08x\n", blob->ts_group[6]);
+                       fprintf(stdout, "ts_group[7] 0x%08x\n", blob->ts_group[7]);
+                       fprintf(stdout, "ssc0 0x%08x\n", blob->ssc0);
+                       fprintf(stdout, "ssc1 0x%08x\n", blob->ssc1);
+                       fprintf(stdout, "sscto 0x%08x\n", blob->sscto);
+                       fprintf(stdout, "sspsp 0x%08x\n", blob->sspsp);
+                       fprintf(stdout, "sstsa 0x%08x\n", blob->sstsa);
+                       fprintf(stdout, "ssrsa 0x%08x\n", blob->ssrsa);
+                       fprintf(stdout, "ssc2 0x%08x\n", blob->ssc2);
+                       fprintf(stdout, "sspsp2 0x%08x\n", blob->sspsp2);
+                       fprintf(stdout, "ssc3 0x%08x\n", blob->ssc3);
+                       fprintf(stdout, "ssioc 0x%08x\n", blob->ssioc);
+                       fprintf(stdout, "mdivc 0x%08x\n", blob->mdivc);
+                       fprintf(stdout, "mdivr 0x%08x\n", blob->mdivr);
+               }
+               blob_aux = (struct ssp_aux_blob *)&(ssp->ssp_blob_ext[ssp_index][i]);
+               fprintf(stdout, "aux_blob size  %u\n", blob_aux->size);
+               for (j = 0; j < blob_aux->size; j += 4) {
+                       ptr = (uint32_t *)&(blob_aux->aux_blob[j]);
+                       fprintf(stdout, "aux_blob %d 0x%08x\n", j, *ptr);
+               }
+
+               fprintf(stdout, "\n");
+       }
+
+       fprintf(stdout, "\n");
+}
+
+void ssp_print_internal(struct intel_ssp_params *ssp)
+{
+       struct ssp_aux_config_link *link;
+       struct ssp_aux_config_sync *sync;
+       struct ssp_aux_config_ext *ext;
+       struct ssp_aux_config_run *run;
+       struct ssp_aux_config_clk *clk;
+       struct ssp_aux_config_mn *mn;
+       struct ssp_aux_config_tr *tr;
+       struct ssp_config_dai *dai;
+       struct ssp_config_hw *hw_conf;
+       uint32_t enabled;
+       int i, j;
+
+       dai = &ssp->ssp_prm[ssp->ssp_count];
+
+       fprintf(stdout, "printing ssp nhlt internal data:\n");
+
+       fprintf(stdout, "io_clk %u\n", dai->io_clk);
+       fprintf(stdout, "dai_index %u\n", dai->dai_index);
+       fprintf(stdout, "mclk_id %u\n", dai->mclk_id);
+       fprintf(stdout, "sample_valid_bits %u\n", dai->sample_valid_bits);
+       fprintf(stdout, "mclk_direction %u\n", dai->mclk_direction);
+       fprintf(stdout, "frame_pulse_width %u\n", dai->frame_pulse_width);
+       fprintf(stdout, "tdm_per_slot_padding_flag %u\n", dai->tdm_per_slot_padding_flag);
+       fprintf(stdout, "clks_control %u\n", dai->clks_control);
+       fprintf(stdout, "quirks %u\n", dai->quirks);
+       fprintf(stdout, "bclk_delay %u\n", dai->bclk_delay);
+       fprintf(stdout, "version %u\n", dai->version);
+
+       fprintf(stdout, "\n");
+
+       fprintf(stdout, "hw_config_count %u\n", ssp->ssp_hw_config_count[ssp->ssp_count]);
+
+       for (i = 0; i < ssp->ssp_hw_config_count[ssp->ssp_count]; i++) {
+               hw_conf = &dai->hw_cfg[i];
+               fprintf(stdout, "mclk_rate %u\n", hw_conf->mclk_rate);
+               fprintf(stdout, "bclk_rate %u\n", hw_conf->bclk_rate);
+               fprintf(stdout, "fsync_rate %u\n", hw_conf->fsync_rate);
+               fprintf(stdout, "tdm_slots %u\n", hw_conf->tdm_slots);
+               fprintf(stdout, "tdm_slot_width %u\n", hw_conf->tdm_slot_width);
+               fprintf(stdout, "tx_slots %u\n", hw_conf->tx_slots);
+               fprintf(stdout, "rx_slots %u\n", hw_conf->rx_slots);
+               fprintf(stdout, "format %u\n", hw_conf->format);
+
+               enabled = dai->aux_cfg[i].enabled;
+               fprintf(stdout, "aux enabled %x\n", enabled);
+               fprintf(stdout, "\n");
+
+               mn = (struct ssp_aux_config_mn *)&(dai->aux_cfg[i].mn);
+               clk = (struct ssp_aux_config_clk *)&(dai->aux_cfg[i].clk);
+               tr = (struct ssp_aux_config_tr *)&(dai->aux_cfg[i].tr_start);
+               tr = (struct ssp_aux_config_tr *)&(dai->aux_cfg[i].tr_stop);
+               run = (struct ssp_aux_config_run *)&(dai->aux_cfg[i].run);
+               sync = (struct ssp_aux_config_sync *)&(dai->aux_cfg[i].sync);
+               ext = (struct ssp_aux_config_ext *)&(dai->aux_cfg[i].ext);
+               link = (struct ssp_aux_config_link *)&(dai->aux_cfg[i].link);
+
+               if (enabled & BIT(SSP_MN_DIVIDER_CONTROLS)) {
+                       fprintf(stdout, "aux mn m_div %u\n", mn->m_div);
+                       fprintf(stdout, "aux mn n_div %u\n", mn->n_div);
+                       fprintf(stdout, "\n");
+               }
+
+               if (enabled & BIT(SSP_DMA_CLK_CONTROLS)) {
+                       fprintf(stdout, "aux clk clock_warm_up %u\n", clk->clock_warm_up);
+                       fprintf(stdout, "aux clk mclk %u\n", clk->mclk);
+                       fprintf(stdout, "aux clk warm_up_ovr %u\n", clk->warm_up_ovr);
+                       fprintf(stdout, "aux clk clock_stop_delay %u\n", clk->clock_stop_delay);
+                       fprintf(stdout, "aux clk keep_running %u\n", clk->keep_running);
+                       fprintf(stdout, "aux clk keep_running %u\n", clk->clock_stop_ovr);
+                       fprintf(stdout, "\n");
+               }
+
+               if (enabled & BIT(SSP_DMA_TRANSMISSION_START)) {
+                       fprintf(stdout, "aux tr start sampling_frequency %u\n", tr->sampling_frequency);
+                       fprintf(stdout, "aux tr start bit_depth %u\n", tr->bit_depth);
+                       fprintf(stdout, "aux tr start channel_map %u\n", tr->channel_map);
+                       fprintf(stdout, "aux tr start channel_config %u\n", tr->channel_config);
+                       fprintf(stdout, "aux tr start interleaving_style %u\n", tr->interleaving_style);
+                       fprintf(stdout, "aux tr start number_of_channels %u\n", tr->number_of_channels);
+                       fprintf(stdout, "aux tr start valid_bit_depth %u\n", tr->valid_bit_depth);
+                       fprintf(stdout, "aux tr start sample_types %u\n", tr->sample_type);
+                       fprintf(stdout, "\n");
+               }
+
+               if (enabled & BIT(SSP_DMA_TRANSMISSION_STOP)) {
+                       fprintf(stdout, "aux tr start sampling_frequency %u\n", tr->sampling_frequency);
+                       fprintf(stdout, "aux tr start bit_depth %u\n", tr->bit_depth);
+                       fprintf(stdout, "aux tr start channel_map %u\n", tr->channel_map);
+                       fprintf(stdout, "aux tr start channel_config %u\n", tr->channel_config);
+                       fprintf(stdout, "aux tr start interleaving_style %u\n", tr->interleaving_style);
+                       fprintf(stdout, "aux tr start number_of_channels %u\n", tr->number_of_channels);
+                       fprintf(stdout, "aux tr start valid_bit_depth %u\n", tr->valid_bit_depth);
+                       fprintf(stdout, "aux tr start sample_types %u\n", tr->sample_type);
+                       fprintf(stdout, "\n");
+               }
+
+               if (enabled & BIT(SSP_DMA_ALWAYS_RUNNING_MODE)) {
+                       fprintf(stdout, "aux run always_run %u\n", run->always_run);
+                       fprintf(stdout, "\n");
+               }
+
+               if (enabled & BIT(SSP_DMA_SYNC_DATA)) {
+                       fprintf(stdout, "aux sync sync_denominator %u\n", sync->sync_denominator);
+                       fprintf(stdout, "aux sync count %u\n", sync->count);
+
+                       for (j = 0; j < sync->count; j++) {
+                               fprintf(stdout, "aux sync node_id %u\n", sync->nodes[j].node_id);
+                               fprintf(stdout, "aux sync sampling_rate %u\n", sync->nodes[j].sampling_rate);
+                       }
+
+                       fprintf(stdout, "\n");
+               }
+
+               if (enabled & BIT(SSP_DMA_CLK_CONTROLS_EXT)) {
+                       fprintf(stdout, "aux ext mclk_policy_override %u\n", ext->mclk_policy_override);
+                       fprintf(stdout, "aux ext mclk_always_running %u\n", ext->mclk_always_running);
+                       fprintf(stdout, "aux ext mclk_starts_on_gtw_init %u\n", ext->mclk_starts_on_gtw_init);
+                       fprintf(stdout, "aux ext mclk_starts_on_run %u\n", ext->mclk_starts_on_run);
+                       fprintf(stdout, "aux ext mclk_starts_on_pause %u\n", ext->mclk_starts_on_pause);
+                       fprintf(stdout, "aux ext mclk_stops_on_pause %u\n", ext->mclk_stops_on_pause);
+                       fprintf(stdout, "aux ext mclk_stops_on_reset %u\n", ext->mclk_stops_on_reset);
+                       fprintf(stdout, "aux ext bclk_policy_override %u\n", ext->bclk_policy_override);
+                       fprintf(stdout, "aux ext bclk_always_running %u\n", ext->bclk_always_running);
+                       fprintf(stdout, "aux ext bclk_starts_on_gtw_init %u\n", ext->bclk_starts_on_gtw_init);
+                       fprintf(stdout, "aux ext bclk_starts_on_run %u\n", ext->bclk_starts_on_run);
+                       fprintf(stdout, "aux ext bclk_starts_on_pause %u\n", ext->bclk_starts_on_pause);
+                       fprintf(stdout, "aux ext bclk_stops_on_pause %u\n", ext->bclk_stops_on_pause);
+                       fprintf(stdout, "aux ext bclk_stops_on_reset %u\n", ext->bclk_stops_on_reset);
+                       fprintf(stdout, "aux ext sync_policy_override %u\n", ext->sync_policy_override);
+                       fprintf(stdout, "aux ext sync_always_running %u\n", ext->sync_always_running);
+                       fprintf(stdout, "aux ext sync_starts_on_gtw_init %u\n", ext->sync_starts_on_gtw_init);
+                       fprintf(stdout, "aux ext sync_starts_on_run %u\n", ext->sync_starts_on_run);
+                       fprintf(stdout, "aux ext sync_starts_on_pause %u\n", ext->sync_starts_on_pause);
+                       fprintf(stdout, "aux ext sync_stops_on_pause %u\n", ext->sync_stops_on_pause);
+                       fprintf(stdout, "aux ext sync_stops_on_reset %u\n", ext->sync_stops_on_reset);
+                       fprintf(stdout, "\n");
+               }
+
+               if (enabled & BIT(SSP_LINK_CLK_SOURCE)) {
+                       fprintf(stdout, "aux link clock_source %u\n", link->clock_source);
+                       fprintf(stdout, "\n");
+               }
+       }
+
+       fprintf(stdout, "\n");
+}
+
+#else /* NHLT_DEBUG */
+void ssp_print_internal(struct intel_ssp_params *ssp ATTRIBUTE_UNUSED) {}
+void ssp_print_calculated(struct intel_ssp_params *ssp ATTRIBUTE_UNUSED) {}
+#endif
diff --git a/topology/nhlt/intel/ssp/ssp-debug.h b/topology/nhlt/intel/ssp/ssp-debug.h
new file mode 100644 (file)
index 0000000..d1a8df6
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __SSP_DEBUG_H
+#define __SSP_DEBUG_H
+
+#include "ssp-internal.h"
+
+void ssp_print_internal(struct intel_ssp_params *ssp);
+void ssp_print_calculated(struct intel_ssp_params *ssp);
+
+#endif
diff --git a/topology/nhlt/intel/ssp/ssp-intel.h b/topology/nhlt/intel/ssp/ssp-intel.h
new file mode 100644 (file)
index 0000000..9c92424
--- /dev/null
@@ -0,0 +1,102 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
+//         Keyon Jie <yang.jie@linux.intel.com>
+//         Rander Wang <rander.wang@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __SSP_INTEL_H
+#define __SSP_INTEL_H
+
+#include <stdint.h>
+
+/* struct for intel ssp nhlt vendor specific blob generation */
+struct ssp_intel_config_data {
+       uint32_t gateway_attributes;
+       uint32_t ts_group[8];
+       uint32_t ssc0;
+       uint32_t ssc1;
+       uint32_t sscto;
+       uint32_t sspsp;
+       uint32_t sstsa;
+       uint32_t ssrsa;
+       uint32_t ssc2;
+       uint32_t sspsp2;
+       uint32_t ssc3;
+       uint32_t ssioc;
+       uint32_t mdivc;
+       uint32_t mdivr;
+} __attribute__((packed));
+
+#define SSP_BLOB_VER_1_5 0xEE000105
+
+struct ssp_intel_config_data_1_5 {
+       uint32_t gateway_attributes;
+       uint32_t version;
+       uint32_t size;
+       uint32_t ts_group[8];
+       uint32_t ssc0;
+       uint32_t ssc1;
+       uint32_t sscto;
+       uint32_t sspsp;
+       uint32_t sstsa;
+       uint32_t ssrsa;
+       uint32_t ssc2;
+       uint32_t sspsp2;
+       uint32_t ssc3;
+       uint32_t ssioc;
+       uint32_t mdivctlr;
+       uint32_t mdivrcnt;
+       uint32_t mdivr[];
+} __attribute__((packed));
+
+struct ssp_intel_aux_tlv {
+       uint32_t type;
+       uint32_t size;
+       uint32_t val[];
+} __attribute__((packed));
+
+struct ssp_intel_mn_ctl {
+       uint32_t div_m;
+       uint32_t div_n;
+} __attribute__((packed));
+
+struct ssp_intel_clk_ctl {
+       uint32_t start;
+       uint32_t stop;
+} __attribute__((packed));
+
+struct ssp_intel_tr_ctl {
+       uint32_t sampling_frequency;
+       uint32_t bit_depth;
+       uint32_t channel_map;
+       uint32_t channel_config;
+       uint32_t interleaving_style;
+       uint32_t format;
+} __attribute__((packed));
+
+struct ssp_intel_run_ctl {
+       uint32_t enabled;
+} __attribute__((packed));
+
+struct ssp_intel_node_ctl {
+       uint32_t node_id;
+       uint32_t sampling_rate;
+} __attribute__((packed));
+
+struct ssp_intel_sync_ctl {
+       uint32_t sync_denominator;
+       uint32_t count;
+} __attribute__((packed));
+
+struct ssp_intel_ext_ctl {
+       uint32_t ext_data;
+} __attribute__((packed));
+
+struct ssp_intel_link_ctl {
+       uint32_t clock_source;
+} __attribute__((packed));
+
+#endif /* __SSP_INTEL_H */
diff --git a/topology/nhlt/intel/ssp/ssp-internal.h b/topology/nhlt/intel/ssp/ssp-internal.h
new file mode 100644 (file)
index 0000000..23a8489
--- /dev/null
@@ -0,0 +1,370 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
+//         Keyon Jie <yang.jie@linux.intel.com>
+//         Rander Wang <rander.wang@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __SSP_MACROS_H
+#define __SSP_MACROS_H
+
+#include "ssp-intel.h"
+
+#define SSP_MAX_DAIS 8
+#define SSP_MAX_HW_CONFIG 8
+#define SSP_TDM_MAX_SLOT_MAP_COUNT 8
+
+struct ssp_aux_config_mn {
+       uint32_t m_div;
+       uint32_t n_div;
+};
+
+struct ssp_aux_config_clk {
+       uint32_t clock_warm_up;
+       uint32_t mclk;
+       uint32_t warm_up_ovr;
+       uint32_t clock_stop_delay;
+       uint32_t keep_running;
+       uint32_t clock_stop_ovr;
+};
+
+struct ssp_aux_config_tr {
+       uint32_t sampling_frequency;
+       uint32_t bit_depth;
+       uint32_t channel_map;
+       uint32_t channel_config;
+       uint32_t interleaving_style;
+       uint32_t number_of_channels;
+       uint32_t valid_bit_depth;
+       uint32_t sample_type;
+};
+
+struct ssp_aux_config_run {
+       uint32_t always_run;
+};
+
+struct ssp_aux_config_node {
+       uint32_t node_id;
+       uint32_t sampling_rate;
+};
+
+struct ssp_aux_config_sync {
+       uint32_t sync_denominator;
+       uint32_t count;
+       struct ssp_aux_config_node nodes[SSP_MAX_DAIS];
+};
+
+struct ssp_aux_config_ext {
+       uint32_t mclk_policy_override;
+       uint32_t mclk_always_running;
+       uint32_t mclk_starts_on_gtw_init;
+       uint32_t mclk_starts_on_run;
+       uint32_t mclk_starts_on_pause;
+       uint32_t mclk_stops_on_pause;
+       uint32_t mclk_stops_on_reset;
+       uint32_t bclk_policy_override;
+       uint32_t bclk_always_running;
+       uint32_t bclk_starts_on_gtw_init;
+       uint32_t bclk_starts_on_run;
+       uint32_t bclk_starts_on_pause;
+       uint32_t bclk_stops_on_pause;
+       uint32_t bclk_stops_on_reset;
+       uint32_t sync_policy_override;
+       uint32_t sync_always_running;
+       uint32_t sync_starts_on_gtw_init;
+       uint32_t sync_starts_on_run;
+       uint32_t sync_starts_on_pause;
+       uint32_t sync_stops_on_pause;
+       uint32_t sync_stops_on_reset;
+};
+
+struct ssp_aux_config_link {
+       uint32_t clock_source;
+};
+
+struct ssp_config_aux {
+       /* bits set for found aux structs */
+       uint32_t enabled;
+       struct ssp_aux_config_mn mn;
+       struct ssp_aux_config_clk clk;
+       struct ssp_aux_config_tr tr_start;
+       struct ssp_aux_config_tr tr_stop;
+       struct ssp_aux_config_run run;
+       struct ssp_aux_config_sync sync;
+       struct ssp_aux_config_ext ext;
+       struct ssp_aux_config_link link;
+};
+
+struct ssp_aux_blob {
+       uint32_t size;
+       uint8_t aux_blob[256];
+};
+
+struct ssp_config_mdivr {
+       uint32_t count;
+       uint32_t mdivrs[8];
+};
+
+/* structs for gathering the ssp parameters from topology */
+struct ssp_config_hw {
+       uint32_t mclk_rate;
+       uint32_t bclk_rate;
+       uint32_t fsync_rate;
+       uint32_t tdm_slots;
+       uint32_t tdm_slot_width;
+       uint32_t tx_slots;
+       uint32_t rx_slots;
+       uint32_t format;
+};
+
+struct ssp_config_dai {
+       uint32_t io_clk;
+       uint32_t dai_index;
+       uint16_t mclk_id;
+       uint32_t sample_valid_bits;
+       uint32_t mclk_direction;
+       uint16_t frame_pulse_width;
+       uint16_t tdm_per_slot_padding_flag;
+       uint32_t clks_control;
+       uint32_t quirks;
+       uint32_t bclk_delay;
+       uint8_t direction;
+       uint32_t version;
+       struct ssp_config_hw hw_cfg[SSP_MAX_HW_CONFIG];
+       struct ssp_config_aux aux_cfg[SSP_MAX_HW_CONFIG];
+       struct ssp_config_mdivr mdivr[SSP_MAX_HW_CONFIG];
+};
+
+struct intel_ssp_params {
+       /* structs to gather ssp params before calculations */
+       struct ssp_config_dai ssp_prm[SSP_MAX_DAIS];
+       uint32_t ssp_dai_index[SSP_MAX_DAIS];
+       uint32_t ssp_hw_config_count[SSP_MAX_DAIS];
+       int ssp_count;
+
+       /* ssp vendor blob structs */
+       struct ssp_intel_config_data ssp_blob[SSP_MAX_DAIS][SSP_MAX_HW_CONFIG];
+       struct ssp_intel_config_data_1_5 ssp_blob_1_5[SSP_MAX_DAIS][SSP_MAX_HW_CONFIG];
+       struct ssp_aux_blob ssp_blob_ext[SSP_MAX_DAIS][SSP_MAX_HW_CONFIG];
+};
+
+#define SSP_MN_DIVIDER_CONTROLS                 0
+#define SSP_DMA_CLK_CONTROLS                    1
+#define SSP_DMA_TRANSMISSION_START              2
+#define SSP_DMA_TRANSMISSION_STOP               3
+#define SSP_DMA_ALWAYS_RUNNING_MODE             4
+#define SSP_DMA_SYNC_DATA                       5
+#define SSP_DMA_CLK_CONTROLS_EXT                6
+#define SSP_LINK_CLK_SOURCE                     7
+/* officially "undefined" node for topology parsing */
+#define SSP_DMA_SYNC_NODE                       32
+
+#define SSP_CLOCK_XTAL_OSCILLATOR       0x0
+#define SSP_CLOCK_AUDIO_CARDINAL        0x1
+#define SSP_CLOCK_PLL_FIXED             0x2
+
+#define MCDSS(x)        SET_BITS(17, 16, x)
+#define MNDSS(x)        SET_BITS(21, 20, x)
+
+#define SSP_FMT_I2S         1 /**< I2S mode */
+#define SSP_FMT_RIGHT_J     2 /**< Right Justified mode */
+#define SSP_FMT_LEFT_J      3 /**< Left Justified mode */
+#define SSP_FMT_DSP_A       4 /**< L data MSB after FRM LRC */
+#define SSP_FMT_DSP_B       5 /**< L data MSB during FRM LRC */
+#define SSP_FMT_PDM         6 /**< Pulse density modulation */
+
+#define SSP_FMT_CONT        (1 << 4) /**< continuous clock */
+#define SSP_FMT_GATED       (0 << 4) /**< clock is gated */
+
+#define SSP_FMT_NB_NF       (0 << 8) /**< normal bit clock + frame */
+#define SSP_FMT_NB_IF       (2 << 8) /**< normal BCLK + inv FRM */
+#define SSP_FMT_IB_NF       (3 << 8) /**< invert BCLK + nor FRM */
+#define SSP_FMT_IB_IF       (4 << 8) /**< invert BCLK + FRM */
+
+#define SSP_FMT_CBP_CFP     (0 << 12) /**< codec bclk provider & frame provider */
+#define SSP_FMT_CBC_CFP     (2 << 12) /**< codec bclk consumer & frame provider */
+#define SSP_FMT_CBP_CFC     (3 << 12) /**< codec bclk provider & frame consumer */
+#define SSP_FMT_CBC_CFC     (4 << 12) /**< codec bclk consumer & frame consumer */
+
+#define SSP_FMT_FORMAT_MASK         0x000f
+#define SSP_FMT_CLOCK_MASK          0x00f0
+#define SSP_FMT_INV_MASK            0x0f00
+#define SSP_FMT_CLOCK_PROVIDER_MASK 0xf000
+
+/* SSCR0 bits */
+#define SSCR0_DSIZE(x) SET_BITS(3, 0, (x) - 1)
+#define SSCR0_FRF      MASK(5, 4)
+#define SSCR0_MOT      SET_BITS(5, 4, 0)
+#define SSCR0_TI       SET_BITS(5, 4, 1)
+#define SSCR0_NAT      SET_BITS(5, 4, 2)
+#define SSCR0_PSP      SET_BITS(5, 4, 3)
+#define SSCR0_ECS      BIT(6)
+#define SSCR0_SSE      BIT(7)
+#define SSCR0_SCR_MASK MASK(19, 8)
+#define SSCR0_SCR(x)   SET_BITS(19, 8, x)
+#define SSCR0_EDSS     BIT(20)
+#define SSCR0_NCS      BIT(21)
+#define SSCR0_RIM      BIT(22)
+#define SSCR0_TIM      BIT(23)
+#define SSCR0_FRDC(x)  SET_BITS(26, 24, (x) - 1)
+#define SSCR0_ACS      BIT(30)
+#define SSCR0_MOD      BIT(31)
+
+/* SSCR1 bits */
+#define SSCR1_RIE      BIT(0)
+#define SSCR1_TIE      BIT(1)
+#define SSCR1_LBM      BIT(2)
+#define SSCR1_SPO      BIT(3)
+#define SSCR1_SPH      BIT(4)
+#define SSCR1_MWDS     BIT(5)
+#define SSCR1_TFT_MASK MASK(9, 6)
+#define SSCR1_TFT(x)   SET_BITS(9, 6, (x) - 1)
+#define SSCR1_RFT_MASK MASK(13, 10)
+#define SSCR1_RFT(x)   SET_BITS(13, 10, (x) - 1)
+#define SSCR1_EFWR     BIT(14)
+#define SSCR1_STRF     BIT(15)
+#define SSCR1_IFS      BIT(16)
+#define SSCR1_PINTE    BIT(18)
+#define SSCR1_TINTE    BIT(19)
+#define SSCR1_RSRE     BIT(20)
+#define SSCR1_TSRE     BIT(21)
+#define SSCR1_TRAIL    BIT(22)
+#define SSCR1_RWOT     BIT(23)
+#define SSCR1_SFRMDIR  BIT(24)
+#define SSCR1_SCLKDIR  BIT(25)
+#define SSCR1_ECRB     BIT(26)
+#define SSCR1_ECRA     BIT(27)
+#define SSCR1_SCFR     BIT(28)
+#define SSCR1_EBCEI    BIT(29)
+#define SSCR1_TTE      BIT(30)
+#define SSCR1_TTELP    BIT(31)
+
+/* SSCR2 bits */
+#define SSCR2_URUN_FIX0        BIT(0)
+#define SSCR2_URUN_FIX1        BIT(1)
+#define SSCR2_SLV_EXT_CLK_RUN_EN       BIT(2)
+#define SSCR2_CLK_DEL_EN               BIT(3)
+#define SSCR2_UNDRN_FIX_EN             BIT(6)
+#define SSCR2_FIFO_EMPTY_FIX_EN                BIT(7)
+#define SSCR2_ASRC_CNTR_EN             BIT(8)
+#define SSCR2_ASRC_CNTR_CLR            BIT(9)
+#define SSCR2_ASRC_FRM_CNRT_EN         BIT(10)
+#define SSCR2_ASRC_INTR_MASK           BIT(11)
+#define SSCR2_TURM1            BIT(1)
+#define SSCR2_PSPSRWFDFD       BIT(3)
+#define SSCR2_PSPSTWFDFD       BIT(4)
+#define SSCR2_SDFD             BIT(14)
+#define SSCR2_SDPM             BIT(16)
+#define SSCR2_LJDFD            BIT(17)
+#define SSCR2_MMRATF           BIT(18)
+#define SSCR2_SMTATF           BIT(19)
+
+/* SSR bits */
+#define SSSR_TNF       BIT(2)
+#define SSSR_RNE       BIT(3)
+#define SSSR_BSY       BIT(4)
+#define SSSR_TFS       BIT(5)
+#define SSSR_RFS       BIT(6)
+#define SSSR_ROR       BIT(7)
+#define SSSR_TUR       BIT(21)
+
+/* SSPSP bits */
+#define SSPSP_SCMODE(x)                SET_BITS(1, 0, x)
+#define SSPSP_SFRMP(x)         SET_BIT(2, x)
+#define SSPSP_ETDS             BIT(3)
+#define SSPSP_STRTDLY(x)       SET_BITS(6, 4, x)
+#define SSPSP_DMYSTRT(x)       SET_BITS(8, 7, x)
+#define SSPSP_SFRMDLY(x)       SET_BITS(15, 9, x)
+#define SSPSP_SFRMWDTH(x)      SET_BITS(21, 16, x)
+#define SSPSP_DMYSTOP(x)       SET_BITS(24, 23, x)
+#define SSPSP_DMYSTOP_BITS     2
+#define SSPSP_DMYSTOP_MASK     MASK(SSPSP_DMYSTOP_BITS - 1, 0)
+#define SSPSP_FSRT             BIT(25)
+#define SSPSP_EDMYSTOP(x)      SET_BITS(28, 26, x)
+
+#define SSPSP2                 0x44
+#define SSPSP2_FEP_MASK                0xff
+
+#define SSCR3          0x48
+#define SSIOC          0x4C
+#define SSP_REG_MAX    SSIOC
+
+/* SSTSA bits */
+#define SSTSA_SSTSA(x)         SET_BITS(7, 0, x)
+#define SSTSA_TXEN             BIT(8)
+
+/* SSRSA bits */
+#define SSRSA_SSRSA(x)         SET_BITS(7, 0, x)
+#define SSRSA_RXEN             BIT(8)
+
+/* SSCR3 bits */
+#define SSCR3_FRM_MST_EN       BIT(0)
+#define SSCR3_I2S_MODE_EN      BIT(1)
+#define SSCR3_I2S_FRM_POL(x)   SET_BIT(2, x)
+#define SSCR3_I2S_TX_SS_FIX_EN BIT(3)
+#define SSCR3_I2S_RX_SS_FIX_EN BIT(4)
+#define SSCR3_I2S_TX_EN                BIT(9)
+#define SSCR3_I2S_RX_EN                BIT(10)
+#define SSCR3_CLK_EDGE_SEL     BIT(12)
+#define SSCR3_STRETCH_TX       BIT(14)
+#define SSCR3_STRETCH_RX       BIT(15)
+#define SSCR3_MST_CLK_EN       BIT(16)
+#define SSCR3_SYN_FIX_EN       BIT(17)
+
+/* SSCR4 bits */
+#define SSCR4_TOT_FRM_PRD(x)   ((x) << 7)
+
+/* SSCR5 bits */
+#define SSCR5_FRM_ASRT_CLOCKS(x)       (((x) - 1) << 1)
+#define SSCR5_FRM_POLARITY(x)  SET_BIT(0, x)
+
+/* SFIFOTT bits */
+#define SFIFOTT_TX(x)          ((x) - 1)
+#define SFIFOTT_RX(x)          (((x) - 1) << 16)
+
+/* SFIFOL bits */
+#define SFIFOL_TFL(x)          ((x) & 0xFFFF)
+#define SFIFOL_RFL(x)          ((x) >> 16)
+
+#define SSTSA_TSEN                     BIT(8)
+#define SSRSA_RSEN                     BIT(8)
+
+#define SSCR3_TFL_MASK MASK(5, 0)
+#define SSCR3_RFL_MASK MASK(13, 8)
+#define SSCR3_TFL_VAL(scr3_val)        (((scr3_val) >> 0) & MASK(5, 0))
+#define SSCR3_RFL_VAL(scr3_val)        (((scr3_val) >> 8) & MASK(5, 0))
+#define SSCR3_TX(x)    SET_BITS(21, 16, (x) - 1)
+#define SSCR3_RX(x)    SET_BITS(29, 24, (x) - 1)
+
+#define SSIOC_TXDPDEB  BIT(1)
+#define SSIOC_SFCR     BIT(4)
+#define SSIOC_SCOE     BIT(5)
+
+#define MAX_SSP_COUNT 8
+#define SSP_FIFO_DEPTH          16
+#define SSP_FIFO_WATERMARK      8
+
+#define SSP_INTEL_QUIRK_TINTE          (1 << 0)
+#define SSP_INTEL_QUIRK_PINTE          (1 << 1)
+#define SSP_INTEL_QUIRK_SMTATF         (1 << 2)
+#define SSP_INTEL_QUIRK_MMRATF         (1 << 3)
+#define SSP_INTEL_QUIRK_PSPSTWFDFD     (1 << 4)
+#define SSP_INTEL_QUIRK_PSPSRWFDFD     (1 << 5)
+#define SSP_INTEL_QUIRK_LBM            (1 << 6)
+#define SSP_INTEL_QUIRK_BT_SIDEBAND    (1 << 7)
+#define SSP_INTEL_QUIRK_RENDER_FEEDBACK        (1 << 8)
+
+#define SSP_INTEL_FRAME_PULSE_WIDTH_MAX                38
+#define SSP_INTEL_SLOT_PADDING_MAX             31
+
+/* SSP clocks control settings */
+#define SSP_INTEL_MCLK_0_DISABLE               BIT(0)
+#define SSP_INTEL_MCLK_1_DISABLE               BIT(1)
+#define SSP_INTEL_CLKCTRL_MCLK_KA              BIT(2)
+#define SSP_INTEL_CLKCTRL_BCLK_KA              BIT(3)
+#define SSP_INTEL_CLKCTRL_FS_KA                        BIT(4)
+#define SSP_INTEL_CLKCTRL_BCLK_IDLE_HIGH       BIT(5)
+
+#endif /* __SSP_MACROS_H */
diff --git a/topology/nhlt/intel/ssp/ssp-process.c b/topology/nhlt/intel/ssp/ssp-process.c
new file mode 100644 (file)
index 0000000..6a0e853
--- /dev/null
@@ -0,0 +1,1263 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
+//         Keyon Jie <yang.jie@linux.intel.com>
+//         Rander Wang <rander.wang@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#include "aconfig.h"
+#include <stdint.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+#include <alsa/global.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/conf.h>
+#include <alsa/error.h>
+#include "../intel-nhlt.h"
+#include "../../nhlt.h"
+#include "ssp-process.h"
+#include "ssp-intel.h"
+#include "ssp-internal.h"
+#include "ssp-debug.h"
+
+static int popcount(uint32_t value)
+{
+       int bits_set = 0;
+
+       while (value) {
+               bits_set += value & 1;
+               value >>= 1;
+       }
+
+       return bits_set;
+}
+
+static void ssp_calculate_intern_v15(struct intel_nhlt_params *nhlt, int hwi)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       int di = ssp->ssp_count;;
+       struct ssp_intel_config_data_1_5 *blob15 = &ssp->ssp_blob_1_5[di][hwi];
+       struct ssp_intel_config_data *blob = &ssp->ssp_blob[di][hwi];
+       int i;
+
+       blob15->gateway_attributes = ssp->ssp_blob[di][hwi].gateway_attributes;
+       blob15->version = SSP_BLOB_VER_1_5;
+
+       for (i = 0; i < 8; i++)
+               blob15->ts_group[i] = blob->ts_group[i];
+
+       blob15->ssc0 = blob->ssc0;
+       blob15->ssc1 = blob->ssc1;
+       blob15->sscto = blob->sscto;
+       blob15->sspsp = blob->sspsp;
+       blob15->sstsa = blob->sstsa;
+       blob15->ssrsa = blob->ssrsa;
+       blob15->ssc2 = blob->ssc2;
+       blob15->sspsp2 = blob->sspsp2;
+       blob15->ssc3 = blob->ssc3;
+       blob15->ssioc = blob->ssioc;
+
+       /* for now we use only 1 divider as in legacy */
+       blob15->mdivctlr = blob->mdivc;
+       ssp->ssp_prm[di].mdivr[hwi].count = 1;
+       blob15->mdivrcnt = ssp->ssp_prm[di].mdivr[hwi].count;
+       ssp->ssp_prm[di].mdivr[hwi].mdivrs[0] = blob->mdivr;
+
+       blob15->size = sizeof(struct ssp_intel_config_data_1_5) +
+               blob15->mdivrcnt * sizeof(uint32_t) +
+               ssp->ssp_blob_ext[di][hwi].size;
+}
+
+static int ssp_calculate_intern(struct intel_nhlt_params *nhlt, int hwi)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       uint32_t active_tx_slots = 2;
+       uint32_t active_rx_slots = 2;
+       uint32_t inverted_frame = 0;
+       uint32_t inverted_bclk = 0;
+       uint32_t frame_end_padding;
+       uint32_t total_sample_size;
+       uint32_t slot_end_padding;
+       bool start_delay = false;
+       uint32_t frame_len = 0;
+       uint32_t sample_width;
+       uint32_t end_padding;
+       uint32_t data_size;
+       uint32_t bdiv_min;
+       bool cfs = false;
+       uint32_t clk_div;
+       uint32_t bdiv;
+       uint32_t tft;
+       uint32_t rft;
+       int di;
+       unsigned int i, j;
+
+       if (!ssp)
+               return -EINVAL;
+
+       di = ssp->ssp_count;
+
+       /* should be eventually the lp_mode defined in pipeline */
+       ssp->ssp_blob[di][hwi].gateway_attributes = 0;
+
+       for (j = 0; j < SSP_TDM_MAX_SLOT_MAP_COUNT; j++) {
+               for (i = 0; i < ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots; i++)
+                       ssp->ssp_blob[di][hwi].ts_group[j] |= (i << (i * 4));
+               for (; i < SSP_TDM_MAX_SLOT_MAP_COUNT; i++)
+                       ssp->ssp_blob[di][hwi].ts_group[j] |= (0xF << (i * 4));
+       }
+
+       /* reset SSP settings */
+       /* sscr0 dynamic settings are DSS, EDSS, SCR, FRDC, ECS */
+       ssp->ssp_blob[di][hwi].ssc0 = SSCR0_PSP | SSCR0_RIM | SSCR0_TIM;
+
+       /* sscr1 dynamic settings are SFRMDIR, SCLKDIR, SCFR */
+       ssp->ssp_blob[di][hwi].ssc1 = SSCR1_TTE | SSCR1_TTELP | SSCR1_TRAIL | SSCR1_RSRE |
+               SSCR1_TSRE;
+
+       /* sscr2 dynamic setting is LJDFD */
+       ssp->ssp_blob[di][hwi].ssc2 = SSCR2_SDFD | SSCR2_TURM1;
+
+       /* sscr3 dynamic settings are TFT, RFT */
+       ssp->ssp_blob[di][hwi].ssc3 = 0;
+
+       /* sspsp dynamic settings are SCMODE, SFRMP, DMYSTRT, SFRMWDTH */
+       ssp->ssp_blob[di][hwi].sspsp = 0;
+
+       /* sspsp2 no dynamic setting */
+       ssp->ssp_blob[di][hwi].sspsp2 = 0x0;
+
+       /* ssioc dynamic setting is SFCR */
+       ssp->ssp_blob[di][hwi].ssioc = SSIOC_SCOE;
+
+       /* ssto no dynamic setting */
+       ssp->ssp_blob[di][hwi].sscto = 0x0;
+
+       /* sstsa dynamic setting is TTSA, default 2 slots */
+       ssp->ssp_blob[di][hwi].sstsa = SSTSA_SSTSA(ssp->ssp_prm[di].hw_cfg[hwi].tx_slots);
+
+       /* ssrsa dynamic setting is RTSA, default 2 slots */
+       ssp->ssp_blob[di][hwi].ssrsa = SSRSA_SSRSA(ssp->ssp_prm[di].hw_cfg[hwi].rx_slots);
+
+       switch (ssp->ssp_prm[di].hw_cfg[hwi].format & SSP_FMT_CLOCK_PROVIDER_MASK) {
+       case SSP_FMT_CBP_CFP:
+               ssp->ssp_blob[di][hwi].ssc1 |= SSCR1_SCLKDIR | SSCR1_SFRMDIR;
+               break;
+       case SSP_FMT_CBC_CFC:
+               ssp->ssp_blob[di][hwi].ssc1 |= SSCR1_SCFR;
+               cfs = true;
+               break;
+       case SSP_FMT_CBP_CFC:
+               ssp->ssp_blob[di][hwi].ssc1 |= SSCR1_SCLKDIR;
+               /* FIXME: this mode has not been tested */
+
+               cfs = true;
+               break;
+       case SSP_FMT_CBC_CFP:
+               ssp->ssp_blob[di][hwi].ssc1 |= SSCR1_SCFR | SSCR1_SFRMDIR;
+               /* FIXME: this mode has not been tested */
+               break;
+       default:
+               fprintf(stderr, "ssp_calculate(): format & PROVIDER_MASK EINVAL\n");
+               return -EINVAL;
+       }
+
+       /* clock signal polarity */
+       switch (ssp->ssp_prm[di].hw_cfg[hwi].format & SSP_FMT_INV_MASK) {
+       case SSP_FMT_NB_NF:
+               break;
+       case SSP_FMT_NB_IF:
+               inverted_frame = 1; /* handled later with format */
+               break;
+       case SSP_FMT_IB_IF:
+               inverted_bclk = 1; /* handled later with bclk idle */
+               inverted_frame = 1; /* handled later with format */
+               break;
+       case SSP_FMT_IB_NF:
+               inverted_bclk = 1; /* handled later with bclk idle */
+               break;
+       default:
+               fprintf(stderr, "ssp_calculate: format & INV_MASK EINVAL\n");
+               return -EINVAL;
+       }
+
+       /* supporting bclk idle state */
+       if (ssp->ssp_prm[di].clks_control &
+               SSP_INTEL_CLKCTRL_BCLK_IDLE_HIGH) {
+               /* bclk idle state high */
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_SCMODE((inverted_bclk ^ 0x3) & 0x3);
+       } else {
+               /* bclk idle state low */
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_SCMODE(inverted_bclk);
+       }
+
+       ssp->ssp_blob[di][hwi].ssc0 |= SSCR0_MOD | SSCR0_ACS;
+
+       /* Additional hardware settings */
+
+       /* Receiver Time-out Interrupt Disabled/Enabled */
+       ssp->ssp_blob[di][hwi].ssc1 |= (ssp->ssp_prm[di].quirks & SSP_INTEL_QUIRK_TINTE) ?
+               SSCR1_TINTE : 0;
+
+       /* Peripheral Trailing Byte Interrupts Disable/Enable */
+       ssp->ssp_blob[di][hwi].ssc1 |= (ssp->ssp_prm[di].quirks & SSP_INTEL_QUIRK_PINTE) ?
+               SSCR1_PINTE : 0;
+
+       /* Enable/disable internal loopback. Output of transmit serial
+        * shifter connected to input of receive serial shifter, internally.
+        */
+       ssp->ssp_blob[di][hwi].ssc1 |= (ssp->ssp_prm[di].quirks & SSP_INTEL_QUIRK_LBM) ?
+               SSCR1_LBM : 0;
+
+       /* Transmit data are driven at the same/opposite clock edge specified
+        * in SSPSP.SCMODE[1:0]
+        */
+       ssp->ssp_blob[di][hwi].ssc2 |= (ssp->ssp_prm[di].quirks & SSP_INTEL_QUIRK_SMTATF) ?
+               SSCR2_SMTATF : 0;
+
+       /* Receive data are sampled at the same/opposite clock edge specified
+        * in SSPSP.SCMODE[1:0]
+        */
+       ssp->ssp_blob[di][hwi].ssc2 |= (ssp->ssp_prm[di].quirks & SSP_INTEL_QUIRK_MMRATF) ?
+               SSCR2_MMRATF : 0;
+
+       /* Enable/disable the fix for PSP consumer mode TXD wait for frame
+        * de-assertion before starting the second channel
+        */
+       ssp->ssp_blob[di][hwi].ssc2 |= (ssp->ssp_prm[di].quirks & SSP_INTEL_QUIRK_PSPSTWFDFD) ?
+               SSCR2_PSPSTWFDFD : 0;
+
+       /* Enable/disable the fix for PSP provider mode FSRT with dummy stop &
+        * frame end padding capability
+        */
+       ssp->ssp_blob[di][hwi].ssc2 |= (ssp->ssp_prm[di].quirks & SSP_INTEL_QUIRK_PSPSRWFDFD) ?
+               SSCR2_PSPSRWFDFD : 0;
+
+       if (!ssp->ssp_prm[di].hw_cfg[hwi].mclk_rate) {
+               fprintf(stderr, "ssp_calculate(): invalid MCLK = %u \n",
+                       ssp->ssp_prm[di].hw_cfg[hwi].mclk_rate);
+               return -EINVAL;
+       }
+
+       if (!ssp->ssp_prm[di].hw_cfg[hwi].bclk_rate ||
+           ssp->ssp_prm[di].hw_cfg[hwi].bclk_rate > ssp->ssp_prm[di].hw_cfg[hwi].mclk_rate) {
+               fprintf(stderr, "ssp_calculate(): BCLK %u Hz = 0 or > MCLK %u Hz\n",
+                       ssp->ssp_prm[di].hw_cfg[hwi].bclk_rate,
+                       ssp->ssp_prm[di].hw_cfg[hwi].mclk_rate);
+               return -EINVAL;
+       }
+
+       /* calc frame width based on BCLK and rate - must be divisible */
+       if (ssp->ssp_prm[di].hw_cfg[hwi].bclk_rate % ssp->ssp_prm[di].hw_cfg[hwi].fsync_rate) {
+               fprintf(stderr, "ssp_calculate(): BCLK %u is not divisible by rate %u\n",
+                       ssp->ssp_prm[di].hw_cfg[hwi].bclk_rate,
+                       ssp->ssp_prm[di].hw_cfg[hwi].fsync_rate);
+               return -EINVAL;
+       }
+
+       /* must be enough BCLKs for data */
+       bdiv = ssp->ssp_prm[di].hw_cfg[hwi].bclk_rate / ssp->ssp_prm[di].hw_cfg[hwi].fsync_rate;
+       if (bdiv < ssp->ssp_prm[di].hw_cfg[hwi].tdm_slot_width *
+           ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots) {
+               fprintf(stderr, "ssp_calculate(): not enough BCLKs need %u\n",
+                       ssp->ssp_prm[di].hw_cfg[hwi].tdm_slot_width *
+                       ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots);
+               return -EINVAL;
+       }
+
+       /* tdm_slot_width must be <= 38 for SSP */
+       if (ssp->ssp_prm[di].hw_cfg[hwi].tdm_slot_width > 38) {
+               fprintf(stderr, "ssp_calculate(): tdm_slot_width %u > 38\n",
+                       ssp->ssp_prm[di].hw_cfg[hwi].tdm_slot_width);
+               return -EINVAL;
+       }
+
+       bdiv_min = ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots *
+                  (ssp->ssp_prm[di].tdm_per_slot_padding_flag ?
+                   ssp->ssp_prm[di].hw_cfg[hwi].tdm_slot_width :
+                   ssp->ssp_prm[di].sample_valid_bits);
+       if (bdiv < bdiv_min) {
+               fprintf(stderr, "ssp_calculate(): bdiv(%u) < bdiv_min(%u)\n",
+                       bdiv, bdiv_min);
+               return -EINVAL;
+       }
+
+       frame_end_padding = bdiv - bdiv_min;
+       if (frame_end_padding > SSPSP2_FEP_MASK) {
+               fprintf(stderr, "ssp_calculate(): frame_end_padding too big: %u\n",
+                       frame_end_padding);
+               return -EINVAL;
+       }
+
+       /* format */
+       switch (ssp->ssp_prm[di].hw_cfg[hwi].format & SSP_FMT_FORMAT_MASK) {
+       case SSP_FMT_I2S:
+
+               start_delay = true;
+
+               ssp->ssp_blob[di][hwi].ssc0 |= SSCR0_FRDC(ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots);
+
+               if (bdiv % 2) {
+                       fprintf(stderr, "ssp_calculate(): bdiv %u is not divisible by 2\n",
+                               bdiv);
+                       return -EINVAL;
+               }
+
+               /* set asserted frame length to half frame length */
+               frame_len = bdiv / 2;
+
+               /*
+                * handle frame polarity, I2S default is falling/active low,
+                * non-inverted(inverted_frame=0) -- active low(SFRMP=0),
+                * inverted(inverted_frame=1) -- rising/active high(SFRMP=1),
+                * so, we should set SFRMP to inverted_frame.
+                */
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_SFRMP(inverted_frame);
+
+               /*
+                *  for I2S/LEFT_J, the padding has to happen at the end
+                * of each slot
+                */
+               if (frame_end_padding % 2) {
+                       fprintf(stderr, "ssp_calculate():frame_end_padding %u not divisible by 2\n",
+                               frame_end_padding);
+                       return -EINVAL;
+               }
+
+               slot_end_padding = frame_end_padding / 2;
+
+               if (slot_end_padding > SSP_INTEL_SLOT_PADDING_MAX) {
+                       /* too big padding */
+                       fprintf(stderr, "ssp_calculate(): slot_end_padding > %d\n",
+                               SSP_INTEL_SLOT_PADDING_MAX);
+                       return -EINVAL;
+               }
+
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_DMYSTOP(slot_end_padding);
+               slot_end_padding >>= SSPSP_DMYSTOP_BITS;
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_EDMYSTOP(slot_end_padding);
+
+               break;
+
+       case SSP_FMT_LEFT_J:
+
+               /* default start_delay value is set to false */
+
+               ssp->ssp_blob[di][hwi].ssc0 |= SSCR0_FRDC(ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots);
+
+               /* LJDFD enable */
+               ssp->ssp_blob[di][hwi].ssc2 &= ~SSCR2_LJDFD;
+
+               if (bdiv % 2) {
+                       fprintf(stderr, "ssp_calculate(): bdiv %u is not divisible by 2\n",
+                               bdiv);
+                       return -EINVAL;
+               }
+
+               /* set asserted frame length to half frame length */
+               frame_len = bdiv / 2;
+
+               /*
+                * handle frame polarity, LEFT_J default is rising/active high,
+                * non-inverted(inverted_frame=0) -- active high(SFRMP=1),
+                * inverted(inverted_frame=1) -- falling/active low(SFRMP=0),
+                * so, we should set SFRMP to !inverted_frame.
+                */
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_SFRMP(!inverted_frame ? 1 : 0);
+
+               /*
+                *  for I2S/LEFT_J, the padding has to happen at the end
+                * of each slot
+                */
+               if (frame_end_padding % 2) {
+                       fprintf(stderr, "ssp_set_config(): frame padding %u not divisible by 2\n",
+                               frame_end_padding);
+                       return -EINVAL;
+               }
+
+               slot_end_padding = frame_end_padding / 2;
+
+               if (slot_end_padding > 15) {
+                       /* can't handle padding over 15 bits */
+                       fprintf(stderr, "ssp_set_config(): slot_end_padding %u > 15 bits\n",
+                               slot_end_padding);
+                       return -EINVAL;
+               }
+
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_DMYSTOP(slot_end_padding);
+               slot_end_padding >>= SSPSP_DMYSTOP_BITS;
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_EDMYSTOP(slot_end_padding);
+
+               break;
+       case SSP_FMT_DSP_A:
+
+               start_delay = true;
+
+               /* fallthrough */
+
+       case SSP_FMT_DSP_B:
+
+               /* default start_delay value is set to false */
+
+               ssp->ssp_blob[di][hwi].ssc0 |= SSCR0_MOD |
+                       SSCR0_FRDC(ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots);
+
+               /* set asserted frame length */
+               frame_len = 1; /* default */
+
+               if (cfs && ssp->ssp_prm[di].frame_pulse_width > 0 &&
+                   ssp->ssp_prm[di].frame_pulse_width <=
+                   SSP_INTEL_FRAME_PULSE_WIDTH_MAX) {
+                       frame_len = ssp->ssp_prm[di].frame_pulse_width;
+               }
+
+               /* frame_pulse_width must less or equal 38 */
+               if (ssp->ssp_prm[di].frame_pulse_width >
+                       SSP_INTEL_FRAME_PULSE_WIDTH_MAX) {
+                       fprintf(stderr, "ssp_set_config(): frame_pulse_width > %d\n",
+                               SSP_INTEL_FRAME_PULSE_WIDTH_MAX);
+                       return -EINVAL;
+               }
+               /*
+                * handle frame polarity, DSP_B default is rising/active high,
+                * non-inverted(inverted_frame=0) -- active high(SFRMP=1),
+                * inverted(inverted_frame=1) -- falling/active low(SFRMP=0),
+                * so, we should set SFRMP to !inverted_frame.
+                */
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_SFRMP(!inverted_frame ? 1 : 0);
+
+               active_tx_slots = popcount(ssp->ssp_prm[di].hw_cfg[hwi].tx_slots);
+               active_rx_slots = popcount(ssp->ssp_prm[di].hw_cfg[hwi].rx_slots);
+
+               /*
+                * handle TDM mode, TDM mode has padding at the end of
+                * each slot. The amount of padding is equal to result of
+                * subtracting slot width and valid bits per slot.
+                */
+               if (ssp->ssp_prm[di].tdm_per_slot_padding_flag) {
+                       frame_end_padding = bdiv - ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots *
+                               ssp->ssp_prm[di].hw_cfg[hwi].tdm_slot_width;
+
+                       slot_end_padding = ssp->ssp_prm[di].hw_cfg[hwi].tdm_slot_width -
+                               ssp->ssp_prm[di].sample_valid_bits;
+
+                       if (slot_end_padding >
+                               SSP_INTEL_SLOT_PADDING_MAX) {
+                               fprintf(stderr, "ssp_set_config(): slot_end_padding > %d\n",
+                                       SSP_INTEL_SLOT_PADDING_MAX);
+                               return -EINVAL;
+                       }
+
+                       ssp->ssp_blob[di][hwi].sspsp |= SSPSP_DMYSTOP(slot_end_padding);
+                       slot_end_padding >>= SSPSP_DMYSTOP_BITS;
+                       ssp->ssp_blob[di][hwi].sspsp |= SSPSP_EDMYSTOP(slot_end_padding);
+               }
+
+               ssp->ssp_blob[di][hwi].sspsp2 |= (frame_end_padding & SSPSP2_FEP_MASK);
+
+               break;
+       default:
+               fprintf(stderr, "ssp_set_config(): invalid format 0x%04x\n",
+                       ssp->ssp_prm[di].hw_cfg[hwi].format);
+               return -EINVAL;
+       }
+
+       if (start_delay)
+               ssp->ssp_blob[di][hwi].sspsp |= SSPSP_FSRT;
+
+       ssp->ssp_blob[di][hwi].sspsp |= SSPSP_SFRMWDTH(frame_len);
+
+       data_size = ssp->ssp_prm[di].sample_valid_bits;
+
+       if (data_size > 16)
+               ssp->ssp_blob[di][hwi].ssc0 |= (SSCR0_EDSS | SSCR0_DSIZE(data_size - 16));
+       else
+               ssp->ssp_blob[di][hwi].ssc0 |= SSCR0_DSIZE(data_size);
+
+       end_padding = 0;
+       total_sample_size = ssp->ssp_prm[di].hw_cfg[hwi].tdm_slot_width *
+               ssp->ssp_prm[di].hw_cfg[hwi].tdm_slots;
+       while (ssp->ssp_prm[di].io_clk % ((total_sample_size + end_padding) *
+                                     ssp->ssp_prm[di].hw_cfg[hwi].fsync_rate)) {
+               if (++end_padding >= 256)
+                       break;
+       }
+
+       if (end_padding >= 256)
+               return -EINVAL;
+
+       /* calc scr divisor */
+       clk_div = ssp->ssp_prm[di].io_clk / ((total_sample_size + end_padding) *
+                                        ssp->ssp_prm[di].hw_cfg[hwi].fsync_rate);
+       if (clk_div >= 4095)
+               return -EINVAL;
+
+       ssp->ssp_blob[di][hwi].ssc0 |= SSCR0_SCR(clk_div - 1);
+
+       /* setting TFT and RFT */
+       switch (ssp->ssp_prm[di].sample_valid_bits) {
+       case 16:
+               /* use 2 bytes for each slot */
+               sample_width = 2;
+               break;
+       case 24:
+       case 32:
+               /* use 4 bytes for each slot */
+               sample_width = 4;
+               break;
+       default:
+               fprintf(stderr, "ssp_set_config(): sample_valid_bits %u\n",
+                       ssp->ssp_prm[di].sample_valid_bits);
+               return -EINVAL;
+       }
+
+       tft = MIN((uint32_t)(SSP_FIFO_DEPTH - SSP_FIFO_WATERMARK),
+                 sample_width * active_tx_slots);
+       rft = MIN((uint32_t)(SSP_FIFO_DEPTH - SSP_FIFO_WATERMARK),
+                 sample_width * active_rx_slots);
+
+       ssp->ssp_blob[di][hwi].ssc3 |= SSCR3_TX(tft) | SSCR3_RX(rft);
+
+       /* calc mn divisor */
+       if (ssp->ssp_prm[di].io_clk % ssp->ssp_prm[di].hw_cfg[hwi].mclk_rate) {
+               fprintf(stderr, "ssp_set_config(): io_clk not divisible with mclk\n");
+               return -EINVAL;
+       }
+
+       clk_div = ssp->ssp_prm[di].io_clk / ssp->ssp_prm[di].hw_cfg[hwi].mclk_rate;
+       if (clk_div > 1)
+               clk_div -= 2;
+       else
+               clk_div = 0xFFF; /* bypass clk divider */
+
+       ssp->ssp_blob[di][hwi].mdivr = clk_div;
+       /* clock will always go through the divider */
+       ssp->ssp_blob[di][hwi].ssc0 |= SSCR0_ECS;
+       /* enable divider for this clock id */
+       ssp->ssp_blob[di][hwi].mdivc |= BIT(ssp->ssp_prm[di].mclk_id);
+       /* set mclk source always for audio cardinal clock */
+       ssp->ssp_blob[di][hwi].mdivc |= MCDSS(SSP_CLOCK_AUDIO_CARDINAL);
+       /* set bclk source for audio cardinal clock */
+       ssp->ssp_blob[di][hwi].mdivc |= MNDSS(SSP_CLOCK_AUDIO_CARDINAL);
+
+       return 0;
+}
+
+static int ssp_calculate_intern_ext(struct intel_nhlt_params *nhlt, int hwi)
+{
+       size_t aux_size, mn_size, clk_size, tr_size, run_size, sync_size, node_size, ext_size,
+               link_size, size, total_size;
+       struct intel_ssp_params *ssp;
+       struct ssp_config_aux *aux;
+       struct ssp_intel_aux_tlv *tlv;
+       struct ssp_intel_mn_ctl *mn;
+       struct ssp_intel_clk_ctl *clk;
+       struct ssp_intel_tr_ctl *tr;
+       struct ssp_intel_run_ctl *run;
+       struct ssp_intel_sync_ctl *sync;
+       struct ssp_intel_node_ctl *node;
+       struct ssp_intel_ext_ctl *ext;
+       struct ssp_intel_link_ctl *link;
+       uint8_t *aux_blob;
+       uint32_t enabled;
+       unsigned int i;
+       int di;
+
+       aux_size = sizeof(struct ssp_intel_aux_tlv);
+       mn_size = sizeof(struct ssp_intel_mn_ctl);
+       clk_size = sizeof(struct ssp_intel_clk_ctl);
+       tr_size = sizeof(struct ssp_intel_tr_ctl);
+       run_size = sizeof(struct ssp_intel_run_ctl);
+       sync_size = sizeof(struct ssp_intel_sync_ctl);
+       node_size = sizeof(struct ssp_intel_node_ctl);
+       ext_size = sizeof(struct ssp_intel_ext_ctl);
+       link_size = sizeof(struct ssp_intel_link_ctl);
+
+       ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       di = ssp->ssp_count;
+       enabled = ssp->ssp_prm[di].aux_cfg[hwi].enabled;
+       aux = &(ssp->ssp_prm[di].aux_cfg[hwi]);
+       aux_blob = ssp->ssp_blob_ext[di][hwi].aux_blob;
+       total_size = 0;
+       size = 0;
+
+       if (enabled & BIT(SSP_MN_DIVIDER_CONTROLS)) {
+               tlv = (struct ssp_intel_aux_tlv *)aux_blob;
+               mn = (struct ssp_intel_mn_ctl *)(aux_blob + aux_size);
+               size = mn_size + aux_size;
+               tlv->type = SSP_MN_DIVIDER_CONTROLS;
+               tlv->size = mn_size;
+               mn->div_m = aux->mn.m_div;
+               mn->div_n = aux->mn.n_div;
+               aux_blob += size;
+               total_size += size;
+       }
+
+       if (enabled & BIT(SSP_DMA_CLK_CONTROLS)) {
+               tlv = (struct ssp_intel_aux_tlv *)aux_blob;
+               clk = (struct ssp_intel_clk_ctl *)(aux_blob + aux_size);
+               size = clk_size + aux_size;
+               tlv->type = SSP_DMA_CLK_CONTROLS;
+               tlv->size = clk_size;
+               clk->start |= SET_BITS(15, 0, aux->clk.clock_warm_up);
+               clk->start |= SET_BIT(16, aux->clk.mclk);
+               clk->start |= SET_BIT(17, aux->clk.warm_up_ovr);
+               clk->stop |= SET_BITS(15, 0, aux->clk.clock_stop_delay);
+               clk->stop |= SET_BIT(16, aux->clk.keep_running);
+               clk->stop |= SET_BIT(17, aux->clk.clock_stop_ovr);
+               aux_blob += size;
+               total_size += size;
+       }
+
+       if (enabled & BIT(SSP_DMA_TRANSMISSION_START)) {
+               tlv = (struct ssp_intel_aux_tlv *)aux_blob;
+               tr = (struct ssp_intel_tr_ctl *)(aux_blob + aux_size);
+               size = tr_size + aux_size;
+               tlv->type = SSP_DMA_TRANSMISSION_START;
+               tlv->size = tr_size;
+               tr->sampling_frequency = aux->tr_start.sampling_frequency;
+               tr->bit_depth = aux->tr_start.bit_depth;
+               tr->channel_map = aux->tr_start.channel_map;
+               tr->channel_config = aux->tr_start.channel_config;
+               tr->interleaving_style = aux->tr_start.interleaving_style;
+               tr->format |= SET_BITS(7, 0, aux->tr_start.number_of_channels);
+               tr->format |= SET_BITS(15, 8, aux->tr_start.valid_bit_depth);
+               tr->format |= SET_BITS(23, 16, aux->tr_start.sample_type);
+               aux_blob += size;
+               total_size += size;
+       }
+
+       if (enabled & BIT(SSP_DMA_TRANSMISSION_STOP)) {
+               tlv = (struct ssp_intel_aux_tlv *)aux_blob;
+               tr = (struct ssp_intel_tr_ctl *)(aux_blob + aux_size);
+               size = tr_size + aux_size;
+               tlv->type = SSP_DMA_TRANSMISSION_STOP;
+               tlv->size = tr_size;
+               tr->sampling_frequency = aux->tr_stop.sampling_frequency;
+               tr->bit_depth = aux->tr_stop.bit_depth;
+               tr->channel_map = aux->tr_stop.channel_map;
+               tr->channel_config = aux->tr_stop.channel_config;
+               tr->interleaving_style = aux->tr_stop.interleaving_style;
+               tr->format |= SET_BITS(7, 0, aux->tr_stop.number_of_channels);
+               tr->format |= SET_BITS(15, 8, aux->tr_stop.valid_bit_depth);
+               tr->format |= SET_BITS(23, 16, aux->tr_stop.sample_type);
+               aux_blob += size;
+               total_size += size;
+       }
+
+       if (enabled & BIT(SSP_DMA_ALWAYS_RUNNING_MODE)) {
+               tlv = (struct ssp_intel_aux_tlv *)aux_blob;
+               run = (struct ssp_intel_run_ctl *)(aux_blob + aux_size);
+               size = run_size + aux_size;
+               tlv->type = SSP_DMA_ALWAYS_RUNNING_MODE;
+               tlv->size = run_size;
+               run->enabled = aux->run.always_run;
+               aux_blob += size;
+               total_size += size;
+       }
+
+       if (enabled & BIT(SSP_DMA_SYNC_DATA)) {
+               tlv = (struct ssp_intel_aux_tlv *)aux_blob;
+               sync = (struct ssp_intel_sync_ctl *)(aux_blob + aux_size);
+               size = sync_size + aux_size;
+               tlv->type = SSP_DMA_SYNC_DATA;
+               tlv->size = sync_size;
+               sync->sync_denominator = aux->sync.sync_denominator;
+               sync->count = aux->sync.count;
+               aux_blob += size;
+               total_size += size;
+               for (i = 0; i < sync->count; i++) {
+                       node = (struct ssp_intel_node_ctl *)(aux_blob);
+                       size = node_size;
+                       node->node_id = aux->sync.nodes[i].node_id;
+                       node->sampling_rate = aux->sync.nodes[i].sampling_rate;
+                       tlv->size += node_size;
+                       aux_blob += size;
+                       total_size += size;
+               }
+       }
+
+       if (enabled & BIT(SSP_DMA_CLK_CONTROLS_EXT)) {
+               tlv = (struct ssp_intel_aux_tlv *)aux_blob;
+               ext = (struct ssp_intel_ext_ctl *)(aux_blob + aux_size);
+               size = ext_size + aux_size;
+               tlv->type = SSP_DMA_CLK_CONTROLS_EXT;
+               tlv->size = ext_size;
+               ext->ext_data |= SET_BIT(0, aux->ext.mclk_policy_override);
+               ext->ext_data |= SET_BIT(1, aux->ext.mclk_always_running);
+               ext->ext_data |= SET_BIT(2, aux->ext.mclk_starts_on_gtw_init);
+               ext->ext_data |= SET_BIT(3, aux->ext.mclk_starts_on_run);
+               ext->ext_data |= SET_BIT(4, aux->ext.mclk_starts_on_pause);
+               ext->ext_data |= SET_BIT(5, aux->ext.mclk_stops_on_pause);
+               ext->ext_data |= SET_BIT(6, aux->ext.mclk_stops_on_reset);
+               ext->ext_data |= SET_BIT(8, aux->ext.bclk_policy_override);
+               ext->ext_data |= SET_BIT(9, aux->ext.bclk_always_running);
+               ext->ext_data |= SET_BIT(10, aux->ext.bclk_starts_on_gtw_init);
+               ext->ext_data |= SET_BIT(11, aux->ext.bclk_starts_on_run);
+               ext->ext_data |= SET_BIT(12, aux->ext.bclk_starts_on_pause);
+               ext->ext_data |= SET_BIT(13, aux->ext.bclk_stops_on_pause);
+               ext->ext_data |= SET_BIT(14, aux->ext.bclk_stops_on_reset);
+               ext->ext_data |= SET_BIT(16, aux->ext.sync_policy_override);
+               ext->ext_data |= SET_BIT(17, aux->ext.sync_always_running);
+               ext->ext_data |= SET_BIT(18, aux->ext.sync_starts_on_gtw_init);
+               ext->ext_data |= SET_BIT(19, aux->ext.sync_starts_on_run);
+               ext->ext_data |= SET_BIT(20, aux->ext.sync_starts_on_pause);
+               ext->ext_data |= SET_BIT(21, aux->ext.sync_stops_on_pause);
+               ext->ext_data |= SET_BIT(22, aux->ext.sync_stops_on_reset);
+               aux_blob += size;
+               total_size += size;
+       }
+
+       if (enabled & BIT(SSP_LINK_CLK_SOURCE)) {
+               tlv = (struct ssp_intel_aux_tlv *)aux_blob;
+               link = (struct ssp_intel_link_ctl *)(aux_blob + aux_size);
+               size = link_size + aux_size;
+               tlv->type = SSP_LINK_CLK_SOURCE;
+               tlv->size = link_size;
+               link->clock_source = aux->link.clock_source;
+               aux_blob += size;
+               total_size += size;
+       }
+
+       ssp->ssp_blob_ext[di][hwi].size = total_size;
+
+       return 0;
+}
+
+
+
+int ssp_calculate(struct intel_nhlt_params *nhlt)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       unsigned int i;
+
+       if (!ssp)
+               return -EINVAL;
+
+       /* calculate blob for every hw config */
+       for (i = 0; i < ssp->ssp_hw_config_count[ssp->ssp_count]; i++) {
+               if (ssp_calculate_intern(nhlt, i) < 0)
+                       return -EINVAL;
+               if (ssp_calculate_intern_ext(nhlt, i) < 0)
+                       return -EINVAL;
+               /* v15 blob is made from legacy blob, so it can't fail */
+               ssp_calculate_intern_v15(nhlt, i);
+       }
+
+       ssp_print_internal(ssp);
+       ssp_print_calculated(ssp);
+
+       ssp->ssp_count++;
+
+       return 0;
+}
+
+int ssp_get_dir(struct intel_nhlt_params *nhlt, int dai_index, uint8_t *dir)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+
+       if (!ssp)
+               return -EINVAL;
+
+       *dir = ssp->ssp_prm[dai_index].direction;
+
+       return 0;
+}
+
+int ssp_get_params(struct intel_nhlt_params *nhlt, int dai_index, uint32_t *virtualbus_id,
+                  uint32_t *formats_count, uint32_t *device_type, uint32_t *direction)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+
+       if (!ssp)
+               return -EINVAL;
+
+       *virtualbus_id = ssp->ssp_dai_index[dai_index];
+       *formats_count = ssp->ssp_hw_config_count[dai_index];
+       if (ssp->ssp_prm[dai_index].quirks & SSP_INTEL_QUIRK_BT_SIDEBAND)
+               *device_type = NHLT_DEVICE_TYPE_SSP_BT_SIDEBAND;
+       else
+               *device_type = 0;
+       if (ssp->ssp_prm[dai_index].quirks & SSP_INTEL_QUIRK_RENDER_FEEDBACK) {
+               if (*direction == NHLT_ENDPOINT_DIRECTION_RENDER)
+                       *direction = NHLT_ENDPOINT_DIRECTION_RENDER_WITH_LOOPBACK;
+               else if (*direction == NHLT_ENDPOINT_DIRECTION_CAPTURE)
+                       *direction = NHLT_ENDPOINT_DIRECTION_FEEDBACK_FOR_RENDER;
+       }
+
+       return 0;
+}
+
+int ssp_get_hw_params(struct intel_nhlt_params *nhlt, int dai_index, int hw_index,
+                     uint32_t *sample_rate, uint16_t *channel_count, uint32_t *bits_per_sample)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+
+       if (!ssp)
+               return -EINVAL;
+
+       *channel_count = ssp->ssp_prm[dai_index].hw_cfg[hw_index].tdm_slots;
+       *sample_rate = ssp->ssp_prm[dai_index].hw_cfg[hw_index].fsync_rate;
+       *bits_per_sample = ssp->ssp_prm[dai_index].hw_cfg[hw_index].tdm_slot_width;
+
+       return 0;
+}
+
+/*
+ * Build ssp vendor blob from calculated parameters.
+ *
+ * Supposed to be called after all ssp DAIs are parsed from topology and the final nhlt blob is
+ * generated.
+ */
+int ssp_get_vendor_blob_size(struct intel_nhlt_params *nhlt, int dai_index,
+                            int hw_config_index, size_t *size)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+
+       if (!ssp)
+               return -EINVAL;
+
+       /* set size for the blob */
+       if (ssp->ssp_prm[dai_index].version == SSP_BLOB_VER_1_5)
+               *size = ssp->ssp_blob_1_5[dai_index][hw_config_index].size;
+       else
+               /* legacy */
+               *size = sizeof(struct ssp_intel_config_data) +
+                       ssp->ssp_blob_ext[dai_index][hw_config_index].size;
+
+       return 0;
+}
+
+int ssp_get_vendor_blob_count(struct intel_nhlt_params *nhlt)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+
+       if (!ssp || !ssp->ssp_count)
+               return -EINVAL;
+
+       return ssp->ssp_count;
+}
+
+/* Get the size of dynamic vendor blob to reserve proper amount of memory */
+int ssp_get_vendor_blob(struct intel_nhlt_params *nhlt, uint8_t *vendor_blob,
+                       int dai_index, int hw_config_index)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       uint32_t basic_len, clock_len;
+
+       if (!ssp)
+               return -EINVAL;
+
+       /* top level struct */
+       if (ssp->ssp_prm[dai_index].version == SSP_BLOB_VER_1_5) {
+               basic_len = sizeof(struct ssp_intel_config_data_1_5);
+               clock_len = sizeof(uint32_t) * ssp->ssp_prm[dai_index].mdivr[hw_config_index].count;
+               /* basic data */
+               memcpy(vendor_blob, &ssp->ssp_blob_1_5[dai_index][hw_config_index], basic_len);
+               /* clock data */
+               memcpy(vendor_blob + basic_len,
+                      &ssp->ssp_prm[dai_index].mdivr[hw_config_index].mdivrs[0], clock_len);
+               /* ext data */
+               memcpy(vendor_blob + basic_len + clock_len,
+                      ssp->ssp_blob_ext[dai_index][hw_config_index].aux_blob,
+                      ssp->ssp_blob_ext[dai_index][hw_config_index].size);
+       }
+       else {
+               basic_len = sizeof(struct ssp_intel_config_data);
+               /*basic data */
+               memcpy(vendor_blob, &ssp->ssp_blob[dai_index][hw_config_index], basic_len);
+               /* ext data */
+               memcpy(vendor_blob + basic_len,
+                      ssp->ssp_blob_ext[dai_index][hw_config_index].aux_blob,
+                      ssp->ssp_blob_ext[dai_index][hw_config_index].size);
+       }
+
+       return 0;
+}
+
+int ssp_set_params(struct intel_nhlt_params *nhlt, const char *dir, int dai_index, int io_clk,
+                  int bclk_delay, int sample_bits, int mclk_id, int clks_control,
+                  int frame_pulse_width, const char *tdm_padding_per_slot, const char *quirks,
+                  int version)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       char delim[] = ",";
+       char *buf, *token = NULL;
+
+       if (!ssp)
+               return -EINVAL;
+
+       if (dir) {
+               if (!strcmp(dir, "playback"))
+                       ssp->ssp_prm[ssp->ssp_count].direction = NHLT_ENDPOINT_DIRECTION_RENDER;
+               else if (!strcmp(dir, "capture"))
+                       ssp->ssp_prm[ssp->ssp_count].direction = NHLT_ENDPOINT_DIRECTION_CAPTURE;
+               else if (!strcmp(dir, "duplex"))
+                       ssp->ssp_prm[ssp->ssp_count].direction =
+                         NHLT_ENDPOINT_DIRECTION_FEEDBACK_FOR_RENDER + 1;
+               else
+                       return -EINVAL;
+       }
+       ssp->ssp_dai_index[ssp->ssp_count] = dai_index;
+       ssp->ssp_prm[ssp->ssp_count].io_clk = io_clk;
+       ssp->ssp_prm[ssp->ssp_count].bclk_delay = bclk_delay;
+       ssp->ssp_prm[ssp->ssp_count].sample_valid_bits = sample_bits;
+       ssp->ssp_prm[ssp->ssp_count].mclk_id = mclk_id;
+       ssp->ssp_prm[ssp->ssp_count].clks_control = clks_control;
+       ssp->ssp_prm[ssp->ssp_count].frame_pulse_width = frame_pulse_width;
+       /* let's compare the lower 16 bits as we don't send the signature from topology */
+       if (version == (SSP_BLOB_VER_1_5 & ((1 << 16) - 1)))
+               ssp->ssp_prm[ssp->ssp_count].version = SSP_BLOB_VER_1_5;
+       if (tdm_padding_per_slot && !strcmp(tdm_padding_per_slot, "true"))
+               ssp->ssp_prm[ssp->ssp_count].tdm_per_slot_padding_flag = 1;
+       else
+               ssp->ssp_prm[ssp->ssp_count].tdm_per_slot_padding_flag = 0;
+
+       ssp->ssp_prm[ssp->ssp_count].quirks = 0;
+
+       if (quirks) {
+               buf = strdup(quirks);
+               if (!buf)
+                       return -ENOMEM;
+
+               token = strtok(buf, delim);
+
+               while (token) {
+                       if (!strcmp(token, "lbm_mode"))
+                               ssp->ssp_prm[ssp->ssp_count].quirks |= SSP_INTEL_QUIRK_LBM;
+                       else if (!strcmp(token, "bt_sideband"))
+                               ssp->ssp_prm[ssp->ssp_count].quirks |= SSP_INTEL_QUIRK_BT_SIDEBAND;
+                       else if (!strcmp(token, "render_feedback")) {
+                               if (!strcmp(dir, "duplex"))
+                                       ssp->ssp_prm[ssp->ssp_count].quirks |= SSP_INTEL_QUIRK_RENDER_FEEDBACK;
+                       } else {
+                               fprintf(stderr, "ssp_set_params(): unknown quirk %s\n", token);
+                               free(buf);
+                               return -EINVAL;
+                       }
+
+                       token = strtok(NULL, delim);
+               }
+
+               free(buf);
+       }
+
+       /* reset hw config count for this ssp instance */
+       ssp->ssp_hw_config_count[ssp->ssp_count] = 0;
+
+       return 0;
+}
+
+int ssp_hw_set_params(struct intel_nhlt_params *nhlt, const char *format,
+                     const char *mclk ATTRIBUTE_UNUSED,
+                     const char *bclk, const char *bclk_invert, const char *fsync,
+                     const char *fsync_invert, int mclk_freq, int bclk_freq, int fsync_freq,
+                     int tdm_slots, int tdm_slot_width, int tx_slots, int rx_slots)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       uint32_t hwi;
+
+       if (!ssp)
+               return -EINVAL;
+
+       /* check that the strings are defined ?*/
+
+       /* compose format out of clock related string variables */
+       hwi = ssp->ssp_hw_config_count[ssp->ssp_count];
+
+       if (!strcmp(format, "I2S")) {
+               ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format = SSP_FMT_I2S;
+       } else if (!strcmp(format, "RIGHT_J")) {
+               ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format = SSP_FMT_RIGHT_J;
+       } else if (!strcmp(format, "LEFT_J")) {
+               ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format = SSP_FMT_LEFT_J;
+       } else if (!strcmp(format, "DSP_A")) {
+               ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format = SSP_FMT_DSP_A;
+       } else if (!strcmp(format, "DSP_B")) {
+               ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format = SSP_FMT_DSP_B;
+       } else {
+               fprintf(stderr, "no valid format specified for ssp: %s\n", format);
+               return -EINVAL;
+       }
+
+       /* clock directions wrt codec */
+       if (bclk && !strcmp(bclk, "codec_provider")) {
+               /* codec is bclk provider */
+               if (fsync && !strcmp(fsync, "codec_provider"))
+                       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format |= SSP_FMT_CBP_CFP;
+               else
+                       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format |= SSP_FMT_CBP_CFC;
+       } else {
+               /* codec is bclk consumer */
+               if (fsync && !strcmp(fsync, "codec_provider"))
+                       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format |= SSP_FMT_CBC_CFP;
+               else
+                       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format |= SSP_FMT_CBC_CFC;
+       }
+
+       /* inverted clocks ? */
+       if (bclk_invert && !strcmp(bclk_invert, "true")) {
+               if (fsync_invert && !strcmp(fsync_invert, "true"))
+                       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format |= SSP_FMT_IB_IF;
+               else
+                       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format |= SSP_FMT_IB_NF;
+       } else {
+               if (fsync_invert && !strcmp(fsync_invert, "true"))
+                       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format |= SSP_FMT_NB_IF;
+               else
+                       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].format |= SSP_FMT_NB_NF;
+       }
+
+       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].mclk_rate = mclk_freq;
+       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].bclk_rate = bclk_freq;
+       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].fsync_rate = fsync_freq;
+       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].tdm_slots = tdm_slots;
+       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].tdm_slot_width = tdm_slot_width;
+       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].tx_slots = tx_slots;
+       ssp->ssp_prm[ssp->ssp_count].hw_cfg[hwi].rx_slots = rx_slots;
+
+       ssp->ssp_hw_config_count[ssp->ssp_count]++;
+
+       return 0;
+}
+
+int ssp_mn_set_params(struct intel_nhlt_params *nhlt, int m_div, int n_div)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       int di = ssp->ssp_count;
+       int hwi = ssp->ssp_hw_config_count[di];
+
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+
+       ssp->ssp_prm[di].aux_cfg[hwi].enabled |= BIT(SSP_MN_DIVIDER_CONTROLS);
+
+       ssp->ssp_prm[di].aux_cfg[hwi].mn.m_div = m_div;
+       ssp->ssp_prm[di].aux_cfg[hwi].mn.n_div = n_div;
+
+       return 0;
+}
+
+int ssp_clk_set_params(struct intel_nhlt_params *nhlt, int clock_warm_up, int mclk, int warm_up_ovr,
+                      int clock_stop_delay, int keep_running, int clock_stop_ovr)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       int di = ssp->ssp_count;
+       int hwi = ssp->ssp_hw_config_count[di];
+
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+
+       ssp->ssp_prm[di].aux_cfg[hwi].enabled |= BIT(SSP_DMA_CLK_CONTROLS);
+
+       ssp->ssp_prm[di].aux_cfg[hwi].clk.clock_warm_up = clock_warm_up;
+       ssp->ssp_prm[di].aux_cfg[hwi].clk.mclk = mclk;
+       ssp->ssp_prm[di].aux_cfg[hwi].clk.warm_up_ovr = warm_up_ovr;
+       ssp->ssp_prm[di].aux_cfg[hwi].clk.clock_stop_delay = clock_stop_delay;
+       ssp->ssp_prm[di].aux_cfg[hwi].clk.keep_running = keep_running;
+       ssp->ssp_prm[di].aux_cfg[hwi].clk.clock_stop_ovr = clock_stop_ovr;
+
+       return 0;
+}
+
+int ssp_tr_start_set_params(struct intel_nhlt_params *nhlt, int sampling_frequency,
+                           int bit_depth, int channel_map, int channel_config,
+                           int interleaving_style, int number_of_channels,
+                           int valid_bit_depth, int sample_type)
+{
+       struct intel_ssp_params *ssp;
+       struct ssp_aux_config_tr *tr;
+       int di, hwi;
+
+       ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       di = ssp->ssp_count;
+       hwi = ssp->ssp_hw_config_count[di];
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+       tr = (struct ssp_aux_config_tr *)&(ssp->ssp_prm[di].aux_cfg[hwi].tr_start);
+
+       ssp->ssp_prm[di].aux_cfg[hwi].enabled |= BIT(SSP_DMA_TRANSMISSION_START);
+
+       tr->sampling_frequency = sampling_frequency;
+       tr->bit_depth = bit_depth;
+       tr->channel_map = channel_map;
+       tr->channel_config = channel_config;
+       tr->interleaving_style = interleaving_style;
+       tr->number_of_channels = number_of_channels;
+       tr->valid_bit_depth = valid_bit_depth;
+       tr->sample_type = sample_type;
+
+       return 0;
+}
+
+int ssp_tr_stop_set_params(struct intel_nhlt_params *nhlt, int sampling_frequency,
+                           int bit_depth, int channel_map, int channel_config,
+                           int interleaving_style, int number_of_channels,
+                           int valid_bit_depth, int sample_type)
+{
+       struct intel_ssp_params *ssp;
+       struct ssp_aux_config_tr *tr;
+       int di, hwi;
+
+       ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       di = ssp->ssp_count;
+       hwi = ssp->ssp_hw_config_count[di];
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+       tr = (struct ssp_aux_config_tr *)&(ssp->ssp_prm[di].aux_cfg[hwi].tr_stop);
+
+       ssp->ssp_prm[di].aux_cfg[hwi].enabled |= BIT(SSP_DMA_TRANSMISSION_STOP);
+
+       tr->sampling_frequency = sampling_frequency;
+       tr->bit_depth = bit_depth;
+       tr->channel_map = channel_map;
+       tr->channel_config = channel_config;
+       tr->interleaving_style = interleaving_style;
+       tr->number_of_channels = number_of_channels;
+       tr->valid_bit_depth = valid_bit_depth;
+       tr->sample_type = sample_type;
+
+       return 0;
+}
+
+int ssp_run_set_params(struct intel_nhlt_params *nhlt, int always_run)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       int di = ssp->ssp_count;
+       int hwi = ssp->ssp_hw_config_count[di];
+
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+
+       ssp->ssp_prm[di].aux_cfg[hwi].enabled |= BIT(SSP_DMA_ALWAYS_RUNNING_MODE);
+
+       ssp->ssp_prm[di].aux_cfg[hwi].run.always_run = always_run;
+
+       return 0;
+}
+
+int ssp_sync_set_params(struct intel_nhlt_params *nhlt, int sync_denominator)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       int di = ssp->ssp_count;
+       int hwi = ssp->ssp_hw_config_count[di];
+
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+
+       ssp->ssp_prm[di].aux_cfg[hwi].enabled |= BIT(SSP_DMA_SYNC_DATA);
+
+       ssp->ssp_prm[di].aux_cfg[hwi].sync.sync_denominator = sync_denominator;
+
+       return 0;
+}
+
+int ssp_node_set_params(struct intel_nhlt_params *nhlt, int node_id, int sampling_rate)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       int di = ssp->ssp_count;
+       int hwi = ssp->ssp_hw_config_count[di];
+       int count;
+
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+
+       count = ssp->ssp_prm[di].aux_cfg[hwi].sync.count;
+       if (count > SSP_MAX_DAIS)
+               return -EINVAL;
+
+       ssp->ssp_prm[di].aux_cfg[hwi].sync.nodes[count].node_id = node_id;
+       ssp->ssp_prm[di].aux_cfg[hwi].sync.nodes[count].sampling_rate = sampling_rate;
+
+       ssp->ssp_prm[di].aux_cfg[hwi].sync.count++;
+
+       return 0;
+}
+
+int ssp_ext_set_params(struct intel_nhlt_params *nhlt, int mclk_policy_override,
+                      int mclk_always_running, int mclk_starts_on_gtw_init, int mclk_starts_on_run,
+                      int mclk_starts_on_pause, int mclk_stops_on_pause, int mclk_stops_on_reset,
+                      int bclk_policy_override, int bclk_always_running,
+                      int bclk_starts_on_gtw_init, int bclk_starts_on_run,
+                      int bclk_starts_on_pause, int bclk_stops_on_pause, int bclk_stops_on_reset,
+                      int sync_policy_override, int sync_always_running,
+                      int sync_starts_on_gtw_init, int sync_starts_on_run,
+                      int sync_starts_on_pause, int sync_stops_on_pause, int sync_stops_on_reset)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       int di = ssp->ssp_count;
+       int hwi = ssp->ssp_hw_config_count[di];
+
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+
+       ssp->ssp_prm[di].aux_cfg[hwi].enabled |= BIT(SSP_DMA_CLK_CONTROLS_EXT);
+
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.mclk_policy_override = mclk_policy_override;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.mclk_always_running = mclk_always_running;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.mclk_starts_on_gtw_init  = mclk_starts_on_gtw_init;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.mclk_starts_on_run = mclk_starts_on_run;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.mclk_starts_on_pause = mclk_starts_on_pause;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.mclk_stops_on_pause = mclk_stops_on_pause;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.mclk_stops_on_reset = mclk_stops_on_reset;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.bclk_policy_override = bclk_policy_override;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.bclk_always_running = bclk_always_running;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.bclk_starts_on_gtw_init = bclk_starts_on_gtw_init;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.bclk_starts_on_run = bclk_starts_on_run;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.bclk_starts_on_pause = bclk_starts_on_pause;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.bclk_stops_on_pause = bclk_stops_on_pause;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.bclk_stops_on_reset = bclk_stops_on_reset;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.sync_policy_override = sync_policy_override;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.sync_always_running = sync_always_running;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.sync_starts_on_gtw_init = sync_starts_on_gtw_init;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.sync_starts_on_run = sync_starts_on_run;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.sync_starts_on_pause = sync_starts_on_pause;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.sync_stops_on_pause = sync_stops_on_pause;
+       ssp->ssp_prm[di].aux_cfg[hwi].ext.sync_stops_on_reset = sync_stops_on_reset;
+
+       return 0;
+}
+
+int ssp_link_set_params(struct intel_nhlt_params *nhlt, int clock_source)
+{
+       struct intel_ssp_params *ssp = (struct intel_ssp_params *)nhlt->ssp_params;
+       int di = ssp->ssp_count;
+       int hwi = ssp->ssp_hw_config_count[di];
+
+       if (di < 0 || hwi < 0)
+               return -EINVAL;
+
+       ssp->ssp_prm[di].aux_cfg[hwi].enabled |= BIT(SSP_LINK_CLK_SOURCE);
+
+       ssp->ssp_prm[di].aux_cfg[hwi].link.clock_source = clock_source;
+
+       return 0;
+}
+
+/* init ssp parameters, should be called before parsing dais */
+int ssp_init_params(struct intel_nhlt_params *nhlt)
+{
+       struct intel_ssp_params *ssp;
+       int i, j;
+
+       ssp = calloc(1, sizeof(struct intel_ssp_params));
+       if (!ssp)
+               return -EINVAL;
+
+       nhlt->ssp_params = ssp;
+       ssp->ssp_count = 0;
+
+       for (i = 0; i < SSP_MAX_DAIS; i++) {
+               ssp->ssp_hw_config_count[i] = 0;
+               for (j = 0; j < SSP_MAX_HW_CONFIG; j++)
+                       ssp->ssp_prm[i].aux_cfg[j].sync.count = 0;
+       }
+
+       return 0;
+}
diff --git a/topology/nhlt/intel/ssp/ssp-process.h b/topology/nhlt/intel/ssp/ssp-process.h
new file mode 100644 (file)
index 0000000..ea80482
--- /dev/null
@@ -0,0 +1,69 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
+//         Keyon Jie <yang.jie@linux.intel.com>
+//         Rander Wang <rander.wang@linux.intel.com>
+//         Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __SSP_PROCESS_H
+#define __SSP_PROCESS_H
+
+#include <stdint.h>
+
+/* initialize and set default values before parsing */
+int ssp_init_params(struct intel_nhlt_params *nhlt);
+
+/* set parameters when parsing topology2 conf */
+int ssp_set_params(struct intel_nhlt_params *nhlt, const char *dir, int dai_index, int io_clk,
+                  int bclk_delay, int sample_bits, int mclk_id, int clks_control,
+                  int frame_pulse_width, const char *tdm_padding_per_slot, const char *quirks,
+                  int version);
+int ssp_hw_set_params(struct intel_nhlt_params *nhlt, const char *format, const char *mclk,
+                     const char *bclk, const char *bclk_invert, const char *fsync,
+                     const char *fsync_invert, int mclk_freq, int bclk_freq, int fsync_freq,
+                     int tdm_slots, int tdm_slot_width, int tx_slots, int rx_slots);
+
+/* set aux params when parsing topology2 conf */
+int ssp_mn_set_params(struct intel_nhlt_params *nhlt, int m_div, int n_div);
+int ssp_clk_set_params(struct intel_nhlt_params *nhlt, int clock_warm_up, int mclk, int warm_up_ovr,
+                      int clock_stop_delay, int keep_running, int clock_stop_ovr);
+int ssp_tr_start_set_params(struct intel_nhlt_params *nhlt, int sampling_frequency,
+                           int bit_depth, int channel_map, int hannel_config,
+                           int interleaving_style, int number_of_channels,
+                           int valid_bit_depth, int sample_type);
+int ssp_tr_stop_set_params(struct intel_nhlt_params *nhlt, int sampling_frequency,
+                          int bit_depth, int channel_map, int hannel_config,
+                          int interleaving_style, int number_of_channels,
+                          int valid_bit_depth, int sample_type);
+int ssp_run_set_params(struct intel_nhlt_params *nhlt, int always_run);
+int ssp_sync_set_params(struct intel_nhlt_params *nhlt, int sync_denominator);
+int ssp_node_set_params(struct intel_nhlt_params *nhlt, int node_id, int sampling_rate);
+int ssp_ext_set_params(struct intel_nhlt_params *nhlt, int mclk_policy_override,
+                      int mclk_always_running, int mclk_starts_on_gtw_init, int mclk_starts_on_run,
+                      int mclk_starts_on_pause, int mclk_stops_on_pause, int mclk_stops_on_reset,
+                      int bclk_policy_override, int bclk_always_running,
+                      int bclk_starts_on_gtw_init, int bclk_starts_on_run,
+                      int bclk_starts_on_pause, int bclk_stops_on_pause, int bclk_stops_on_reset,
+                      int sync_policy_override, int sync_always_running,
+                      int sync_starts_on_gtw_init, int sync_starts_on_run,
+                      int sync_starts_on_pause, int sync_stops_on_pause, int sync_stops_on_reset);
+int ssp_link_set_params(struct intel_nhlt_params *nhlt, int clock_source);
+
+/* calculate the blob after parsing the values*/
+int ssp_calculate(struct intel_nhlt_params *nhlt);
+/* get spec parameters when building the nhlt endpoint */
+int ssp_get_params(struct intel_nhlt_params *nhlt, int dai_index, uint32_t *virtualbus_id,
+                  uint32_t *formats_count, uint32_t *device_type, uint32_t *direction);
+int ssp_get_hw_params(struct intel_nhlt_params *nhlt, int dai_index, int hw_index,
+                     uint32_t *sample_rate, uint16_t *channel_count, uint32_t *bits_per_sample);
+int ssp_get_dir(struct intel_nhlt_params *nhlt, int dai_index, uint8_t *dir);
+/* get vendor specific blob when building the nhlt endpoint */
+int ssp_get_vendor_blob_count(struct intel_nhlt_params *nhlt);
+int ssp_get_vendor_blob_size(struct intel_nhlt_params *nhlt, int dai_index, int hw_config_index,
+                            size_t *size);
+int ssp_get_vendor_blob(struct intel_nhlt_params *nhlt, uint8_t *vendor_blob, int dai_index,
+                       int hw_config_index);
+
+#endif
diff --git a/topology/nhlt/nhlt-processor.c b/topology/nhlt/nhlt-processor.c
new file mode 100644 (file)
index 0000000..ca539c3
--- /dev/null
@@ -0,0 +1,495 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#include "aconfig.h"
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+#include <inttypes.h>
+#include <alsa/global.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/conf.h>
+#include <alsa/error.h>
+#include "pre-process-external.h"
+#include "nhlt.h"
+#include "intel/intel-nhlt.h"
+#include "intel/dmic-nhlt.h"
+#include "intel/ssp-nhlt.h"
+
+#define MAX_ENDPOINT_COUNT 20
+#define ALSA_BYTE_CHARS 5
+#define SOF_ABI_CHARS 29
+#define SOF_MANIFEST_DATA_TYPE_NHLT 1
+
+struct sof_manifest_tlv {
+       uint32_t type;
+       uint32_t size;
+       uint8_t data[];
+} __attribute__((packed));
+
+struct sof_manifest {
+       uint16_t abi_major;
+       uint16_t abi_minor;
+       uint16_t abi_patch;
+       uint16_t count;
+       struct sof_manifest_tlv items[];
+} __attribute__((packed));
+
+#ifdef NHLT_DEBUG
+static void debug_print_nhlt(struct nhlt *blob, struct endpoint_descriptor **eps)
+{
+       uint8_t *top_p = (uint8_t *)blob;
+       struct endpoint_descriptor *ep;
+       uint8_t *ep_p;
+       int i, j, k, lines, remain;
+
+       fprintf(stdout, "printing nhlt as bytes:\n");
+
+       lines = sizeof(struct nhlt) / 8;
+       remain = sizeof(struct nhlt) % 8;
+       for (i = 0; i < lines; i++) {
+               for (j = 0; j < 8; j++) {
+                       fprintf(stdout, "0x%02x,", *top_p);
+                       top_p++;
+               }
+               fprintf(stdout, "\n");
+       }
+       for (i = 0; i < remain; i++) {
+               fprintf(stdout, "0x%02x,", *top_p);
+               top_p++;
+       }
+       fprintf(stdout, "\n\n");
+
+       for (i = 0; i < blob->endpoint_count; i++) {
+               ep = eps[i];
+               ep_p = (uint8_t *)ep;
+               lines = ep->length / 8;
+               remain = ep->length % 8;
+               for (j = 0; j < lines; j++) {
+                       for (k = 0; k < 8; k++) {
+                               fprintf(stdout, "0x%02x,", *ep_p);
+                               ep_p++;
+                       }
+                       fprintf(stdout, "\n");
+               }
+               for (j = 0; j < remain; j++) {
+                       fprintf(stdout, "0x%02x,", *ep_p);
+                       ep_p++;
+               }
+               fprintf(stdout, "\n");
+       }
+
+       fprintf(stdout, "\n");
+}
+#else
+static void debug_print_nhlt(struct nhlt *blob ATTRIBUTE_UNUSED,
+                            struct endpoint_descriptor **eps ATTRIBUTE_UNUSED) {}
+#endif
+
+static int print_as_hex_bytes(uint8_t *manifest_buffer, uint32_t manifest_size,
+                             uint8_t *nhlt_buffer, uint32_t nhlt_size, char **src)
+{
+       char *bytes_string_buffer;
+       char *dst;
+       unsigned int i;
+
+       bytes_string_buffer = calloc((manifest_size + nhlt_size) * ALSA_BYTE_CHARS + 1,
+                                    sizeof(uint8_t));
+       if (!bytes_string_buffer)
+               return -ENOMEM;
+
+       dst = bytes_string_buffer;
+       for (i = 0; i < manifest_size; i++) {
+               snprintf(dst, ALSA_BYTE_CHARS + 1, "0x%02x,", *manifest_buffer);
+               dst += ALSA_BYTE_CHARS;
+               manifest_buffer++;
+       }
+
+       for (i = 0; i < nhlt_size; i++) {
+               snprintf(dst, ALSA_BYTE_CHARS + 1, "0x%02x,", *nhlt_buffer);
+               dst += ALSA_BYTE_CHARS;
+               nhlt_buffer++;
+       }
+
+       /* remove the last comma... */
+       dst--;
+       *dst = '\0';
+
+       *src = bytes_string_buffer;
+
+       return 0;
+}
+
+static int merge_manifest_data(snd_config_t *cfg, uint8_t *manifest_buffer, uint32_t manifest_size,
+                              uint8_t *nhlt_buffer, uint32_t nhlt_size)
+{
+       const char *data_name = "SOF ABI";
+       snd_config_t *data_section;
+       snd_config_t *manifest;
+       snd_config_t *old_bytes;
+       snd_config_t *new_bytes;
+       char *src = NULL;
+       int ret;
+
+       /* merge manifest struct and nhlt bytes as new config into existing SectionData*/
+       ret = snd_config_search(cfg, "SectionData", &data_section);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_search(data_section, data_name, &manifest);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_search(manifest, "bytes", &old_bytes);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_make(&new_bytes, "bytes", SND_CONFIG_TYPE_STRING);
+       if (ret < 0)
+               goto err;
+
+       ret = print_as_hex_bytes(manifest_buffer, manifest_size, nhlt_buffer, nhlt_size, &src);
+       if (ret < 0)
+               goto err;
+
+       ret = snd_config_set_string(new_bytes, src);
+       if (ret < 0)
+               goto err;
+
+       ret = snd_config_merge(old_bytes, new_bytes, true);
+       if (ret < 0)
+               goto err;
+
+       free(src);
+
+       return 0;
+err:
+       if (new_bytes)
+               snd_config_delete(new_bytes);
+       if (src)
+               free(src);
+
+       return ret;
+}
+
+static void save_nhlt_binary(struct nhlt *blob, struct endpoint_descriptor **eps, snd_config_t *cfg)
+{
+       const char *bin_file = NULL;
+       snd_config_t *defines;
+       FILE *fp;
+       int ret;
+       int i;
+
+       ret = snd_config_search(cfg, "Define.NHLT_BIN", &defines);
+       if (ret < 0)
+               return;
+
+       if (snd_config_get_string(defines, &bin_file) < 0)
+               return;
+
+       fp = fopen(bin_file, "wb");
+       if (fp == NULL) {
+               fprintf(stderr, "can't open nhlt binary output file %s\n", bin_file);
+               return;
+       }
+
+       fprintf(stdout, "saving nhlt as binary in %s\n", bin_file);
+
+       fwrite(blob, 1, sizeof(struct nhlt), fp);
+
+       for (i = 0; i < blob->endpoint_count; i++)
+               fwrite(eps[i], eps[i]->length, sizeof(uint8_t), fp);
+
+       fclose(fp);
+}
+
+static int manifest_create(snd_config_t *input, uint8_t **manifest_buffer, uint32_t *size, uint32_t nhlt_size)
+{
+       struct sof_manifest_tlv manifest_tlv;
+       struct sof_manifest manifest;
+       snd_config_t *data_section;
+       snd_config_t *data;
+       snd_config_t *old_bytes;
+       uint32_t manifest_size;
+       uint8_t *byte_buffer;
+       const char *abi;
+       uint8_t *top_p;
+       uint8_t *dst;
+       int ret;
+       unsigned int i;
+
+       ret = snd_config_search(input, "SectionData", &data_section);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_search(data_section, "SOF ABI", &data);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_search(data, "bytes", &old_bytes);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_get_string(old_bytes, &abi);
+       if (ret < 0)
+               return ret;
+
+       /* we have something funny in abi string */
+       if (strlen(abi) != SOF_ABI_CHARS)
+               return -EINVAL;
+
+       manifest.count = 1;
+       manifest_tlv.type = SOF_MANIFEST_DATA_TYPE_NHLT;
+       manifest_tlv.size = nhlt_size;
+
+       manifest_size = sizeof(struct sof_manifest) + sizeof(struct sof_manifest_tlv);
+       byte_buffer = calloc(manifest_size, sizeof(uint8_t));
+       if (!byte_buffer)
+               return -ENOMEM;
+
+       *size = manifest_size;
+
+       dst = byte_buffer;
+
+       /* copy the ABI version bytes */
+       for (i = 0; i < 6; i++)
+               sscanf(&abi[i * ALSA_BYTE_CHARS], "%" SCNx8, dst++);
+
+       /* set the count */
+       *dst++ = manifest.count;
+       *dst++ = manifest.count >> 2;
+
+       top_p = (uint8_t *)&manifest_tlv;
+       for (i = 0; i < sizeof(struct sof_manifest_tlv); i++)
+               *dst++ = *top_p++;
+
+       *manifest_buffer = byte_buffer;
+
+       return 0;
+}
+
+static int nhlt_get_flat_buffer(struct nhlt *blob, struct endpoint_descriptor **eps,
+                               uint32_t eps_count, uint32_t *size, uint8_t **nhlt_buffer)
+{
+       uint8_t *top_p = (uint8_t *)blob;
+       struct endpoint_descriptor *ep;
+       uint8_t *byte_buffer;
+       uint32_t nhlt_size;
+       uint8_t *ep_p;
+       uint8_t *dst;
+       unsigned int i, j;
+
+       /* get blob total size */
+       nhlt_size = sizeof(struct nhlt);
+       for (i = 0; i < eps_count; i++) {
+               if (eps[i])
+                       nhlt_size += eps[i]->length;
+       }
+
+       *size = nhlt_size;
+
+       byte_buffer = calloc(nhlt_size, sizeof(uint8_t));
+       if (!byte_buffer)
+               return -ENOMEM;
+
+       dst = byte_buffer;
+       for (i = 0; i < sizeof(struct nhlt); i++)
+               *dst++ = *top_p++;
+
+       for (i = 0; i < blob->endpoint_count; i++) {
+               ep = eps[i];
+               ep_p = (uint8_t *)ep;
+               for (j = 0; j < ep->length; j++)
+                       *dst++ = *ep_p++;
+       }
+
+       *nhlt_buffer = byte_buffer;
+
+       return 0;
+}
+
+/* called at the end of topology pre-processing, create flat buffer from variable size nhlt */
+static int nhlt_create(struct intel_nhlt_params *nhlt, snd_config_t *input,
+                      snd_config_t *output ATTRIBUTE_UNUSED,
+                      uint8_t **nhlt_buffer, uint32_t *nhlt_size)
+{
+       struct endpoint_descriptor *eps[MAX_ENDPOINT_COUNT];
+       int eps_count = 0;
+       struct nhlt blob;
+       uint32_t size;
+       uint8_t dir;
+       int ret;
+       int i;
+
+       for (i = 0; i < MAX_ENDPOINT_COUNT; i++)
+               eps[i] = NULL;
+
+       /* we always have only 0 or 1 dmic ep */
+       for (i = 0; i < nhlt_dmic_get_ep_count(nhlt); i++) {
+               ret = nhlt_dmic_get_ep(nhlt, &eps[eps_count], i);
+               if (ret < 0)
+                       return -EINVAL;
+               eps_count++;
+       }
+
+       /* we can have 0 to several ssp eps */
+       for (i = 0; i < nhlt_ssp_get_ep_count(nhlt); i++) {
+               nhlt_ssp_get_dir(nhlt, i, &dir);
+               /* duplicate endpoint for duplex dai */
+               if (dir > NHLT_ENDPOINT_DIRECTION_FEEDBACK_FOR_RENDER) {
+                       ret = nhlt_ssp_get_ep(nhlt, &eps[eps_count], i,
+                                             NHLT_ENDPOINT_DIRECTION_RENDER);
+                       if (ret < 0)
+                               goto err;
+                       eps_count++;
+                       ret = nhlt_ssp_get_ep(nhlt, &eps[eps_count], i,
+                                             NHLT_ENDPOINT_DIRECTION_CAPTURE);
+               } else {
+                       ret = nhlt_ssp_get_ep(nhlt, &eps[eps_count], i, dir);
+               }
+               if (ret < 0)
+                       goto err;
+               eps_count++;
+       }
+
+       /* we don't have endpoints */
+       if (!eps_count)
+               return 0;
+
+       uint8_t sig[4] = {'N', 'H', 'L', 'T'};
+       blob.efi_acpi.signature = *((uint32_t *)sig);
+       blob.efi_acpi.length = 0;
+       blob.efi_acpi.revision = 0;
+       blob.efi_acpi.checksum = 0;
+       for (i = 0; i < 6; i++)
+               blob.efi_acpi.oem_id[i] = 0;
+       blob.efi_acpi.oem_table_id = 0;
+       blob.efi_acpi.oem_revision = 0;
+       blob.efi_acpi.creator_id = 0;
+       blob.efi_acpi.creator_revision = 0;
+
+       blob.endpoint_count = eps_count;
+
+       /* get blob total size */
+       size = sizeof(struct nhlt);
+       for (i = 0; i < eps_count; i++) {
+               if (eps[i])
+                       size += eps[i]->length;
+       }
+
+       /* add the total length to top level struct */
+       blob.efi_acpi.length = size;
+
+       debug_print_nhlt(&blob, eps);
+
+       save_nhlt_binary(&blob, eps, input);
+
+       ret = nhlt_get_flat_buffer(&blob, eps, eps_count, nhlt_size, nhlt_buffer);
+
+err:
+       /* remove all enpoints */
+       for (i = 0; i < eps_count; i++)
+               free(eps[i]);
+
+       return ret;
+}
+
+static int do_nhlt(struct intel_nhlt_params *nhlt, snd_config_t *input, snd_config_t *output)
+{
+       uint8_t *manifest_buffer = NULL;
+       uint8_t *nhlt_buffer = NULL;
+       uint32_t manifest_size;
+       uint32_t nhlt_size = 0;
+       int ret = 0;
+
+       ret = nhlt_create(nhlt, input, output, &nhlt_buffer, &nhlt_size);
+       if (ret) {
+               fprintf(stderr, "can't create nhlt blob, err %d\n", ret);
+               return ret;
+       }
+
+       ret = manifest_create(output, &manifest_buffer, &manifest_size, nhlt_size);
+       if (ret) {
+               fprintf(stderr, "can't re-create manifest, err %d\n", ret);
+               goto err;
+       }
+
+       ret = merge_manifest_data(output, manifest_buffer, manifest_size, nhlt_buffer, nhlt_size);
+       if (ret)
+               fprintf(stderr, "can't merge manifest data, err %d\n", ret);
+
+err:
+       if (manifest_buffer)
+               free(manifest_buffer);
+       if (nhlt_buffer)
+               free(nhlt_buffer);
+
+       return ret;
+}
+
+SND_TOPOLOGY_PLUGIN_DEFINE_FUNC(nhlt)
+{
+       snd_config_iterator_t i, i2, next, next2;
+       struct intel_nhlt_params nhlt;
+       snd_config_t *n, *n2;
+       snd_config_t *items;
+       const char *id, *id2;
+       int ret;
+
+       /* initialize the internal structs */
+       ret = nhlt_ssp_init_params(&nhlt);
+       if (ret < 0)
+               return ret;
+
+       ret = nhlt_dmic_init_params(&nhlt);
+       if (ret < 0)
+               return ret;
+
+       /* find DAIs and set internal parameters */
+       ret = snd_config_search(input, "Object.Dai", &items);
+       if (ret < 0)
+               return ret;
+
+       snd_config_for_each(i, next, items) {
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               snd_config_for_each(i2, next2, n) {
+                       n2 = snd_config_iterator_entry(i2);
+
+                       if (snd_config_get_id(n2, &id2) < 0)
+                               continue;
+
+                       /* set dai parameters here */
+                       if (!strncmp(id, "DMIC", 4)) {
+                               ret = nhlt_dmic_set_params(&nhlt, n2, input);
+                               if (ret < 0)
+                                       return ret;
+                       }
+
+                       if (!strncmp(id, "SSP", 3)) {
+                               ret = nhlt_ssp_set_params(&nhlt, n2, input);
+                               if (ret < 0)
+                                       return ret;
+                       }
+               }
+       }
+
+       /* create the nhlt blob from internal structs */
+       ret = do_nhlt(&nhlt, input, output);
+       if (ret)
+               fprintf(stderr, "error in nhlt processing\n");
+
+       free(nhlt.ssp_params);
+       free(nhlt.dmic_params);
+
+       return 0;
+}
diff --git a/topology/nhlt/nhlt.h b/topology/nhlt/nhlt.h
new file mode 100644 (file)
index 0000000..c7d573a
--- /dev/null
@@ -0,0 +1,181 @@
+// SPDX-License-Identifier: BSD-3-Clause
+//
+// Copyright(c) 2021 Intel Corporation. All rights reserved.
+//
+// Author: Jaska Uimonen <jaska.uimonen@linux.intel.com>
+
+#ifndef __NHLT_H
+#define __NHLT_H
+
+#include <stdint.h>
+
+/*
+ * Nhlt defines and structs are derived from:
+ * https://01.org/sites/default/files/595976_intel_sst_nhlt.pdf
+ *
+ * Acpi description header for example:
+ * https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
+ *
+ * Idea is to generate similar blob as you would get from:
+ * 'cat /sys/firmware/acpi/tables/NHLT'
+ *
+ */
+#define        NHLT_LINK_TYPE_HDAUDIO 0
+#define NHLT_LINK_TYPE_DSP 1
+#define NHLT_LINK_TYPE_PDM 2
+#define NHLT_LINK_TYPE_SSP 3
+#define NHLT_LINK_TYPE_SLIMBUS 4
+#define NHLT_LINK_TYPE_SOUNDWIRE 5
+
+#define NHLT_VENDOR_ID_INTEL 0x8086
+
+#define NHLT_DEVICE_ID_INTEL_PDM_DMIC 0xAE20
+#define NHLT_DEVICE_ID_INTEL_BT_SIDEBAND 0xAE30
+#define NHLT_DEVICE_ID_INTEL_I2S_TDM 0xAE34
+
+#define NHLT_DEVICE_TYPE_SSP_BT_SIDEBAND 0
+#define NHLT_DEVICE_TYPE_SSP_FM 1
+#define NHLT_DEVICE_TYPE_SSP_MODEM 2
+#define NHLT_DEVICE_TYPE_SSP_ANALOG 4
+
+#define NHLT_ENDPOINT_DIRECTION_RENDER 0
+#define NHLT_ENDPOINT_DIRECTION_CAPTURE 1
+#define NHLT_ENDPOINT_DIRECTION_RENDER_WITH_LOOPBACK 2
+#define NHLT_ENDPOINT_DIRECTION_FEEDBACK_FOR_RENDER 3
+
+#define NHLT_DEVICE_CONFIG_TYPE_GENERIC 0
+#define NHLT_DEVICE_CONFIG_TYPE_MICARRAY 1
+#define NHLT_DEVICE_CONFIG_TYPE_RENDERWITHLOOPBACK 2
+#define NHLT_DEVICE_CONFIG_TYPE_RENDERFEEDBACK 3
+
+#define NHLT_MIC_ARRAY_TYPE_LINEAR_2_ELEMENT_SMALL 0xA
+#define NHLT_MIC_ARRAY_TYPE_LINEAR_2_ELEMENT_BIG 0xB
+#define NHLT_MIC_ARRAY_TYPE_LINEAR_4_ELEMENT_1ST_GEOMETRY 0xC
+#define NHLT_MIC_ARRAY_TYPE_PLANAR_4_ELEMENT_L_SHAPED 0xD
+#define NHLT_MIC_ARRAY_TYPE_PLANAR_4_ELEMENT_2ND_GEOMETRY 0xE
+#define NHLT_MIC_ARRAY_TYPE_VENDOR_DEFINED 0xF
+
+#define NHLT_MIC_ARRAY_NO_EXTENSION 0x0
+#define NHLT_MIC_ARRAY_SNR_AND_SENSITIVITY_EXTENSION 0x1
+
+#define NHLT_MIC_TYPE_OMNIDIRECTIONAL 0
+#define NHLT_MIC_TYPE_SUBCARDIOID 1
+#define NHLT_MIC_TYPE_CARDIOID 2
+#define NHLT_MIC_TYPE_SUPERCARDIOID 3
+#define NHLT_MIC_TYPE_HYPERCARDIOID 4
+#define NHLT_MIC_TYPE_8SHAPED 5
+#define NHLT_MIC_TYPE_RESERVED 6
+#define NHLT_MIC_TYPE_VENDORDEFINED 7
+
+#define NHLT_MIC_POSITION_TOP 0
+#define NHLT_MIC_POSITION_BOTTOM 1
+#define NHLT_MIC_POSITION_LEFT 2
+#define NHLT_MIC_POSITION_RIGHT 3
+#define NHLT_MIC_POSITION_FRONT 4 /*(default) */
+#define NHLT_MIC_POSITION_REAR 5
+
+struct specific_config {
+       uint32_t capabilities_size; /* does not include size of this field */
+       uint8_t capabilities[];
+} __attribute__((packed));
+
+struct device_specific_config {
+       uint8_t virtual_slot;
+       uint8_t config_type;
+} __attribute__((packed));
+
+struct ssp_device_specific_config {
+       struct specific_config config;
+       struct device_specific_config device_config;
+} __attribute__((packed));
+
+struct mic_snr_sensitivity_extension {
+       uint32_t snr;
+       uint32_t sensitivity;
+} __attribute__((packed));
+
+struct mic_vendor_config {
+       uint8_t type;
+       uint8_t panel;
+       uint32_t speaker_position_distance;
+       uint32_t horizontal_offset;
+       uint32_t vertical_offset;
+       uint8_t frequency_low_band;
+       uint8_t frequency_high_band;
+       uint16_t direction_angle;
+       uint16_t elevation_angle;
+       uint16_t vertical_angle_begin;
+       uint16_t vertical_angle_end;
+       uint16_t horizontal_angle_begin;
+       uint16_t horizontal_angle_end;
+} __attribute__((packed));
+
+struct mic_array_device_specific_config {
+       struct specific_config config;
+       struct device_specific_config device_config;
+       uint8_t array_type_ex;
+} __attribute__((packed));
+
+struct mic_array_device_specific_vendor_config {
+       struct specific_config config;
+       struct device_specific_config device_config;
+       uint8_t array_type_ex;
+       uint8_t number_of_microphones;
+       uint8_t mic_vendor_configs[];
+} __attribute__((packed));
+
+struct WAVEFORMATEXTENSIBLE {
+       uint16_t wFormatTag;
+       uint16_t nChannels;
+       uint32_t nSamplesPerSec;
+       uint32_t nAvgBytesPerSec;
+       uint16_t nBlockAlign;
+       uint16_t wBitsPerSample;
+       uint16_t cbSize;
+       uint16_t wValidBitsPerSample;
+       uint32_t dwChannelMask;
+       uint32_t SubFormat[4];
+} __attribute__((packed));
+
+struct format_config {
+       struct WAVEFORMATEXTENSIBLE format;
+       struct specific_config vendor_blob;
+} __attribute__((packed));
+
+struct formats_config {
+       uint8_t formats_count;
+       uint8_t f_configs[];
+} __attribute__((packed));
+
+struct endpoint_descriptor {
+       uint32_t length; /* includes the length of this field also */
+       uint8_t link_type;
+       uint8_t instance_id;
+       uint16_t vendor_id;
+       uint16_t device_id;
+       uint16_t revision_id;
+       uint32_t subsystem_id;
+       uint8_t device_type;
+       uint8_t direction;
+       uint8_t virtualbus_id;
+} __attribute__((packed));
+
+struct efi_acpi_description_header {
+       uint32_t signature;
+       uint32_t length;
+       uint8_t revision;
+       uint8_t checksum;
+       uint8_t oem_id[6];
+       uint64_t oem_table_id;
+       uint32_t oem_revision;
+       uint32_t creator_id;
+       uint32_t creator_revision;
+} __attribute__((packed));
+
+struct nhlt {
+       struct efi_acpi_description_header efi_acpi;
+       uint8_t endpoint_count;
+       uint8_t endpoints[];
+} __attribute__((packed));
+
+#endif /* __NHLT_H */
diff --git a/topology/pre-process-class.c b/topology/pre-process-class.c
new file mode 100644 (file)
index 0000000..bedcebe
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+  Copyright(c) 2021 Intel Corporation
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of version 2 of the GNU General Public License as
+  published by the Free Software Foundation.
+
+  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 St - Fifth Floor, Boston, MA 02110-1301 USA.
+  The full GNU General Public License is included in this distribution
+  in the file called LICENSE.GPL.
+*/
+#include "aconfig.h"
+#include <assert.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <alsa/asoundlib.h>
+#include "topology.h"
+#include "pre-processor.h"
+
+bool tplg_class_is_attribute_check(const char *attr, snd_config_t *class_cfg, char *category)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *cfg, *n;
+       int ret;
+
+       ret = snd_config_search(class_cfg, category, &cfg);
+       if (ret < 0)
+               return false;
+
+       snd_config_for_each(i, next, cfg) {
+               const char *id, *s;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (snd_config_get_string(n, &s) < 0)
+                       continue;
+
+               if (!strcmp(attr, s))
+                       return true;
+       }
+
+       return false;
+}
+
+/* check if attribute is mandatory */
+bool tplg_class_is_attribute_mandatory(const char *attr, snd_config_t *class_cfg)
+{
+       return tplg_class_is_attribute_check(attr, class_cfg, "attributes.mandatory");
+}
+
+/* check if attribute is immutable */
+bool tplg_class_is_attribute_immutable(const char *attr, snd_config_t *class_cfg)
+{
+       return tplg_class_is_attribute_check(attr, class_cfg, "attributes.immutable");
+}
+
+/* check if attribute is unique */
+bool tplg_class_is_attribute_unique(const char *attr, snd_config_t *class_cfg)
+{
+       snd_config_t *unique;
+       const char *s;
+       int ret;
+
+       ret = snd_config_search(class_cfg, "attributes.unique", &unique);
+       if (ret < 0)
+               return false;
+
+       if (snd_config_get_string(unique, &s) < 0)
+               return false;
+
+       if (!strcmp(attr, s))
+               return true;
+
+       return false;
+}
+
+/*
+ * Helper function to look up class definition from the Object config.
+ * ex: For an object declaration, Object.Widget.pga.0{}, return the config correspdonding to
+ * Class.Widget.pga{}. Note that input config , "cfg" does not include the "Object" node.
+ */
+snd_config_t *tplg_class_lookup(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg)
+{
+       snd_config_iterator_t first, end;
+       snd_config_t *class, *class_cfg = NULL;
+       const char *class_type, *class_name;
+       char *class_config_id;
+       int ret;
+
+       if (snd_config_get_id(cfg, &class_type) < 0)
+               return NULL;
+
+       first = snd_config_iterator_first(cfg);
+       end = snd_config_iterator_end(cfg);
+
+       if (first == end) {
+               SNDERR("No class name provided for object type: %s\n", class_type);
+               return NULL;
+       }
+
+       class = snd_config_iterator_entry(first);
+
+       if (snd_config_get_id(class, &class_name) < 0)
+               return NULL;
+
+       class_config_id = tplg_snprintf("Class.%s.%s", class_type, class_name);
+       if (!class_config_id)
+               return NULL;
+
+       ret = snd_config_search(tplg_pp->input_cfg, class_config_id, &class_cfg);
+       if (ret < 0)
+               SNDERR("No Class definition found for %s\n", class_config_id);
+
+       free(class_config_id);
+       return class_cfg;
+}
+
+/* find the attribute config by name in the class definition */
+snd_config_t *tplg_class_find_attribute_by_name(struct tplg_pre_processor *tplg_p ATTRIBUTE_UNUSED,
+                                               snd_config_t *class, const char *name)
+{
+       snd_config_t *attr = NULL;
+       const char *class_id;
+       char *attr_str;
+       int ret;
+
+       if (snd_config_get_id(class, &class_id) < 0)
+               return NULL;
+
+       attr_str = tplg_snprintf("DefineAttribute.%s", name);
+       if (!attr_str)
+               return NULL;
+
+       ret = snd_config_search(class, attr_str, &attr);
+       if (ret < 0)
+               SNDERR("No definition for attribute '%s' in class '%s'\n",
+                       name, class_id);
+
+       free(attr_str);
+       return attr;
+}
+
+/* get the name of the attribute that must have a unique value in the object instance */
+const char *tplg_class_get_unique_attribute_name(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                                snd_config_t *class)
+{
+       snd_config_t *unique;
+       const char *unique_name, *class_id;
+       int ret;
+
+       if (snd_config_get_id(class, &class_id) < 0)
+               return NULL;
+
+       ret = snd_config_search(class, "attributes.unique", &unique);
+       if (ret < 0) {
+               SNDERR("No unique attribute in class '%s'\n", class_id);
+               return NULL;
+       }
+
+       if (snd_config_get_string(unique, &unique_name) < 0) {
+               SNDERR("Invalid name for unique attribute in class '%s'\n", class_id);
+               return NULL;
+       }
+
+       return unique_name;
+}
+
+/* get attribute type from the definition */
+snd_config_type_t tplg_class_get_attribute_type(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                               snd_config_t *attr)
+{
+       snd_config_t *type;
+       const char *s;
+       int ret;
+
+       /* default to integer if no type is given */
+       ret = snd_config_search(attr, "type", &type);
+       if (ret < 0)
+               return SND_CONFIG_TYPE_INTEGER;
+
+       ret = snd_config_get_string(type, &s);
+       assert(ret >= 0);
+
+       if (!strcmp(s, "string"))
+               return SND_CONFIG_TYPE_STRING;
+
+       if (!strcmp(s, "compound"))
+               return SND_CONFIG_TYPE_COMPOUND;
+
+       if (!strcmp(s, "real"))
+               return SND_CONFIG_TYPE_REAL;
+
+       if (!strcmp(s, "integer64"))
+               return SND_CONFIG_TYPE_INTEGER64;
+
+       return SND_CONFIG_TYPE_INTEGER;
+}
+
+/* get token_ref for attribute with name attr_name in the class */
+const char *tplg_class_get_attribute_token_ref(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                              snd_config_t *class, const char *attr_name)
+{
+       snd_config_t *attributes, *attr, *token_ref;
+       const char *token;
+       int ret;
+
+       ret = snd_config_search(class, "DefineAttribute", &attributes);
+       if (ret < 0)
+               return NULL;
+
+       ret = snd_config_search(attributes, attr_name, &attr);
+       if (ret < 0)
+               return NULL;
+
+       ret = snd_config_search(attr, "token_ref", &token_ref);
+       if (ret < 0)
+               return NULL;
+
+       ret = snd_config_get_string(token_ref, &token);
+       if (ret < 0)
+               return NULL;
+
+       return token;
+}
+
+/* convert a valid attribute string value to the corresponding tuple value */
+long tplg_class_attribute_valid_tuple_value(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                           snd_config_t *class, snd_config_t *attr)
+{
+
+       snd_config_t *attributes, *cfg, *valid, *tuples, *n;
+       snd_config_iterator_t i, next;
+       const char *attr_name, *attr_value;
+       int ret;
+
+       ret = snd_config_get_id(attr, &attr_name);
+       if (ret < 0)
+               return -EINVAL;
+
+       ret = snd_config_get_string(attr, &attr_value);
+       if (ret < 0)
+               return -EINVAL;
+
+       /* find attribute definition in class */
+       ret = snd_config_search(class, "DefineAttribute", &attributes);
+       if (ret < 0)
+               return -EINVAL;
+
+
+       ret = snd_config_search(attributes, attr_name, &cfg);
+       if (ret < 0)
+               return -EINVAL;
+
+       /* check if it has valid values */
+       ret = snd_config_search(cfg, "constraints.valid_values", &valid);
+       if (ret < 0)
+               return -EINVAL;
+
+       ret = snd_config_search(cfg, "constraints.tuple_values", &tuples);
+       if (ret < 0)
+               return -EINVAL;
+
+       /* find and return the tuple value matching the attribute value id */
+       snd_config_for_each(i, next, valid) {
+               const char *s, *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_string(n, &s) < 0)
+                       continue;
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (!strcmp(attr_value, s)) {
+                       snd_config_t *tuple;
+                       long tuple_value;
+
+                       ret = snd_config_search(tuples, id, &tuple);
+                       if (ret < 0)
+                               return -EINVAL;
+
+                       ret = snd_config_get_integer(tuple, &tuple_value);
+                       if (ret < 0)
+                               return ret;
+
+                       return tuple_value;
+               }
+       }
+
+       return -EINVAL;
+}
diff --git a/topology/pre-process-dai.c b/topology/pre-process-dai.c
new file mode 100644 (file)
index 0000000..343ce81
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+  Copyright(c) 2021 Intel Corporation
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of version 2 of the GNU General Public License as
+  published by the Free Software Foundation.
+
+  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 St - Fifth Floor, Boston, MA 02110-1301 USA.
+  The full GNU General Public License is included in this distribution
+  in the file called LICENSE.GPL.
+*/
+#include "aconfig.h"
+#include <errno.h>
+#include <stdio.h>
+#include <alsa/asoundlib.h>
+#include "topology.h"
+#include "pre-processor.h"
+
+int tplg_build_hw_cfg_object(struct tplg_pre_processor *tplg_pp,
+                              snd_config_t *obj_cfg, snd_config_t *parent)
+{
+       snd_config_t *hw_cfg, *obj;
+       const char *name;
+       int ret;
+
+       obj = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+
+       name = tplg_object_get_name(tplg_pp, obj);
+       if (!name)
+               return -EINVAL;
+
+       ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &hw_cfg, NULL, false);
+       if (ret < 0)
+               return ret;
+
+       return tplg_parent_update(tplg_pp, parent, "hw_configs", name);
+}
+
+int tplg_build_fe_dai_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent)
+{
+       return tplg_build_base_object(tplg_pp, obj_cfg, parent, false);
+}
+
+static int tplg_update_pcm_object(struct tplg_pre_processor *tplg_pp,
+                              snd_config_t *obj_cfg, snd_config_t *parent)
+{
+       snd_config_t *top, *parent_obj, *obj, *dest, *cfg, *pcm, *child;
+       const char *parent_name, *item_name, *direction;
+       int ret;
+
+       /* get object name */
+       obj = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+       item_name = tplg_object_get_name(tplg_pp, obj);
+       if (!item_name)
+               return -EINVAL;
+
+       /* get direction */
+       ret = snd_config_search(obj, "direction", &cfg);
+       if (ret < 0) {
+               SNDERR("no direction attribute in %s\n", item_name);
+               return ret;
+       }
+
+       ret = snd_config_get_string(cfg, &direction);
+       if (ret < 0) {
+               SNDERR("Invalid direction attribute in %s\n", item_name);
+               return ret;
+       }
+
+       /* add to parent section */
+       top = tplg_object_get_section(tplg_pp, parent);
+       if (!top) {
+               SNDERR("Cannot find parent for %s\n", item_name);
+               return -EINVAL;
+       }
+
+       parent_obj = tplg_object_get_instance_config(tplg_pp, parent);
+
+       /* get parent name. if parent has no name, skip adding config */
+       parent_name = tplg_object_get_name(tplg_pp, parent_obj);
+       if (!parent_name)
+               return 0;
+
+       /* find parent config with name */
+       dest = tplg_find_config(top, parent_name);
+       if (!dest) {
+               SNDERR("Cannot find parent section %s\n", parent_name);
+               return -EINVAL;
+       }
+
+       ret = snd_config_search(dest, "pcm", &pcm);
+       if (ret < 0) {
+               ret = tplg_config_make_add(&pcm, "pcm", SND_CONFIG_TYPE_COMPOUND, dest);
+               if (ret < 0) {
+                       SNDERR("Error creating pcm config in %s\n", parent_name);
+                       return ret;
+               }
+       }
+
+       ret = snd_config_search(pcm, direction, &cfg);
+       if (ret >= 0) {
+               SNDERR("pcm.%s exists already in %s\n", direction, parent_name);
+               return -EEXIST;
+       }
+
+       ret = tplg_config_make_add(&cfg, direction, SND_CONFIG_TYPE_COMPOUND, pcm);
+
+       if (ret >= 0)
+       ret = tplg_config_make_add(&child, "capabilities", SND_CONFIG_TYPE_STRING, cfg);
+
+       if (ret >= 0)
+       ret = snd_config_set_string(child, item_name);
+
+       return ret;
+}
+
+int tplg_build_pcm_caps_object(struct tplg_pre_processor *tplg_pp,
+                              snd_config_t *obj_cfg, snd_config_t *parent)
+{
+       snd_config_t *caps;
+       int ret;
+
+       ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &caps, NULL, false);
+       if (ret < 0)
+               return ret;
+
+       /* add pcm capabilities to parent */
+       return tplg_update_pcm_object(tplg_pp, obj_cfg, parent);
+}
diff --git a/topology/pre-process-dapm.c b/topology/pre-process-dapm.c
new file mode 100644 (file)
index 0000000..78944a6
--- /dev/null
@@ -0,0 +1,451 @@
+/*
+  Copyright(c) 2021 Intel Corporation
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of version 2 of the GNU General Public License as
+  published by the Free Software Foundation.
+
+  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 St - Fifth Floor, Boston, MA 02110-1301 USA.
+  The full GNU General Public License is included in this distribution
+  in the file called LICENSE.GPL.
+*/
+#include <errno.h>
+#include <stdio.h>
+#include <alsa/asoundlib.h>
+#include "topology.h"
+#include "pre-processor.h"
+
+int tplg_build_base_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                          snd_config_t *parent, bool skip_name)
+{
+       snd_config_t *top, *parent_obj, *cfg, *dest;
+       const char *parent_name;
+
+       /* find parent section config */
+       top = tplg_object_get_section(tplg_pp, parent);
+       if (!top)
+               return -EINVAL;
+
+       parent_obj = tplg_object_get_instance_config(tplg_pp, parent);
+
+       /* get parent name */
+       parent_name = tplg_object_get_name(tplg_pp, parent_obj);
+       if (!parent_name)
+               return 0;
+
+       /* find parent config with name */
+       dest = tplg_find_config(top, parent_name);
+       if (!dest) {
+               SNDERR("Cannot find parent config %s\n", parent_name);
+               return -EINVAL;
+       }
+
+       /* build config from template and add to parent */
+       return tplg_build_object_from_template(tplg_pp, obj_cfg, &cfg, dest, skip_name);
+}
+
+int tplg_build_scale_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent)
+{
+       return tplg_build_base_object(tplg_pp, obj_cfg, parent, true);
+}
+
+int tplg_build_ops_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent)
+{
+       return tplg_build_base_object(tplg_pp, obj_cfg, parent, false);
+}
+
+int tplg_build_channel_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent)
+{
+       return tplg_build_base_object(tplg_pp, obj_cfg, parent, false);
+}
+
+int tplg_build_text_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                          snd_config_t *parent)
+{
+       snd_config_t *cfg;
+       const char *name;
+       int ret;
+
+       cfg = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+
+       name = tplg_object_get_name(tplg_pp, cfg);
+       if (!name)
+               return -EINVAL;
+
+       ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &cfg, NULL, false);
+       if (ret < 0)
+               return ret;
+
+       return tplg_parent_update(tplg_pp, parent, "texts", name);
+}
+
+int tplg_build_tlv_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent)
+{
+       snd_config_t *cfg;
+       const char *name;
+       int ret;
+
+       cfg = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+
+       name = tplg_object_get_name(tplg_pp, cfg);
+       if (!name)
+               return -EINVAL;
+
+       ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &cfg, NULL, false);
+       if (ret < 0)
+               return ret;
+
+       return tplg_parent_update(tplg_pp, parent, "tlv", name);
+}
+
+static int tplg_build_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent, char *type)
+{
+       snd_config_t *cfg, *obj;
+       const char *name;
+       int ret;
+
+       obj = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+
+       /* get control name */
+       ret = snd_config_search(obj, "name", &cfg);
+       if (ret < 0)
+               return 0;
+
+       ret = snd_config_get_string(cfg, &name);
+       if (ret < 0)
+               return ret;
+
+       ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &cfg, NULL, false);
+       if (ret < 0)
+               return ret;
+
+       ret = tplg_add_object_data(tplg_pp, obj_cfg, cfg, NULL);
+       if (ret < 0)
+               SNDERR("Failed to add data section for %s\n", name);
+
+       return tplg_parent_update(tplg_pp, parent, type, name);
+}
+
+int tplg_build_mixer_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent)
+{
+       return tplg_build_control(tplg_pp, obj_cfg, parent, "mixer");
+}
+
+int tplg_build_bytes_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent)
+{
+       return tplg_build_control(tplg_pp, obj_cfg, parent, "bytes");
+}
+
+int tplg_build_enum_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                            snd_config_t *parent)
+{
+       return tplg_build_control(tplg_pp, obj_cfg, parent, "enum");
+}
+
+/*
+ * Widget names for pipeline endpoints can be of the following type:
+ * "class.<constructor args separated by .> ex: pga.0.1, buffer.1.1 etc
+ * Optionally, the index argument for a widget can be omitted and will be substituted with
+ * the index from the route: ex: pga..0, host..playback etc
+ */
+static int tplg_pp_get_widget_name(struct tplg_pre_processor *tplg_pp,
+                                     const char *string, long index, char **widget)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *temp_cfg, *child, *class_cfg, *n;
+       char *class_name, *args, *widget_name;
+       int ret;
+
+       /* get class name */
+       args = strchr(string, '.');
+       if (!args) {
+               SNDERR("Error getting class name for %s\n", string);
+               return -EINVAL;
+       }
+
+       class_name = calloc(1, strlen(string) - strlen(args) + 1);
+       if (!class_name)
+               return -ENOMEM;
+
+       snprintf(class_name, strlen(string) - strlen(args) + 1, "%s", string);
+
+       /* create config with Widget class type */
+       ret = snd_config_make(&temp_cfg, "Widget", SND_CONFIG_TYPE_COMPOUND);
+       if (ret < 0) {
+               free(class_name);
+               return ret;
+       }
+
+       /* create config with class name and add it to the Widget config */
+       ret = tplg_config_make_add(&child, class_name, SND_CONFIG_TYPE_COMPOUND, temp_cfg);
+       if (ret < 0) {
+               free(class_name);
+               return ret;
+       }
+
+       /* get class definition for widget */
+       class_cfg = tplg_class_lookup(tplg_pp, temp_cfg);
+       snd_config_delete(temp_cfg);
+       if (!class_cfg) {
+               free(class_name);
+               return -EINVAL;
+       }
+
+       /* get constructor for class */
+       ret = snd_config_search(class_cfg, "attributes.constructor", &temp_cfg);
+       if (ret < 0) {
+               SNDERR("No arguments in class for widget %s\n", string);
+               free(class_name);
+               return ret;
+       }
+
+       widget_name = strdup(class_name);
+       free(class_name);
+       if (!widget_name)
+               return -ENOMEM;
+
+       /* construct widget name using the constructor argument values */
+       snd_config_for_each(i, next, temp_cfg) {
+               const char *id;
+               char *arg, *remaining, *temp;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_string(n, &id) < 0)
+                       continue;
+
+               if (!args) {
+                       SNDERR("insufficient arugments for widget %s\n", string);
+                       ret = -EINVAL;
+                       goto err;
+               }
+
+               remaining = strchr(args + 1, '.');
+               if (remaining) {
+                       arg = calloc(1, strlen(args + 1) - strlen(remaining) + 1);
+                       if (!arg) {
+                               ret = -ENOMEM;
+                               goto err;
+                       }
+                       snprintf(arg, strlen(args + 1) - strlen(remaining) + 1, "%s", args + 1);
+               } else {
+                       arg = calloc(1, strlen(args + 1) + 1);
+                       if (!arg) {
+                               ret = -ENOMEM;
+                               goto err;
+                       }
+
+                       snprintf(arg, strlen(args + 1) + 1, "%s", args + 1);
+               }
+
+               /* if no index provided, substitue with route index */
+               if (!strcmp(arg, "") && !strcmp(id, "index")) {
+                       free(arg);
+                       arg = tplg_snprintf("%ld", index);
+                       if (!arg) {
+                               ret = -ENOMEM;
+                               free(arg);
+                               goto err;
+                       }
+               }
+
+               temp = tplg_snprintf("%s.%s", widget_name, arg);
+               if (!temp) {
+                       ret = -ENOMEM;
+                       free(arg);
+                       goto err;
+               }
+
+               free(widget_name);
+               widget_name = temp;
+               free(arg);
+               if (remaining)
+                       args = remaining;
+               else
+                       args = NULL;
+       }
+
+       *widget = widget_name;
+       return 0;
+
+err:
+       free(widget_name);
+       return ret;
+}
+
+int tplg_build_dapm_route_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent)
+{
+       snd_config_t *top, *obj, *cfg, *route, *child, *parent_obj;
+       const char *name, *wname;
+       const char *parent_name = "Endpoint";
+       char *src_widget_name, *sink_widget_name, *line_str, *route_name;
+       const char *control = "";
+       long index = 0;
+       int ret;
+
+       obj = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+
+       ret = snd_config_get_id(obj, &name);
+       if (ret < 0)
+               return -EINVAL;
+
+       /* endpoint connections at the top-level conf have no parent */
+       if (parent) {
+               parent_obj = tplg_object_get_instance_config(tplg_pp, parent);
+
+               ret = snd_config_get_id(parent_obj, &parent_name);
+               if (ret < 0)
+                       return -EINVAL;
+       }
+
+       tplg_pp_debug("Building DAPM route object: '%s' ...", name);
+
+       ret = snd_config_search(tplg_pp->output_cfg, "SectionGraph", &top);
+       if (ret < 0) {
+               ret = tplg_config_make_add(&top, "SectionGraph",
+                                         SND_CONFIG_TYPE_COMPOUND, tplg_pp->output_cfg);
+               if (ret < 0) {
+                       SNDERR("Error creating 'SectionGraph' config\n");
+                       return ret;
+               }
+       }
+
+       /* get route index */
+       ret = snd_config_search(obj, "index", &cfg);
+       if (ret >= 0) {
+               ret = snd_config_get_integer(cfg, &index);
+               if (ret < 0) {
+                       SNDERR("Invalid index route %s\n", name);
+                       return ret;
+               }
+       }
+
+       /* get source widget name */
+       ret = snd_config_search(obj, "source", &cfg);
+       if (ret < 0) {
+               SNDERR("No source for route %s\n", name);
+               return ret;
+       }
+
+       ret = snd_config_get_string(cfg, &wname);
+       if (ret < 0) {
+               SNDERR("Invalid name for source in route %s\n", name);
+               return ret;
+       }
+
+       ret = tplg_pp_get_widget_name(tplg_pp, wname, index, &src_widget_name);
+       if (ret < 0) {
+               SNDERR("error getting widget name for %s\n", wname);
+               return ret;
+       }
+
+       /* get sink widget name */
+       ret = snd_config_search(obj, "sink", &cfg);
+       if (ret < 0) {
+               SNDERR("No sink for route %s\n", name);
+               free(src_widget_name);
+               return ret;
+       }
+
+       ret = snd_config_get_string(cfg, &wname);
+       if (ret < 0) {
+               SNDERR("Invalid name for sink in route %s\n", name);
+               free(src_widget_name);
+               return ret;
+       }
+
+       ret = tplg_pp_get_widget_name(tplg_pp, wname, index, &sink_widget_name);
+       if (ret < 0) {
+               SNDERR("error getting widget name for %s\n", wname);
+               free(src_widget_name);
+               return ret;
+       }
+
+       /* get control name */
+       ret = snd_config_search(obj, "control", &cfg);
+       if (ret >= 0) {
+               ret = snd_config_get_string(cfg, &control);
+               if (ret < 0) {
+                       SNDERR("Invalid control name for route %s\n", name);
+                       goto err;
+               }
+       }
+
+       /* add route */
+       route_name = tplg_snprintf("%s.%s", parent_name, name);
+       if (!route_name) {
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       ret = snd_config_make(&route, route_name, SND_CONFIG_TYPE_COMPOUND);
+       free(route_name);
+       if (ret < 0) {
+               SNDERR("Error creating route config for %s %d\n", name, ret);
+               goto err;
+       }
+
+       ret = snd_config_add(top, route);
+       if (ret < 0) {
+               SNDERR("Error adding route config for %s %d\n", name, ret);
+               goto err;
+       }
+
+       /* add index */
+       ret = tplg_config_make_add(&child, "index", SND_CONFIG_TYPE_INTEGER, route);
+       if (ret < 0) {
+               SNDERR("Error creating index config for %s\n", name);
+               goto err;
+       }
+
+       ret = snd_config_set_integer(child, index);
+       if (ret < 0) {
+               SNDERR("Error setting index config for %s\n", name);
+               goto err;
+       }
+
+       /* add lines */
+       ret = tplg_config_make_add(&cfg, "lines", SND_CONFIG_TYPE_COMPOUND, route);
+       if (ret < 0) {
+               SNDERR("Error creating lines config for %s\n", name);
+               goto err;
+       }
+
+       /* add route string */
+       ret = tplg_config_make_add(&child, "0", SND_CONFIG_TYPE_STRING, cfg);
+       if (ret < 0) {
+               SNDERR("Error creating lines config for %s\n", name);
+               goto err;
+       }
+
+       line_str = tplg_snprintf("%s, %s, %s", sink_widget_name, control, src_widget_name);
+       if (!line_str) {
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       /* set the line string */
+       ret = snd_config_set_string(child, line_str);
+       free(line_str);
+       if (ret < 0)
+               SNDERR("Error creating lines config for %s\n", name);
+err:
+       free(src_widget_name);
+       free(sink_widget_name);
+       return ret;
+}
diff --git a/topology/pre-process-external.h b/topology/pre-process-external.h
new file mode 100644 (file)
index 0000000..9d930ef
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ *   This library is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Lesser General Public License as
+ *   published by the Free Software Foundation; either version 2.1 of
+ *   the License, or (at your option) any later version.
+ *
+ *   This 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 Lesser General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Lesser General Public
+ *   License along with this library; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+#ifndef __PRE_PROCESS_EXTERNAL_H
+#define __PRE_PROCESS_EXTERNAL_H
+
+#define PROCESS_FUNC_PREFIX "_snd_topology_"
+#define PROCESS_FUNC_POSTFIX "_process"
+#define PROCESS_LIB_PREFIX "libalsatplg_module_"
+#define PROCESS_LIB_POSTFIX ".so"
+
+/**
+ * Define the object entry for external pre-process plugins
+ */
+#define SND_TOPOLOGY_PLUGIN_ENTRY(name) _snd_topology_##name##_process
+
+/**
+ * Define the plugin
+ */
+#define SND_TOPOLOGY_PLUGIN_DEFINE_FUNC(plugin) \
+       __attribute__ ((visibility ("default"))) \
+       int SND_TOPOLOGY_PLUGIN_ENTRY(plugin) (snd_config_t *input, snd_config_t *output)
+
+typedef int (*plugin_pre_process)(snd_config_t *input, snd_config_t *output);
+
+#endif /* __PRE_PROCESS_EXTERNAL_H */
diff --git a/topology/pre-process-object.c b/topology/pre-process-object.c
new file mode 100644 (file)
index 0000000..de088a6
--- /dev/null
@@ -0,0 +1,2094 @@
+/*
+  Copyright(c) 2021 Intel Corporation
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of version 2 of the GNU General Public License as
+  published by the Free Software Foundation.
+
+  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 St - Fifth Floor, Boston, MA 02110-1301 USA.
+  The full GNU General Public License is included in this distribution
+  in the file called LICENSE.GPL.
+*/
+#include "aconfig.h"
+#include <assert.h>
+#include <errno.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <alsa/asoundlib.h>
+#include "gettext.h"
+#include "topology.h"
+#include "pre-processor.h"
+
+/* Parse VendorToken object, create the "SectionVendorToken" and save it */
+int tplg_build_vendor_token_object(struct tplg_pre_processor *tplg_pp,
+                                  snd_config_t *obj_cfg,
+                                  snd_config_t *parent ATTRIBUTE_UNUSED)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *vtop, *n, *obj;
+       const char *name;
+       int ret;
+
+       ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &vtop, NULL, false);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_get_id(vtop, &name);
+       if (ret < 0)
+               return ret;
+
+       /* add the tuples */
+       obj = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+       snd_config_for_each(i, next, obj) {
+               snd_config_t *dst;
+               const char *id;
+
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (!strcmp(id, "name"))
+                       continue;
+
+               ret = snd_config_copy(&dst, n);
+               if (ret < 0) {
+                       SNDERR("Error copying config node %s for '%s'\n", id, name);
+                       return ret;
+               }
+
+               ret = snd_config_add(vtop, dst);
+               if (ret < 0) {
+                       snd_config_delete(dst);
+                       SNDERR("Error adding vendortoken %s for %s\n", id, name);
+                       return ret;
+               }
+       }
+
+       return ret;
+}
+
+int tplg_parent_update(struct tplg_pre_processor *tplg_pp, snd_config_t *parent,
+                         const char *section_name, const char *item_name)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *child, *cfg, *top, *item_config, *n;
+       const char *parent_name;
+       char *item_id;
+       int ret, id = 0;
+
+       /* Nothing to do if parent is NULL */
+       if (!parent)
+               return 0;
+
+       child = tplg_object_get_instance_config(tplg_pp, parent);
+       ret = snd_config_search(child, "name", &cfg);
+       if (ret < 0) {
+               ret = snd_config_get_id(child, &parent_name);
+               if (ret < 0) {
+                       SNDERR("No name config for parent\n");
+                       return ret;
+               }
+       } else {
+               ret = snd_config_get_string(cfg, &parent_name);
+               if (ret < 0) {
+                       SNDERR("Invalid name for parent\n");
+                       return ret;
+               }
+       }
+
+       top = tplg_object_get_section(tplg_pp, parent);
+       if (!top)
+               return -EINVAL;
+
+       /* get config with name */
+       cfg = tplg_find_config(top, parent_name);
+       if (!cfg)
+               return ret;
+
+       /* get section config */
+       if (!strcmp(section_name, "tlv") || !strcmp(section_name, "texts")) {
+               /* set tlv name if config exists already */
+               ret = snd_config_search(cfg, section_name, &item_config);
+                       if (ret < 0) {
+                       ret = tplg_config_make_add(&item_config, section_name,
+                                                 SND_CONFIG_TYPE_STRING, cfg);
+                       if (ret < 0) {
+                               SNDERR("Error creating section config widget %s for %s\n",
+                                      section_name, parent_name);
+                               return ret;
+                       }
+               }
+
+               return snd_config_set_string(item_config, item_name);
+       }
+
+       ret = snd_config_search(cfg, section_name, &item_config);
+       if (ret < 0) {
+               ret = tplg_config_make_add(&item_config, section_name,
+                                         SND_CONFIG_TYPE_COMPOUND, cfg);
+               if (ret < 0) {
+                       SNDERR("Error creating section config widget %s for %s\n",
+                              section_name, parent_name);
+                       return ret;
+               }
+       }
+
+       snd_config_for_each(i, next, item_config) {
+               const char *name;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_string(n, &name) < 0)
+                       continue;
+
+               /* item already exists */
+               if (!strcmp(name, item_name))
+                       return 0;
+               id++;
+       }
+
+       /* add new item */
+       item_id = tplg_snprintf("%d", id);
+       if (!item_id)
+               return -ENOMEM;
+
+       ret = snd_config_make(&cfg, item_id, SND_CONFIG_TYPE_STRING);
+       free(item_id);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_set_string(cfg, item_name);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_add(item_config, cfg);
+       if (ret < 0)
+               snd_config_delete(cfg);
+
+       return ret;
+}
+
+/* Parse data object, create the "SectionData" and save it. Only "bytes" data supported for now */
+int tplg_build_data_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                           snd_config_t *parent)
+{
+       snd_config_t *dtop;
+       const char *name;
+       int ret;
+
+       ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &dtop, NULL, false);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_get_id(dtop, &name);
+       if (ret < 0)
+               return ret;
+
+       return tplg_parent_update(tplg_pp, parent, "data", name);
+}
+
+static int tplg_create_config_template(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                      snd_config_t **template,
+                                      const struct config_template_items *items)
+{
+       snd_config_t *top, *child;
+       int ret, i;
+
+       ret = snd_config_make(&top, "template", SND_CONFIG_TYPE_COMPOUND);
+       if (ret < 0)
+               return ret;
+
+       /* add integer configs */
+       for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
+               if (items->int_config_ids[i]) {
+                       ret = tplg_config_make_add(&child, items->int_config_ids[i],
+                                                  SND_CONFIG_TYPE_INTEGER, top);
+                       if (ret < 0)
+                               goto err;
+               }
+
+       /* add string configs */
+       for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++)
+               if (items->string_config_ids[i]) {
+                       ret = tplg_config_make_add(&child, items->string_config_ids[i],
+                                                  SND_CONFIG_TYPE_STRING, top);
+                       if (ret < 0)
+                               goto err;
+               }
+
+       /* add compound configs */
+       for (i = 0; i < MAX_CONFIGS_IN_TEMPLATE; i++) {
+               if (items->compound_config_ids[i]) {
+                       ret = tplg_config_make_add(&child, items->compound_config_ids[i],
+                                                  SND_CONFIG_TYPE_COMPOUND, top);
+                       if (ret < 0)
+                               goto err;
+               }
+       }
+
+err:
+       if (ret < 0) {
+               snd_config_delete(top);
+               return ret;
+       }
+
+       *template = top;
+       return ret;
+}
+
+static void tplg_attribute_print_valid_values(snd_config_t *valid_values, const char *name)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *n;
+
+       SNDERR("valid values for attribute %s are:\n", name);
+
+       snd_config_for_each(i, next, valid_values) {
+               const char *s, *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (snd_config_get_string(n, &s) < 0)
+                       continue;
+
+               SNDERR("%s", s);
+       }
+}
+
+/* check is attribute value belongs in the set of valid values */
+static bool tplg_is_attribute_valid_value(snd_config_t *valid_values, const char *value)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *n;
+
+       snd_config_for_each(i, next, valid_values) {
+               const char *s, *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (snd_config_get_string(n, &s) < 0)
+                       continue;
+
+               if (!strcmp(value, s))
+                       return true;
+       }
+
+       return false;
+}
+
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+static int pre_process_find_variable(snd_config_t **dst, const char *str, snd_config_t *config);
+
+/* check is attribute value belongs in the set of valid values after expanding the valid values */
+static bool tplg_is_attribute_valid_expanded_value(struct tplg_pre_processor *tplg_pp,
+                                                  snd_config_t *valid_values, int value)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *n, *var, *conf_defines;
+       int ret;
+
+       ret = snd_config_search(tplg_pp->input_cfg, "Define", &conf_defines);
+       if (ret < 0)
+               return false;
+
+       snd_config_for_each(i, next, valid_values) {
+               const char *s, *id;
+               long v;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (snd_config_get_string(n, &s) < 0)
+                       continue;
+
+               if (s[0] != '$')
+                       continue;
+
+               /* find the variable definition */
+               ret = pre_process_find_variable(&var, s + 1, conf_defines);
+               if (ret < 0) {
+                       SNDERR("No definition for variable %s\n", s + 1);
+                       return false;
+               }
+
+               if (snd_config_get_integer(var, &v) < 0) {
+                       SNDERR("Invalid definition for %s\n", s);
+                       snd_config_delete(var);
+                       return false;
+               }
+
+               snd_config_delete(var);
+
+               if (value == v)
+                       return true;
+       }
+
+       return false;
+}
+#endif
+
+/* check if attribute value passes the min/max value constraints */
+static bool tplg_object_is_attribute_min_max_valid(snd_config_t *attr, snd_config_t *obj_attr,
+                                                  bool min_check)
+{
+       snd_config_type_t type = snd_config_get_type(obj_attr);
+       snd_config_t *valid;
+       const char *attr_name;
+       int ret;
+
+       if (snd_config_get_id(attr, &attr_name) < 0)
+               return false;
+
+       if (min_check) {
+               ret = snd_config_search(attr, "constraints.min", &valid);
+               if (ret < 0)
+                       return true;
+       } else {
+               ret = snd_config_search(attr, "constraints.max", &valid);
+               if (ret < 0)
+                       return true;
+       }
+
+       switch(type) {
+       case SND_CONFIG_TYPE_INTEGER:
+       {
+               long v, m;
+
+               if (snd_config_get_integer(valid, &m) < 0)
+                       return true;
+
+               if (snd_config_get_integer(obj_attr, &v) < 0)
+                       return false;
+
+               if (min_check) {
+                       if (v < m) {
+                               SNDERR("attribute '%s' value: %ld is less than min value: %d\n",
+                                      attr_name, v, m);
+                               return false;
+                       }
+               } else {
+                       if (v > m) {
+                               SNDERR("attribute '%s' value: %ld is greater than max value: %d\n",
+                                      attr_name, v, m);
+                               return false;
+                       }
+               }
+
+               return true;
+       }
+       case SND_CONFIG_TYPE_INTEGER64:
+       {
+               long long v;
+               long m;
+
+               if (snd_config_get_integer(valid, &m) < 0)
+                       return true;
+
+               if (snd_config_get_integer64(obj_attr, &v) < 0)
+                       return false;
+
+               if (min_check) {
+                       if (v < m) {
+                               SNDERR("attribute '%s' value: %ld is less than min value: %d\n",
+                                      attr_name, v, m);
+                               return false;
+                       }
+               } else {
+                       if (v > m) {
+                               SNDERR("attribute '%s' value: %ld is greater than max value: %d\n",
+                                      attr_name, v, m);
+                               return false;
+                       }
+               }
+
+               return true;
+       }
+       default:
+               break;
+       }
+
+       return false;
+}
+
+/* check for min/max and valid value constraints */
+static bool tplg_object_is_attribute_valid(struct tplg_pre_processor *tplg_pp,
+                                          snd_config_t *attr, snd_config_t *obj_attr)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *valid, *n;
+       snd_config_type_t type;
+       const char *attr_name, *obj_value;
+       int ret;
+
+       if (snd_config_get_id(attr, &attr_name) < 0)
+               return false;
+
+       type = snd_config_get_type(obj_attr);
+
+       /* check if attribute has valid values */
+       ret = snd_config_search(attr, "constraints.valid_values", &valid);
+       if (ret < 0)
+               goto min_max_check;
+
+       switch(type) {
+       case SND_CONFIG_TYPE_STRING:
+               if (snd_config_get_string(obj_attr, &obj_value) < 0)
+                       return false;
+               if (!tplg_is_attribute_valid_value(valid, obj_value)) {
+                       tplg_attribute_print_valid_values(valid, attr_name);
+                       return false;
+               }
+               return true;
+       case SND_CONFIG_TYPE_COMPOUND:
+               snd_config_for_each(i, next, obj_attr) {
+                       const char *s, *id;
+
+                       n = snd_config_iterator_entry(i);
+                       if (snd_config_get_id(n, &id) < 0)
+                               continue;
+
+                       if (snd_config_get_string(n, &s) < 0)
+                               continue;
+
+                       if (!tplg_is_attribute_valid_value(valid, s)) {
+                               tplg_attribute_print_valid_values(valid, attr_name);
+                               return false;
+                       }
+               }
+               return true;
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+       case SND_CONFIG_TYPE_INTEGER:
+       {
+               long v;
+
+               if (snd_config_get_integer(obj_attr, &v) < 0)
+                       return false;
+
+               if (!tplg_is_attribute_valid_expanded_value(tplg_pp, valid, v)) {
+                       tplg_attribute_print_valid_values(valid, attr_name);
+                       return false;
+               }
+               return true;
+       }
+#endif
+       default:
+               break;
+       }
+
+       return false;
+
+min_max_check:
+       if (!tplg_object_is_attribute_min_max_valid(attr, obj_attr, true))
+               return false;
+
+       return tplg_object_is_attribute_min_max_valid(attr, obj_attr, false);
+}
+
+/* get object's name attribute value */
+const char *tplg_object_get_name(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                snd_config_t *object)
+{
+       snd_config_t *cfg;
+       const char *name;
+       int ret;
+
+       ret = snd_config_search(object, "name", &cfg);
+       if (ret < 0)
+               return NULL;
+
+       ret = snd_config_get_string(cfg, &name);
+       if (ret < 0)
+               return NULL;
+
+       return name;
+}
+
+/* look up the instance of object in a config */
+static snd_config_t *tplg_object_lookup_in_config(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                                 snd_config_t *class, const char *type,
+                                                 const char *class_name, const char *id)
+{
+       snd_config_t *obj_cfg = NULL;
+       char *config_id;
+
+       config_id = tplg_snprintf("Object.%s.%s.%s", type, class_name, id);
+       if (!config_id)
+               return NULL;
+
+       if (snd_config_search(class, config_id, &obj_cfg) < 0)
+               return NULL;
+       free(config_id);
+       return obj_cfg;
+}
+
+static int tplg_pp_add_object_tuple_section(struct tplg_pre_processor *tplg_pp,
+                                           snd_config_t *class_cfg,
+                                           snd_config_t *attr, char *data_name,
+                                           const char *token_ref, const char *array_name)
+{
+       snd_config_t *top, *tuple_cfg, *child, *cfg, *new;
+       const char *id;
+       char *token, *type, *str;
+       long tuple_value;
+       int ret;
+
+       tplg_pp_debug("Building vendor tuples section: '%s' ...", data_name);
+
+       ret = snd_config_search(tplg_pp->output_cfg, "SectionVendorTuples", &top);
+       if (ret < 0) {
+               ret = tplg_config_make_add(&top, "SectionVendorTuples",
+                                         SND_CONFIG_TYPE_COMPOUND, tplg_pp->output_cfg);
+               if (ret < 0) {
+                       SNDERR("Error creating SectionVendorTuples config\n");
+                       return ret;
+               }
+       }
+
+       type = strchr(token_ref, '.');
+       if(!type) {
+               SNDERR("Error getting type for %s\n", token_ref);
+               return -EINVAL;
+       }
+
+       token = calloc(1, strlen(token_ref) - strlen(type) + 1);
+       if (!token)
+               return -ENOMEM;
+       snprintf(token, strlen(token_ref) - strlen(type) + 1, "%s", token_ref);
+
+       if (!array_name)
+               str = strdup(type + 1);
+       else
+               str = tplg_snprintf("%s.%s", type + 1, array_name);
+       if (!str) {
+               ret = -ENOMEM;
+               goto free;
+       }
+
+       tuple_cfg = tplg_find_config(top, data_name);
+       if (!tuple_cfg) {
+               /* add new SectionVendorTuples */
+               ret = tplg_config_make_add(&tuple_cfg, data_name, SND_CONFIG_TYPE_COMPOUND, top);
+               if (ret < 0) {
+                       SNDERR("Error creating new vendor tuples config %s\n", data_name);
+                       goto err;
+               }
+
+               ret = tplg_config_make_add(&child, "tokens", SND_CONFIG_TYPE_STRING,
+                                         tuple_cfg);
+               if (ret < 0) {
+                       SNDERR("Error creating tokens config for '%s'\n", data_name);
+                       goto err;
+               }
+
+               ret = snd_config_set_string(child, token);
+               if (ret < 0) {
+                       SNDERR("Error setting tokens config for '%s'\n", data_name);
+                       goto err;
+               }
+
+               ret = tplg_config_make_add(&child, "tuples", SND_CONFIG_TYPE_COMPOUND,
+                                         tuple_cfg);
+               if (ret < 0) {
+                       SNDERR("Error creating tuples config for '%s'\n", data_name);
+                       goto err;
+               }
+
+               ret = tplg_config_make_add(&cfg, str, SND_CONFIG_TYPE_COMPOUND,
+                                         child);
+               if (ret < 0) {
+                       SNDERR("Error creating tuples type config for '%s'\n", data_name);
+                       goto err;
+               }
+       } else {
+               snd_config_t *tuples_cfg;
+
+               ret = snd_config_search(tuple_cfg, "tuples" , &tuples_cfg);
+               if (ret < 0) {
+                       SNDERR("can't find tuples config in %s\n", data_name);
+                       goto err;
+               }
+
+               cfg = tplg_find_config(tuples_cfg, str);
+               if (!cfg) {
+                       ret = tplg_config_make_add(&cfg, str, SND_CONFIG_TYPE_COMPOUND,
+                                                 tuples_cfg);
+                       if (ret < 0) {
+                               SNDERR("Error creating tuples config for '%s' and type name %s\n", data_name, str);
+                               goto err;
+                       }
+               }
+       }
+
+       ret = snd_config_get_id(attr, &id);
+       if (ret < 0)
+               goto err;
+
+       /* tuple exists already? */
+       ret = snd_config_search(cfg, id, &child);
+       if (ret >=0)
+               goto err;
+
+       /* add attribute to tuples */
+       tuple_value = tplg_class_attribute_valid_tuple_value(tplg_pp, class_cfg, attr);
+       if (tuple_value < 0) {
+               /* just copy attribute cfg as is */
+               ret = snd_config_copy(&new, attr);
+               if (ret < 0) {
+                       SNDERR("can't copy attribute for %s\n", data_name);
+                       goto err;
+               }
+       } else {
+               ret = snd_config_make(&new, id, SND_CONFIG_TYPE_INTEGER);
+               if (ret < 0)
+                       goto err;
+
+               ret = snd_config_set_integer(new, tuple_value);
+               if (ret < 0)
+                       goto err;
+       }
+
+       ret = snd_config_add(cfg, new);
+err:
+       free(str);
+free:
+       free(token);
+       return ret;
+}
+
+static int tplg_pp_add_object_data_section(struct tplg_pre_processor *tplg_pp,
+                                          snd_config_t *obj_data, char *data_name)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *top, *data_cfg, *child;
+       char *data_id;
+       int ret, id = 0;
+
+       ret = snd_config_search(tplg_pp->output_cfg, "SectionData", &top);
+       if (ret < 0) {
+               ret = tplg_config_make_add(&top, "SectionData", SND_CONFIG_TYPE_COMPOUND,
+                                         tplg_pp->output_cfg);
+               if (ret < 0) {
+                       SNDERR("Failed to add SectionData\n");
+                       return ret;
+               }
+       }
+
+       /* nothing to do if data section already exists */
+       data_cfg = tplg_find_config(top, data_name);
+       if (data_cfg)
+               return 0;
+
+       tplg_pp_debug("Building data section %s ...", data_name);
+
+       /* add new SectionData */
+       ret = tplg_config_make_add(&data_cfg, data_name, SND_CONFIG_TYPE_COMPOUND, top);
+       if (ret < 0)
+               return ret;
+
+       ret = tplg_config_make_add(&child, "tuples", SND_CONFIG_TYPE_STRING, data_cfg);
+       if (ret < 0) {
+               SNDERR("error adding data ref for %s\n", data_name);
+               return ret;
+       }
+
+       ret = snd_config_set_string(child, data_name);
+       if (ret < 0) {
+               SNDERR("error setting tuples ref for %s\n", data_name);
+               return ret;
+       }
+
+       /* add data item to object */
+       snd_config_for_each(i, next, obj_data)
+               id++;
+
+       data_id = tplg_snprintf("%d", id);
+       if (!data_id)
+               return -ENOMEM;
+
+       ret = tplg_config_make_add(&child, data_id, SND_CONFIG_TYPE_STRING, obj_data);
+       free(data_id);
+       if (ret < 0) {
+               SNDERR("error adding data ref %s\n", data_name);
+               return ret;
+       }
+
+       return snd_config_set_string(child, data_name);
+}
+
+int tplg_add_object_data(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                        snd_config_t *top, const char *array_name)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *data_cfg, *class_cfg, *n, *obj;
+       const char *object_id;
+       int ret;
+
+       if (snd_config_get_id(top, &object_id) < 0)
+               return 0;
+
+       obj = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+
+       class_cfg = tplg_class_lookup(tplg_pp, obj_cfg);
+       if (!class_cfg)
+               return -EINVAL;
+
+       /* add data config to top */
+       ret = snd_config_search(top, "data", &data_cfg);
+       if (ret < 0) {
+               ret = tplg_config_make_add(&data_cfg, "data", SND_CONFIG_TYPE_COMPOUND, top);
+               if (ret < 0) {
+                       SNDERR("error creating data config for %s\n", object_id);
+                       return ret;
+               }
+       }
+
+       /* add data items to object's data section */
+       snd_config_for_each(i, next, obj) {
+               const char *id, *token;
+               char *data_cfg_name;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               token = tplg_class_get_attribute_token_ref(tplg_pp, class_cfg, id);
+               if (!token)
+                       continue;
+
+               data_cfg_name = tplg_snprintf("%s.%s", object_id, token);
+               if (!data_cfg_name)
+                       return -ENOMEM;
+
+               ret = tplg_pp_add_object_data_section(tplg_pp, data_cfg, data_cfg_name);
+               if (ret < 0) {
+                       SNDERR("Failed to add data section %s\n", data_cfg_name);
+                       free(data_cfg_name);
+                       return ret;
+               }
+
+               ret = tplg_pp_add_object_tuple_section(tplg_pp, class_cfg, n, data_cfg_name,
+                                                      token, array_name);
+               if (ret < 0) {
+                       SNDERR("Failed to add data section %s\n", data_cfg_name);
+                       free(data_cfg_name);
+                       return ret;
+               }
+               free(data_cfg_name);
+       }
+
+       return 0;
+}
+
+/* search for all template configs in the source config and copy them to the destination */
+static int tplg_object_add_attributes(snd_config_t *dst, snd_config_t *template,
+                                     snd_config_t *src)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *n;
+       int ret;
+
+       snd_config_for_each(i, next, template) {
+               snd_config_t *attr, *new;
+               const char *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               ret = snd_config_search(src, id, &attr);
+               if (ret < 0)
+                       continue;
+
+               /* skip if attribute is already set */
+               ret = snd_config_search(dst, id, &new);
+               if (ret >= 0)
+                       continue;
+
+               ret = snd_config_copy(&new, attr);
+               if (ret < 0) {
+                       SNDERR("failed to copy attribute %s\n", id);
+                       return ret;
+               }
+
+               ret = snd_config_add(dst, new);
+               if (ret < 0) {
+                       snd_config_delete(new);
+                       SNDERR("failed to add attribute %s\n", id);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+static const struct build_function_map *tplg_object_get_map(struct tplg_pre_processor *tplg_pp,
+                                                           snd_config_t *obj);
+
+/* Add object attributes to the private data of the parent object config */
+static int tplg_build_parent_data(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                                 snd_config_t *parent)
+{
+       snd_config_t *obj, *parent_obj, *section_cfg, *top;
+       const struct build_function_map *map;
+       const char *id, *parent_id;
+       int ret;
+
+       /* nothing to do if parent is NULL */
+       if (!parent)
+               return 0;
+
+       obj = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+       parent_obj = tplg_object_get_instance_config(tplg_pp, parent);
+
+       /* get object ID */
+       if (snd_config_get_id(obj, &id) < 0) {
+               SNDERR("Invalid ID for object\n");
+               return -EINVAL;
+       }
+
+       /* get parent object name or ID */
+       parent_id = tplg_object_get_name(tplg_pp, parent_obj);
+       if (!parent_id) {
+               ret = snd_config_get_id(parent_obj, &parent_id);
+               if (ret < 0) {
+                       SNDERR("Invalid ID for parent of object %s\n", id);
+                       return ret;
+               }
+       }
+
+       map = tplg_object_get_map(tplg_pp, parent);
+       if (!map) {
+               SNDERR("Parent object %s not supported\n", parent_id);
+               return -EINVAL;
+       }
+
+       /* find parent config with ID */
+       ret = snd_config_search(tplg_pp->output_cfg, map->section_name, &section_cfg);
+       if (ret < 0) {
+               SNDERR("No SectionBE found\n");
+               return ret;
+       }
+
+       top = tplg_find_config(section_cfg, parent_id);
+       if (!top) {
+               SNDERR("SectionBE %s not found\n", parent_id);
+               return -EINVAL;
+       }
+
+       return tplg_add_object_data(tplg_pp, obj_cfg, top, id);
+}
+
+/*
+ * Function to create a new "section" config based on the template. The new config will be
+ * added to the output_cfg or the top_config input parameter.
+ */
+int tplg_build_object_from_template(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                                   snd_config_t **wtop, snd_config_t *top_config,
+                                   bool skip_name)
+{
+       snd_config_t *top, *template, *obj;
+       const struct build_function_map *map;
+       const char *object_name;
+       int ret;
+
+       /* look up object map */
+       map = tplg_object_get_map(tplg_pp, obj_cfg);
+       if (!map) {
+               SNDERR("unknown object type or class name\n");
+               return -EINVAL;
+       }
+
+       obj = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+
+       /* look up or create the corresponding section config for object */
+       if (!top_config)
+               top_config = tplg_pp->output_cfg;
+
+       ret = snd_config_search(top_config, map->section_name, &top);
+       if (ret < 0) {
+               ret = tplg_config_make_add(&top, map->section_name, SND_CONFIG_TYPE_COMPOUND,
+                                          top_config);
+               if (ret < 0) {
+                       SNDERR("Error creating %s config\n", map->section_name);
+                       return ret;
+               }
+       }
+
+       /* get object name */
+       object_name = tplg_object_get_name(tplg_pp, obj);
+       if (!object_name) {
+               ret = snd_config_get_id(obj, &object_name);
+               if (ret < 0) {
+                       SNDERR("Invalid ID for %s\n", map->section_name);
+                       return ret;
+               }
+       }
+
+       tplg_pp_debug("Building object: '%s' ...", object_name);
+
+       /* create and add new object config with name, if needed */
+       if (skip_name) {
+               *wtop = top;
+       } else {
+               *wtop = tplg_find_config(top, object_name);
+               if (*wtop)
+                       goto template;
+
+               ret = tplg_config_make_add(wtop, object_name, SND_CONFIG_TYPE_COMPOUND,
+                                          top);
+               if (ret < 0) {
+                       SNDERR("Error creating config for %s\n", object_name);
+                       return ret;
+               }
+       }
+
+template:
+       /* create template config */
+       if (!map->template_items)
+               return 0;
+
+       ret = tplg_create_config_template(tplg_pp, &template, map->template_items);
+       if (ret < 0) {
+               SNDERR("Error creating template config for %s\n", object_name);
+               return ret;
+       }
+
+       /* update section config based on template and the attribute values in the object */
+       ret = tplg_object_add_attributes(*wtop, template, obj);
+       snd_config_delete(template);
+       if (ret < 0)
+               SNDERR("Error adding attributes for object '%s'\n", object_name);
+
+       return ret;
+}
+
+static int tplg_build_generic_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                                    snd_config_t *parent ATTRIBUTE_UNUSED)
+{
+       snd_config_t *wtop;
+       const char *name;
+       int ret;
+
+       ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &wtop, NULL, false);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_get_id(wtop, &name);
+       if (ret < 0)
+               return ret;
+
+       ret = tplg_add_object_data(tplg_pp, obj_cfg, wtop, NULL);
+       if (ret < 0)
+               SNDERR("Failed to add data section for %s\n", name);
+
+       return ret;
+}
+
+const struct config_template_items pcm_caps_config = {
+       .int_config_ids = {"rate_min", "rate_max", "channels_min", "channels_max", "periods_min",
+                          "periods_max", "period_size_min", "period_size_max", "buffer_size_min",
+                          "buffer_size_max", "sig_bits"},
+       .string_config_ids = {"formats", "rates"},
+};
+
+const struct config_template_items fe_dai_config = {
+       .int_config_ids = {"id"},
+};
+
+const struct config_template_items hwcfg_config = {
+       .int_config_ids = {"id", "bclk_freq", "bclk_invert", "fsync_invert", "fsync_freq",
+                          "mclk_freq", "pm_gate_clocks", "tdm_slots", "tdm_slot_width",
+                          "tx_slots", "rx_slots", "tx_channels", "rx_channels"},
+       .string_config_ids = {"format", "bclk", "fsync", "mclk"},
+};
+
+const struct config_template_items be_dai_config = {
+       .int_config_ids = {"id", "default_hw_conf_id", "symmertic_rates", "symmetric_channels",
+                          "symmetric_sample_bits"},
+       .string_config_ids = {"stream_name"},
+};
+
+const struct config_template_items pcm_config = {
+       .int_config_ids = {"id", "compress", "symmertic_rates", "symmetric_channels",
+                          "symmetric_sample_bits"},
+};
+
+const struct config_template_items mixer_control_config = {
+       .int_config_ids = {"index", "max", "invert"},
+       .compound_config_ids = {"access"}
+};
+
+const struct config_template_items bytes_control_config = {
+       .int_config_ids = {"index", "base", "num_regs", "max", "mask"},
+       .compound_config_ids = {"access"}
+};
+
+const struct config_template_items enum_control_config = {
+       .int_config_ids = {"index"},
+       .compound_config_ids = {"access"}
+};
+
+const struct config_template_items text_config = {
+       .compound_config_ids = {"values"}
+};
+
+const struct config_template_items scale_config = {
+       .int_config_ids = {"min", "step", "mute"},
+};
+
+const struct config_template_items ops_config = {
+       .int_config_ids = {"get", "put"},
+       .string_config_ids = {"info"},
+};
+
+const struct config_template_items channel_config = {
+       .int_config_ids = {"reg", "shift"},
+};
+
+const struct config_template_items widget_config = {
+       .int_config_ids = {"index", "no_pm", "shift", "invert", "subseq", "event_type",
+                           "event_flags"},
+       .string_config_ids = {"type", "stream_name"},
+};
+
+const struct config_template_items data_config = {
+       .string_config_ids = {"bytes"}
+};
+
+/*
+ * Items without class name should be placed lower than those with one,
+ * because they are much more generic.
+ */
+const struct build_function_map object_build_map[] = {
+       {"Base", "manifest", "SectionManifest", &tplg_build_generic_object, NULL, NULL},
+       {"Base", "data", "SectionData", &tplg_build_data_object, NULL, &data_config},
+       {"Base", "tlv", "SectionTLV", &tplg_build_tlv_object, NULL, NULL},
+       {"Base", "scale", "scale", &tplg_build_scale_object, NULL, &scale_config},
+       {"Base", "ops", "ops" ,&tplg_build_ops_object, NULL, &ops_config},
+       {"Base", "extops", "extops" ,&tplg_build_ops_object, NULL, &ops_config},
+       {"Base", "channel", "channel", &tplg_build_channel_object, NULL, &channel_config},
+       {"Base", "text", "SectionText", &tplg_build_text_object, NULL, &text_config},
+       {"Base", "VendorToken", "SectionVendorTokens", &tplg_build_vendor_token_object,
+        NULL, NULL},
+       {"Base", "hw_config", "SectionHWConfig", &tplg_build_hw_cfg_object, NULL,
+        &hwcfg_config},
+       {"Base", "fe_dai", "dai", &tplg_build_fe_dai_object, NULL, &fe_dai_config},
+       {"Base", "route", "SectionGraph", &tplg_build_dapm_route_object, NULL, NULL},
+       {"Widget", "buffer", "SectionWidget", &tplg_build_generic_object, NULL, &widget_config},
+       {"Widget", "", "SectionWidget", &tplg_build_generic_object, NULL, &widget_config},
+       {"Control", "mixer", "SectionControlMixer", &tplg_build_mixer_control, NULL,
+        &mixer_control_config},
+       {"Control", "bytes", "SectionControlBytes", &tplg_build_bytes_control, NULL,
+        &bytes_control_config},
+        {"Control", "enum", "SectionControlEnum", &tplg_build_enum_control, NULL,
+        &enum_control_config},
+       {"Dai", "", "SectionBE", &tplg_build_generic_object, NULL, &be_dai_config},
+       {"PCM", "pcm", "SectionPCM", &tplg_build_generic_object, NULL, &pcm_config},
+       {"PCM", "pcm_caps", "SectionPCMCapabilities", &tplg_build_pcm_caps_object,
+        NULL, &pcm_caps_config},
+};
+
+static const struct build_function_map *tplg_object_get_map(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                                           snd_config_t *obj)
+{
+       snd_config_iterator_t first;
+       snd_config_t *class;
+       const char *class_type, *class_name;
+       unsigned int i;
+
+       first = snd_config_iterator_first(obj);
+       class = snd_config_iterator_entry(first);
+
+       if (snd_config_get_id(class, &class_name) < 0)
+               return NULL;
+
+       if (snd_config_get_id(obj, &class_type) < 0)
+               return NULL;
+
+       for (i = 0; i < ARRAY_SIZE(object_build_map); i++) {
+               if (!strcmp(class_type, "Widget") &&
+                   !strcmp(object_build_map[i].class_type, "Widget") &&
+                       !strcmp(object_build_map[i].class_name, ""))
+                       return &object_build_map[i];
+
+               if (!strcmp(class_type, "Dai") &&
+                   !strcmp(object_build_map[i].class_type, "Dai"))
+                       return &object_build_map[i];
+
+               /* for other type objects, also match the object class_name */
+               if (!strcmp(class_type, object_build_map[i].class_type) &&
+                   !strcmp(object_build_map[i].class_name, class_name))
+                       return &object_build_map[i];
+       }
+
+       return NULL;
+}
+
+/* search for section name based on class type and name and return the config in output_cfg */
+snd_config_t *tplg_object_get_section(struct tplg_pre_processor *tplg_pp, snd_config_t *class)
+{
+       const struct build_function_map *map;
+       snd_config_t *cfg = NULL;
+       int ret;
+
+       map = tplg_object_get_map(tplg_pp, class);
+       if (!map)
+               return NULL;
+
+       ret = snd_config_search(tplg_pp->output_cfg, map->section_name, &cfg);
+       if (ret < 0)
+               SNDERR("Section config for %s not found\n", map->section_name);
+
+       return cfg;
+}
+
+/* return 1 if attribute not found in search_config, 0 on success and negative value on error */
+static int tplg_object_copy_and_add_param(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                         snd_config_t *obj,
+                                         snd_config_t *attr_cfg,
+                                         snd_config_t *search_config)
+{
+       snd_config_iterator_t first = snd_config_iterator_first(obj);
+       snd_config_t *attr, *new, *first_cfg;
+       const char *id, *search_id;
+       int ret;
+
+       first_cfg = snd_config_iterator_entry(first);
+
+       if (snd_config_get_id(attr_cfg, &id) < 0)
+               return 0;
+
+       if (snd_config_get_id(search_config, &search_id) < 0)
+               return 0;
+
+       /* copy object value */
+       ret = snd_config_search(search_config, id, &attr);
+       if (ret < 0)
+               return 1;
+
+       ret = snd_config_copy(&new, attr);
+       if (ret < 0) {
+               SNDERR("error copying attribute '%s' value from %s\n", id, search_id);
+               return ret;
+       }
+
+       if (first_cfg) {
+               /* prepend the new config */
+               ret = snd_config_add_before(first_cfg, new);
+               if (ret < 0) {
+                       snd_config_delete(new);
+                       SNDERR("error prepending attribute '%s' value to %s\n", id, search_id);
+               }
+       } else {
+               ret = snd_config_add(obj, new);
+               if (ret < 0) {
+                       snd_config_delete(new);
+                       SNDERR("error adding attribute '%s' value to %s\n", id, search_id);
+               }
+       }
+
+       return ret;
+}
+
+/*
+ * Attribute values for an object can be set in one of the following in order of
+ * precedence:
+ * 1. Value set in object instance
+ * 2. Default value set in the object's class definition
+ * 3. Inherited value from the parent object
+ * 4. Value set in the object instance embedded in the parent object
+ * 5. Value set in the object instance embedded in the parent class definition
+ */
+static int tplg_object_update(struct tplg_pre_processor *tplg_pp, snd_config_t *obj,
+                             snd_config_t *parent)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *n, *cfg, *args;
+       snd_config_t *obj_cfg, *class_cfg, *parent_obj;
+       const char *obj_id, *class_name, *class_type;
+       int ret;
+
+       class_cfg = tplg_class_lookup(tplg_pp, obj);
+       if (!class_cfg)
+               return -EINVAL;
+
+       /* find config for class attributes */
+       ret = snd_config_search(class_cfg, "DefineAttribute", &args);
+       if (ret < 0)
+               return 0;
+
+       if (snd_config_get_id(obj, &class_type) < 0)
+               return 0;
+
+       if (snd_config_get_id(class_cfg, &class_name) < 0)
+               return 0;
+
+       /* get obj cfg */
+       obj_cfg = tplg_object_get_instance_config(tplg_pp, obj);
+       if (snd_config_get_id(obj_cfg, &obj_id) < 0)
+               return 0;
+
+       /* copy and add attributes */
+       snd_config_for_each(i, next, args) {
+               snd_config_t *attr;
+               const char *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (tplg_class_is_attribute_unique(id, class_cfg))
+                       continue;
+
+               if (tplg_class_is_attribute_immutable(id, class_cfg))
+                       goto class;
+
+               /* check if attribute value is set in the object */
+               ret = snd_config_search(obj_cfg, id, &attr);
+               if (ret < 0)
+                       goto class;
+               continue;
+class:
+               /* search for attributes value in class */
+               ret = tplg_object_copy_and_add_param(tplg_pp, obj_cfg, n, class_cfg);
+               if (ret == 1) {
+                       if (tplg_class_is_attribute_immutable(id, class_cfg)) {
+                               SNDERR("Immutable attribute %s not set in class %s\n",
+                                      id, class_name);
+                               return -EINVAL;
+                       }
+                       goto parent;
+               }
+               else if (ret < 0)
+                       return ret;
+               continue;
+parent:
+               /* search for attribute value in parent */
+               if (!parent)
+                       goto parent_object;
+
+               /* get parent obj cfg */
+               parent_obj = tplg_object_get_instance_config(tplg_pp, parent);
+               if (!parent_obj)
+                       goto parent_object;
+
+               ret = tplg_object_copy_and_add_param(tplg_pp, obj_cfg, n, parent_obj);
+               if (ret == 1)
+                       goto parent_object;
+               else if (ret < 0)
+                       return ret;
+               continue;
+parent_object:
+               if (!parent)
+                       goto parent_class;
+
+               cfg = tplg_object_lookup_in_config(tplg_pp, parent_obj, class_type,
+                                                  class_name, obj_id);
+               if (!cfg)
+                       goto parent_class;
+
+               ret = tplg_object_copy_and_add_param(tplg_pp, obj_cfg, n, cfg);
+               if (ret == 1)
+                       goto parent_class;
+               else if (ret < 0)
+                       return ret;
+               continue;
+parent_class:
+               if (!parent)
+                       goto check;
+
+               cfg = tplg_class_lookup(tplg_pp, parent);
+               if (!cfg)
+                       return -EINVAL;
+
+               cfg = tplg_object_lookup_in_config(tplg_pp, cfg, class_type,
+                                                  class_name, obj_id);
+               if (!cfg)
+                       goto check;
+
+               ret = tplg_object_copy_and_add_param(tplg_pp, obj_cfg, n, cfg);
+               if (ret == 1)
+                       goto check;
+               else if (ret < 0)
+                       return ret;
+               continue;
+check:
+               if (tplg_class_is_attribute_mandatory(id, class_cfg)) {
+                       SNDERR("Mandatory attribute %s not set for class %s\n", id, class_name);
+                       return -EINVAL;
+               }
+       }
+
+       return 0;
+}
+
+static int tplg_object_pre_process_children(struct tplg_pre_processor *tplg_pp,
+                                           snd_config_t *parent, snd_config_t *cfg)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *children, *n;
+       int ret;
+
+       ret = snd_config_search(cfg, "Object", &children);
+       if (ret < 0)
+               return 0;
+
+       /* create all embedded objects */
+       snd_config_for_each(i, next, children) {
+               const char *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               ret = tplg_pre_process_objects(tplg_pp, n, parent);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
+static int tplg_construct_object_name(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                     snd_config_t *obj, snd_config_t *class_cfg)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *args, *n;
+       const char *id, *class_id, *obj_id, *s;
+       char *new_name;
+       int ret;
+
+       /* find config for class constructor attributes. Nothing to do if not defined */
+       ret = snd_config_search(class_cfg, "attributes.constructor", &args);
+       if (ret < 0)
+               return 0;
+
+       /* set class name as the name prefix for the object */
+       if (snd_config_get_id(obj, &obj_id) < 0)
+               return -EINVAL;
+       if (snd_config_get_id(class_cfg, &class_id) < 0)
+               return -EINVAL;
+       new_name = strdup(class_id);
+       if (!new_name)
+               return -ENOMEM;
+
+       /* iterate through all class arguments and set object name */
+       snd_config_for_each(i, next, args) {
+               snd_config_t *arg;
+               char *arg_value, *temp;
+
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_id(n, &id) < 0) {
+                       SNDERR("Invalid ID for constructor argument\n");
+                       ret = -EINVAL;
+                       goto err;
+               }
+
+               if (snd_config_get_string(n, &s) < 0) {
+                       SNDERR("Invalid value for constructor argument\n");
+                       ret = -EINVAL;
+                       goto err;
+               }
+
+               /* find and replace with value set in object */
+               ret = snd_config_search(obj, s, &arg);
+               if (ret < 0) {
+                       SNDERR("Argument %s not set for object '%s.%s'\n", s, class_id, obj_id);
+                       ret = -ENOENT;
+                       goto err;
+               }
+
+               /* concat arg value to object name. arg types must be either integer or string */
+               switch (snd_config_get_type(arg)) {
+               case SND_CONFIG_TYPE_INTEGER:
+               {
+                       long v;
+                       ret = snd_config_get_integer(arg, &v);
+                       assert(ret >= 0);
+
+                       arg_value = tplg_snprintf("%ld", v);
+                       if (!arg_value) {
+                               ret = -ENOMEM;
+                               goto err;
+                       }
+                       break;
+               }
+               case SND_CONFIG_TYPE_STRING:
+               {
+                       const char *s;
+
+                       ret = snd_config_get_string(arg, &s);
+                       assert(ret >= 0);
+
+                       arg_value = strdup(s);
+                       if (!arg_value) {
+                               ret = -ENOMEM;
+                               goto err;
+                       }
+                       break;
+               }
+               default:
+                       SNDERR("Argument '%s' in object '%s.%s' is not an integer or a string\n",
+                              s, class_id, obj_id);
+                       ret = -EINVAL;
+                       goto err;
+               }
+
+               /* alloc and concat arg value to the name */
+               temp = tplg_snprintf("%s.%s", new_name, arg_value);
+               free(arg_value);
+               if (!temp) {
+                       ret = -ENOMEM;
+                       goto err;
+               }
+               free(new_name);
+               new_name = temp;
+       }
+
+       ret = snd_config_set_id(obj, new_name);
+err:
+       free(new_name);
+       return ret;
+}
+
+/* set the attribute value by type */
+static int tplg_set_attribute_value(snd_config_t *attr, const char *value)
+{
+       int err;
+       snd_config_type_t type = snd_config_get_type(attr);
+
+       switch (type) {
+       case SND_CONFIG_TYPE_INTEGER:
+       {
+               long v;
+
+               v = strtol(value, NULL, 10);
+               err = snd_config_set_integer(attr, v);
+               assert(err >= 0);
+               break;
+       }
+       case SND_CONFIG_TYPE_INTEGER64:
+       {
+               long long v;
+
+               v = strtoll(value, NULL, 10);
+               err = snd_config_set_integer64(attr, v);
+               assert(err >= 0);
+               break;
+       }
+       case SND_CONFIG_TYPE_STRING:
+       {
+               err = snd_config_set_string(attr, value);
+               assert(err >= 0);
+               break;
+       }
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+
+/*
+ * Find the unique attribute in the class definition and set its value and type.
+ * Only string or integer types are allowed for unique values.
+ */
+static int tplg_object_set_unique_attribute(struct tplg_pre_processor *tplg_pp,
+                                           snd_config_t *obj, snd_config_t *class_cfg,
+                                           const char *id)
+{
+       snd_config_t *unique_attr, *new;
+       const char *unique_name, *class_id;
+       int ret;
+
+       if (snd_config_get_id(class_cfg, &class_id) < 0)
+               return 0;
+
+       /* find config for class unique attribute */
+       unique_name = tplg_class_get_unique_attribute_name(tplg_pp, class_cfg);
+       if (!unique_name)
+               return -ENOENT;
+
+       /* find the unique attribute definition in the class */
+       unique_attr = tplg_class_find_attribute_by_name(tplg_pp, class_cfg, unique_name);
+       if (!unique_attr)
+               return -ENOENT;
+
+       /* override value if unique attribute is set in the object instance */
+       ret = snd_config_search(obj, unique_name, &new);
+       if (ret < 0) {
+               ret = snd_config_make(&new, unique_name,
+                                     tplg_class_get_attribute_type(tplg_pp, unique_attr));
+               if (ret < 0) {
+                       SNDERR("error creating new attribute cfg for object %s\n", id);
+                       return ret;
+               }
+               ret = snd_config_add(obj, new);
+               if (ret < 0) {
+                       SNDERR("error adding new attribute cfg for object %s\n", id);
+                       return ret;
+               }
+       }
+
+       ret = tplg_set_attribute_value(new, id);
+       if (ret < 0) {
+               SNDERR("error setting unique attribute cfg for object %s\n", id);
+               return ret;
+       }
+
+       return ret;
+}
+
+/*
+ * Helper function to get object instance config which is 2 nodes down from class_type config.
+ * ex: Get the pointer to the config node with ID "0" from the input config Widget.pga.0 {}
+ */
+snd_config_t *tplg_object_get_instance_config(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                       snd_config_t *class_type)
+{
+       snd_config_iterator_t first;
+       snd_config_t *cfg;
+
+       first = snd_config_iterator_first(class_type);
+       cfg = snd_config_iterator_entry(first);
+       first = snd_config_iterator_first(cfg);
+       return snd_config_iterator_entry(first);
+}
+
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+static int pre_process_find_variable(snd_config_t **dst, const char *str, snd_config_t *config)
+{
+       snd_config_iterator_t i, next;
+
+       snd_config_for_each(i, next, config) {
+               snd_config_t *n;
+               const char *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (strcmp(id, str))
+                       continue;
+
+               /* found definition, copy config */
+               return snd_config_copy(dst, n);
+       }
+
+       return -EINVAL;
+}
+
+static int
+pre_process_object_variables_expand_fcn(snd_config_t **dst, const char *str, void *private_data)
+{
+
+       struct tplg_pre_processor *tplg_pp = private_data;
+       snd_config_t *object_cfg = tplg_pp->current_obj_cfg;
+       snd_config_t *conf_defines;
+       const char *object_id;
+       const char *val;
+       int ret;
+
+       ret = snd_config_search(tplg_pp->input_cfg, "Define", &conf_defines);
+       if (ret < 0)
+               return 0;
+
+       /* find variable from global definitions first */
+       ret = pre_process_find_variable(dst, str, conf_defines);
+       if (ret >= 0)
+               return ret;
+
+       /* No global define found, proceeed to object attribute search */
+       if (snd_config_get_id(object_cfg, &object_id) < 0)
+               return -EINVAL;
+
+       /* find variable from object attribute values if not found in global definitions */
+       ret = pre_process_find_variable(dst, str, object_cfg);
+       if (ret < 0) {
+               SNDERR("Failed to find definition for attribute %s in '%s' object\n",
+                      str, object_id);
+               return ret;
+       }
+
+       /* the extracted value may contain a nested $-expression */
+       if (snd_config_get_string(*dst, &val) >= 0) {
+               if (val[0] == '$') {
+                       char *var = strdup(val);
+
+                       snd_config_delete(*dst);
+                       ret = snd_config_evaluate_string(dst, var,
+                                                        pre_process_object_variables_expand_fcn,
+                                                        tplg_pp);
+                       free(var);
+               }
+       }
+
+       return ret;
+}
+
+/*
+ * Searches for the first '$VAR_NAME' or '$[<contents>]' occurrence in
+ * *stringp. Allocates memory for it and copies it there. The
+ * allocated string is returned in '*varname'. If there was a prefix
+ * before $VAR_NAME, it is returned in '*prefix'. The *stringp is
+ * moved forward to the char after the $VAR_NAME.
+ *
+ * The end of $VAR_NAME is the first char that is not alpha numeric, '_',
+ * or '\0'.
+ *
+ * In '$[<contents>]' case all letters but '[' and ']' are allow in
+ * any sequence. Nested '[]' is also allowed if the number of '[' and
+ * ']' match.
+ *
+ * The function modifies *stringp, and *prefix - if not NULL - points
+ * to the original *stringp, *varname - if not NULL - is malloced and
+ * should be freed by the caller.
+ *
+ * Returns 0           if the *stringp was an empty string.
+ *         1           if *prefix or *varname was set
+ *         -ENOMEM     if malloc failed
+ */
+static int tplg_get_varname(char **stringp, char **prefix, char **varname)
+{
+       size_t prefix_len, varname_len = 0;
+
+       *prefix = NULL;
+       *varname = NULL;
+
+       prefix_len = strcspn(*stringp, "$");
+       *prefix = *stringp;
+       (*stringp) += prefix_len;
+       if (**stringp == '$') {
+               if ((*stringp)[1] == '[') {
+                       int brackets = 1;
+                       varname_len = 1;
+
+                       do {
+                               varname_len += strcspn((*stringp) + varname_len + 1, "[]") + 1;
+                               if ((*stringp)[varname_len] == '[')
+                                       brackets++;
+                               else if ((*stringp)[varname_len] == ']')
+                                       brackets--;
+                               else
+                                       break;
+                       }  while (brackets > 0);
+                       if (brackets != 0)
+                               return -EINVAL;
+                       varname_len++;
+               } else {
+                       varname_len = 1;
+                       while (isalnum((*stringp)[varname_len]) || (*stringp)[varname_len] == '_')
+                               varname_len++;
+               }
+       }
+
+       if (varname_len == 0 && prefix_len == 0)
+               return 0;
+
+       if (varname_len) {
+               *varname = malloc(varname_len + 1);
+               if (*varname == NULL)
+                       return -ENOMEM;
+               strncpy(*varname, *stringp, varname_len);
+               (*varname)[varname_len] = '\0';
+               (*stringp) += varname_len;
+       }
+
+       if (prefix_len)
+               (*prefix)[prefix_len] = '\0';
+       else
+               *prefix = NULL;
+
+       return 1;
+}
+
+static int tplg_evaluate_config_string(struct tplg_pre_processor *tplg_pp,
+                                   snd_config_t **dst, const char *s, const char *id)
+{
+       char *str = strdup(s);
+       char *varname, *prefix, *freep = str;
+       int ret;
+
+       if (!str)
+               return -ENOMEM;
+
+       *dst = NULL;
+
+       /* split the string and expand global definitions or object attribute values */
+       while (tplg_get_varname(&str, &prefix, &varname) == 1) {
+               const char *current_str;
+               char *temp;
+
+               if (prefix) {
+                       if (*dst == NULL) {
+                               ret = snd_config_make(dst, id, SND_CONFIG_TYPE_STRING);
+                               if (ret < 0)
+                                       goto out;
+                               ret = snd_config_set_string(*dst, prefix);
+                               if (ret < 0)
+                                       goto out;
+                       } else {
+                               /* concat the prefix */
+                               snd_config_get_string(*dst, &current_str);
+                               temp = tplg_snprintf("%s%s", current_str, prefix);
+                               if (!temp) {
+                                       ret = -ENOMEM;
+                                       goto out;
+                               }
+
+                               ret = snd_config_set_string(*dst, temp);
+                               free(temp);
+                               if (ret < 0)
+                                       goto out;
+                       }
+               }
+
+               if (varname) {
+                       snd_config_t *tmp_config;
+
+                       ret = snd_config_evaluate_string(&tmp_config, varname,
+                                                        pre_process_object_variables_expand_fcn,
+                                                        tplg_pp);
+                       if (ret < 0)
+                               goto out;
+
+                       if (*dst == NULL) {
+                               *dst = tmp_config;
+                       } else {
+                               char *ascii;
+
+                               snd_config_get_string(*dst, &current_str);
+
+                               ret = snd_config_get_ascii(tmp_config, &ascii);
+                               if (ret)
+                                       goto out;
+
+                               temp = tplg_snprintf("%s%s", current_str, ascii);
+                               free(ascii);
+
+                               if (!temp) {
+                                       ret = -ENOMEM;
+                                       goto out;
+                               }
+
+                               ret = snd_config_set_string(*dst, temp);
+                               free(temp);
+                               snd_config_delete(tmp_config);
+                               if (ret < 0)
+                                       goto out;
+                       }
+                       free(varname);
+               }
+       }
+
+       free(freep);
+       snd_config_set_id(*dst, id);
+
+       return 0;
+out:
+       if (*dst)
+               snd_config_delete(*dst);
+       free(varname);
+       free(freep);
+       return ret;
+}
+
+#endif
+
+/* build object config and its child objects recursively */
+static int tplg_build_object(struct tplg_pre_processor *tplg_pp, snd_config_t *new_obj,
+                             snd_config_t *parent)
+{
+       snd_config_t *obj_local, *class_cfg;
+       const struct build_function_map *map;
+       snd_config_iterator_t i, next;
+       build_func builder;
+       update_auto_attr_func auto_attr_updater;
+       const char *id, *class_id;
+       int ret;
+
+       obj_local = tplg_object_get_instance_config(tplg_pp, new_obj);
+       if (!obj_local)
+               return -EINVAL;
+
+       class_cfg = tplg_class_lookup(tplg_pp, new_obj);
+       if (!class_cfg)
+               return -EINVAL;
+
+       if (snd_config_get_id(obj_local, &id) < 0)
+               return 0;
+
+       if (snd_config_get_id(class_cfg, &class_id) < 0)
+               return 0;
+
+       /* set unique attribute value */
+       ret = tplg_object_set_unique_attribute(tplg_pp, obj_local, class_cfg, id);
+       if (ret < 0) {
+               SNDERR("error setting unique attribute value for '%s.%s'\n", class_id, id);
+               return ret;
+       }
+
+       /* update object attributes and validate them */
+       ret = tplg_object_update(tplg_pp, new_obj, parent);
+       if (ret < 0) {
+               SNDERR("Failed to update attributes for object '%s.%s'\n", class_id, id);
+               return ret;
+       }
+
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+       tplg_pp_config_debug(tplg_pp, obj_local);
+
+       /* expand all non-compound type child configs in object */
+       snd_config_for_each(i, next, obj_local) {
+               snd_config_t *n, *new, *class_attr;
+               const char *id, *s;
+               char *attr_config_name;
+
+               n = snd_config_iterator_entry(i);
+
+               if (snd_config_get_type(n) == SND_CONFIG_TYPE_COMPOUND)
+                       continue;
+
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (snd_config_get_string(n, &s) < 0)
+                       continue;
+
+               if (!strstr(s, "$"))
+                       goto validate;
+
+               tplg_pp->current_obj_cfg = obj_local;
+
+               /* Expand definitions and object attribute references. */
+               ret = tplg_evaluate_config_string(tplg_pp, &new, s, id);
+               if (ret < 0) {
+                       SNDERR("Failed to evaluate attributes %s in %s, from '%s'\n",
+                              id, class_id, s);
+                       return ret;
+               }
+
+               ret = snd_config_merge(n, new, true);
+               if (ret < 0)
+                       return ret;
+validate:
+               /* validate attribute value */
+               snd_config_get_id(n, &id);
+               attr_config_name = tplg_snprintf("DefineAttribute.%s", id);
+               if (!attr_config_name)
+                       return -ENOMEM;
+
+               ret = snd_config_search(class_cfg, attr_config_name, &class_attr);
+               free(attr_config_name);
+               if (ret < 0)
+                       continue;
+
+               if (!tplg_object_is_attribute_valid(tplg_pp, class_attr, n)) {
+                       SNDERR("Failed to validate attribute %s in %s\n", id, class_id);
+                       return -EINVAL;
+               }
+       }
+#endif
+
+       /* construct object name using class constructor */
+       ret = tplg_construct_object_name(tplg_pp, obj_local, class_cfg);
+       if (ret < 0) {
+               SNDERR("Failed to construct object name for %s\n", id);
+               return ret;
+       }
+
+       /*
+        * Build objects if object type is supported.
+        * If not, process object attributes and add to parent's data section
+        */
+       map = tplg_object_get_map(tplg_pp, new_obj);
+       if (map) {
+               builder = map->builder;
+
+               /* update automatic attribute for current object */
+               auto_attr_updater = map->auto_attr_updater;
+               if(auto_attr_updater) {
+                       ret = auto_attr_updater(tplg_pp, obj_local, parent);
+                       if (ret < 0) {
+                               SNDERR("Failed to update automatic attributes for %s\n", id);
+                               return ret;
+                       }
+               }
+       } else {
+               builder = &tplg_build_parent_data;
+       }
+
+       ret = builder(tplg_pp, new_obj, parent);
+       if (ret < 0)
+               return ret;
+
+       /* create child objects in the object instance */
+       ret = tplg_object_pre_process_children(tplg_pp, new_obj, obj_local);
+       if (ret < 0) {
+               SNDERR("error processing child objects in object %s\n", id);
+               return ret;
+       }
+
+       /* create child objects in the object's class definition */
+       ret = tplg_object_pre_process_children(tplg_pp, new_obj, class_cfg);
+       if (ret < 0)
+               SNDERR("error processing child objects in class %s\n", class_id);
+
+       return ret;
+}
+
+/* create top-level topology objects */
+int tplg_pre_process_objects(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg,
+                            snd_config_t *parent)
+{
+       snd_config_iterator_t i, next, i2, next2;
+       snd_config_t *n, *n2, *_obj_type, *_obj_class, *_obj;
+       const char *id, *class_type, *class_name;
+       int ret;
+
+       if (snd_config_get_id(cfg, &class_type) < 0)
+               return 0;
+
+       /* create all objects of the same type and class */
+       snd_config_for_each(i, next, cfg) {
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &class_name) < 0)
+                       continue;
+               snd_config_for_each(i2, next2, n) {
+                       snd_config_t *temp_n2;
+
+                       n2 = snd_config_iterator_entry(i2);
+                       if (snd_config_get_id(n2, &id) < 0) {
+                               SNDERR("Invalid id for object\n");
+                               return -EINVAL;
+                       }
+
+                       ret = snd_config_copy(&temp_n2, n2);
+                       if (ret < 0)
+                               return ret;
+
+                       /*
+                        * An object declared within a class definition as follows:
+                        * Class.Pipeline.volume-playback {
+                        *      Object.Widget.pga.0 {
+                        *              ramp_step_ms 250
+                        *      }
+                        * }
+                        *
+                        * While instantiating the volume-pipeline class, the pga object
+                        * could be modified as follows:
+                        * Object.Pipeline.volume-playback.0 {
+                        *      Object.Widget.pga.0 {
+                        *              format "s24le"
+                        *      }
+                        * }
+                        * When building the pga.0 object in the class definition, merge
+                        * the attributes declared in the volume-playback.0 object to create
+                        * a new config as follows to make sure that all attributes are
+                        * set for the pga object.
+                        * Object.Widget.pga.0 {
+                        *      ramp_step_ms 250
+                        *      format "s24le"
+                        * }
+                        */
+
+                       if (parent) {
+                               snd_config_t *parent_instance, *parent_obj, *temp;
+                               char *obj_cfg_name;
+
+                               obj_cfg_name = tplg_snprintf("%s%s.%s.%s", "Object.",
+                                                            class_type, class_name, id);
+
+                               /* search for object instance in the parent */
+                               parent_instance = tplg_object_get_instance_config(tplg_pp, parent);
+                               if (!parent_instance)
+                                       goto temp_cfg;
+
+                               ret = snd_config_search(parent_instance, obj_cfg_name, &parent_obj);
+                               free(obj_cfg_name);
+                               if (ret < 0)
+                                       goto temp_cfg;
+
+                               /* don't merge if the object configs are the same */
+                               if (parent_obj == n2)
+                                       goto temp_cfg;
+
+                               /* create a temp config copying the parent object config */
+                               ret = snd_config_copy(&temp, parent_obj);
+                               if (ret < 0) {
+                                       snd_config_delete(temp_n2);
+                                       return ret;
+                               }
+
+                               /*
+                                * Merge parent object with the current object instance.
+                                * temp will be deleted by merge
+                                */
+                               ret = snd_config_merge(temp_n2, temp, false);
+                               if (ret < 0) {
+                                       SNDERR("error merging parent object config for %s.%s.%s\n",
+                                              class_type, class_name, id);
+                                       snd_config_delete(temp_n2);
+                                       return ret;
+                               }
+                       }
+temp_cfg:
+                       /* create a temp config for object with class type as the root node */
+                       ret = snd_config_make(&_obj_type, class_type, SND_CONFIG_TYPE_COMPOUND);
+                       if (ret < 0) {
+                               snd_config_delete(temp_n2);
+                               return ret;
+                       }
+
+                       ret = snd_config_make(&_obj_class, class_name, SND_CONFIG_TYPE_COMPOUND);
+                       if (ret < 0)
+                               goto err;
+
+                       ret = snd_config_add(_obj_type, _obj_class);
+                       if (ret < 0) {
+                               snd_config_delete(_obj_class);
+                               goto err;
+                       }
+
+                       ret = snd_config_copy(&_obj, temp_n2);
+                       if (ret < 0)
+                               goto err;
+
+                       ret = snd_config_add(_obj_class, _obj);
+                       if (ret < 0) {
+                               snd_config_delete(_obj);
+                               goto err;
+                       }
+
+                       /* Build the object now */
+                       ret = tplg_build_object(tplg_pp, _obj_type, parent);
+                       if (ret < 0)
+                               SNDERR("Error building object %s.%s.%s\n",
+                                      class_type, class_name, id);
+err:
+                       snd_config_delete(temp_n2);
+                       snd_config_delete(_obj_type);
+                       if (ret < 0)
+                               return ret;
+               }
+       }
+
+       return 0;
+}
diff --git a/topology/pre-processor.c b/topology/pre-processor.c
new file mode 100644 (file)
index 0000000..01f8a5d
--- /dev/null
@@ -0,0 +1,1009 @@
+/*
+  Copyright(c) 2021 Intel Corporation
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of version 2 of the GNU General Public License as
+  published by the Free Software Foundation.
+
+  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 St - Fifth Floor, Boston, MA 02110-1301 USA.
+  The full GNU General Public License is included in this distribution
+  in the file called LICENSE.GPL.
+*/
+
+#include "aconfig.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <regex.h>
+#include <dlfcn.h>
+
+#include <alsa/asoundlib.h>
+#include "gettext.h"
+#include "topology.h"
+#include "pre-processor.h"
+#include "pre-process-external.h"
+
+#define SND_TOPOLOGY_MAX_PLUGINS 32
+
+static int get_plugin_string(struct tplg_pre_processor *tplg_pp, char **plugin_string)
+{
+       const char *lib_names_t = NULL;
+       snd_config_t *defines;
+       int ret;
+
+       ret = snd_config_search(tplg_pp->input_cfg, "Define.PREPROCESS_PLUGINS", &defines);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_get_string(defines, &lib_names_t);
+       if (ret < 0)
+               return ret;
+
+       *plugin_string = strdup(lib_names_t);
+
+       if (!*plugin_string)
+               return -ENOMEM;
+
+       return 0;
+}
+
+static int run_plugin(struct tplg_pre_processor *tplg_pp, char *plugin)
+{
+       plugin_pre_process process;
+       char *xlib, *xfunc, *path;
+       void *h = NULL;
+       int ret = 0;
+
+       /* compose the plugin path, if not from environment, then from default plugins dir */
+       path = getenv("ALSA_TOPOLOGY_PLUGIN_DIR");
+       if (!path)
+               path = ALSA_TOPOLOGY_PLUGIN_DIR;
+
+       xlib = tplg_snprintf("%s/%s%s%s", path, PROCESS_LIB_PREFIX, plugin,
+                            PROCESS_LIB_POSTFIX);
+       xfunc = tplg_snprintf("%s%s%s", PROCESS_FUNC_PREFIX, plugin,
+                             PROCESS_FUNC_POSTFIX);
+
+       if (!xlib || !xfunc) {
+               fprintf(stderr, "can't reserve memory for plugin paths and func names\n");
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       /* open plugin */
+       h = dlopen(xlib, RTLD_NOW);
+       if (!h) {
+               fprintf(stderr, "unable to open library '%s'\n", xlib);
+               ret = -EINVAL;
+               goto err;
+       }
+
+       /* find function */
+       process = dlsym(h, xfunc);
+
+       if (!process) {
+               fprintf(stderr, "symbol 'topology_process' was not found in %s\n", xlib);
+               ret = -EINVAL;
+               goto err;
+       }
+
+       /* process plugin */
+       ret = process(tplg_pp->input_cfg, tplg_pp->output_cfg);
+
+err:
+       if (h)
+               dlclose(h);
+       if (xlib)
+               free(xlib);
+       if (xfunc)
+               free(xfunc);
+
+       return ret;
+}
+
+static int pre_process_plugins(struct tplg_pre_processor *tplg_pp)
+{
+       char *plugins[SND_TOPOLOGY_MAX_PLUGINS];
+       char *plugin_string;
+       int count;
+       int ret;
+       int i;
+
+       /* parse plugin names */
+       ret = get_plugin_string(tplg_pp, &plugin_string);
+
+       /* no plugins defined, so just return */
+       if (ret < 0)
+               return 0;
+
+       count = 0;
+       plugins[count] = strtok(plugin_string, ":");
+       while ((count < SND_TOPOLOGY_MAX_PLUGINS - 1) && plugins[count]) {
+               count++;
+               plugins[count] = strtok(NULL, ":");
+       }
+
+       /* run all plugins */
+       for (i = 0; i < count; i++) {
+               ret = run_plugin(tplg_pp, plugins[i]);
+               if (ret < 0)
+                       return ret;
+       }
+
+       free(plugin_string);
+
+       return 0;
+}
+
+/*
+ * Helper function to find config by id.
+ * Topology2.0 object names are constructed with attribute values separated by '.'.
+ * So snd_config_search() cannot be used as it interprets the '.' as the node separator.
+ */
+snd_config_t *tplg_find_config(snd_config_t *config, const char *name)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *n;
+       const char *id;
+
+       snd_config_for_each(i, next, config) {
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (!strcmp(id, name))
+                       return n;
+       }
+
+       return NULL;
+}
+
+/* make a new config and add it to parent */
+int tplg_config_make_add(snd_config_t **config, const char *id, snd_config_type_t type,
+                        snd_config_t *parent)
+{
+       int ret;
+
+       ret = snd_config_make(config, id, type);
+       if (ret < 0)
+               return ret;
+
+       ret = snd_config_add(parent, *config);
+       if (ret < 0)
+               snd_config_delete(*config);
+
+       return ret;
+}
+
+/*
+ * The pre-processor will need to concat multiple strings separate by '.' to construct the object
+ * name and search for configs with ID's separated by '.'.
+ * This function helps concat input strings in the specified input format
+ */
+char *tplg_snprintf(char *fmt, ...)
+{
+       char *string;
+       int len = 1;
+
+       va_list va;
+
+       va_start(va, fmt);
+       len += vsnprintf(NULL, 0, fmt, va);
+       va_end(va);
+
+       string = calloc(1, len);
+       if (!string)
+               return NULL;
+
+       va_start(va, fmt);
+       vsnprintf(string, len, fmt, va);
+       va_end(va);
+
+       return string;
+}
+
+#ifdef TPLG_DEBUG
+void tplg_pp_debug(char *fmt, ...)
+{
+       char msg[DEBUG_MAX_LENGTH];
+       va_list va;
+
+       va_start(va, fmt);
+       vsnprintf(msg, DEBUG_MAX_LENGTH, fmt, va);
+       va_end(va);
+
+       fprintf(stdout, "%s\n", msg);
+}
+
+void tplg_pp_config_debug(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg)
+{
+       snd_config_save(cfg, tplg_pp->dbg_output);
+}
+#else
+void tplg_pp_debug(char *fmt ATTRIBUTE_UNUSED, ...) {}
+void tplg_pp_config_debug(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                         snd_config_t *cfg ATTRIBUTE_UNUSED) {}
+#endif
+
+static int pre_process_config(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg)
+{
+       snd_config_iterator_t i, next, i2, next2;
+       snd_config_t *n, *n2;
+       const char *id;
+       int err;
+
+       if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
+               fprintf(stderr, "compound type expected at top level");
+               return -EINVAL;
+       }
+
+       /* parse topology objects */
+       snd_config_for_each(i, next, cfg) {
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               if (strcmp(id, "Object"))
+                       continue;
+
+               if (snd_config_get_type(n) != SND_CONFIG_TYPE_COMPOUND) {
+                       fprintf(stderr, "compound type expected for %s", id);
+                       return -EINVAL;
+               }
+
+               snd_config_for_each(i2, next2, n) {
+                       n2 = snd_config_iterator_entry(i2);
+
+                       if (snd_config_get_id(n2, &id) < 0)
+                               continue;
+
+                       if (snd_config_get_type(n2) != SND_CONFIG_TYPE_COMPOUND) {
+                               fprintf(stderr, "compound type expected for %s", id);
+                               return -EINVAL;
+                       }
+
+                       /* pre-process Object instance. Top-level object have no parent */
+                       err = tplg_pre_process_objects(tplg_pp, n2, NULL);
+                       if (err < 0)
+                               return err;
+               }
+       }
+
+       return 0;
+}
+
+void free_pre_processor(struct tplg_pre_processor *tplg_pp)
+{
+       snd_output_close(tplg_pp->output);
+       snd_output_close(tplg_pp->dbg_output);
+       snd_config_delete(tplg_pp->output_cfg);
+       if (tplg_pp->define_cfg)
+               snd_config_delete(tplg_pp->define_cfg);
+       free(tplg_pp->inc_path);
+       free(tplg_pp);
+}
+
+int init_pre_processor(struct tplg_pre_processor **tplg_pp, snd_output_type_t type,
+                      const char *output_file)
+{
+       struct tplg_pre_processor *_tplg_pp;
+       int ret;
+
+       _tplg_pp = calloc(1, sizeof(struct tplg_pre_processor));
+       if (!_tplg_pp)
+               return -ENOMEM;
+
+       *tplg_pp = _tplg_pp;
+
+       /* create output top-level config node */
+       ret = snd_config_top(&_tplg_pp->output_cfg);
+       if (ret < 0)
+               goto err;
+
+       /* open output based on type */
+       if (type == SND_OUTPUT_STDIO) {
+               ret = snd_output_stdio_open(&_tplg_pp->output, output_file, "w");
+               if (ret < 0) {
+                       fprintf(stderr, "failed to open file output\n");
+                       goto open_err;
+               }
+       } else {
+               ret = snd_output_buffer_open(&_tplg_pp->output);
+               if (ret < 0) {
+                       fprintf(stderr, "failed to open buffer output\n");
+                       goto open_err;
+               }
+       }
+
+       /* debug output */
+       ret = snd_output_stdio_attach(&_tplg_pp->dbg_output, stdout, 0);
+       if (ret < 0) {
+               fprintf(stderr, "failed to open stdout output\n");
+               goto out_close;
+       }
+
+       return 0;
+out_close:
+       snd_output_close(_tplg_pp->output);
+open_err:
+       snd_config_delete(_tplg_pp->output_cfg);
+err:
+       free(_tplg_pp);
+       return ret;
+}
+
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+static int pre_process_set_defines(struct tplg_pre_processor *tplg_pp, const char *pre_processor_defs)
+{
+       int ret;
+
+       /*
+        * load the command line defines to the configuration tree
+        */
+       if (pre_processor_defs != NULL) {
+               ret = snd_config_load_string(&tplg_pp->define_cfg, pre_processor_defs, 0);
+               if (ret < 0) {
+                       fprintf(stderr, "Failed to load pre-processor command line definitions\n");
+                       return ret;
+               }
+       } else {
+               tplg_pp->define_cfg = NULL;
+       }
+
+       return 0;
+}
+
+static int pre_process_add_defines(struct tplg_pre_processor *tplg_pp, snd_config_t *from)
+{
+       snd_config_t *conf_defines, *conf_tmp;
+       int ret;
+
+       ret = snd_config_search(from, "Define", &conf_defines);
+       if (ret == -ENOENT) {
+               if (tplg_pp->input_cfg == from && tplg_pp->define_cfg) {
+                       conf_defines = NULL;
+                       goto create;
+               }
+       }
+       if (ret < 0)
+               return ret;
+
+       if (snd_config_get_type(conf_defines) != SND_CONFIG_TYPE_COMPOUND) {
+               fprintf(stderr, "Define must be a compound!\n");
+               return -EINVAL;
+       }
+
+       if (tplg_pp->input_cfg == from)
+               tplg_pp->define_cfg_merged = conf_defines;
+
+       if (tplg_pp->define_cfg_merged == NULL) {
+create:
+               ret = snd_config_make_compound(&tplg_pp->define_cfg_merged, "Define", 0);
+               if (ret < 0)
+                       return ret;
+               ret = snd_config_add(tplg_pp->input_cfg, tplg_pp->define_cfg_merged);
+               if (ret < 0)
+                       return ret;
+       }
+
+       if (tplg_pp->define_cfg_merged != conf_defines) {
+               /*
+                * merge back to the main configuration tree (Define subtree)
+                */
+               ret = snd_config_merge(tplg_pp->define_cfg_merged, conf_defines, true);
+               if (ret < 0) {
+                       fprintf(stderr, "Failed to override main variable definitions\n");
+                       return ret;
+               }
+       }
+
+       /*
+        * merge the command line defines with the variables in the conf file to override
+        * default values; use a copy (merge deletes the source tree)
+        */
+       if (tplg_pp->define_cfg) {
+               ret = snd_config_copy(&conf_tmp, tplg_pp->define_cfg);
+               if (ret < 0) {
+                       fprintf(stderr, "Failed to copy variable definitions\n");
+                       return ret;
+               }
+               ret = snd_config_merge(tplg_pp->define_cfg_merged, conf_tmp, true);
+               if (ret < 0) {
+                       fprintf(stderr, "Failed to override variable definitions\n");
+                       snd_config_delete(conf_tmp);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+static int pre_process_includes(struct tplg_pre_processor *tplg_pp, snd_config_t *top);
+
+static int pre_process_include_conf(struct tplg_pre_processor *tplg_pp, snd_config_t *config,
+                                   snd_config_t **new, snd_config_t *variable)
+{
+       snd_config_iterator_t i, next;
+       const char *variable_name;
+       char *value;
+       int ret;
+
+       if (snd_config_get_id(variable, &variable_name) < 0)
+               return 0;
+
+       switch(snd_config_get_type(variable)) {
+       case SND_CONFIG_TYPE_STRING:
+       {
+               const char *s;
+
+               if (snd_config_get_string(variable, &s) < 0) {
+                       SNDERR("Invalid value for variable %s\n", variable_name);
+                       return -EINVAL;
+               }
+               value = strdup(s);
+               if (!value)
+                       return -ENOMEM;
+               break;
+       }
+       case SND_CONFIG_TYPE_INTEGER:
+       {
+               long v;
+
+               ret = snd_config_get_integer(variable, &v);
+               if (ret < 0) {
+                       SNDERR("Invalid value for variable %s\n", variable_name);
+                       return ret;
+               }
+
+               value = tplg_snprintf("%ld", v);
+               if (!value)
+                       return -ENOMEM;
+               break;
+       }
+       default:
+               SNDERR("Invalid type for variable definition %s\n", variable_name);
+               return -EINVAL;
+       }
+
+       /* create top-level config node */
+       ret = snd_config_top(new);
+       if (ret < 0) {
+               SNDERR("failed to create top-level node for include conf %s\n", variable_name);
+               goto err;
+       }
+
+       snd_config_for_each(i, next, config) {
+               snd_input_t *in;
+               snd_config_t *n;
+               regex_t regex;
+               const char *filename;
+               const char *id;
+               char *full_path;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               ret = regcomp(&regex, id, REG_EXTENDED | REG_ICASE);
+               if (ret) {
+                       fprintf(stderr, "Could not compile regex\n");
+                       goto err;
+               }
+
+               /* Execute regular expression */
+               ret = regexec(&regex, value, 0, NULL, 0);
+               if (ret)
+                       continue;
+
+               /* regex matched. now include or use the configuration */
+               if (snd_config_get_type(n) == SND_CONFIG_TYPE_COMPOUND) {
+                       /* configuration block */
+                       ret = snd_config_merge(*new, n, 0);
+                       if (ret < 0) {
+                               fprintf(stderr, "Unable to merge key '%s'\n", value);
+                               goto err;
+                       }
+               } else {
+                       ret = snd_config_get_string(n, &filename);
+                       if (ret < 0)
+                               goto err;
+
+                       if (filename && filename[0] != '/')
+                               full_path = tplg_snprintf("%s/%s", tplg_pp->inc_path, filename);
+                       else
+                               full_path = tplg_snprintf("%s", filename);
+
+                       ret = snd_input_stdio_open(&in, full_path, "r");
+                       if (ret < 0) {
+                               fprintf(stderr, "Unable to open included conf file %s\n", full_path);
+                               free(full_path);
+                               goto err;
+                       }
+                       free(full_path);
+
+                       /* load config */
+                       ret = snd_config_load(*new, in);
+                       snd_input_close(in);
+                       if (ret < 0) {
+                               fprintf(stderr, "Unable to load included configuration\n");
+                               goto err;
+                       }
+               }
+
+               /* forcefully overwrite with defines from the command line */
+               ret = pre_process_add_defines(tplg_pp, *new);
+               if (ret < 0 && ret != -ENOENT) {
+                       fprintf(stderr, "Failed to parse arguments in input config\n");
+                       goto err;
+               }
+
+               /* recursively process any nested includes */
+               ret = pre_process_includes(tplg_pp, *new);
+               if (ret < 0)
+                       goto err;
+       }
+
+err:
+       free(value);
+       return ret;
+}
+
+static int pre_process_includes(struct tplg_pre_processor *tplg_pp, snd_config_t *top)
+{
+       snd_config_iterator_t i, next;
+       snd_config_t *includes;
+       const char *top_id;
+       int ret;
+
+       if (tplg_pp->define_cfg_merged == NULL)
+               return 0;
+
+       ret = snd_config_search(top, "IncludeByKey", &includes);
+       if (ret < 0)
+               return 0;
+
+       snd_config_get_id(top, &top_id);
+
+       snd_config_for_each(i, next, includes) {
+               snd_config_t *n, *new, *define;
+               const char *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               /* find id from variable definitions */
+               ret = snd_config_search(tplg_pp->define_cfg_merged, id, &define);
+               if (ret < 0) {
+                       fprintf(stderr, "No variable defined for %s\n", id);
+                       return ret;
+               }
+
+               /* create conf node from included file */
+               ret = pre_process_include_conf(tplg_pp, n, &new, define);
+               if (ret < 0) {
+                       fprintf(stderr, "Unable to process include file \n");
+                       return ret;
+               }
+
+               /* merge the included conf file with the top-level conf */
+               ret = snd_config_merge(top, new, 0);
+               if (ret < 0) {
+                       fprintf(stderr, "Failed to add included conf\n");
+                       return ret;
+               }
+       }
+
+       /* delete all includes from current top */
+       snd_config_delete(includes);
+
+       return 0;
+}
+
+static int pre_process_includes_all(struct tplg_pre_processor *tplg_pp, snd_config_t *top)
+{
+       snd_config_iterator_t i, next;
+       int ret;
+
+       if (snd_config_get_type(top) != SND_CONFIG_TYPE_COMPOUND)
+               return 0;
+
+       /* process includes at this node */
+       ret = pre_process_includes(tplg_pp, top);
+       if (ret < 0) {
+               fprintf(stderr, "Failed to process includes\n");
+               return ret;
+       }
+
+       /* process includes at all child nodes */
+       snd_config_for_each(i, next, top) {
+               snd_config_t *n;
+
+               n = snd_config_iterator_entry(i);
+
+               ret = pre_process_includes_all(tplg_pp, n);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
+/* duplicate the existing objects in src into dest and update with new attribute */
+static int pre_process_add_objects(struct tplg_pre_processor *tplg_pp ATTRIBUTE_UNUSED,
+                                  int *object_count, snd_config_t *src,
+                                  snd_config_t *dest, snd_config_t *attr_cfg)
+{
+       snd_config_iterator_t i, next;
+       int ret;
+
+       snd_config_for_each(i, next, src) {
+               snd_config_t *n, *new, *new_attr;
+               char* new_id = tplg_snprintf("%d", (*object_count)++);
+
+               n = snd_config_iterator_entry(i);
+
+               /* duplicate the existing object */
+               ret = snd_config_copy(&new, n);
+               if (ret < 0) {
+                       free(new_id);
+                       return ret;
+               }
+
+               ret = snd_config_set_id(new, new_id);
+               free(new_id);
+               if (ret < 0) {
+                       snd_config_delete(new);
+                       return ret;
+               }
+
+               ret = snd_config_add(dest, new);
+               if (ret < 0) {
+                       snd_config_delete(new);
+                       return ret;
+               }
+
+               /* and update the new attribute */
+               ret = snd_config_copy(&new_attr, attr_cfg);
+               if (ret < 0)
+                       return ret;
+
+               ret = snd_config_add(new, new_attr);
+               if (ret < 0) {
+                       snd_config_delete(new_attr);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+/* Create config based on the number of items in the array */
+static int pre_process_create_items(struct tplg_pre_processor *tplg_pp,
+                                   snd_config_t *cfg, snd_config_t *top,
+                                   int *object_count_offset)
+{
+       snd_config_iterator_t i, next;
+       snd_config_type_t type;
+       const char *class_id;
+       char *class_id_local;
+       int attr_count = 0;
+       int object_count = *object_count_offset;
+       int ret;
+
+       snd_config_get_id(top, &class_id);
+       class_id_local = strdup(class_id);
+
+       snd_config_for_each(i, next, cfg) {
+               snd_config_iterator_t i2, next2;
+               snd_config_t *n, *local_top;
+               const char *attribute;
+               int attr_val_count = 0;
+               object_count = *object_count_offset;
+
+               n = snd_config_iterator_entry(i);
+               type = snd_config_get_type(n);
+               if (type != SND_CONFIG_TYPE_COMPOUND)
+                       continue;
+               if (snd_config_get_id(n, &attribute) < 0)
+                       continue;
+
+               ret = snd_config_make(&local_top, class_id_local, SND_CONFIG_TYPE_COMPOUND);
+
+               snd_config_for_each(i2, next2, n) {
+                       snd_config_t *n2, *new, *new_obj;
+                       snd_config_type_t attr_type;
+                       char *new_id;
+
+                       n2 = snd_config_iterator_entry(i2);
+
+                       attr_type = snd_config_get_type(n2);
+
+                       /* create new config based on type */
+                       if (attr_type == SND_CONFIG_TYPE_INTEGER) {
+                               long val;
+
+                               ret = snd_config_get_integer(n2, &val);
+                               if (ret < 0)
+                                       return ret;
+
+                               ret = snd_config_make(&new, attribute, SND_CONFIG_TYPE_INTEGER);
+                               if (ret < 0)
+                                       return ret;
+
+                               ret = snd_config_set_integer(new, val);
+                       } else {
+                               const char *s;
+
+                               ret = snd_config_get_string(n2, &s);
+                               if (ret < 0)
+                                       return ret;
+                               ret = snd_config_make(&new, attribute, SND_CONFIG_TYPE_STRING);
+                               if (ret < 0)
+                                       return ret;
+
+                               ret = snd_config_set_string(new, s);
+                       }
+
+                       if (ret < 0)
+                               goto err;
+
+                       /* for the first array simply create new conf nodes */
+                       if (!attr_count) {
+                               new_id = tplg_snprintf("%d", object_count++);
+                               ret = snd_config_make(&new_obj, new_id, SND_CONFIG_TYPE_COMPOUND);
+                               free(new_id);
+
+                               ret = snd_config_add(new_obj, new);
+                               if (ret < 0) {
+                                       snd_config_delete(new_obj);
+                                       goto err;
+                               }
+
+                               ret = snd_config_add(local_top, new_obj);
+                               if (ret < 0) {
+                                       snd_config_delete(new_obj);
+                                       goto err;
+                               }
+
+                               continue;
+                       }
+
+                       /*
+                        * for the subsequent arrays, duplicate the existing objects
+                        * and update them with the new ones
+                        */
+                       ret = pre_process_add_objects(tplg_pp, &object_count, top,
+                                                     local_top, new);
+                       if (ret < 0) {
+                               SNDERR("failed to add objects of type %s\n", class_id_local);
+                               goto err;
+                       }
+
+                       attr_val_count++;
+err:
+                       snd_config_delete(new);
+                       if (ret < 0) {
+                               snd_config_delete(local_top);
+                               return ret;
+                       }
+               }
+
+               /* substitute current list of configs with the updated list */
+               ret = snd_config_substitute(top, local_top);
+               if (ret < 0) {
+                       snd_config_delete(local_top);
+                       return ret;
+               }
+               attr_count++;
+       }
+
+       *object_count_offset = object_count;
+       return 0;
+}
+
+static int pre_process_array_item(struct tplg_pre_processor *tplg_pp, snd_config_t *top,
+                                 snd_config_t *array)
+{
+       snd_config_iterator_t i, next;
+       int object_count;
+       int ret;
+
+       snd_config_for_each(i, next, array) {
+               snd_config_iterator_t i3, next3;
+               snd_config_t *n, *new;
+               const char *id;
+
+               n = snd_config_iterator_entry(i);
+               if (snd_config_get_id(n, &id) < 0)
+                       continue;
+
+               /* Create a new node if it doesn't exist already */
+               if (snd_config_search(top, id, &new) < 0) {
+                       ret = snd_config_make(&new, id, SND_CONFIG_TYPE_COMPOUND);
+                       if (ret < 0)
+                               return ret;
+
+                       /* add the list of objects to the current top */
+                       ret = snd_config_add(top, new);
+                       if (ret < 0) {
+                               snd_config_delete(new);
+                               return ret;
+                       }
+               }
+
+               /* if the conf node is not an array, move on to parse child nodes */
+               if (snd_config_is_array(n) <= 0)
+                       return pre_process_array_item(tplg_pp, new, n);
+
+               object_count = 0;
+               snd_config_for_each(i3, next3, n) {
+                       snd_config_t *n3, *local_top;
+
+                       n3 = snd_config_iterator_entry(i3);
+
+                       ret = snd_config_make(&local_top, id, SND_CONFIG_TYPE_COMPOUND);
+                       if (ret < 0)
+                               return ret;
+
+                       ret = pre_process_create_items(tplg_pp, n3, local_top,
+                                                        &object_count);
+                       if (ret < 0) {
+                               SNDERR("failed to create objects of type %s\n", id);
+                               return ret;
+                       }
+
+                       ret = snd_config_merge(new, local_top, 0);
+                       if (ret < 0) {
+                               snd_config_delete(local_top);
+                               return ret;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+static int pre_process_array(struct tplg_pre_processor *tplg_pp, snd_config_t *top)
+{
+       snd_config_t *arrays;
+       int ret;
+
+       ret = snd_config_search(top, "CombineArrays", &arrays);
+       if (ret < 0)
+               return 0;
+
+       ret = pre_process_array_item(tplg_pp, top, arrays);
+       if (ret < 0)
+               return ret;
+
+       snd_config_delete(arrays);
+       return 0;
+}
+
+static int pre_process_arrays(struct tplg_pre_processor *tplg_pp, snd_config_t *top)
+{
+       snd_config_iterator_t i, next;
+       int ret;
+
+       if (snd_config_get_type(top) != SND_CONFIG_TYPE_COMPOUND)
+               return 0;
+
+       /* process object arrays at this node */
+       ret = pre_process_array(tplg_pp, top);
+       if (ret < 0) {
+               fprintf(stderr, "Failed to process object arrays\n");
+               return ret;
+       }
+
+       /* process object arrays at all child nodes */
+       snd_config_for_each(i, next, top) {
+               snd_config_t *n;
+
+               n = snd_config_iterator_entry(i);
+
+               ret = pre_process_arrays(tplg_pp, n);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
+#endif /* version < 1.2.6 */
+
+int pre_process(struct tplg_pre_processor *tplg_pp, char *config, size_t config_size,
+               const char *pre_processor_defs, const char *inc_path)
+{
+       snd_input_t *in;
+       snd_config_t *top;
+       int err;
+
+       /* create input buffer */
+       err = snd_input_buffer_open(&in, config, config_size);
+       if (err < 0) {
+               fprintf(stderr, "Unable to open input buffer\n");
+               return err;
+       }
+
+       /* create top-level config node */
+       err = snd_config_top(&top);
+       if (err < 0)
+               goto input_close;
+
+       /* load config */
+       err = snd_config_load(top, in);
+       if (err < 0) {
+               fprintf(stderr, "Unable not load configuration\n");
+               goto err;
+       }
+
+       tplg_pp->input_cfg = top;
+       tplg_pp->inc_path = inc_path ? strdup(inc_path) : NULL;
+
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+       /* parse command line definitions */
+       err = pre_process_set_defines(tplg_pp, pre_processor_defs);
+       if (err < 0) {
+               fprintf(stderr, "Failed to parse arguments in input config\n");
+               goto err;
+       }
+
+       /* parse command line definitions */
+       err = pre_process_add_defines(tplg_pp, top);
+       if (err < 0) {
+               fprintf(stderr, "Failed to parse arguments in input config\n");
+               goto err;
+       }
+
+       /* include conditional conf files */
+       err = pre_process_includes_all(tplg_pp, tplg_pp->input_cfg);
+       if (err < 0) {
+               fprintf(stderr, "Failed to process conditional includes in input config\n");
+               goto err;
+       }
+
+       /* expand object arrays */
+       err = pre_process_arrays(tplg_pp, tplg_pp->input_cfg);
+       if (err < 0) {
+               fprintf(stderr, "Failed to process object arrays in input config\n");
+               goto err;
+       }
+#endif
+
+       err = pre_process_config(tplg_pp, tplg_pp->input_cfg);
+       if (err < 0) {
+               fprintf(stderr, "Unable to pre-process configuration\n");
+               goto err;
+       }
+
+       /* process topology plugins */
+       err = pre_process_plugins(tplg_pp);
+       if (err < 0) {
+               fprintf(stderr, "Unable to run pre-process plugins or plugins return error\n");
+               goto err;
+       }
+
+       /* save config to output */
+       err = snd_config_save(tplg_pp->output_cfg, tplg_pp->output);
+       if (err < 0)
+               fprintf(stderr, "failed to save pre-processed output file\n");
+
+err:
+       snd_config_delete(top);
+input_close:
+       snd_input_close(in);
+
+       return err;
+}
diff --git a/topology/pre-processor.h b/topology/pre-processor.h
new file mode 100644 (file)
index 0000000..3a8a4bc
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __PRE_PROCESSOR_H
+#define __PRE_PROCESSOR_H
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <string.h>
+#include "topology.h"
+
+#define DEBUG_MAX_LENGTH       256
+#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a)[0])
+
+#define MAX_CONFIGS_IN_TEMPLATE        32
+
+struct config_template_items {
+       char *int_config_ids[MAX_CONFIGS_IN_TEMPLATE];
+       char *string_config_ids[MAX_CONFIGS_IN_TEMPLATE];
+       char *compound_config_ids[MAX_CONFIGS_IN_TEMPLATE];
+};
+
+typedef int (*build_func)(struct tplg_pre_processor *tplg_pp, snd_config_t *obj,
+                         snd_config_t *parent);
+
+typedef int (*update_auto_attr_func)(struct tplg_pre_processor *tplg_pp,
+                         snd_config_t *obj, snd_config_t *parent);
+
+struct build_function_map {
+       char *class_type;
+       char *class_name;
+       char *section_name;
+       build_func builder;
+       update_auto_attr_func auto_attr_updater;
+       const struct config_template_items *template_items;
+};
+
+extern const struct build_function_map object_build_map[];
+
+/* debug helpers */
+void tplg_pp_debug(char *fmt, ...);
+void tplg_pp_config_debug(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg);
+
+/* object build helpers */
+int tplg_build_object_from_template(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                                   snd_config_t **wtop, snd_config_t *top_config,
+                                   bool skip_name);
+int tplg_build_tlv_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent);
+int tplg_build_scale_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent);
+int tplg_build_ops_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent);
+int tplg_build_channel_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent);
+int tplg_build_mixer_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent);
+int tplg_build_bytes_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent);
+int tplg_build_enum_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                            snd_config_t *parent);
+int tplg_build_text_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                          snd_config_t *parent);
+int tplg_build_dapm_route_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent);
+int tplg_build_hw_cfg_object(struct tplg_pre_processor *tplg_pp,
+                              snd_config_t *obj_cfg, snd_config_t *parent);
+int tplg_build_fe_dai_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                             snd_config_t *parent);
+int tplg_build_base_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                          snd_config_t *parent, bool skip_name);
+int tplg_build_pcm_caps_object(struct tplg_pre_processor *tplg_pp,
+                              snd_config_t *obj_cfg, snd_config_t *parent);
+int tplg_parent_update(struct tplg_pre_processor *tplg_pp, snd_config_t *parent,
+                         const char *section_name, const char *item_name);
+int tplg_add_object_data(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+                        snd_config_t *top, const char *array_name);
+
+/* object helpers */
+int tplg_pre_process_objects(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg,
+                            snd_config_t *parent);
+snd_config_t *tplg_object_get_instance_config(struct tplg_pre_processor *tplg_pp,
+                                       snd_config_t *class_type);
+const char *tplg_object_get_name(struct tplg_pre_processor *tplg_pp,
+                                snd_config_t *object);
+snd_config_t *tplg_object_get_section(struct tplg_pre_processor *tplg_pp, snd_config_t *class);
+
+/* class helpers */
+snd_config_t *tplg_class_lookup(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg);
+snd_config_t *tplg_class_find_attribute_by_name(struct tplg_pre_processor *tplg_pp,
+                                               snd_config_t *class, const char *name);
+bool tplg_class_is_attribute_mandatory(const char *attr, snd_config_t *class_cfg);
+bool tplg_class_is_attribute_immutable(const char *attr, snd_config_t *class_cfg);
+bool tplg_class_is_attribute_unique(const char *attr, snd_config_t *class_cfg);
+const char *tplg_class_get_unique_attribute_name(struct tplg_pre_processor *tplg_pp,
+                                                snd_config_t *class);
+snd_config_type_t tplg_class_get_attribute_type(struct tplg_pre_processor *tplg_pp,
+                                               snd_config_t *attr);
+const char *tplg_class_get_attribute_token_ref(struct tplg_pre_processor *tplg_pp,
+                                              snd_config_t *class, const char *attr_name);
+long tplg_class_attribute_valid_tuple_value(struct tplg_pre_processor *tplg_pp,
+                                           snd_config_t *class, snd_config_t *attr);
+
+/* config helpers */
+snd_config_t *tplg_find_config(snd_config_t *config, const char *name);
+int tplg_config_make_add(snd_config_t **config, const char *id, snd_config_type_t type,
+                        snd_config_t *parent);
+
+char *tplg_snprintf(char *fmt, ...);
+#endif
diff --git a/topology/topology.c b/topology/topology.c
new file mode 100644 (file)
index 0000000..9752f88
--- /dev/null
@@ -0,0 +1,553 @@
+/*
+  Copyright(c) 2019 Red Hat Inc.
+  Copyright(c) 2014-2015 Intel Corporation
+  Copyright(c) 2010-2011 Texas Instruments Incorporated,
+  All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of version 2 of the GNU General Public License as
+  published by the Free Software Foundation.
+
+  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 St - Fifth Floor, Boston, MA 02110-1301 USA.
+  The full GNU General Public License is included in this distribution
+  in the file called LICENSE.GPL.
+*/
+
+#include "aconfig.h"
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <getopt.h>
+#include <assert.h>
+
+#include <alsa/asoundlib.h>
+#include <alsa/topology.h>
+#include "gettext.h"
+#ifdef ENABLE_NLS
+#include <locale.h>
+#endif
+#include "version.h"
+#include "topology.h"
+
+bool pre_process_config = false;
+
+static snd_output_t *log;
+
+static void usage(const char *name)
+{
+       printf(
+_("Usage: %s [OPTIONS]...\n"
+"\n"
+"-h, --help              help\n"
+"-c, --compile=FILE      compile configuration file\n"
+"-p, --pre-process       pre-process Topology2.0 configuration file before compilation\n"
+"-P, --pre-process=FILE  pre-process Topology2.0 configuration file\n"
+"-d, --decode=FILE       decode binary topology file\n"
+"-n, --normalize=FILE    normalize configuration file\n"
+"-u, --dump=FILE         dump (reparse) configuration file\n"
+"-v, --verbose=LEVEL     set verbosity level (0...1)\n"
+"-o, --output=FILE       set output file\n"
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+"-D, --define=ARGS       define variables (VAR1=VAL1[,VAR2=VAL2] ...)\n"
+"                        (may be used multiple times)\n"
+"-I, --inc-dir=DIR       set include path\n"
+#endif
+"-s, --sort              sort the identifiers in the normalized output\n"
+"-g, --group             save configuration by group indexes\n"
+"-x, --nocheck           save configuration without additional integrity checks\n"
+"-z, --dapm-nosort       do not sort the DAPM widgets\n"
+"-V, --version           print version\n"
+), name);
+}
+
+static void version(const char *name)
+{
+       printf(
+_("%s version %s\n"
+"libasound version %s\n"
+"libatopology version %s\n"
+), name, SND_UTIL_VERSION_STR,
+   snd_asoundlib_version(), snd_tplg_version());
+}
+
+static int load(const char *source_file, void **dst, size_t *dst_size)
+{
+       int fd;
+       void *buf, *buf2;
+       size_t size, pos;
+       ssize_t r;
+
+       if (strcmp(source_file, "-") == 0) {
+               fd = fileno(stdin);
+       } else {
+               fd = open(source_file, O_RDONLY);
+               if (fd < 0) {
+                       fprintf(stderr, _("Unable to open input file '%s': %s\n"),
+                               source_file, strerror(errno));
+                       return 1;
+               }
+       }
+
+       size = 16*1024;
+       pos = 0;
+       buf = malloc(size);
+       if (buf == NULL)
+               goto _nomem;
+       while (1) {
+               r = read(fd, buf + pos, size - pos);
+               if (r < 0 && (errno == EAGAIN || errno == EINTR))
+                       continue;
+               if (r <= 0)
+                       break;
+               pos += r;
+               size += 8*1024;
+               buf2 = realloc(buf, size);
+               if (buf2 == NULL)
+                       goto _nomem;
+               buf = buf2;
+       }
+       if (r < 0) {
+               fprintf(stderr, _("Read error: %s\n"), strerror(errno));
+               goto _err;
+       }
+
+       if (fd != fileno(stdin))
+               close(fd);
+
+       *dst = buf;
+       *dst_size = pos;
+       return 0;
+
+_nomem:
+       fprintf(stderr, _("No enough memory\n"));
+_err:
+       if (fd != fileno(stdin))
+               close(fd);
+       free(buf);
+       return 1;
+}
+
+static int load_topology(snd_tplg_t **tplg, char *config,
+                        size_t config_size, int cflags)
+{
+       int err;
+
+       *tplg = snd_tplg_create(cflags);
+       if (*tplg == NULL) {
+               fprintf(stderr, _("failed to create new topology context\n"));
+               return 1;
+       }
+
+       err = snd_tplg_load(*tplg, config, config_size);
+       if (err < 0) {
+               fprintf(stderr, _("Unable to load configuration: %s\n"),
+                       snd_strerror(-err));
+               snd_tplg_free(*tplg);
+               return 1;
+       }
+
+       return 0;
+}
+
+static int save(const char *output_file, void *buf, size_t size)
+{
+       char *fname = NULL;
+       int fd;
+       ssize_t r;
+
+       if (strcmp(output_file, "-") == 0) {
+               fd = fileno(stdout);
+       } else {
+               fname = alloca(strlen(output_file) + 5);
+               strcpy(fname, output_file);
+               strcat(fname, ".new");
+               fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+               if (fd < 0) {
+                       fprintf(stderr, _("Unable to open output file '%s': %s\n"),
+                               fname, strerror(errno));
+                       return 1;
+               }
+       }
+
+       r = 0;
+       while (size > 0) {
+               r = write(fd, buf, size);
+               if (r < 0 && (errno == EAGAIN || errno == EINTR))
+                       continue;
+               if (r < 0)
+                       break;
+               size -= r;
+               buf += r;
+       }
+
+       if (r < 0) {
+               fprintf(stderr, _("Write error: %s\n"), strerror(errno));
+               if (fd != fileno(stdout)) {
+                       if (fname && remove(fname))
+                               fprintf(stderr, _("Unable to remove file %s: %s\n"),
+                                               fname, strerror(errno));
+                       close(fd);
+               }
+               return 1;
+       }
+
+       if (fd != fileno(stdout))
+               close(fd);
+
+       if (fname && rename(fname, output_file)) {
+               fprintf(stderr, _("Unable to rename file '%s' to '%s': %s\n"),
+                       fname, output_file, strerror(errno));
+               return 1;
+       }
+
+       return 0;
+}
+
+static int dump(const char *source_file, const char *output_file, int cflags, int sflags)
+{
+       snd_tplg_t *tplg;
+       char *config, *text;
+       size_t size;
+       int err;
+
+       err = load(source_file, (void **)&config, &size);
+       if (err)
+               return err;
+       err = load_topology(&tplg, config, size, cflags);
+       free(config);
+       if (err)
+               return err;
+       err = snd_tplg_save(tplg, &text, sflags);
+       snd_tplg_free(tplg);
+       if (err < 0) {
+               fprintf(stderr, _("Unable to save parsed configuration: %s\n"),
+                       snd_strerror(-err));
+               return 1;
+       }
+       err = save(output_file, text, strlen(text));
+       free(text);
+       return err;
+}
+
+static char *get_inc_path(const char *filename)
+{
+       const char *s = strrchr(filename, '/');
+       char *r = strdup(filename);
+       if (r) {
+               if (s)
+                       r[s - filename] = '\0';
+               else if (r[0])
+                       strcpy(r, ".");
+       }
+       return r;
+}
+
+static int pre_process_run(struct tplg_pre_processor **tplg_pp,
+                          const char *source_file, const char *output_file,
+                          const char *pre_processor_defs, const char *include_path)
+{
+       size_t config_size;
+       char *config, *inc_path;
+       snd_output_type_t output_type;
+       int err;
+
+       err = load(source_file, (void **)&config, &config_size);
+       if (err)
+               return err;
+
+       /* init pre-processor */
+       output_type = output_file == NULL ? SND_OUTPUT_BUFFER : SND_OUTPUT_STDIO;
+       err = init_pre_processor(tplg_pp, output_type, output_file);
+       if (err < 0) {
+               fprintf(stderr, _("failed to init pre-processor for Topology2.0\n"));
+               free(config);
+               return err;
+       }
+
+       /* pre-process conf file */
+       if (!include_path)
+               inc_path = get_inc_path(source_file);
+       else
+               inc_path = strdup(include_path);
+       err = pre_process(*tplg_pp, config, config_size, pre_processor_defs, inc_path);
+       free(inc_path);
+
+       if (err < 0)
+               free_pre_processor(*tplg_pp);
+       free(config);
+       return err;
+}
+
+/* Convert Topology2.0 conf to the existing conf syntax */
+static int pre_process_conf(const char *source_file, const char *output_file,
+                           const char *pre_processor_defs, const char *include_path)
+{
+       struct tplg_pre_processor *tplg_pp;
+       int err;
+
+       err = pre_process_run(&tplg_pp, source_file, output_file,
+                             pre_processor_defs, include_path);
+       if (err < 0)
+               return err;
+
+       /* free pre-processor */
+       free_pre_processor(tplg_pp);
+       return err;
+}
+
+static int compile(const char *source_file, const char *output_file, int cflags,
+                  const char *pre_processor_defs, const char *include_path)
+{
+       struct tplg_pre_processor *tplg_pp = NULL;
+       snd_tplg_t *tplg;
+       char *config;
+       void *bin;
+       size_t config_size, size;
+       int err;
+
+       err = load(source_file, (void **)&config, &config_size);
+       if (err)
+               return err;
+
+       /* pre-process before compiling */
+       if (pre_process_config) {
+               char *pconfig;
+               size_t size;
+
+               err = pre_process_run(&tplg_pp, source_file, NULL,
+                                     pre_processor_defs, include_path);
+               if (err < 0)
+                       return err;
+
+               /* load topology */
+               size = snd_output_buffer_string(tplg_pp->output, &pconfig);
+               err = load_topology(&tplg, pconfig, size, cflags);
+
+               /* free pre-processor */
+               free_pre_processor(tplg_pp);
+       } else {
+               err = load_topology(&tplg, config, config_size, cflags);
+       }
+       free(config);
+       if (err)
+               return err;
+       err = snd_tplg_build_bin(tplg, &bin, &size);
+       snd_tplg_free(tplg);
+       if (err < 0 || size == 0) {
+               fprintf(stderr, _("failed to compile context %s: %s\n"),
+                       source_file, snd_strerror(-err));
+               return 1;
+       }
+       err = save(output_file, bin, size);
+       free(bin);
+       return err;
+}
+
+static int decode(const char *source_file, const char *output_file,
+                 int cflags, int dflags, int sflags)
+{
+       snd_tplg_t *tplg;
+       void *bin;
+       char *text;
+       size_t size;
+       int err;
+
+       if (load(source_file, &bin, &size))
+               return 1;
+       tplg = snd_tplg_create(cflags);
+       if (tplg == NULL) {
+               fprintf(stderr, _("failed to create new topology context\n"));
+               return 1;
+       }
+       err = snd_tplg_decode(tplg, bin, size, dflags);
+       free(bin);
+       if (err < 0) {
+               snd_tplg_free(tplg);
+               fprintf(stderr, _("failed to decode context %s: %s\n"),
+                       source_file, snd_strerror(-err));
+               return 1;
+       }
+       err = snd_tplg_save(tplg, &text, sflags);
+       snd_tplg_free(tplg);
+       if (err < 0) {
+               fprintf(stderr, _("Unable to save parsed configuration: %s\n"),
+                       snd_strerror(-err));
+               return 1;
+       }
+       err = save(output_file, text, strlen(text));
+       free(text);
+       return err;
+}
+
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+static int add_define(char **defs, char *d)
+{
+       size_t len = (*defs ? strlen(*defs) : 0) + strlen(d) + 2;
+       char *m = realloc(*defs, len);
+       if (m) {
+               if (*defs)
+                       strcat(m, ",");
+               strcat(m, d);
+               *defs = m;
+               return 0;
+       }
+       return 1;
+}
+#endif
+
+int main(int argc, char *argv[])
+{
+       static const char short_options[] = "hc:d:n:u:v:o:pP:sgxzV"
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+               "D:I:"
+#endif
+               ;
+       static const struct option long_options[] = {
+               {"help", 0, NULL, 'h'},
+               {"verbose", 1, NULL, 'v'},
+               {"compile", 1, NULL, 'c'},
+               {"pre-process", 1, NULL, 'p'},
+               {"decode", 1, NULL, 'd'},
+               {"normalize", 1, NULL, 'n'},
+               {"dump", 1, NULL, 'u'},
+               {"output", 1, NULL, 'o'},
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+               {"define", 1, NULL, 'D'},
+               {"inc-dir", 1, NULL, 'I'},
+#endif
+               {"sort", 0, NULL, 's'},
+               {"group", 0, NULL, 'g'},
+               {"nocheck", 0, NULL, 'x'},
+               {"dapm-nosort", 0, NULL, 'z'},
+               {"version", 0, NULL, 'V'},
+               {0, 0, 0, 0},
+       };
+       char *source_file = NULL;
+       char *output_file = NULL;
+       const char *inc_path = NULL;
+       char *pre_processor_defs = NULL;
+       int c, err, op = 'c', cflags = 0, dflags = 0, sflags = 0, option_index;
+
+#ifdef ENABLE_NLS
+       setlocale(LC_ALL, "");
+       textdomain(PACKAGE);
+#endif
+
+       err = snd_output_stdio_attach(&log, stderr, 0);
+       assert(err >= 0);
+
+       while ((c = getopt_long(argc, argv, short_options, long_options, &option_index)) != -1) {
+               switch (c) {
+               case 'h':
+                       usage(argv[0]);
+                       return 0;
+               case 'v':
+                       cflags |= SND_TPLG_CREATE_VERBOSE;
+                       break;
+               case 'z':
+                       cflags |= SND_TPLG_CREATE_DAPM_NOSORT;
+                       break;
+               case 'c':
+               case 'd':
+               case 'n':
+               case 'u':
+                       if (source_file) {
+                               fprintf(stderr, _("Cannot combine operations (compile, normalize, pre-process, dump)\n"));
+                               return 1;
+                       }
+                       source_file = optarg;
+                       op = c;
+                       break;
+               case 'o':
+                       output_file = optarg;
+                       break;
+               case 's':
+                       sflags |= SND_TPLG_SAVE_SORT;
+                       break;
+               case 'P':
+                       op = 'P';
+                       source_file = optarg;
+                       break;
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+               case 'I':
+                       inc_path = optarg;
+                       break;
+#endif
+               case 'p':
+                       pre_process_config = true;
+                       break;
+               case 'g':
+                       sflags |= SND_TPLG_SAVE_GROUPS;
+                       break;
+               case 'x':
+                       sflags |= SND_TPLG_SAVE_NOCHECK;
+                       break;
+#if SND_LIB_VER(1, 2, 5) < SND_LIB_VERSION
+               case 'D':
+                       if (add_define(&pre_processor_defs, optarg)) {
+                               fprintf(stderr, _("No enough memory"));
+                               return 1;
+                       }
+                       break;
+#endif
+               case 'V':
+                       version(argv[0]);
+                       return 0;
+               default:
+                       fprintf(stderr, _("Try `%s --help' for more information.\n"), argv[0]);
+                       return 1;
+               }
+       }
+
+       if (source_file == NULL || output_file == NULL) {
+               usage(argv[0]);
+               return 1;
+       }
+
+       if ((cflags & SND_TPLG_CREATE_VERBOSE) != 0 &&
+           output_file && strcmp(output_file, "-") == 0) {
+               fprintf(stderr, _("Invalid mix of verbose level and output to stdout.\n"));
+               return 1;
+       }
+
+       if (op == 'n') {
+               if (sflags != 0 && sflags != SND_TPLG_SAVE_SORT) {
+                       fprintf(stderr, _("Wrong parameters for the normalize operation!\n"));
+                       return 1;
+               }
+               /* normalize has predefined output */
+               sflags = SND_TPLG_SAVE_SORT;
+       }
+
+       switch (op) {
+       case 'c':
+               err = compile(source_file, output_file, cflags, pre_processor_defs, inc_path);
+               break;
+       case 'd':
+               err = decode(source_file, output_file, cflags, dflags, sflags);
+               break;
+       case 'P':
+               err = pre_process_conf(source_file, output_file, pre_processor_defs, inc_path);
+               break;
+       default:
+               err = dump(source_file, output_file, cflags, sflags);
+               break;
+       }
+
+       snd_output_close(log);
+       free(pre_processor_defs);
+       return err ? 1 : 0;
+}
diff --git a/topology/topology.h b/topology/topology.h
new file mode 100644 (file)
index 0000000..3a09c20
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TOPOLOGY_H
+#define __TOPOLOGY_H
+
+#include <stdlib.h>
+
+/* pre_processor */
+struct tplg_pre_processor {
+       snd_config_t *input_cfg;
+       snd_config_t *output_cfg;
+       snd_output_t *output;
+       snd_output_t *dbg_output;
+       snd_config_t *current_obj_cfg;
+       snd_config_t *define_cfg;
+       snd_config_t *define_cfg_merged;
+       char *inc_path;
+};
+
+int pre_process(struct tplg_pre_processor *tplg_pp, char *config, size_t config_size,
+               const char *pre_processor_defs, const char *inc_path);
+int init_pre_processor(struct tplg_pre_processor **tplg_pp, snd_output_type_t type,
+                      const char *output_file);
+void free_pre_processor(struct tplg_pre_processor *tplg_pp);
+#endif
index f5efbb1..8bb4926 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -50,21 +88,35 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = utils
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/alsa-utils.spec.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/aconfig.h
 CONFIG_CLEAN_FILES = alsa-utils.spec
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
 am__can_run_installinfo = \
@@ -72,13 +124,19 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/alsa-utils.spec.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALSACTL_DAEMONSWITCH = @ALSACTL_DAEMONSWITCH@
 ALSACTL_PIDFILE_DIR = @ALSACTL_PIDFILE_DIR@
 ALSA_CFLAGS = @ALSA_CFLAGS@
 ALSA_LIBS = @ALSA_LIBS@
+ALSA_TOPOLOGY_LIBS = @ALSA_TOPOLOGY_LIBS@
+ALSA_TOPOLOGY_PLUGIN_DIR = @ALSA_TOPOLOGY_PLUGIN_DIR@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
 ASOUND_LOCK_DIR = @ASOUND_LOCK_DIR@
 ASOUND_STATE_DIR = @ASOUND_STATE_DIR@
 AUTOCONF = @AUTOCONF@
@@ -96,11 +154,18 @@ CURSES_CFLAGS = @CURSES_CFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+FFTW_CFLAGS = @FFTW_CFLAGS@
+FFTW_INC = @FFTW_INC@
+FFTW_LIB = @FFTW_LIB@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
@@ -112,27 +177,37 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBOBJS = @LIBOBJS@
 LIBRT = @LIBRT@
 LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
 NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
 NCURSESW_LIBS = @NCURSESW_LIBS@
 NCURSES_CFLAGS = @NCURSES_CFLAGS@
 NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -145,6 +220,7 @@ PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 POSUB = @POSUB@
+RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
@@ -153,6 +229,8 @@ SND_UTIL_MINOR = @SND_UTIL_MINOR@
 SND_UTIL_SUBMINOR = @SND_UTIL_SUBMINOR@
 SND_UTIL_VERSION = @SND_UTIL_VERSION@
 STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
 TESTSOUND = @TESTSOUND@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
@@ -163,7 +241,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -204,6 +284,8 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+rst2man_available = @rst2man_available@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -214,7 +296,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 udevrulesdir = @udevrulesdir@
-xmlto = @xmlto@
+xmlto_available = @xmlto_available@
 EXTRA_DIST = buildrpm
 all: all-am
 
@@ -231,14 +313,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --foreign utils/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -251,16 +332,23 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 alsa-utils.spec: $(top_builddir)/config.status $(srcdir)/alsa-utils.spec.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-tags: TAGS
-TAGS:
 
-ctags: CTAGS
-CTAGS:
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
 
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -326,7 +414,7 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
@@ -378,7 +466,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
 
 pdf: pdf-am
 
@@ -392,15 +480,19 @@ uninstall-am:
 
 .MAKE: install-am install-strip
 
-.PHONY: all all-am check check-am clean clean-generic distclean \
-       distclean-generic distdir dvi dvi-am html html-am info info-am \
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       cscopelist-am ctags-am distclean distclean-generic \
+       distclean-libtool distdir dvi dvi-am html html-am info info-am \
        install install-am install-data install-data-am install-dvi \
        install-dvi-am install-exec install-exec-am install-html \
        install-html-am install-info install-info-am install-man \
        install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
 
 
 rpm: buildrpm alsa-lib.spec