From c32a2d4cee97188788e94262c83a62f2a8f51d00 Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 15 2020 18:58:39 +0000 Subject: mpg123-1.25.10 base --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..c1eac97 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,175 @@ +This is an attempt to give credit to the people who contributed in some way to the mpg123 project. +There are names and email addresses listed. Please use these addresses only to contact contributors with some question about their mpg123 contribution. +You are explicitly not allowed to send them unwanted business offers or to question the quality of their sex life. +-------------------- + +Being on the list of contributing authors not necessarily means that there +is significant copyright in parts of the source code. There are obviously +contributions of differing complexity. I try to mention people who motivated +changes at least by suggesting some definite code changes, even if their +code did not enter the mpg123 source verbatim. Trivial changes like pointing +out ovbious syntax errors that make compilers cry do not land here. + +-------------------- + +Current maintainers with various sorts of contributions: + Thomas Orgis + Patrick Dehne + Jonathan Yong <10walls@gmail.com> + Taihei Momma + +Co-initiator of the revived mpg123 project, but not that involved anymore: + Nicholas J Humfrey + +Special thanks go to Taihei, the person who keeps the assembly optimisations alive +and takes care of portability to OSX/iOS platforms. + +Generic address pointing to the current maintainer (hopefully still works in future in case maintainership will change again): + +The creator: Michael Hipp (email: hippm@informatik.uni-tuebingen.de - please bother maintainers first) + +Contributions/ideas Thomas Orgis era (includes backports from mhipp trunk): + +Won-Kyu Park : patch to get rid of asm textrels (x86 PIC) +Michael Weiser : update of coreaudio output to AudioComponents API +Bent Bisballe Nyeng : patch for MPG123_NO_PEEK_END and MPG123_FORCE_SEEKABLE +Eric S. Raymond : man page fixes +Tobias Weber : patch for --disable-equalizer +Hans de Goede : patch to skip APE tags +Stephan Vedder : MSVC++ 2013 port update +Rajeev V. Pillai : pointing out/patching issues in HTTP code and behaviour of mpg123 remote/terminal control +Jarno Lehtinen : tinyalsa output +Anthony Wells : initial version of ID3v2 APIC patch +David Wohlferd : Win32 WaveOut buffer destructor fix. +Mike Gorchak : QNX native audio output (QSA) +Dan McGee : various patches (also for test suite) +Jonathan Yong (jon_y) <10walls@gmail.com>: win32 hacking, win32 wasapi audio. +Malcolm Boczek : Common language runtime wrapper +Elbert Pol (TeLLie) : OS/2 port fixup +Jeroen Valkonet : motivate pitch control, suggestive patch for pitch command in generic control interface +Andy Hefner : patch for that second UTF16 issue +Taihei Monma : A whole lot of new/improved assembler code, including Altivec! +Christian Weisgerber , Brad Smith: sndio output +Patrick Dehne (P4tr3ck) : more MSVC++ porting, patch to handle missing bit reservoirs +Thorsten Glaser : icy2utf8, suggest utf8 locale stuff +Dan Smith : ABI fixes for ensuring stack alignment (esp. for MinGW-built DLL with MSVC) +Michael Ryzhykh : mpg123.spec.in +Stefan Lenselink : initial aRts output +Sergej Kvachonok : win32 audio rewrite +Winston: SunOS-4.1.4/gcc-2.7.0 testing and suggestions for fixes (legacy Makefile, integer type headers) +Mika Tiainen: pointing out the fix for the UTF to ASCII filtering of tags to actually work +Nick Kurshev : extended 3dnow (from mplayer) +Zuxy Meng : SSE (from mplayer) +Honza : idea and prototype patch for ICY meta data support +Petr Baudis : patches: term sigcont, id3 display unicode fallback and condensed output +Petr Salinger : i486 enhancement +mpdavig@users.sourceforge.net: linux-ppc-nas Makefile.legacy entry +Adrian Bacon : patched decode_i586_dither (noise shaped float/int rounding) +Cool Feet Audio project : realtime equalizer control +Steve Grundell : clean stdout in control mode with stdout decoding +Romain Dolbeau : Altivec support (taken from mplayer) +higway : MMX Patch +Clemens Ladisch : ALSA 0.9/1.0 support + +Debian Daniel Kobras era: + +Steve Kemp +Dan Olson +Syuuhei Kashiyama +Rupert Levene +Andreas Dilger +Erik B. Andersen +Chris Butler +Martin Sjogren +Chet Hosey +Roland Rosenfeld + + +Debian Colin Watson era: + +Helge Deller +Chet Hosey +Christopher C. Chimelis +Roland Rosenfeld +Marcelo E. Magallon + + +Initial Debianers: + +Tommi Virtanen +Paul Haggart + + +Contributions/ideas Michael Hipp era: + +Mikko Tommila: DCT9 +Oliver Fromme +MPEG Software Simulation Group: reference decoder package +Tobias Bading: idea for DCT64 in subband synthesis from maplay package +Jeff Tsay and Mikko Tommila: MDCT36 from maplay package +Philipp Knirsch : DCT36/manual unroll idea +Thomas Woerner: SGI Audio +Damien Clermonte: HP-UX audio fixes +Niclas Lindstrom : OS2 port +Stefan Bieschewski : Pentium optimizations, decode_i586.s +Martin Denn : NAS port +Niklas Beisert : MPEG 2.5 tables + and : NetBSD Patch(es) +Kevin Brintnall : BSD patch +Tony Million: win32 port +Steven Tiger Lang: advanced shuffle +Eric B. Mitchell: esd port +Ryan R. Prosser : esd port for Solaris +Andreas Neuhaus: initial generic control interface + +(additionally fetched from changelog:) + +Ralf Hildebrandt : audio_alib changes +: BSDOS 4.0 with gcc added to Makefile +Bertrand Petit : frontend changes +Erik Mouw : SGI audio fix for non RAD machines +Daniel O'Connor : freebsd-esd make-entry +D. Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>: enhanced head_check +Wilson, Jeff D : xterm-title +Robert Bihlmeyer : esd changes +Hannu Napari's : SGI audio patches +: native AIX support +: playlist patch +Gilles Zunino : SGI audio patches +Matthew Parslow : esdserver patch +: equalizer patch (equalfile setting) +Ducroquet Erwan : HPUX/ALib support +Shane Wegner : genrepatch +Samuel Audet : wav-File patch +"J. Dean Brederson" : SGI-RAD support +Chou Ye-chi : sajberplay/FreeBSD patch +Fabrice Bellard : 486 optimizations +A. Hermansen and J. Kysela : ALSA output +KIMURA Takuhiro : K6-3DNow +Petr Stehlik : MINT +Andy : float2int speed up proposal +Brian Foutz : TK3Play +Thomas Niederreiter : RIFF header fix +Stefan Gybas : m68k patch +Grant Erickson : Linux PPC patch +Peter Berger : BSDi patch +Henrik P Johnson : HTTP auth +Steven Tiger Lang : advanced shuffle +"Brian J. Swetland" : front-end (remote) patch + +Tillmann Steinbrecher : shuffle patch +M.Stekelenburg : i386-getbits +Antti Andreimann : outburst patch +Hur TaeSung : 'http accept' patch + +(from post-0.59 changes that yet have to go into new trunk:) + +Hans Schwengeler : audio_dec additions +Wojciech Bara�ski's Mp3Play (check the tools folder): Mp3Play frontend +Daniel Koukola: audio_oss.c patch +Munechika SUMIKAWA : IPv6 +TEMNOTA : HTTP,FTP patch/playlist fix +Peter Surda : VBR patch +Ben : ARM startup time improvements +Dave MacKenzie : init_output() patch +pasky's : close-on-stop patch diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d7bb85f --- /dev/null +++ b/COPYING @@ -0,0 +1,772 @@ +This is the file that contains the terms of use, copying, etc. for the mpg123 distribution package. + +Main message, to include in "About ..." boxes, etc: + + Copyright (c) 1995-2013 by Michael Hipp and others, + free software under the terms of the LGPL v2.1 + +There is an attempt to cover the actual list of authors in the AUTHORS file. +Project maintainer since 2006 is Thomas Orgis and many people have contributed +since the Michael Hipp era, but he stays the initial source and it would +be impractical to count them all individually, so it's "and others". +Source files contain the phrase "the mpg123 project" to the same effect +in their license boilerplate; especially those that were added after +maintainership changed. The person mainly responsible for the first version +is usually named in the phrase "initially written by ...". + +All files in the distribution that don't carry a license note on their own are +licensed under the terms of the LGPL 2.1; exceptions may apply, especially to +files not in the official distribution but in the revision control repository. + +The formal license text follows. + +======================= +1. The LGPL version 2.1 +======================= + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + +==================== +2. The GPL version 2 +==================== + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e8d40a1 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,3 @@ +This is a dummy file. If you want to see the change log, use subversion: + + svn log -v svn://orgis.org/mpg123 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..5585d0f --- /dev/null +++ b/INSTALL @@ -0,0 +1,115 @@ +mpg123 install hints +-------------------- + +(This file has very long lines - die-hard terminal nostalgists can be satisfied by `fmt -s -w 75 < INSTALL | less`. I think it's better to let the reader's preference rule than to preformat the stuff to some arbitrary width.) + + +0. Prerequesites + +You really need: + +- a C compiler; we try to keep the code ANSI C89/ISO C90 compatible + gcc from 2.95 on should work, others, too - please report any issues + Actually, we have a confirmed working build (svn trunk leading to release 0.67) on SunOS 4.1.4 with gcc-2.7.0 . + +- an (UNIX-like) operating system with standard tools; MinGW32 and Cygwin are working for Microsoft Windows, too. We also have users happily on OS/2. +- For the library only, you may get lucky with MSVC++ using the project files under ports/ +- For other exotic platforms, also see ports/ +- If building from direct SCM checkout, you need GNU autotools installed (see below). + +You want: + +- working assembler (recent GNU binutils) if using certain CPU optimizations +- headers and lib for certain audio output drivers (libasound for alsa, sdl for sdl...) + +1. Build + +There is one main supported way to get your mpg123 installation consisting of + + a) the mpg123 binary file + - with libmpg123 as shared library or statically linked + - with audio output plugins, or one statically linked + b) a man page + +(you may want to copy some of the documentation - README, etc - to /usr/share/doc/mpg123 or the like, too) + +This way is the usual GNU 3-step procedure: + + ./configure + make + make install + +Run + + ./configure --help + +for a list of possible parameters you can specify in the configuration step. The obvious are --prefix and the normal GNU autotool bunch, but others include what audio subsystem to use and what CPU optimizations to build in. +For the optimizations (decoder choice), the default is a build that combines all usable optimizations for the platform and chooses one at runtime (see --cpu, --list-cpu and --test-cpu parameters). + +There are various parameters you can tune, but of course the defaults are what is mainly tested. + +Also, various library features can be left out via --disable options (like output formats, resampling modes). That way, you can strive for a minimal build that only does what you really need. Not every combination of library features is tested regularily, so you might hit some speed bumps, but usually stuff that is easily worked out (at least for the mpg123 team when you report it). + +An example (working on mpg123 trunk r3062): + + CFLAGS="-Os -s" ./configure --with-cpu=generic --disable-id3v2 --disable-lfs-alias --disable-feature-report --with-seektable=0 --disable-16bit --disable-32bit --disable-8bit --disable-messages --disable-feeder --disable-ntom --disable-downsample --disable-icy && make + +That, and further application of `strip --strip-unneeded`, yields a lean 93 KiB shared library for MPEG layer I/II/III decoding to floating point on my x86-64 system (it should be a bit smaller on 32 bit systems). When disabling layers I and II, too, that goes down to 81 KiB. + +The shared library of a full build weighs 170 KiB after stripping. + + +2. Developer build + +This project uses GNU autotools (no specific version, but they should be fairly recent), also libtool. You need to have those installed, as it is usually the case for build environments based on the GNU toolchain. + +One a fresh SCM checkout, or after changing things in configure.ac, you need to run + + autoreconf -iv + +to prepare the configure script. Then you can build as per point 1. + + +3. Library-only build + +If you do not want to build the whole thing, but only the library, run + + ./configure + cd src/libmpg123 + make + +You can then find the library itself under src/libmpg123/.libs (libtool likes to hide things there). + + +4. Exotic platforms + +See the ports/ directory for some help for building at least libmpg123 without the UNIX shell / autotools. The main strategy is to write a config.h to replace what configure would generate and then have a correct listing of all source files involved in that configuration (there are optional files for different decoder choices, for example). + +Then compile objects, link. + + +4a. Preparing Win32 binary packages. + +Caution: You should make sure to use some gcc >= 4.2.0, even if it's still the experimental package for MinGW32. +This helps preventing incompatibilities between generated DLL files and other compilers (it's about stack alignment). + +Get MinGW/MSYS installed, run the MSYS shell. +Enter the mpg123 source directory. +Execute sh ./windows-builds.sh . + +After some time, you should have some relevant files under releases/ (or releases\, for Windows people;-). +You don't just get one build -- there are several variants, corresponding to what usually is to be found under http://mpg123.org/download/win32 . + + +5. Note on large file support + +The libmpg123 API includes the generic off_t type for file offsets and thus is subject to shape-shifting on systems that change off_t depending on build flags. +To deal with the incompatibilities that can cause, the library needs to separate code paths for small and large off_t. +Since version 1.12.0, a large-file-enabled libmpg123 (the default set by configure) provides a dual-mode ABI. Depending on _FILE_OFFSET_BITS, the mpg123.h header file selects different library symbols to use for your app. +In both large-file and normal mode, the library should just work for your app. + +6. Security + +If you consider installing the mpg123 binary or any program using libout123 as suid root, please don't. Apart from evaluating MPG123_MODDIR from the environment and thus possibly loading any code, the purpose of libout123 is to write audio data to somewhere. That includes writing raw data to files. Any files you specify to the program. You do not install dd or gzip suid root, do you? + +Programs using libmpg123 should be fine, as that one does not load runtime modules and also only has code to read files, not write them. Still, if your task involves decoding random MPEG audio files from anywhere, it is only sensible to limit the damage of a possible bug triggered by certain crafted files. This is not specific to libmpg123 but generally a good idea working with data from untrusted sources. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..c6d51ba --- /dev/null +++ b/Makefile.am @@ -0,0 +1,134 @@ +## Makefile.am: produce Makefile.in from this + +## copyright by the mpg123 project - free software under the terms of the LGPL 2.1 +## see COPYING and AUTHORS files in distribution or http://mpg123.org +## initially written by Nicholas J. Humfrey +## reworked for non-recursive make by Thomas Orgis + +# Mention all global variables first before including Make modules. +ACLOCAL_AMFLAGS = -I m4 +bin_PROGRAMS = +EXTRA_PROGRAMS = +EXTRA_DIST = +pkglib_LTLIBRARIES = +lib_LTLIBRARIES = +noinst_LIBRARIES = +noinst_LTLIBRARIES = +nodist_include_HEADERS = +include_HEADERS = +dist_man_MANS = +CLEANFILES = + +AM_CPPFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\"" +# That can be trimmed down later when adapting the sources to +# use relative paths for includes. +# Watch out for generated headers (that's why top_builddir is also present). +AM_CPPFLAGS += \ + $(LTDLINCL) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/compat \ + -I$(top_srcdir)/src/libmpg123 \ + -I$(top_srcdir)/src/libout123 \ + -I$(top_builddir)/src/libmpg123 \ + -I$(top_builddir)/src/libout123 + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = + +# Include Make modules from subdirectories. +include src/Makemodule.am +include doc/Makemodule.am + +# Stuff from this directory. +pkgconfig_DATA += libmpg123.pc libout123.pc + +dist_man_MANS += man1/mpg123.1 man1/out123.1 + +# mpg123.spec is autogenerated but needs to be present in tarball! +EXTRA_DIST += \ + mpg123.spec \ + makedll.sh \ + windows-builds.sh \ + equalize.dat \ + NEWS.libmpg123 \ + NEWS.libout123 \ + ports/MSVC++/mpg123.h \ + ports/MSVC++/config.h \ + ports/MSVC++/msvc.c \ + ports/MSVC++/examples/scan.c \ + ports/MSVC++/examples/feedseek.c \ + ports/MSVC++/2008clr/2008clr.sln \ + ports/MSVC++/2008clr/mpg123clr/advanced.cpp \ + ports/MSVC++/2008clr/mpg123clr/advanced.h \ + ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp \ + ports/MSVC++/2008clr/mpg123clr/dllmain.cpp \ + ports/MSVC++/2008clr/mpg123clr/enum.h \ + ports/MSVC++/2008clr/mpg123clr/error.cpp \ + ports/MSVC++/2008clr/mpg123clr/error.h \ + ports/MSVC++/2008clr/mpg123clr/id3v1.cpp \ + ports/MSVC++/2008clr/mpg123clr/id3v1.h \ + ports/MSVC++/2008clr/mpg123clr/id3v2.cpp \ + ports/MSVC++/2008clr/mpg123clr/id3v2.h \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.h \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj \ + ports/MSVC++/2008clr/mpg123clr/ReadMe.txt \ + ports/MSVC++/2008clr/mpg123clr/resource.h \ + ports/MSVC++/2008clr/mpg123clr/stdafx.cpp \ + ports/MSVC++/2008clr/mpg123clr/stdafx.h \ + ports/MSVC++/2008clr/mpg123clr/string.cpp \ + ports/MSVC++/2008clr/mpg123clr/string.h \ + ports/MSVC++/2008clr/mpg123clr/targetver.h \ + ports/MSVC++/2008clr/mpg123clr/text.cpp \ + ports/MSVC++/2008clr/mpg123clr/text.h \ + ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj \ + ports/MSVC++/2008clr/examples/feedseekclr/Program.cs \ + ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj \ + ports/MSVC++/2008clr/examples/scanclr/Program.cs \ + ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2015/win32/feedseek \ + ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj.filters \ + ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj \ + ports/MSVC++/2015/win32/libmpg123 \ + ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj \ + ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj.filters \ + ports/MSVC++/2015/win32/mpg123.sln \ + ports/MSVC++/2015/win32/dump_seekindex \ + ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj \ + ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj.filters \ + ports/MSVC++/2015/win32/scan \ + ports/MSVC++/2015/win32/scan/scan.vcxproj.filters \ + ports/MSVC++/2015/win32/scan/scan.vcxproj \ + ports/MSVC++/2015/uwp/libmpg123 \ + ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj \ + ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj.filters \ + ports/MSVC++/2015/uwp/libmpg123.sln \ + ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj \ + ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE \ + ports/MSVC++/CMP3Stream/README \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP \ + ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H \ + ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H \ + ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H \ + ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H \ + ports/README \ + ports/Sony_PSP/config.h \ + ports/Sony_PSP/README \ + ports/Sony_PSP/Makefile.psp \ + ports/Sony_PSP/readers.c.patch \ + ports/mpg123_.pas \ + ports/Xcode/config.h \ + ports/Xcode/mpg123.h \ + ports/Xcode/mpg123.xcodeproj/project.pbxproj \ + scripts/benchmark-cpu.pl \ + scripts/tag_lyrics.py \ + scripts/conplay \ + scripts/mpg123info diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..b435730 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,4084 @@ +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 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@ + +# Module for non-recursive mpg123 build system. + +# Module for non-recursive mpg123 build system. + +# Module for non-recursive mpg123 build system. + +# Module for non-recursive mpg123 build system. +# Gah! Not even re-defining that variable is allowed in automake! +# I WANT TO USE PROPER MAKE! +# makedir := src/libout123/modules +# Experiment: Does automake pick that up in a Make variable? +# Damn, no! It complains wildly. +# I just want to use GNU Make and be done with it! +# Perhaps the next build system rewrite ... +#makenam=src_libout123_modules + +# Module for non-recursive mpg123 build system. + + + + + +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 = src/mpg123$(EXEEXT) src/out123$(EXEEXT) \ + src/mpg123-id3dump$(EXEEXT) src/mpg123-strip$(EXEEXT) +EXTRA_PROGRAMS = src/libmpg123/testcpu$(EXEEXT) \ + src/tests/seek_whence$(EXEEXT) src/tests/noise$(EXEEXT) \ + src/tests/text$(EXEEXT) src/tests/plain_id3$(EXEEXT) + +# Optionally containing the one static module to use. +@HAVE_MODULES_FALSE@am__append_1 = src/libout123/modules/libdefaultmodule.la + +# These are not tested and _very_ likely need work: aix alib hp os2 sgi mint + +# Use that sh/perl script to generate the module entries: +# Confused as to when to use _LIBADD and when _LDADD. +# _LDADD gives errors from autotools. +#echo \ +#dummy tinyalsa alsa qsa coreaudio esd jack nas oss portaudio \ +#pulse sdl sndio sun win32 win32_wasapi aix alib arts hp os2 \ +#sgi mint openal \ +#| tr ' ' '\n' | +#perl -ne 'chomp; $big = uc($_); print </dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(dist_man_MANS) +DATA = $(pkgconfig_DATA) +HEADERS = $(include_HEADERS) $(nodist_include_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 +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope +am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ + $(srcdir)/doc/Makemodule.am $(srcdir)/libmpg123.pc.in \ + $(srcdir)/libout123.pc.in $(srcdir)/mpg123.spec.in \ + $(srcdir)/src/Makemodule.am $(srcdir)/src/compat/Makemodule.am \ + $(srcdir)/src/libmpg123/Makemodule.am \ + $(srcdir)/src/libout123/Makemodule.am \ + $(srcdir)/src/libout123/modules/Makemodule.am \ + $(top_srcdir)/build/compile $(top_srcdir)/build/config.guess \ + $(top_srcdir)/build/config.sub $(top_srcdir)/build/depcomp \ + $(top_srcdir)/build/install-sh $(top_srcdir)/build/ltmain.sh \ + $(top_srcdir)/build/missing $(top_srcdir)/src/config.h.in \ + $(top_srcdir)/src/libmpg123/mpg123.h.in \ + $(top_srcdir)/src/libout123/out123.h.in AUTHORS COPYING \ + ChangeLog INSTALL NEWS README TODO build/compile \ + build/config.guess build/config.sub build/depcomp \ + build/install-sh build/ltmain.sh build/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AIX_CFLAGS = @AIX_CFLAGS@ +AIX_LDFLAGS = @AIX_LDFLAGS@ +AIX_LIBS = @AIX_LIBS@ +ALIB_CFLAGS = @ALIB_CFLAGS@ +ALIB_LDFLAGS = @ALIB_LDFLAGS@ +ALIB_LIBS = @ALIB_LIBS@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LDFLAGS = @ALSA_LDFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +API_VERSION = @API_VERSION@ +AR = @AR@ +ARTS_CFLAGS = @ARTS_CFLAGS@ +ARTS_LDFLAGS = @ARTS_LDFLAGS@ +ARTS_LIBS = @ARTS_LIBS@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COREAUDIO_CFLAGS = @COREAUDIO_CFLAGS@ +COREAUDIO_LDFLAGS = @COREAUDIO_LDFLAGS@ +COREAUDIO_LIBS = @COREAUDIO_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DECODER_LOBJ = @DECODER_LOBJ@ +DECODER_OBJ = @DECODER_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMMY_CFLAGS = @DUMMY_CFLAGS@ +DUMMY_LDFLAGS = @DUMMY_LDFLAGS@ +DUMMY_LIBS = @DUMMY_LIBS@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_LDFLAGS = @ESD_LDFLAGS@ +ESD_LIBS = @ESD_LIBS@ +EXEC_LT_LDFLAGS = @EXEC_LT_LDFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HP_CFLAGS = @HP_CFLAGS@ +HP_LDFLAGS = @HP_LDFLAGS@ +HP_LIBS = @HP_LIBS@ +INCLUDE_STDIO_H = @INCLUDE_STDIO_H@ +INCLUDE_STDLIB_H = @INCLUDE_STDLIB_H@ +INCLUDE_SYS_TYPE_H = @INCLUDE_SYS_TYPE_H@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBS = @JACK_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LFS_LOBJ = @LFS_LOBJ@ +LIBM = @LIBM@ +LIBMPG123_VERSION = @LIBMPG123_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBOUT123_VERSION = @LIBOUT123_VERSION@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_LDFLAGS = @LT_LDFLAGS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MINT_CFLAGS = @MINT_CFLAGS@ +MINT_LDFLAGS = @MINT_LDFLAGS@ +MINT_LIBS = @MINT_LIBS@ +MKDIR_P = @MKDIR_P@ +NAS_CFLAGS = @NAS_CFLAGS@ +NAS_LDFLAGS = @NAS_LDFLAGS@ +NAS_LIBS = @NAS_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENAL_CFLAGS = @OPENAL_CFLAGS@ +OPENAL_LDFLAGS = @OPENAL_LDFLAGS@ +OPENAL_LIBS = @OPENAL_LIBS@ +OS2_CFLAGS = @OS2_CFLAGS@ +OS2_LDFLAGS = @OS2_LDFLAGS@ +OS2_LIBS = @OS2_LIBS@ +OSS_CFLAGS = @OSS_CFLAGS@ +OSS_LDFLAGS = @OSS_LDFLAGS@ +OSS_LIBS = @OSS_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +OUTAPI_VERSION = @OUTAPI_VERSION@ +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@ +PORTAUDIO_CFLAGS = @PORTAUDIO_CFLAGS@ +PORTAUDIO_LDFLAGS = @PORTAUDIO_LDFLAGS@ +PORTAUDIO_LIBS = @PORTAUDIO_LIBS@ +PULSE_CFLAGS = @PULSE_CFLAGS@ +PULSE_LDFLAGS = @PULSE_LDFLAGS@ +PULSE_LIBS = @PULSE_LIBS@ +QSA_CFLAGS = @QSA_CFLAGS@ +QSA_LDFLAGS = @QSA_LDFLAGS@ +QSA_LIBS = @QSA_LIBS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LDFLAGS = @SDL_LDFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SGI_CFLAGS = @SGI_CFLAGS@ +SGI_LDFLAGS = @SGI_LDFLAGS@ +SGI_LIBS = @SGI_LIBS@ +SHELL = @SHELL@ +SNDIO_CFLAGS = @SNDIO_CFLAGS@ +SNDIO_LDFLAGS = @SNDIO_LDFLAGS@ +SNDIO_LIBS = @SNDIO_LIBS@ +STRIP = @STRIP@ +SUN_CFLAGS = @SUN_CFLAGS@ +SUN_LDFLAGS = @SUN_LDFLAGS@ +SUN_LIBS = @SUN_LIBS@ +TINYALSA_CFLAGS = @TINYALSA_CFLAGS@ +TINYALSA_LDFLAGS = @TINYALSA_LDFLAGS@ +TINYALSA_LIBS = @TINYALSA_LIBS@ +VERSION = @VERSION@ +WIN32_CFLAGS = @WIN32_CFLAGS@ +WIN32_LDFLAGS = @WIN32_LDFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +WIN32_WASAPI_CFLAGS = @WIN32_WASAPI_CFLAGS@ +WIN32_WASAPI_LDFLAGS = @WIN32_WASAPI_LDFLAGS@ +WIN32_WASAPI_LIBS = @WIN32_WASAPI_LIBS@ +YASM = @YASM@ +YASMFLAGS = @YASMFLAGS@ +YASM_FORMAT = @YASM_FORMAT@ +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@ +oldincludedir = @oldincludedir@ +output_modules = @output_modules@ +output_modules_la = @output_modules_la@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Mention all global variables first before including Make modules. +ACLOCAL_AMFLAGS = -I m4 + +# The sfifo code is directly used in some modules. + +# mpg123.spec is autogenerated but needs to be present in tarball! +EXTRA_DIST = src/libmpg123/mpg123.h.in src/libout123/out123.h.in \ + src/libout123/sfifo.c src/libout123/sfifo.h src/intsym.h \ + src/mpg123-with-modules src/out123-with-modules \ + doc/BENCHMARKING doc/BUGS doc/CONTACT doc/PATENTS \ + doc/README.3DNOW doc/README.gain doc/README.remote \ + doc/ROAD_TO_LGPL doc/TODO doc/LICENSE doc/THANKS doc/ACCURACY \ + doc/LARGEFILE doc/libmpg123_speed.txt doc/doxyhead.xhtml \ + doc/doxyfoot.xhtml doc/doxy_examples.c doc/doxygen.conf \ + doc/examples/mpg123_to_out123.c doc/examples/scan.c \ + doc/examples/mpglib.c doc/examples/id3dump.c \ + doc/examples/feedseek.c doc/examples/dump_seekindex.c \ + doc/examples/extract_frames.c doc/examples/Makefile \ + mpg123.spec makedll.sh windows-builds.sh equalize.dat \ + NEWS.libmpg123 NEWS.libout123 ports/MSVC++/mpg123.h \ + ports/MSVC++/config.h ports/MSVC++/msvc.c \ + ports/MSVC++/examples/scan.c ports/MSVC++/examples/feedseek.c \ + ports/MSVC++/2008clr/2008clr.sln \ + ports/MSVC++/2008clr/mpg123clr/advanced.cpp \ + ports/MSVC++/2008clr/mpg123clr/advanced.h \ + ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp \ + ports/MSVC++/2008clr/mpg123clr/dllmain.cpp \ + ports/MSVC++/2008clr/mpg123clr/enum.h \ + ports/MSVC++/2008clr/mpg123clr/error.cpp \ + ports/MSVC++/2008clr/mpg123clr/error.h \ + ports/MSVC++/2008clr/mpg123clr/id3v1.cpp \ + ports/MSVC++/2008clr/mpg123clr/id3v1.h \ + ports/MSVC++/2008clr/mpg123clr/id3v2.cpp \ + ports/MSVC++/2008clr/mpg123clr/id3v2.h \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.h \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj \ + ports/MSVC++/2008clr/mpg123clr/ReadMe.txt \ + ports/MSVC++/2008clr/mpg123clr/resource.h \ + ports/MSVC++/2008clr/mpg123clr/stdafx.cpp \ + ports/MSVC++/2008clr/mpg123clr/stdafx.h \ + ports/MSVC++/2008clr/mpg123clr/string.cpp \ + ports/MSVC++/2008clr/mpg123clr/string.h \ + ports/MSVC++/2008clr/mpg123clr/targetver.h \ + ports/MSVC++/2008clr/mpg123clr/text.cpp \ + ports/MSVC++/2008clr/mpg123clr/text.h \ + ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj \ + ports/MSVC++/2008clr/examples/feedseekclr/Program.cs \ + ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj \ + ports/MSVC++/2008clr/examples/scanclr/Program.cs \ + ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2015/win32/feedseek \ + ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj.filters \ + ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj \ + ports/MSVC++/2015/win32/libmpg123 \ + ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj \ + ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj.filters \ + ports/MSVC++/2015/win32/mpg123.sln \ + ports/MSVC++/2015/win32/dump_seekindex \ + ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj \ + ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj.filters \ + ports/MSVC++/2015/win32/scan \ + ports/MSVC++/2015/win32/scan/scan.vcxproj.filters \ + ports/MSVC++/2015/win32/scan/scan.vcxproj \ + ports/MSVC++/2015/uwp/libmpg123 \ + ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj \ + ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj.filters \ + ports/MSVC++/2015/uwp/libmpg123.sln \ + ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj \ + ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE \ + ports/MSVC++/CMP3Stream/README \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP \ + ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H \ + ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H \ + ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H \ + ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H ports/README \ + ports/Sony_PSP/config.h ports/Sony_PSP/README \ + ports/Sony_PSP/Makefile.psp ports/Sony_PSP/readers.c.patch \ + ports/mpg123_.pas ports/Xcode/config.h ports/Xcode/mpg123.h \ + ports/Xcode/mpg123.xcodeproj/project.pbxproj \ + scripts/benchmark-cpu.pl scripts/tag_lyrics.py scripts/conplay \ + scripts/mpg123info +pkglib_LTLIBRARIES = $(am__append_2) $(am__append_3) $(am__append_4) \ + $(am__append_5) $(am__append_6) $(am__append_7) \ + $(am__append_8) $(am__append_9) $(am__append_10) \ + $(am__append_11) $(am__append_12) $(am__append_13) \ + $(am__append_14) $(am__append_15) $(am__append_16) \ + $(am__append_17) $(am__append_18) $(am__append_19) \ + $(am__append_20) $(am__append_21) $(am__append_22) \ + $(am__append_23) $(am__append_24) $(am__append_25) +lib_LTLIBRARIES = src/libmpg123/libmpg123.la \ + src/libout123/libout123.la +noinst_LIBRARIES = + +# Precursor to the proper libout123. +# For now only wrapping the module loader or the legacy module. +noinst_LTLIBRARIES = src/compat/libcompat.la \ + src/compat/libcompat_str.la $(am__append_1) \ + src/libout123/libmodule.la +nodist_include_HEADERS = src/libmpg123/mpg123.h src/libout123/out123.h +include_HEADERS = src/libmpg123/fmt123.h +dist_man_MANS = man1/mpg123.1 man1/out123.1 + +# Necessary? +CLEANFILES = src/libmpg123/*.a src/*.a +# That can be trimmed down later when adapting the sources to +# use relative paths for includes. +# Watch out for generated headers (that's why top_builddir is also present). +AM_CPPFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\"" $(LTDLINCL) \ + -I$(top_srcdir)/src -I$(top_srcdir)/src/compat \ + -I$(top_srcdir)/src/libmpg123 -I$(top_srcdir)/src/libout123 \ + -I$(top_builddir)/src/libmpg123 \ + -I$(top_builddir)/src/libout123 +pkgconfigdir = $(libdir)/pkgconfig + +# Include Make modules from subdirectories. + +# Stuff from this directory. +pkgconfig_DATA = libmpg123.pc libout123.pc +src_compat_libcompat_la_SOURCES = \ + src/compat/compat_str.c \ + src/compat/compat.c \ + src/compat/compat.h + + +# A smaller one for the output modules. Do not want to grow them +# unnecessarily with unused code. +src_compat_libcompat_str_la_SOURCES = \ + src/compat/compat_str.c \ + src/compat/compat.h + +src_libmpg123_testcpu_DEPENDENCIES = src/libmpg123/getcpuflags.$(OBJEXT) +src_libmpg123_testcpu_SOURCES = src/libmpg123/testcpu.c +src_libmpg123_testcpu_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/getcpuflags.$(OBJEXT) + +src_libmpg123_libmpg123_la_LDFLAGS = \ + -no-undefined \ + -version-info @LIBMPG123_VERSION@ \ + -export-symbols-regex '^mpg123_' + +src_libmpg123_libmpg123_la_LIBADD = \ + src/compat/libcompat.la \ + @DECODER_LOBJ@ @LFS_LOBJ@ @LIBS@ + +src_libmpg123_libmpg123_la_DEPENDENCIES = \ + src/compat/libcompat.la \ + @DECODER_LOBJ@ @LFS_LOBJ@ + +src_libmpg123_libmpg123_la_SOURCES = \ + src/libmpg123/fmt123.h \ + src/libmpg123/mpeghead.h \ + src/libmpg123/parse.c \ + src/libmpg123/parse.h \ + src/libmpg123/frame.c \ + src/libmpg123/format.c \ + src/libmpg123/frame.h \ + src/libmpg123/reader.h \ + src/libmpg123/debug.h \ + src/libmpg123/decode.h \ + src/libmpg123/sample.h \ + src/libmpg123/dct64.c \ + src/libmpg123/synth.h \ + src/libmpg123/synth_mono.h \ + src/libmpg123/synth_ntom.h \ + src/libmpg123/synth_8bit.h \ + src/libmpg123/synths.h \ + src/libmpg123/equalizer.c \ + src/libmpg123/huffman.h \ + src/libmpg123/newhuffman.h \ + src/libmpg123/icy.h \ + src/libmpg123/icy2utf8.h \ + src/libmpg123/id3.h \ + src/libmpg123/id3.c \ + src/libmpg123/true.h \ + src/libmpg123/getbits.h \ + src/libmpg123/optimize.h \ + src/libmpg123/optimize.c \ + src/libmpg123/readers.c \ + src/libmpg123/tabinit.c \ + src/libmpg123/libmpg123.c \ + src/libmpg123/gapless.h \ + src/libmpg123/mpg123lib_intern.h \ + src/libmpg123/abi_align.h \ + src/libmpg123/mangle.h \ + src/libmpg123/getcpuflags.h \ + src/libmpg123/index.h \ + src/libmpg123/index.c + +EXTRA_src_libmpg123_libmpg123_la_SOURCES = \ + src/libmpg123/lfs_alias.c \ + src/libmpg123/lfs_wrap.c \ + src/libmpg123/icy.c \ + src/libmpg123/icy2utf8.c \ + src/libmpg123/l2tables.h \ + src/libmpg123/layer1.c \ + src/libmpg123/layer2.c \ + src/libmpg123/layer3.c \ + src/libmpg123/dither.h \ + src/libmpg123/dither_impl.h \ + src/libmpg123/dither.c \ + src/libmpg123/feature.c \ + src/libmpg123/dct36_3dnowext.S \ + src/libmpg123/dct36_3dnow.S \ + src/libmpg123/dct36_sse.S \ + src/libmpg123/dct36_x86_64.S \ + src/libmpg123/dct36_avx.S \ + src/libmpg123/dct36_neon.S \ + src/libmpg123/dct36_neon64.S \ + src/libmpg123/dct64_3dnowext.S \ + src/libmpg123/dct64_3dnow.S \ + src/libmpg123/dct64_altivec.c \ + src/libmpg123/dct64_i386.c \ + src/libmpg123/dct64_i486.c \ + src/libmpg123/dct64_mmx.S \ + src/libmpg123/dct64_sse.S \ + src/libmpg123/dct64_sse_float.S \ + src/libmpg123/dct64_x86_64.S \ + src/libmpg123/dct64_x86_64_float.S \ + src/libmpg123/dct64_neon.S \ + src/libmpg123/dct64_neon_float.S \ + src/libmpg123/dct64_neon64.S \ + src/libmpg123/dct64_neon64_float.S \ + src/libmpg123/dct64_avx.S \ + src/libmpg123/dct64_avx_float.S \ + src/libmpg123/synth_3dnowext.S \ + src/libmpg123/synth_3dnow.S \ + src/libmpg123/synth_altivec.c \ + src/libmpg123/synth_i486.c \ + src/libmpg123/synth_i586_dither.S \ + src/libmpg123/synth_i586.S \ + src/libmpg123/synth_mmx.S \ + src/libmpg123/synth_sse3d.h \ + src/libmpg123/synth_sse.S \ + src/libmpg123/synth_sse_float.S \ + src/libmpg123/synth_sse_s32.S \ + src/libmpg123/synth_sse_accurate.S \ + src/libmpg123/synth_stereo_sse_float.S \ + src/libmpg123/synth_stereo_sse_s32.S \ + src/libmpg123/synth_stereo_sse_accurate.S \ + src/libmpg123/synth_x86_64.S \ + src/libmpg123/synth_x86_64_float.S \ + src/libmpg123/synth_x86_64_s32.S \ + src/libmpg123/synth_x86_64_accurate.S \ + src/libmpg123/synth_stereo_x86_64.S \ + src/libmpg123/synth_stereo_x86_64_float.S \ + src/libmpg123/synth_stereo_x86_64_s32.S \ + src/libmpg123/synth_stereo_x86_64_accurate.S \ + src/libmpg123/synth_arm.S \ + src/libmpg123/synth_arm_accurate.S \ + src/libmpg123/synth_neon.S \ + src/libmpg123/synth_neon_float.S \ + src/libmpg123/synth_neon_s32.S \ + src/libmpg123/synth_neon_accurate.S \ + src/libmpg123/synth_stereo_neon.S \ + src/libmpg123/synth_stereo_neon_float.S \ + src/libmpg123/synth_stereo_neon_s32.S \ + src/libmpg123/synth_stereo_neon_accurate.S \ + src/libmpg123/synth_neon64.S \ + src/libmpg123/synth_neon64_float.S \ + src/libmpg123/synth_neon64_s32.S \ + src/libmpg123/synth_neon64_accurate.S \ + src/libmpg123/synth_stereo_neon64.S \ + src/libmpg123/synth_stereo_neon64_float.S \ + src/libmpg123/synth_stereo_neon64_s32.S \ + src/libmpg123/synth_stereo_neon64_accurate.S \ + src/libmpg123/synth_stereo_avx.S \ + src/libmpg123/synth_stereo_avx_float.S \ + src/libmpg123/synth_stereo_avx_s32.S \ + src/libmpg123/synth_stereo_avx_accurate.S \ + src/libmpg123/ntom.c \ + src/libmpg123/synth.c \ + src/libmpg123/synth_8bit.c \ + src/libmpg123/synth_real.c \ + src/libmpg123/synth_s32.c \ + src/libmpg123/equalizer_3dnow.S \ + src/libmpg123/tabinit_mmx.S \ + src/libmpg123/stringbuf.c \ + src/libmpg123/getcpuflags.S \ + src/libmpg123/getcpuflags_x86_64.S \ + src/libmpg123/getcpuflags_arm.c \ + src/libmpg123/check_neon.S \ + src/libmpg123/l12_integer_tables.h \ + src/libmpg123/l3_integer_tables.h + +@USE_YASM_FOR_AVX_TRUE@AVX_SRCS = \ +@USE_YASM_FOR_AVX_TRUE@ src/libmpg123/dct36_avx.S \ +@USE_YASM_FOR_AVX_TRUE@ src/libmpg123/dct64_avx.S \ +@USE_YASM_FOR_AVX_TRUE@ src/libmpg123/dct64_avx_float.S \ +@USE_YASM_FOR_AVX_TRUE@ src/libmpg123/synth_stereo_avx.S \ +@USE_YASM_FOR_AVX_TRUE@ src/libmpg123/synth_stereo_avx_float.S \ +@USE_YASM_FOR_AVX_TRUE@ src/libmpg123/synth_stereo_avx_s32.S \ +@USE_YASM_FOR_AVX_TRUE@ src/libmpg123/synth_stereo_avx_accurate.S + +@USE_YASM_FOR_AVX_TRUE@AVX_OBJS = $(AVX_SRCS:.S=.@OBJEXT@) +@USE_YASM_FOR_AVX_TRUE@ASM_DEPS = \ +@USE_YASM_FOR_AVX_TRUE@ src/libmpg123/mangle.h \ +@USE_YASM_FOR_AVX_TRUE@ $(top_builddir)/src/config.h \ +@USE_YASM_FOR_AVX_TRUE@ src/intsym.h + + +# Do not include uneeded headers from mpg123app.h . +libout123_mod_cppflags = -DBUILDING_OUTPUT_MODULES=1 +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_dummy_la_SOURCES = \ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/dummy.c + +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_dummy_la_LDFLAGS = \ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@ @DUMMY_LDFLAGS@ + +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_dummy_la_CFLAGS = @DUMMY_CFLAGS@ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_dummy_la_LIBADD = \ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@ @DUMMY_LIBS@ + +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_dummy_la_CPPFLAGS = \ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_DUMMY_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@BUILD_AIX_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_AIX_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/aix.c + +@BUILD_ALIB_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_ALIB_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/alib.c + +@BUILD_ALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_ALSA_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/alsa.c + +@BUILD_ARTS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_ARTS_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/arts.c + +@BUILD_COREAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_COREAUDIO_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/coreaudio.c + +@BUILD_DUMMY_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_DUMMY_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/dummy.c + +@BUILD_ESD_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_ESD_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/esd.c + +@BUILD_HP_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_HP_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/hp.c + +@BUILD_JACK_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_JACK_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/jack.c + +@BUILD_MINT_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_MINT_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/mint.c + +@BUILD_NAS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_NAS_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/nas.c + +@BUILD_OPENAL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_OPENAL_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/openal.c + +@BUILD_OS2_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_OS2_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/os2.c + +@BUILD_OSS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_OSS_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/oss.c + +@BUILD_PORTAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_PORTAUDIO_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/portaudio.c + +@BUILD_PULSE_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_PULSE_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/pulse.c + +@BUILD_QSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_QSA_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/qsa.c + +@BUILD_SDL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_SDL_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/sdl.c + +@BUILD_SGI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_SGI_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/sgi.c + +@BUILD_SNDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_SNDIO_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/sndio.c + +@BUILD_SUN_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_SUN_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/sun.c + +@BUILD_TINYALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_TINYALSA_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/tinyalsa.c + +@BUILD_WIN32_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_WIN32_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/win32.c + +@BUILD_WIN32_WASAPI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_SOURCES = \ +@BUILD_WIN32_WASAPI_TRUE@@HAVE_MODULES_FALSE@ src/libout123/modules/win32_wasapi.c + +@BUILD_AIX_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @AIX_CFLAGS@ +@BUILD_ALIB_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @ALIB_CFLAGS@ +@BUILD_ALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @ALSA_CFLAGS@ +@BUILD_ARTS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @ARTS_CFLAGS@ +@BUILD_COREAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @COREAUDIO_CFLAGS@ +@BUILD_DUMMY_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @DUMMY_CFLAGS@ +@BUILD_ESD_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @ESD_CFLAGS@ +@BUILD_HP_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @HP_CFLAGS@ +@BUILD_JACK_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @JACK_CFLAGS@ +@BUILD_MINT_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @MINT_CFLAGS@ +@BUILD_NAS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @NAS_CFLAGS@ +@BUILD_OPENAL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @OPENAL_CFLAGS@ +@BUILD_OS2_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @OS2_CFLAGS@ +@BUILD_OSS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @OSS_CFLAGS@ +@BUILD_PORTAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @PORTAUDIO_CFLAGS@ +@BUILD_PULSE_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @PULSE_CFLAGS@ +@BUILD_QSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @QSA_CFLAGS@ +@BUILD_SDL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @SDL_CFLAGS@ +@BUILD_SGI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @SGI_CFLAGS@ +@BUILD_SNDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @SNDIO_CFLAGS@ +@BUILD_SUN_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @SUN_CFLAGS@ +@BUILD_TINYALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @TINYALSA_CFLAGS@ +@BUILD_WIN32_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @WIN32_CFLAGS@ +@BUILD_WIN32_WASAPI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CFLAGS = @WIN32_WASAPI_CFLAGS@ +@BUILD_AIX_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @AIX_LDFLAGS@ +@BUILD_ALIB_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @ALIB_LDFLAGS@ +@BUILD_ALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @ALSA_LDFLAGS@ +@BUILD_ARTS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @ARTS_LDFLAGS@ +@BUILD_COREAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @COREAUDIO_LDFLAGS@ +@BUILD_DUMMY_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @DUMMY_LDFLAGS@ +@BUILD_ESD_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @ESD_LDFLAGS@ +@BUILD_HP_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @HP_LDFLAGS@ +@BUILD_JACK_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @JACK_LDFLAGS@ +@BUILD_MINT_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @MINT_LDFLAGS@ +@BUILD_NAS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @NAS_LDFLAGS@ +@BUILD_OPENAL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @OPENAL_LDFLAGS@ +@BUILD_OS2_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @OS2_LDFLAGS@ +@BUILD_OSS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @OSS_LDFLAGS@ +@BUILD_PORTAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @PORTAUDIO_LDFLAGS@ +@BUILD_PULSE_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @PULSE_LDFLAGS@ +@BUILD_QSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @QSA_LDFLAGS@ +@BUILD_SDL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @SDL_LDFLAGS@ +@BUILD_SGI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @SGI_LDFLAGS@ +@BUILD_SNDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @SNDIO_LDFLAGS@ +@BUILD_SUN_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @SUN_LDFLAGS@ +@BUILD_TINYALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @TINYALSA_LDFLAGS@ +@BUILD_WIN32_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @WIN32_LDFLAGS@ +@BUILD_WIN32_WASAPI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LDFLAGS = @WIN32_WASAPI_LDFLAGS@ +@BUILD_AIX_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @AIX_LIBS@ +@BUILD_ALIB_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @ALIB_LIBS@ +@BUILD_ALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @ALSA_LIBS@ +@BUILD_ARTS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @ARTS_LIBS@ +@BUILD_COREAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @COREAUDIO_LIBS@ +@BUILD_DUMMY_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @DUMMY_LIBS@ +@BUILD_ESD_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @ESD_LIBS@ +@BUILD_HP_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @HP_LIBS@ +@BUILD_JACK_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @JACK_LIBS@ +@BUILD_MINT_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @MINT_LIBS@ +@BUILD_NAS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @NAS_LIBS@ +@BUILD_OPENAL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @OPENAL_LIBS@ +@BUILD_OS2_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @OS2_LIBS@ +@BUILD_OSS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @OSS_LIBS@ +@BUILD_PORTAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @PORTAUDIO_LIBS@ +@BUILD_PULSE_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @PULSE_LIBS@ +@BUILD_QSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @QSA_LIBS@ +@BUILD_SDL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @SDL_LIBS@ +@BUILD_SGI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @SGI_LIBS@ +@BUILD_SNDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @SNDIO_LIBS@ +@BUILD_SUN_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @SUN_LIBS@ +@BUILD_TINYALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @TINYALSA_LIBS@ +@BUILD_WIN32_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @WIN32_LIBS@ +@BUILD_WIN32_WASAPI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_LIBADD = @WIN32_WASAPI_LIBS@ +@BUILD_AIX_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_AIX_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_AIX_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_ALIB_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_ALIB_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_ALIB_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_ALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_ALSA_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_ALSA_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_ARTS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_ARTS_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_ARTS_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_COREAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_COREAUDIO_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_COREAUDIO_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_DUMMY_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_DUMMY_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_DUMMY_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_ESD_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_ESD_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_ESD_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_HP_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_HP_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_HP_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_JACK_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_JACK_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_JACK_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_MINT_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_MINT_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_MINT_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_NAS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_NAS_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_NAS_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_OPENAL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_OPENAL_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_OPENAL_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_OS2_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_OS2_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_OS2_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_OSS_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_OSS_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_OSS_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_PORTAUDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_PORTAUDIO_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_PORTAUDIO_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_PULSE_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_PULSE_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_PULSE_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_QSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_QSA_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_QSA_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_SDL_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_SDL_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_SDL_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_SGI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_SGI_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_SGI_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_SNDIO_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_SNDIO_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_SNDIO_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_SUN_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_SUN_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_SUN_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_TINYALSA_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_TINYALSA_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_TINYALSA_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_WIN32_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_WIN32_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_WIN32_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@BUILD_WIN32_WASAPI_TRUE@@HAVE_MODULES_FALSE@src_libout123_modules_libdefaultmodule_la_CPPFLAGS = \ +@BUILD_WIN32_WASAPI_TRUE@@HAVE_MODULES_FALSE@ $(AM_CPPFLAGS) \ +@BUILD_WIN32_WASAPI_TRUE@@HAVE_MODULES_FALSE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@src_libout123_modules_output_tinyalsa_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@ src/libout123/modules/tinyalsa.c + +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@src_libout123_modules_output_tinyalsa_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@ @TINYALSA_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@src_libout123_modules_output_tinyalsa_la_CFLAGS = @TINYALSA_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@src_libout123_modules_output_tinyalsa_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@ @TINYALSA_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@src_libout123_modules_outout_tinyalsa_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_TINYALSA_TRUE@ $(libout123_mod_cppflags) + +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_alsa_la_SOURCES = \ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/alsa.c + +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_alsa_la_LDFLAGS = \ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@ @ALSA_LDFLAGS@ + +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_alsa_la_CFLAGS = @ALSA_CFLAGS@ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_alsa_la_LIBADD = \ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@ @ALSA_LIBS@ + +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_alsa_la_CPPFLAGS = \ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_ALSA_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@src_libout123_modules_output_qsa_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@ src/libout123/modules/qsa.c + +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@src_libout123_modules_output_qsa_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@ @QSA_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@src_libout123_modules_output_qsa_la_CFLAGS = @QSA_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@src_libout123_modules_output_qsa_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@ @QSA_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@src_libout123_modules_outout_qsa_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_QSA_TRUE@ $(libout123_mod_cppflags) + +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_coreaudio_la_SOURCES = \ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/coreaudio.c + +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_coreaudio_la_LDFLAGS = \ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@ @COREAUDIO_LDFLAGS@ + +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_coreaudio_la_CFLAGS = @COREAUDIO_CFLAGS@ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_coreaudio_la_LIBADD = \ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@ @COREAUDIO_LIBS@ + +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_coreaudio_la_CPPFLAGS = \ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_COREAUDIO_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_esd_la_SOURCES = \ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/esd.c + +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_esd_la_LDFLAGS = \ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@ @ESD_LDFLAGS@ + +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_esd_la_CFLAGS = @ESD_CFLAGS@ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_esd_la_LIBADD = \ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@ @ESD_LIBS@ + +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_esd_la_CPPFLAGS = \ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_ESD_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_jack_la_SOURCES = \ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/jack.c + +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_jack_la_LDFLAGS = \ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@ @JACK_LDFLAGS@ + +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_jack_la_CFLAGS = @JACK_CFLAGS@ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_jack_la_LIBADD = \ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@ @JACK_LIBS@ + +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_jack_la_CPPFLAGS = \ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_JACK_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@src_libout123_modules_output_nas_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@ src/libout123/modules/nas.c + +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@src_libout123_modules_output_nas_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@ @NAS_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@src_libout123_modules_output_nas_la_CFLAGS = @NAS_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@src_libout123_modules_output_nas_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@ @NAS_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@src_libout123_modules_outout_nas_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_NAS_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@src_libout123_modules_output_oss_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@ src/libout123/modules/oss.c + +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@src_libout123_modules_output_oss_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@ @OSS_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@src_libout123_modules_output_oss_la_CFLAGS = @OSS_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@src_libout123_modules_output_oss_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@ @OSS_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@src_libout123_modules_outout_oss_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_OSS_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@src_libout123_modules_output_portaudio_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@ src/libout123/modules/portaudio.c + +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@src_libout123_modules_output_portaudio_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@ @PORTAUDIO_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@src_libout123_modules_output_portaudio_la_CFLAGS = @PORTAUDIO_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@src_libout123_modules_output_portaudio_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@ @PORTAUDIO_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@src_libout123_modules_outout_portaudio_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_PORTAUDIO_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@src_libout123_modules_output_pulse_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@ src/libout123/modules/pulse.c + +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@src_libout123_modules_output_pulse_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@ @PULSE_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@src_libout123_modules_output_pulse_la_CFLAGS = @PULSE_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@src_libout123_modules_output_pulse_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@ @PULSE_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@src_libout123_modules_outout_pulse_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_PULSE_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@src_libout123_modules_output_sdl_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@ src/libout123/modules/sdl.c + +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@src_libout123_modules_output_sdl_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@ @SDL_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@src_libout123_modules_output_sdl_la_CFLAGS = @SDL_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@src_libout123_modules_output_sdl_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@ @SDL_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@src_libout123_modules_outout_sdl_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_SDL_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@src_libout123_modules_output_sndio_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@ src/libout123/modules/sndio.c + +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@src_libout123_modules_output_sndio_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@ @SNDIO_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@src_libout123_modules_output_sndio_la_CFLAGS = @SNDIO_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@src_libout123_modules_output_sndio_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@ @SNDIO_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@src_libout123_modules_outout_sndio_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_SNDIO_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@src_libout123_modules_output_sun_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@ src/libout123/modules/sun.c + +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@src_libout123_modules_output_sun_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@ @SUN_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@src_libout123_modules_output_sun_la_CFLAGS = @SUN_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@src_libout123_modules_output_sun_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@ @SUN_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@src_libout123_modules_outout_sun_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_SUN_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@src_libout123_modules_output_win32_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@ src/libout123/modules/win32.c + +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@src_libout123_modules_output_win32_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@ @WIN32_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@src_libout123_modules_output_win32_la_CFLAGS = @WIN32_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@src_libout123_modules_output_win32_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@ @WIN32_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@src_libout123_modules_outout_win32_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@src_libout123_modules_output_win32_wasapi_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@ src/libout123/modules/win32_wasapi.c + +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@src_libout123_modules_output_win32_wasapi_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@ @WIN32_WASAPI_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@src_libout123_modules_output_win32_wasapi_la_CFLAGS = @WIN32_WASAPI_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@src_libout123_modules_output_win32_wasapi_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@ @WIN32_WASAPI_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@src_libout123_modules_outout_win32_wasapi_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_WIN32_WASAPI_TRUE@ $(libout123_mod_cppflags) + +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_aix_la_SOURCES = \ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/aix.c + +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_aix_la_LDFLAGS = \ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@ @AIX_LDFLAGS@ + +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_aix_la_CFLAGS = @AIX_CFLAGS@ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_aix_la_LIBADD = \ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@ @AIX_LIBS@ + +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_aix_la_CPPFLAGS = \ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_AIX_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_alib_la_SOURCES = \ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/alib.c + +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_alib_la_LDFLAGS = \ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@ @ALIB_LDFLAGS@ + +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_alib_la_CFLAGS = @ALIB_CFLAGS@ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_alib_la_LIBADD = \ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@ @ALIB_LIBS@ + +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_alib_la_CPPFLAGS = \ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_ALIB_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_arts_la_SOURCES = \ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/arts.c + +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_arts_la_LDFLAGS = \ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@ @ARTS_LDFLAGS@ + +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_arts_la_CFLAGS = @ARTS_CFLAGS@ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_arts_la_LIBADD = \ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@ @ARTS_LIBS@ + +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_arts_la_CPPFLAGS = \ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_ARTS_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_hp_la_SOURCES = \ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/hp.c + +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_hp_la_LDFLAGS = \ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@ @HP_LDFLAGS@ + +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_hp_la_CFLAGS = @HP_CFLAGS@ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_hp_la_LIBADD = \ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@ @HP_LIBS@ + +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_hp_la_CPPFLAGS = \ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_HP_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@src_libout123_modules_output_os2_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@ src/libout123/modules/os2.c + +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@src_libout123_modules_output_os2_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@ @OS2_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@src_libout123_modules_output_os2_la_CFLAGS = @OS2_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@src_libout123_modules_output_os2_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@ @OS2_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@src_libout123_modules_outout_os2_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_OS2_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@src_libout123_modules_output_sgi_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@ src/libout123/modules/sgi.c + +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@src_libout123_modules_output_sgi_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@ @SGI_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@src_libout123_modules_output_sgi_la_CFLAGS = @SGI_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@src_libout123_modules_output_sgi_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@ @SGI_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@src_libout123_modules_outout_sgi_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_SGI_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_mint_la_SOURCES = \ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@ src/libout123/modules/mint.c + +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_mint_la_LDFLAGS = \ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@ @MINT_LDFLAGS@ + +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_mint_la_CFLAGS = @MINT_CFLAGS@ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_output_mint_la_LIBADD = \ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@ @MINT_LIBS@ + +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@src_libout123_modules_outout_mint_la_CPPFLAGS = \ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MINT_TRUE@@HAVE_MODULES_TRUE@ $(libout123_mod_cppflags) + +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@src_libout123_modules_output_openal_la_SOURCES = \ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@ src/libout123/modules/openal.c + +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@src_libout123_modules_output_openal_la_LDFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@ -module -no-undefined -avoid-version \ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@ -export-dynamic -export-symbols-regex '^mpg123_' \ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@ @OPENAL_LDFLAGS@ + +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@src_libout123_modules_output_openal_la_CFLAGS = @OPENAL_CFLAGS@ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@src_libout123_modules_output_openal_la_LIBADD = \ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@ src/compat/libcompat_str.la \ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@ @OPENAL_LIBS@ + +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@src_libout123_modules_outout_openal_la_CPPFLAGS = \ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@ $(AM_CPPFLAGS) \ +@HAVE_MODULES_TRUE@@HAVE_OPENAL_TRUE@ $(libout123_mod_cppflags) + +src_libout123_libout123_la_SOURCES = src/libout123/libout123.c \ + src/libout123/stringlists.h src/libout123/stringlists.c \ + src/libout123/out123_int.h src/libout123/wav.c \ + src/libout123/wav.h src/libout123/wavhead.h $(am__append_26) +src_libout123_libout123_la_LDFLAGS = \ + -no-undefined -version-info @LIBOUT123_VERSION@ -export-symbols-regex '^out123_' + +src_libout123_libout123_la_LIBADD = src/libout123/libmodule.la \ + src/compat/libcompat.la $(am__append_27) +src_libout123_libmodule_la_SOURCES = src/libout123/module.h \ + $(am__append_28) $(am__append_29) +src_mpg123_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la \ + src/libout123/libout123.la \ + $(LIBM) + +src_mpg123_LDFLAGS = @EXEC_LT_LDFLAGS@ +src_out123_LDADD = \ + src/compat/libcompat.la \ + src/libout123/libout123.la + +src_out123_LDFLAGS = @EXEC_LT_LDFLAGS@ +src_mpg123_id3dump_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + +src_mpg123_strip_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + + +# Does that finally work to build/link the correct object file? +src_mpg123_SOURCES = src/audio.c src/audio.h src/common.c src/common.h \ + src/sysutil.c src/sysutil.h src/control_generic.c \ + src/equalizer.c src/getlopt.c src/getlopt.h src/httpget.c \ + src/httpget.h src/resolver.c src/resolver.h src/genre.h \ + src/genre.c src/mpg123.c src/mpg123app.h src/metaprint.c \ + src/metaprint.h src/local.h src/local.c src/playlist.c \ + src/playlist.h src/streamdump.h src/streamdump.c src/term.c \ + src/term.h src/win32_support.h $(am__append_30) + +# Replace common.h by sysutil.h! +src_out123_SOURCES = src/sysutil.c src/sysutil.h src/waves.c \ + src/waves.h src/common.h src/getlopt.c src/getlopt.h \ + src/out123.c src/mpg123app.h src/win32_support.h \ + $(am__append_31) +src_mpg123_id3dump_SOURCES = src/mpg123-id3dump.c src/getlopt.c \ + src/getlopt.h $(am__append_32) +src_mpg123_strip_SOURCES = \ + src/mpg123-strip.c \ + src/getlopt.c \ + src/getlopt.h + +src_tests_seek_whence_SOURCES = \ + src/tests/seek_whence.c + +src_tests_seek_whence_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + +src_tests_noise_SOURCES = \ + src/tests/noise.c \ + src/libmpg123/dither.h \ + src/libmpg123/dither_impl.h + +src_tests_noise_LDADD = \ + src/compat/libcompat.la + +src_tests_text_SOURCES = \ + src/tests/text.c \ + src/tests/testtext.h + +src_tests_text_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + +src_tests_plain_id3_SOURCES = \ + src/tests/plain_id3.c + +src_tests_plain_id3_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/src/Makemodule.am $(srcdir)/src/compat/Makemodule.am $(srcdir)/src/libmpg123/Makemodule.am $(srcdir)/src/libout123/Makemodule.am $(srcdir)/src/libout123/modules/Makemodule.am $(srcdir)/doc/Makemodule.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; +$(srcdir)/src/Makemodule.am $(srcdir)/src/compat/Makemodule.am $(srcdir)/src/libmpg123/Makemodule.am $(srcdir)/src/libout123/Makemodule.am $(srcdir)/src/libout123/modules/Makemodule.am $(srcdir)/doc/Makemodule.am $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +src/config.h: src/stamp-h1 + @test -f $@ || rm -f src/stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1 + +src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status + @rm -f src/stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status src/config.h +$(top_srcdir)/src/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f src/stamp-h1 + touch $@ + +distclean-hdr: + -rm -f src/config.h src/stamp-h1 +libmpg123.pc: $(top_builddir)/config.status $(srcdir)/libmpg123.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libout123.pc: $(top_builddir)/config.status $(srcdir)/libout123.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +mpg123.spec: $(top_builddir)/config.status $(srcdir)/mpg123.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +src/libmpg123/mpg123.h: $(top_builddir)/config.status $(top_srcdir)/src/libmpg123/mpg123.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +src/libout123/out123.h: $(top_builddir)/config.status $(top_srcdir)/src/libout123/out123.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_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}; \ + } + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_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}; \ + } + +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || 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)$(pkglibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_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}; \ + } +src/compat/$(am__dirstamp): + @$(MKDIR_P) src/compat + @: > src/compat/$(am__dirstamp) +src/compat/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/compat/$(DEPDIR) + @: > src/compat/$(DEPDIR)/$(am__dirstamp) +src/compat/compat_str.lo: src/compat/$(am__dirstamp) \ + src/compat/$(DEPDIR)/$(am__dirstamp) +src/compat/compat.lo: src/compat/$(am__dirstamp) \ + src/compat/$(DEPDIR)/$(am__dirstamp) + +src/compat/libcompat.la: $(src_compat_libcompat_la_OBJECTS) $(src_compat_libcompat_la_DEPENDENCIES) $(EXTRA_src_compat_libcompat_la_DEPENDENCIES) src/compat/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(src_compat_libcompat_la_OBJECTS) $(src_compat_libcompat_la_LIBADD) $(LIBS) + +src/compat/libcompat_str.la: $(src_compat_libcompat_str_la_OBJECTS) $(src_compat_libcompat_str_la_DEPENDENCIES) $(EXTRA_src_compat_libcompat_str_la_DEPENDENCIES) src/compat/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(src_compat_libcompat_str_la_OBJECTS) $(src_compat_libcompat_str_la_LIBADD) $(LIBS) +src/libmpg123/$(am__dirstamp): + @$(MKDIR_P) src/libmpg123 + @: > src/libmpg123/$(am__dirstamp) +src/libmpg123/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libmpg123/$(DEPDIR) + @: > src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/parse.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/frame.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/format.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/equalizer.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/id3.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/optimize.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/readers.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/tabinit.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/libmpg123.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/index.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/lfs_alias.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/lfs_wrap.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/icy.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/icy2utf8.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/layer1.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/layer2.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/layer3.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dither.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/feature.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct36_3dnowext.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct36_3dnow.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct36_sse.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct36_x86_64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct36_avx.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct36_neon.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct36_neon64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_3dnowext.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_3dnow.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_altivec.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_i386.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_i486.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_mmx.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_sse.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_sse_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_x86_64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_x86_64_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_neon.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_neon_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_neon64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_neon64_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_avx.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/dct64_avx_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_3dnowext.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_3dnow.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_altivec.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_i486.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_i586_dither.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_i586.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_mmx.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_sse.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_sse_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_sse_s32.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_sse_accurate.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_sse_float.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_sse_s32.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_sse_accurate.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_x86_64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_x86_64_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_x86_64_s32.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_x86_64_accurate.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_x86_64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_x86_64_float.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_x86_64_s32.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_x86_64_accurate.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_arm.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_arm_accurate.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_neon.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_neon_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_neon_s32.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_neon_accurate.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_neon.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_neon_float.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_neon_s32.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_neon_accurate.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_neon64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_neon64_float.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_neon64_s32.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_neon64_accurate.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_neon64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_neon64_float.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_neon64_s32.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_neon64_accurate.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_avx.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_avx_float.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_avx_s32.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_stereo_avx_accurate.lo: \ + src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/ntom.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_8bit.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_real.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/synth_s32.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/equalizer_3dnow.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/tabinit_mmx.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/stringbuf.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/getcpuflags.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/getcpuflags_x86_64.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/getcpuflags_arm.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) +src/libmpg123/check_neon.lo: src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) + +src/libmpg123/libmpg123.la: $(src_libmpg123_libmpg123_la_OBJECTS) $(src_libmpg123_libmpg123_la_DEPENDENCIES) $(EXTRA_src_libmpg123_libmpg123_la_DEPENDENCIES) src/libmpg123/$(am__dirstamp) + $(AM_V_CCLD)$(src_libmpg123_libmpg123_la_LINK) -rpath $(libdir) $(src_libmpg123_libmpg123_la_OBJECTS) $(src_libmpg123_libmpg123_la_LIBADD) $(LIBS) +src/libout123/$(am__dirstamp): + @$(MKDIR_P) src/libout123 + @: > src/libout123/$(am__dirstamp) +src/libout123/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libout123/$(DEPDIR) + @: > src/libout123/$(DEPDIR)/$(am__dirstamp) +src/libout123/module.lo: src/libout123/$(am__dirstamp) \ + src/libout123/$(DEPDIR)/$(am__dirstamp) +src/libout123/legacy_module.lo: src/libout123/$(am__dirstamp) \ + src/libout123/$(DEPDIR)/$(am__dirstamp) + +src/libout123/libmodule.la: $(src_libout123_libmodule_la_OBJECTS) $(src_libout123_libmodule_la_DEPENDENCIES) $(EXTRA_src_libout123_libmodule_la_DEPENDENCIES) src/libout123/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(src_libout123_libmodule_la_OBJECTS) $(src_libout123_libmodule_la_LIBADD) $(LIBS) +src/libout123/libout123.lo: src/libout123/$(am__dirstamp) \ + src/libout123/$(DEPDIR)/$(am__dirstamp) +src/libout123/stringlists.lo: src/libout123/$(am__dirstamp) \ + src/libout123/$(DEPDIR)/$(am__dirstamp) +src/libout123/wav.lo: src/libout123/$(am__dirstamp) \ + src/libout123/$(DEPDIR)/$(am__dirstamp) +src/libout123/buffer.lo: src/libout123/$(am__dirstamp) \ + src/libout123/$(DEPDIR)/$(am__dirstamp) +src/libout123/xfermem.lo: src/libout123/$(am__dirstamp) \ + src/libout123/$(DEPDIR)/$(am__dirstamp) + +src/libout123/libout123.la: $(src_libout123_libout123_la_OBJECTS) $(src_libout123_libout123_la_DEPENDENCIES) $(EXTRA_src_libout123_libout123_la_DEPENDENCIES) src/libout123/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_libout123_la_LINK) -rpath $(libdir) $(src_libout123_libout123_la_OBJECTS) $(src_libout123_libout123_la_LIBADD) $(LIBS) +src/libout123/modules/$(am__dirstamp): + @$(MKDIR_P) src/libout123/modules + @: > src/libout123/modules/$(am__dirstamp) +src/libout123/modules/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libout123/modules/$(DEPDIR) + @: > src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-aix.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alib.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alsa.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-arts.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-coreaudio.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-dummy.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-esd.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-hp.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-jack.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-mint.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-nas.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-openal.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-os2.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-oss.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-portaudio.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-pulse.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-qsa.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sdl.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sgi.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sndio.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sun.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-tinyalsa.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32_wasapi.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/libdefaultmodule.la: $(src_libout123_modules_libdefaultmodule_la_OBJECTS) $(src_libout123_modules_libdefaultmodule_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_libdefaultmodule_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_libdefaultmodule_la_LINK) $(am_src_libout123_modules_libdefaultmodule_la_rpath) $(src_libout123_modules_libdefaultmodule_la_OBJECTS) $(src_libout123_modules_libdefaultmodule_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_aix_la-aix.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_aix.la: $(src_libout123_modules_output_aix_la_OBJECTS) $(src_libout123_modules_output_aix_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_aix_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_aix_la_LINK) $(am_src_libout123_modules_output_aix_la_rpath) $(src_libout123_modules_output_aix_la_OBJECTS) $(src_libout123_modules_output_aix_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_alib_la-alib.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_alib.la: $(src_libout123_modules_output_alib_la_OBJECTS) $(src_libout123_modules_output_alib_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_alib_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_alib_la_LINK) $(am_src_libout123_modules_output_alib_la_rpath) $(src_libout123_modules_output_alib_la_OBJECTS) $(src_libout123_modules_output_alib_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_alsa_la-alsa.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_alsa.la: $(src_libout123_modules_output_alsa_la_OBJECTS) $(src_libout123_modules_output_alsa_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_alsa_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_alsa_la_LINK) $(am_src_libout123_modules_output_alsa_la_rpath) $(src_libout123_modules_output_alsa_la_OBJECTS) $(src_libout123_modules_output_alsa_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_arts_la-arts.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_arts.la: $(src_libout123_modules_output_arts_la_OBJECTS) $(src_libout123_modules_output_arts_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_arts_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_arts_la_LINK) $(am_src_libout123_modules_output_arts_la_rpath) $(src_libout123_modules_output_arts_la_OBJECTS) $(src_libout123_modules_output_arts_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_coreaudio_la-coreaudio.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_coreaudio.la: $(src_libout123_modules_output_coreaudio_la_OBJECTS) $(src_libout123_modules_output_coreaudio_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_coreaudio_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_coreaudio_la_LINK) $(am_src_libout123_modules_output_coreaudio_la_rpath) $(src_libout123_modules_output_coreaudio_la_OBJECTS) $(src_libout123_modules_output_coreaudio_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_dummy_la-dummy.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_dummy.la: $(src_libout123_modules_output_dummy_la_OBJECTS) $(src_libout123_modules_output_dummy_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_dummy_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_dummy_la_LINK) $(am_src_libout123_modules_output_dummy_la_rpath) $(src_libout123_modules_output_dummy_la_OBJECTS) $(src_libout123_modules_output_dummy_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_esd_la-esd.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_esd.la: $(src_libout123_modules_output_esd_la_OBJECTS) $(src_libout123_modules_output_esd_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_esd_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_esd_la_LINK) $(am_src_libout123_modules_output_esd_la_rpath) $(src_libout123_modules_output_esd_la_OBJECTS) $(src_libout123_modules_output_esd_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_hp_la-hp.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_hp.la: $(src_libout123_modules_output_hp_la_OBJECTS) $(src_libout123_modules_output_hp_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_hp_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_hp_la_LINK) $(am_src_libout123_modules_output_hp_la_rpath) $(src_libout123_modules_output_hp_la_OBJECTS) $(src_libout123_modules_output_hp_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_jack_la-jack.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_jack.la: $(src_libout123_modules_output_jack_la_OBJECTS) $(src_libout123_modules_output_jack_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_jack_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_jack_la_LINK) $(am_src_libout123_modules_output_jack_la_rpath) $(src_libout123_modules_output_jack_la_OBJECTS) $(src_libout123_modules_output_jack_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_mint_la-mint.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_mint.la: $(src_libout123_modules_output_mint_la_OBJECTS) $(src_libout123_modules_output_mint_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_mint_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_mint_la_LINK) $(am_src_libout123_modules_output_mint_la_rpath) $(src_libout123_modules_output_mint_la_OBJECTS) $(src_libout123_modules_output_mint_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_nas_la-nas.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_nas.la: $(src_libout123_modules_output_nas_la_OBJECTS) $(src_libout123_modules_output_nas_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_nas_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_nas_la_LINK) $(am_src_libout123_modules_output_nas_la_rpath) $(src_libout123_modules_output_nas_la_OBJECTS) $(src_libout123_modules_output_nas_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_openal_la-openal.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_openal.la: $(src_libout123_modules_output_openal_la_OBJECTS) $(src_libout123_modules_output_openal_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_openal_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_openal_la_LINK) $(am_src_libout123_modules_output_openal_la_rpath) $(src_libout123_modules_output_openal_la_OBJECTS) $(src_libout123_modules_output_openal_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_os2_la-os2.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_os2.la: $(src_libout123_modules_output_os2_la_OBJECTS) $(src_libout123_modules_output_os2_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_os2_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_os2_la_LINK) $(am_src_libout123_modules_output_os2_la_rpath) $(src_libout123_modules_output_os2_la_OBJECTS) $(src_libout123_modules_output_os2_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_oss_la-oss.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_oss.la: $(src_libout123_modules_output_oss_la_OBJECTS) $(src_libout123_modules_output_oss_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_oss_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_oss_la_LINK) $(am_src_libout123_modules_output_oss_la_rpath) $(src_libout123_modules_output_oss_la_OBJECTS) $(src_libout123_modules_output_oss_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_portaudio_la-portaudio.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_portaudio.la: $(src_libout123_modules_output_portaudio_la_OBJECTS) $(src_libout123_modules_output_portaudio_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_portaudio_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_portaudio_la_LINK) $(am_src_libout123_modules_output_portaudio_la_rpath) $(src_libout123_modules_output_portaudio_la_OBJECTS) $(src_libout123_modules_output_portaudio_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_pulse_la-pulse.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_pulse.la: $(src_libout123_modules_output_pulse_la_OBJECTS) $(src_libout123_modules_output_pulse_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_pulse_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_pulse_la_LINK) $(am_src_libout123_modules_output_pulse_la_rpath) $(src_libout123_modules_output_pulse_la_OBJECTS) $(src_libout123_modules_output_pulse_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_qsa_la-qsa.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_qsa.la: $(src_libout123_modules_output_qsa_la_OBJECTS) $(src_libout123_modules_output_qsa_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_qsa_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_qsa_la_LINK) $(am_src_libout123_modules_output_qsa_la_rpath) $(src_libout123_modules_output_qsa_la_OBJECTS) $(src_libout123_modules_output_qsa_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_sdl_la-sdl.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_sdl.la: $(src_libout123_modules_output_sdl_la_OBJECTS) $(src_libout123_modules_output_sdl_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_sdl_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_sdl_la_LINK) $(am_src_libout123_modules_output_sdl_la_rpath) $(src_libout123_modules_output_sdl_la_OBJECTS) $(src_libout123_modules_output_sdl_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_sgi_la-sgi.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_sgi.la: $(src_libout123_modules_output_sgi_la_OBJECTS) $(src_libout123_modules_output_sgi_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_sgi_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_sgi_la_LINK) $(am_src_libout123_modules_output_sgi_la_rpath) $(src_libout123_modules_output_sgi_la_OBJECTS) $(src_libout123_modules_output_sgi_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_sndio_la-sndio.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_sndio.la: $(src_libout123_modules_output_sndio_la_OBJECTS) $(src_libout123_modules_output_sndio_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_sndio_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_sndio_la_LINK) $(am_src_libout123_modules_output_sndio_la_rpath) $(src_libout123_modules_output_sndio_la_OBJECTS) $(src_libout123_modules_output_sndio_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_sun_la-sun.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_sun.la: $(src_libout123_modules_output_sun_la_OBJECTS) $(src_libout123_modules_output_sun_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_sun_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_sun_la_LINK) $(am_src_libout123_modules_output_sun_la_rpath) $(src_libout123_modules_output_sun_la_OBJECTS) $(src_libout123_modules_output_sun_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_tinyalsa_la-tinyalsa.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_tinyalsa.la: $(src_libout123_modules_output_tinyalsa_la_OBJECTS) $(src_libout123_modules_output_tinyalsa_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_tinyalsa_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_tinyalsa_la_LINK) $(am_src_libout123_modules_output_tinyalsa_la_rpath) $(src_libout123_modules_output_tinyalsa_la_OBJECTS) $(src_libout123_modules_output_tinyalsa_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_win32_la-win32.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_win32.la: $(src_libout123_modules_output_win32_la_OBJECTS) $(src_libout123_modules_output_win32_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_win32_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_win32_la_LINK) $(am_src_libout123_modules_output_win32_la_rpath) $(src_libout123_modules_output_win32_la_OBJECTS) $(src_libout123_modules_output_win32_la_LIBADD) $(LIBS) +src/libout123/modules/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.lo: \ + src/libout123/modules/$(am__dirstamp) \ + src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + +src/libout123/modules/output_win32_wasapi.la: $(src_libout123_modules_output_win32_wasapi_la_OBJECTS) $(src_libout123_modules_output_win32_wasapi_la_DEPENDENCIES) $(EXTRA_src_libout123_modules_output_win32_wasapi_la_DEPENDENCIES) src/libout123/modules/$(am__dirstamp) + $(AM_V_CCLD)$(src_libout123_modules_output_win32_wasapi_la_LINK) $(am_src_libout123_modules_output_win32_wasapi_la_rpath) $(src_libout123_modules_output_win32_wasapi_la_OBJECTS) $(src_libout123_modules_output_win32_wasapi_la_LIBADD) $(LIBS) +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 +src/libmpg123/testcpu.$(OBJEXT): src/libmpg123/$(am__dirstamp) \ + src/libmpg123/$(DEPDIR)/$(am__dirstamp) + +src/libmpg123/testcpu$(EXEEXT): $(src_libmpg123_testcpu_OBJECTS) $(src_libmpg123_testcpu_DEPENDENCIES) $(EXTRA_src_libmpg123_testcpu_DEPENDENCIES) src/libmpg123/$(am__dirstamp) + @rm -f src/libmpg123/testcpu$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_libmpg123_testcpu_OBJECTS) $(src_libmpg123_testcpu_LDADD) $(LIBS) +src/$(am__dirstamp): + @$(MKDIR_P) src + @: > src/$(am__dirstamp) +src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/$(DEPDIR) + @: > src/$(DEPDIR)/$(am__dirstamp) +src/audio.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/common.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/sysutil.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/control_generic.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/equalizer.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/getlopt.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/httpget.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/resolver.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/genre.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/mpg123.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/metaprint.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/local.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/playlist.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/streamdump.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/term.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/win32_support.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/win32_net.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/mpg123$(EXEEXT): $(src_mpg123_OBJECTS) $(src_mpg123_DEPENDENCIES) $(EXTRA_src_mpg123_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/mpg123$(EXEEXT) + $(AM_V_CCLD)$(src_mpg123_LINK) $(src_mpg123_OBJECTS) $(src_mpg123_LDADD) $(LIBS) +src/mpg123-id3dump.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/mpg123-id3dump$(EXEEXT): $(src_mpg123_id3dump_OBJECTS) $(src_mpg123_id3dump_DEPENDENCIES) $(EXTRA_src_mpg123_id3dump_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/mpg123-id3dump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_mpg123_id3dump_OBJECTS) $(src_mpg123_id3dump_LDADD) $(LIBS) +src/mpg123-strip.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/mpg123-strip$(EXEEXT): $(src_mpg123_strip_OBJECTS) $(src_mpg123_strip_DEPENDENCIES) $(EXTRA_src_mpg123_strip_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/mpg123-strip$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_mpg123_strip_OBJECTS) $(src_mpg123_strip_LDADD) $(LIBS) +src/waves.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/out123.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/out123$(EXEEXT): $(src_out123_OBJECTS) $(src_out123_DEPENDENCIES) $(EXTRA_src_out123_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/out123$(EXEEXT) + $(AM_V_CCLD)$(src_out123_LINK) $(src_out123_OBJECTS) $(src_out123_LDADD) $(LIBS) +src/tests/$(am__dirstamp): + @$(MKDIR_P) src/tests + @: > src/tests/$(am__dirstamp) +src/tests/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/tests/$(DEPDIR) + @: > src/tests/$(DEPDIR)/$(am__dirstamp) +src/tests/noise.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/noise$(EXEEXT): $(src_tests_noise_OBJECTS) $(src_tests_noise_DEPENDENCIES) $(EXTRA_src_tests_noise_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/noise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_noise_OBJECTS) $(src_tests_noise_LDADD) $(LIBS) +src/tests/plain_id3.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/plain_id3$(EXEEXT): $(src_tests_plain_id3_OBJECTS) $(src_tests_plain_id3_DEPENDENCIES) $(EXTRA_src_tests_plain_id3_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/plain_id3$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_plain_id3_OBJECTS) $(src_tests_plain_id3_LDADD) $(LIBS) +src/tests/seek_whence.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/seek_whence$(EXEEXT): $(src_tests_seek_whence_OBJECTS) $(src_tests_seek_whence_DEPENDENCIES) $(EXTRA_src_tests_seek_whence_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/seek_whence$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_seek_whence_OBJECTS) $(src_tests_seek_whence_LDADD) $(LIBS) +src/tests/text.$(OBJEXT): src/tests/$(am__dirstamp) \ + src/tests/$(DEPDIR)/$(am__dirstamp) + +src/tests/text$(EXEEXT): $(src_tests_text_OBJECTS) $(src_tests_text_DEPENDENCIES) $(EXTRA_src_tests_text_DEPENDENCIES) src/tests/$(am__dirstamp) + @rm -f src/tests/text$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(src_tests_text_OBJECTS) $(src_tests_text_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f src/*.$(OBJEXT) + -rm -f src/compat/*.$(OBJEXT) + -rm -f src/compat/*.lo + -rm -f src/libmpg123/*.$(OBJEXT) + -rm -f src/libmpg123/*.lo + -rm -f src/libout123/*.$(OBJEXT) + -rm -f src/libout123/*.lo + -rm -f src/libout123/modules/*.$(OBJEXT) + -rm -f src/libout123/modules/*.lo + -rm -f src/tests/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/audio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/control_generic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/equalizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/genre.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/getlopt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/httpget.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/local.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/metaprint.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/mpg123-id3dump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/mpg123-strip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/mpg123.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/out123.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/playlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/resolver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/streamdump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sysutil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/term.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/waves.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/win32_net.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/win32_support.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/compat/$(DEPDIR)/compat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/compat/$(DEPDIR)/compat_str.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/check_neon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct36_3dnow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct36_3dnowext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct36_avx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct36_neon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct36_neon64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct36_sse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct36_x86_64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_3dnow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_3dnowext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_altivec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_avx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_avx_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_i386.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_i486.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_mmx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_neon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_neon64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_neon64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_neon_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_sse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_sse_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_x86_64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dct64_x86_64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/dither.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/equalizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/equalizer_3dnow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/feature.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/format.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/frame.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/getcpuflags.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/getcpuflags_arm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/getcpuflags_x86_64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/icy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/icy2utf8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/id3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/index.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/layer1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/layer2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/layer3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/lfs_alias.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/lfs_wrap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/libmpg123.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/ntom.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/optimize.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/readers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/stringbuf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_3dnow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_3dnowext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_8bit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_altivec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_arm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_arm_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_i486.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_i586.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_i586_dither.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_mmx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_neon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_neon64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_neon64_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_neon64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_neon64_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_neon_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_neon_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_neon_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_real.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_sse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_sse_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_sse_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_sse_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_avx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_avx_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_avx_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_avx_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_neon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_neon64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_neon64_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_neon64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_neon64_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_neon_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_neon_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_neon_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_sse_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_sse_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_sse_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_x86_64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_x86_64_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_x86_64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_stereo_x86_64_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_x86_64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_x86_64_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_x86_64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/synth_x86_64_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/tabinit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/tabinit_mmx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libmpg123/$(DEPDIR)/testcpu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/$(DEPDIR)/buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/$(DEPDIR)/legacy_module.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/$(DEPDIR)/libout123.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/$(DEPDIR)/module.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/$(DEPDIR)/stringlists.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/$(DEPDIR)/wav.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/$(DEPDIR)/xfermem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-aix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-alib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-alsa.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-arts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-coreaudio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-dummy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-esd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-hp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-jack.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-mint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-nas.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-openal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-os2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-oss.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-portaudio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-pulse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-qsa.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sdl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sgi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sndio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sun.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-tinyalsa.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-win32_wasapi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_aix_la-aix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_alib_la-alib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_alsa_la-alsa.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_arts_la-arts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_coreaudio_la-coreaudio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_dummy_la-dummy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_esd_la-esd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_hp_la-hp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_jack_la-jack.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_mint_la-mint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_nas_la-nas.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_openal_la-openal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_os2_la-os2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_oss_la-oss.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_portaudio_la-portaudio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_pulse_la-pulse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_qsa_la-qsa.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sdl_la-sdl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sgi_la-sgi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sndio_la-sndio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sun_la-sun.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_tinyalsa_la-tinyalsa.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_win32_la-win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/noise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/plain_id3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/seek_whence.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/tests/$(DEPDIR)/text.Po@am__quote@ + +.S.o: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $< + +.S.obj: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.S.lo: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $< + +.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 $@ $< + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-aix.lo: src/libout123/modules/aix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-aix.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-aix.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-aix.lo `test -f 'src/libout123/modules/aix.c' || echo '$(srcdir)/'`src/libout123/modules/aix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-aix.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-aix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/aix.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-aix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-aix.lo `test -f 'src/libout123/modules/aix.c' || echo '$(srcdir)/'`src/libout123/modules/aix.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alib.lo: src/libout123/modules/alib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alib.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-alib.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alib.lo `test -f 'src/libout123/modules/alib.c' || echo '$(srcdir)/'`src/libout123/modules/alib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-alib.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-alib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/alib.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alib.lo `test -f 'src/libout123/modules/alib.c' || echo '$(srcdir)/'`src/libout123/modules/alib.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alsa.lo: src/libout123/modules/alsa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alsa.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-alsa.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alsa.lo `test -f 'src/libout123/modules/alsa.c' || echo '$(srcdir)/'`src/libout123/modules/alsa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-alsa.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-alsa.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/alsa.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alsa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-alsa.lo `test -f 'src/libout123/modules/alsa.c' || echo '$(srcdir)/'`src/libout123/modules/alsa.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-arts.lo: src/libout123/modules/arts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-arts.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-arts.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-arts.lo `test -f 'src/libout123/modules/arts.c' || echo '$(srcdir)/'`src/libout123/modules/arts.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-arts.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-arts.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/arts.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-arts.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-arts.lo `test -f 'src/libout123/modules/arts.c' || echo '$(srcdir)/'`src/libout123/modules/arts.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-coreaudio.lo: src/libout123/modules/coreaudio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-coreaudio.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-coreaudio.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-coreaudio.lo `test -f 'src/libout123/modules/coreaudio.c' || echo '$(srcdir)/'`src/libout123/modules/coreaudio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-coreaudio.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-coreaudio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/coreaudio.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-coreaudio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-coreaudio.lo `test -f 'src/libout123/modules/coreaudio.c' || echo '$(srcdir)/'`src/libout123/modules/coreaudio.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-dummy.lo: src/libout123/modules/dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-dummy.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-dummy.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-dummy.lo `test -f 'src/libout123/modules/dummy.c' || echo '$(srcdir)/'`src/libout123/modules/dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-dummy.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-dummy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/dummy.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-dummy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-dummy.lo `test -f 'src/libout123/modules/dummy.c' || echo '$(srcdir)/'`src/libout123/modules/dummy.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-esd.lo: src/libout123/modules/esd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-esd.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-esd.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-esd.lo `test -f 'src/libout123/modules/esd.c' || echo '$(srcdir)/'`src/libout123/modules/esd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-esd.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-esd.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/esd.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-esd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-esd.lo `test -f 'src/libout123/modules/esd.c' || echo '$(srcdir)/'`src/libout123/modules/esd.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-hp.lo: src/libout123/modules/hp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-hp.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-hp.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-hp.lo `test -f 'src/libout123/modules/hp.c' || echo '$(srcdir)/'`src/libout123/modules/hp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-hp.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-hp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/hp.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-hp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-hp.lo `test -f 'src/libout123/modules/hp.c' || echo '$(srcdir)/'`src/libout123/modules/hp.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-jack.lo: src/libout123/modules/jack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-jack.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-jack.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-jack.lo `test -f 'src/libout123/modules/jack.c' || echo '$(srcdir)/'`src/libout123/modules/jack.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-jack.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-jack.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/jack.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-jack.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-jack.lo `test -f 'src/libout123/modules/jack.c' || echo '$(srcdir)/'`src/libout123/modules/jack.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-mint.lo: src/libout123/modules/mint.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-mint.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-mint.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-mint.lo `test -f 'src/libout123/modules/mint.c' || echo '$(srcdir)/'`src/libout123/modules/mint.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-mint.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-mint.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/mint.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-mint.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-mint.lo `test -f 'src/libout123/modules/mint.c' || echo '$(srcdir)/'`src/libout123/modules/mint.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-nas.lo: src/libout123/modules/nas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-nas.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-nas.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-nas.lo `test -f 'src/libout123/modules/nas.c' || echo '$(srcdir)/'`src/libout123/modules/nas.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-nas.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-nas.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/nas.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-nas.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-nas.lo `test -f 'src/libout123/modules/nas.c' || echo '$(srcdir)/'`src/libout123/modules/nas.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-openal.lo: src/libout123/modules/openal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-openal.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-openal.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-openal.lo `test -f 'src/libout123/modules/openal.c' || echo '$(srcdir)/'`src/libout123/modules/openal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-openal.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-openal.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/openal.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-openal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-openal.lo `test -f 'src/libout123/modules/openal.c' || echo '$(srcdir)/'`src/libout123/modules/openal.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-os2.lo: src/libout123/modules/os2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-os2.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-os2.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-os2.lo `test -f 'src/libout123/modules/os2.c' || echo '$(srcdir)/'`src/libout123/modules/os2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-os2.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-os2.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/os2.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-os2.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-os2.lo `test -f 'src/libout123/modules/os2.c' || echo '$(srcdir)/'`src/libout123/modules/os2.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-oss.lo: src/libout123/modules/oss.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-oss.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-oss.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-oss.lo `test -f 'src/libout123/modules/oss.c' || echo '$(srcdir)/'`src/libout123/modules/oss.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-oss.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-oss.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/oss.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-oss.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-oss.lo `test -f 'src/libout123/modules/oss.c' || echo '$(srcdir)/'`src/libout123/modules/oss.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-portaudio.lo: src/libout123/modules/portaudio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-portaudio.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-portaudio.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-portaudio.lo `test -f 'src/libout123/modules/portaudio.c' || echo '$(srcdir)/'`src/libout123/modules/portaudio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-portaudio.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-portaudio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/portaudio.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-portaudio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-portaudio.lo `test -f 'src/libout123/modules/portaudio.c' || echo '$(srcdir)/'`src/libout123/modules/portaudio.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-pulse.lo: src/libout123/modules/pulse.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-pulse.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-pulse.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-pulse.lo `test -f 'src/libout123/modules/pulse.c' || echo '$(srcdir)/'`src/libout123/modules/pulse.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-pulse.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-pulse.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/pulse.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-pulse.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-pulse.lo `test -f 'src/libout123/modules/pulse.c' || echo '$(srcdir)/'`src/libout123/modules/pulse.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-qsa.lo: src/libout123/modules/qsa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-qsa.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-qsa.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-qsa.lo `test -f 'src/libout123/modules/qsa.c' || echo '$(srcdir)/'`src/libout123/modules/qsa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-qsa.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-qsa.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/qsa.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-qsa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-qsa.lo `test -f 'src/libout123/modules/qsa.c' || echo '$(srcdir)/'`src/libout123/modules/qsa.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sdl.lo: src/libout123/modules/sdl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sdl.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sdl.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sdl.lo `test -f 'src/libout123/modules/sdl.c' || echo '$(srcdir)/'`src/libout123/modules/sdl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sdl.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sdl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/sdl.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sdl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sdl.lo `test -f 'src/libout123/modules/sdl.c' || echo '$(srcdir)/'`src/libout123/modules/sdl.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sgi.lo: src/libout123/modules/sgi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sgi.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sgi.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sgi.lo `test -f 'src/libout123/modules/sgi.c' || echo '$(srcdir)/'`src/libout123/modules/sgi.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sgi.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sgi.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/sgi.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sgi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sgi.lo `test -f 'src/libout123/modules/sgi.c' || echo '$(srcdir)/'`src/libout123/modules/sgi.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sndio.lo: src/libout123/modules/sndio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sndio.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sndio.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sndio.lo `test -f 'src/libout123/modules/sndio.c' || echo '$(srcdir)/'`src/libout123/modules/sndio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sndio.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sndio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/sndio.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sndio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sndio.lo `test -f 'src/libout123/modules/sndio.c' || echo '$(srcdir)/'`src/libout123/modules/sndio.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sun.lo: src/libout123/modules/sun.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sun.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sun.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sun.lo `test -f 'src/libout123/modules/sun.c' || echo '$(srcdir)/'`src/libout123/modules/sun.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sun.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-sun.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/sun.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sun.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-sun.lo `test -f 'src/libout123/modules/sun.c' || echo '$(srcdir)/'`src/libout123/modules/sun.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-tinyalsa.lo: src/libout123/modules/tinyalsa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-tinyalsa.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-tinyalsa.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-tinyalsa.lo `test -f 'src/libout123/modules/tinyalsa.c' || echo '$(srcdir)/'`src/libout123/modules/tinyalsa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-tinyalsa.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-tinyalsa.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/tinyalsa.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-tinyalsa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-tinyalsa.lo `test -f 'src/libout123/modules/tinyalsa.c' || echo '$(srcdir)/'`src/libout123/modules/tinyalsa.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32.lo: src/libout123/modules/win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-win32.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32.lo `test -f 'src/libout123/modules/win32.c' || echo '$(srcdir)/'`src/libout123/modules/win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-win32.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/win32.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32.lo `test -f 'src/libout123/modules/win32.c' || echo '$(srcdir)/'`src/libout123/modules/win32.c + +src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32_wasapi.lo: src/libout123/modules/win32_wasapi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32_wasapi.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-win32_wasapi.Tpo -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32_wasapi.lo `test -f 'src/libout123/modules/win32_wasapi.c' || echo '$(srcdir)/'`src/libout123/modules/win32_wasapi.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-win32_wasapi.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_libdefaultmodule_la-win32_wasapi.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/win32_wasapi.c' object='src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32_wasapi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libout123_modules_libdefaultmodule_la_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_libdefaultmodule_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_libdefaultmodule_la-win32_wasapi.lo `test -f 'src/libout123/modules/win32_wasapi.c' || echo '$(srcdir)/'`src/libout123/modules/win32_wasapi.c + +src/libout123/modules/src_libout123_modules_output_aix_la-aix.lo: src/libout123/modules/aix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_aix_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_aix_la-aix.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_aix_la-aix.Tpo -c -o src/libout123/modules/src_libout123_modules_output_aix_la-aix.lo `test -f 'src/libout123/modules/aix.c' || echo '$(srcdir)/'`src/libout123/modules/aix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_aix_la-aix.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_aix_la-aix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/aix.c' object='src/libout123/modules/src_libout123_modules_output_aix_la-aix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_aix_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_aix_la-aix.lo `test -f 'src/libout123/modules/aix.c' || echo '$(srcdir)/'`src/libout123/modules/aix.c + +src/libout123/modules/src_libout123_modules_output_alib_la-alib.lo: src/libout123/modules/alib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_alib_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_alib_la-alib.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_alib_la-alib.Tpo -c -o src/libout123/modules/src_libout123_modules_output_alib_la-alib.lo `test -f 'src/libout123/modules/alib.c' || echo '$(srcdir)/'`src/libout123/modules/alib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_alib_la-alib.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_alib_la-alib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/alib.c' object='src/libout123/modules/src_libout123_modules_output_alib_la-alib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_alib_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_alib_la-alib.lo `test -f 'src/libout123/modules/alib.c' || echo '$(srcdir)/'`src/libout123/modules/alib.c + +src/libout123/modules/src_libout123_modules_output_alsa_la-alsa.lo: src/libout123/modules/alsa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_alsa_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_alsa_la-alsa.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_alsa_la-alsa.Tpo -c -o src/libout123/modules/src_libout123_modules_output_alsa_la-alsa.lo `test -f 'src/libout123/modules/alsa.c' || echo '$(srcdir)/'`src/libout123/modules/alsa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_alsa_la-alsa.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_alsa_la-alsa.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/alsa.c' object='src/libout123/modules/src_libout123_modules_output_alsa_la-alsa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_alsa_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_alsa_la-alsa.lo `test -f 'src/libout123/modules/alsa.c' || echo '$(srcdir)/'`src/libout123/modules/alsa.c + +src/libout123/modules/src_libout123_modules_output_arts_la-arts.lo: src/libout123/modules/arts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_arts_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_arts_la-arts.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_arts_la-arts.Tpo -c -o src/libout123/modules/src_libout123_modules_output_arts_la-arts.lo `test -f 'src/libout123/modules/arts.c' || echo '$(srcdir)/'`src/libout123/modules/arts.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_arts_la-arts.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_arts_la-arts.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/arts.c' object='src/libout123/modules/src_libout123_modules_output_arts_la-arts.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_arts_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_arts_la-arts.lo `test -f 'src/libout123/modules/arts.c' || echo '$(srcdir)/'`src/libout123/modules/arts.c + +src/libout123/modules/src_libout123_modules_output_coreaudio_la-coreaudio.lo: src/libout123/modules/coreaudio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_coreaudio_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_coreaudio_la-coreaudio.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_coreaudio_la-coreaudio.Tpo -c -o src/libout123/modules/src_libout123_modules_output_coreaudio_la-coreaudio.lo `test -f 'src/libout123/modules/coreaudio.c' || echo '$(srcdir)/'`src/libout123/modules/coreaudio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_coreaudio_la-coreaudio.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_coreaudio_la-coreaudio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/coreaudio.c' object='src/libout123/modules/src_libout123_modules_output_coreaudio_la-coreaudio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_coreaudio_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_coreaudio_la-coreaudio.lo `test -f 'src/libout123/modules/coreaudio.c' || echo '$(srcdir)/'`src/libout123/modules/coreaudio.c + +src/libout123/modules/src_libout123_modules_output_dummy_la-dummy.lo: src/libout123/modules/dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_dummy_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_dummy_la-dummy.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_dummy_la-dummy.Tpo -c -o src/libout123/modules/src_libout123_modules_output_dummy_la-dummy.lo `test -f 'src/libout123/modules/dummy.c' || echo '$(srcdir)/'`src/libout123/modules/dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_dummy_la-dummy.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_dummy_la-dummy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/dummy.c' object='src/libout123/modules/src_libout123_modules_output_dummy_la-dummy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_dummy_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_dummy_la-dummy.lo `test -f 'src/libout123/modules/dummy.c' || echo '$(srcdir)/'`src/libout123/modules/dummy.c + +src/libout123/modules/src_libout123_modules_output_esd_la-esd.lo: src/libout123/modules/esd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_esd_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_esd_la-esd.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_esd_la-esd.Tpo -c -o src/libout123/modules/src_libout123_modules_output_esd_la-esd.lo `test -f 'src/libout123/modules/esd.c' || echo '$(srcdir)/'`src/libout123/modules/esd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_esd_la-esd.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_esd_la-esd.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/esd.c' object='src/libout123/modules/src_libout123_modules_output_esd_la-esd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_esd_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_esd_la-esd.lo `test -f 'src/libout123/modules/esd.c' || echo '$(srcdir)/'`src/libout123/modules/esd.c + +src/libout123/modules/src_libout123_modules_output_hp_la-hp.lo: src/libout123/modules/hp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_hp_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_hp_la-hp.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_hp_la-hp.Tpo -c -o src/libout123/modules/src_libout123_modules_output_hp_la-hp.lo `test -f 'src/libout123/modules/hp.c' || echo '$(srcdir)/'`src/libout123/modules/hp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_hp_la-hp.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_hp_la-hp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/hp.c' object='src/libout123/modules/src_libout123_modules_output_hp_la-hp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_hp_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_hp_la-hp.lo `test -f 'src/libout123/modules/hp.c' || echo '$(srcdir)/'`src/libout123/modules/hp.c + +src/libout123/modules/src_libout123_modules_output_jack_la-jack.lo: src/libout123/modules/jack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_jack_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_jack_la-jack.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_jack_la-jack.Tpo -c -o src/libout123/modules/src_libout123_modules_output_jack_la-jack.lo `test -f 'src/libout123/modules/jack.c' || echo '$(srcdir)/'`src/libout123/modules/jack.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_jack_la-jack.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_jack_la-jack.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/jack.c' object='src/libout123/modules/src_libout123_modules_output_jack_la-jack.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_jack_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_jack_la-jack.lo `test -f 'src/libout123/modules/jack.c' || echo '$(srcdir)/'`src/libout123/modules/jack.c + +src/libout123/modules/src_libout123_modules_output_mint_la-mint.lo: src/libout123/modules/mint.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_mint_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_mint_la-mint.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_mint_la-mint.Tpo -c -o src/libout123/modules/src_libout123_modules_output_mint_la-mint.lo `test -f 'src/libout123/modules/mint.c' || echo '$(srcdir)/'`src/libout123/modules/mint.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_mint_la-mint.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_mint_la-mint.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/mint.c' object='src/libout123/modules/src_libout123_modules_output_mint_la-mint.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_mint_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_mint_la-mint.lo `test -f 'src/libout123/modules/mint.c' || echo '$(srcdir)/'`src/libout123/modules/mint.c + +src/libout123/modules/src_libout123_modules_output_nas_la-nas.lo: src/libout123/modules/nas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_nas_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_nas_la-nas.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_nas_la-nas.Tpo -c -o src/libout123/modules/src_libout123_modules_output_nas_la-nas.lo `test -f 'src/libout123/modules/nas.c' || echo '$(srcdir)/'`src/libout123/modules/nas.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_nas_la-nas.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_nas_la-nas.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/nas.c' object='src/libout123/modules/src_libout123_modules_output_nas_la-nas.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_nas_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_nas_la-nas.lo `test -f 'src/libout123/modules/nas.c' || echo '$(srcdir)/'`src/libout123/modules/nas.c + +src/libout123/modules/src_libout123_modules_output_openal_la-openal.lo: src/libout123/modules/openal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_openal_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_openal_la-openal.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_openal_la-openal.Tpo -c -o src/libout123/modules/src_libout123_modules_output_openal_la-openal.lo `test -f 'src/libout123/modules/openal.c' || echo '$(srcdir)/'`src/libout123/modules/openal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_openal_la-openal.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_openal_la-openal.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/openal.c' object='src/libout123/modules/src_libout123_modules_output_openal_la-openal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_openal_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_openal_la-openal.lo `test -f 'src/libout123/modules/openal.c' || echo '$(srcdir)/'`src/libout123/modules/openal.c + +src/libout123/modules/src_libout123_modules_output_os2_la-os2.lo: src/libout123/modules/os2.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_os2_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_os2_la-os2.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_os2_la-os2.Tpo -c -o src/libout123/modules/src_libout123_modules_output_os2_la-os2.lo `test -f 'src/libout123/modules/os2.c' || echo '$(srcdir)/'`src/libout123/modules/os2.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_os2_la-os2.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_os2_la-os2.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/os2.c' object='src/libout123/modules/src_libout123_modules_output_os2_la-os2.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_os2_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_os2_la-os2.lo `test -f 'src/libout123/modules/os2.c' || echo '$(srcdir)/'`src/libout123/modules/os2.c + +src/libout123/modules/src_libout123_modules_output_oss_la-oss.lo: src/libout123/modules/oss.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_oss_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_oss_la-oss.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_oss_la-oss.Tpo -c -o src/libout123/modules/src_libout123_modules_output_oss_la-oss.lo `test -f 'src/libout123/modules/oss.c' || echo '$(srcdir)/'`src/libout123/modules/oss.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_oss_la-oss.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_oss_la-oss.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/oss.c' object='src/libout123/modules/src_libout123_modules_output_oss_la-oss.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_oss_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_oss_la-oss.lo `test -f 'src/libout123/modules/oss.c' || echo '$(srcdir)/'`src/libout123/modules/oss.c + +src/libout123/modules/src_libout123_modules_output_portaudio_la-portaudio.lo: src/libout123/modules/portaudio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_portaudio_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_portaudio_la-portaudio.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_portaudio_la-portaudio.Tpo -c -o src/libout123/modules/src_libout123_modules_output_portaudio_la-portaudio.lo `test -f 'src/libout123/modules/portaudio.c' || echo '$(srcdir)/'`src/libout123/modules/portaudio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_portaudio_la-portaudio.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_portaudio_la-portaudio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/portaudio.c' object='src/libout123/modules/src_libout123_modules_output_portaudio_la-portaudio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_portaudio_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_portaudio_la-portaudio.lo `test -f 'src/libout123/modules/portaudio.c' || echo '$(srcdir)/'`src/libout123/modules/portaudio.c + +src/libout123/modules/src_libout123_modules_output_pulse_la-pulse.lo: src/libout123/modules/pulse.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_pulse_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_pulse_la-pulse.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_pulse_la-pulse.Tpo -c -o src/libout123/modules/src_libout123_modules_output_pulse_la-pulse.lo `test -f 'src/libout123/modules/pulse.c' || echo '$(srcdir)/'`src/libout123/modules/pulse.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_pulse_la-pulse.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_pulse_la-pulse.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/pulse.c' object='src/libout123/modules/src_libout123_modules_output_pulse_la-pulse.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_pulse_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_pulse_la-pulse.lo `test -f 'src/libout123/modules/pulse.c' || echo '$(srcdir)/'`src/libout123/modules/pulse.c + +src/libout123/modules/src_libout123_modules_output_qsa_la-qsa.lo: src/libout123/modules/qsa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_qsa_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_qsa_la-qsa.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_qsa_la-qsa.Tpo -c -o src/libout123/modules/src_libout123_modules_output_qsa_la-qsa.lo `test -f 'src/libout123/modules/qsa.c' || echo '$(srcdir)/'`src/libout123/modules/qsa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_qsa_la-qsa.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_qsa_la-qsa.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/qsa.c' object='src/libout123/modules/src_libout123_modules_output_qsa_la-qsa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_qsa_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_qsa_la-qsa.lo `test -f 'src/libout123/modules/qsa.c' || echo '$(srcdir)/'`src/libout123/modules/qsa.c + +src/libout123/modules/src_libout123_modules_output_sdl_la-sdl.lo: src/libout123/modules/sdl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_sdl_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_sdl_la-sdl.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sdl_la-sdl.Tpo -c -o src/libout123/modules/src_libout123_modules_output_sdl_la-sdl.lo `test -f 'src/libout123/modules/sdl.c' || echo '$(srcdir)/'`src/libout123/modules/sdl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sdl_la-sdl.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sdl_la-sdl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/sdl.c' object='src/libout123/modules/src_libout123_modules_output_sdl_la-sdl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_sdl_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_sdl_la-sdl.lo `test -f 'src/libout123/modules/sdl.c' || echo '$(srcdir)/'`src/libout123/modules/sdl.c + +src/libout123/modules/src_libout123_modules_output_sgi_la-sgi.lo: src/libout123/modules/sgi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_sgi_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_sgi_la-sgi.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sgi_la-sgi.Tpo -c -o src/libout123/modules/src_libout123_modules_output_sgi_la-sgi.lo `test -f 'src/libout123/modules/sgi.c' || echo '$(srcdir)/'`src/libout123/modules/sgi.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sgi_la-sgi.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sgi_la-sgi.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/sgi.c' object='src/libout123/modules/src_libout123_modules_output_sgi_la-sgi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_sgi_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_sgi_la-sgi.lo `test -f 'src/libout123/modules/sgi.c' || echo '$(srcdir)/'`src/libout123/modules/sgi.c + +src/libout123/modules/src_libout123_modules_output_sndio_la-sndio.lo: src/libout123/modules/sndio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_sndio_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_sndio_la-sndio.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sndio_la-sndio.Tpo -c -o src/libout123/modules/src_libout123_modules_output_sndio_la-sndio.lo `test -f 'src/libout123/modules/sndio.c' || echo '$(srcdir)/'`src/libout123/modules/sndio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sndio_la-sndio.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sndio_la-sndio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/sndio.c' object='src/libout123/modules/src_libout123_modules_output_sndio_la-sndio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_sndio_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_sndio_la-sndio.lo `test -f 'src/libout123/modules/sndio.c' || echo '$(srcdir)/'`src/libout123/modules/sndio.c + +src/libout123/modules/src_libout123_modules_output_sun_la-sun.lo: src/libout123/modules/sun.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_sun_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_sun_la-sun.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sun_la-sun.Tpo -c -o src/libout123/modules/src_libout123_modules_output_sun_la-sun.lo `test -f 'src/libout123/modules/sun.c' || echo '$(srcdir)/'`src/libout123/modules/sun.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sun_la-sun.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_sun_la-sun.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/sun.c' object='src/libout123/modules/src_libout123_modules_output_sun_la-sun.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_sun_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_sun_la-sun.lo `test -f 'src/libout123/modules/sun.c' || echo '$(srcdir)/'`src/libout123/modules/sun.c + +src/libout123/modules/src_libout123_modules_output_tinyalsa_la-tinyalsa.lo: src/libout123/modules/tinyalsa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_tinyalsa_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_tinyalsa_la-tinyalsa.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_tinyalsa_la-tinyalsa.Tpo -c -o src/libout123/modules/src_libout123_modules_output_tinyalsa_la-tinyalsa.lo `test -f 'src/libout123/modules/tinyalsa.c' || echo '$(srcdir)/'`src/libout123/modules/tinyalsa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_tinyalsa_la-tinyalsa.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_tinyalsa_la-tinyalsa.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/tinyalsa.c' object='src/libout123/modules/src_libout123_modules_output_tinyalsa_la-tinyalsa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_tinyalsa_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_tinyalsa_la-tinyalsa.lo `test -f 'src/libout123/modules/tinyalsa.c' || echo '$(srcdir)/'`src/libout123/modules/tinyalsa.c + +src/libout123/modules/src_libout123_modules_output_win32_la-win32.lo: src/libout123/modules/win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_win32_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_win32_la-win32.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_win32_la-win32.Tpo -c -o src/libout123/modules/src_libout123_modules_output_win32_la-win32.lo `test -f 'src/libout123/modules/win32.c' || echo '$(srcdir)/'`src/libout123/modules/win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_win32_la-win32.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_win32_la-win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/win32.c' object='src/libout123/modules/src_libout123_modules_output_win32_la-win32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_win32_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_win32_la-win32.lo `test -f 'src/libout123/modules/win32.c' || echo '$(srcdir)/'`src/libout123/modules/win32.c + +src/libout123/modules/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.lo: src/libout123/modules/win32_wasapi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_win32_wasapi_la_CFLAGS) $(CFLAGS) -MT src/libout123/modules/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.lo -MD -MP -MF src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.Tpo -c -o src/libout123/modules/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.lo `test -f 'src/libout123/modules/win32_wasapi.c' || echo '$(srcdir)/'`src/libout123/modules/win32_wasapi.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.Tpo src/libout123/modules/$(DEPDIR)/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libout123/modules/win32_wasapi.c' object='src/libout123/modules/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libout123_modules_output_win32_wasapi_la_CFLAGS) $(CFLAGS) -c -o src/libout123/modules/src_libout123_modules_output_win32_wasapi_la-win32_wasapi.lo `test -f 'src/libout123/modules/win32_wasapi.c' || echo '$(srcdir)/'`src/libout123/modules/win32_wasapi.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf src/.libs src/_libs + -rm -rf src/compat/.libs src/compat/_libs + -rm -rf src/libmpg123/.libs src/libmpg123/_libs + -rm -rf src/libout123/.libs src/libout123/_libs + -rm -rf src/libout123/modules/.libs src/libout123/modules/_libs + -rm -rf src/tests/.libs src/tests/_libs + +distclean-libtool: + -rm -f libtool config.lt +install-man1: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_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='$(dist_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) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || 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)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || 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_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) +install-nodist_includeHEADERS: $(nodist_include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || 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_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-nodist_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(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" +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-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 + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(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 + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(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 + @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 + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + 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/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 \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(MANS) \ + $(DATA) $(HEADERS) +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; 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: + -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) + -rm -f src/$(DEPDIR)/$(am__dirstamp) + -rm -f src/$(am__dirstamp) + -rm -f src/compat/$(DEPDIR)/$(am__dirstamp) + -rm -f src/compat/$(am__dirstamp) + -rm -f src/libmpg123/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libmpg123/$(am__dirstamp) + -rm -f src/libout123/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libout123/$(am__dirstamp) + -rm -f src/libout123/modules/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libout123/modules/$(am__dirstamp) + -rm -f src/tests/$(DEPDIR)/$(am__dirstamp) + -rm -f src/tests/$(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." +@HAVE_MODULES_FALSE@install-exec-hook: +@HAVE_MODULES_FALSE@uninstall-hook: +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + clean-pkglibLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf src/$(DEPDIR) src/compat/$(DEPDIR) src/libmpg123/$(DEPDIR) src/libout123/$(DEPDIR) src/libout123/modules/$(DEPDIR) src/tests/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS install-man \ + install-nodist_includeHEADERS install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \ + install-pkglibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +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 $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf src/$(DEPDIR) src/compat/$(DEPDIR) src/libmpg123/$(DEPDIR) src/libout123/$(DEPDIR) src/libout123/modules/$(DEPDIR) src/tests/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-man \ + uninstall-nodist_includeHEADERS uninstall-pkgconfigDATA \ + uninstall-pkglibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +uninstall-man: uninstall-man1 + +.MAKE: install-am install-exec-am install-strip uninstall-am + +.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-noinstLIBRARIES \ + clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES cscope \ + cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck 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-exec-hook install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-libLTLIBRARIES install-man install-man1 \ + install-nodist_includeHEADERS install-pdf install-pdf-am \ + install-pkgconfigDATA install-pkglibLTLIBRARIES 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-hook \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-man uninstall-man1 uninstall-nodist_includeHEADERS \ + uninstall-pkgconfigDATA uninstall-pkglibLTLIBRARIES + +.PRECIOUS: Makefile + + +@USE_YASM_FOR_AVX_TRUE@$(AVX_OBJS): %.@OBJEXT@: %.S $(ASM_DEPS) +@USE_YASM_FOR_AVX_TRUE@ $(CPP) $(DEFAULT_INCLUDES) $(INCLUDES) -DASMALIGN_BALIGN $< | @YASM@ - @YASMFLAGS@ @YASM_FORMAT@ -o $@ + +@USE_YASM_FOR_AVX_TRUE@$(AVX_OBJS:.@OBJEXT@=.lo): %.lo: %.@OBJEXT@ +@USE_YASM_FOR_AVX_TRUE@ @echo "# Generated by ltmain.sh (GNU libtool)" >$@ +@USE_YASM_FOR_AVX_TRUE@ @echo "pic_object='`basename $<`'" >>$@ +@USE_YASM_FOR_AVX_TRUE@ @echo "non_pic_object='`basename $<`'" >>$@ + +# Get rid of .la files, at least _after_ install. +@HAVE_MODULES_TRUE@install-exec-hook: +@HAVE_MODULES_TRUE@ cd $(DESTDIR)$(pkglibdir) && rm -f @output_modules_la@ +# The above breaks uninstall of module .so files? +@HAVE_MODULES_TRUE@uninstall-hook: +@HAVE_MODULES_TRUE@ for m in @output_modules_la@; do eval $$(grep dlname= src/libout123/modules/$$m) && rm -f $(DESTDIR)$(pkglibdir)/$$dlname; done + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..35216bc --- /dev/null +++ b/NEWS @@ -0,0 +1,1981 @@ +1.25.10 +------- + +- libout123: Fix error messages beginning from OUT123_ARG_ERROR (bug 261). + +1.25.9 +------ +- mpg123: Fix --icy-interval handling to work with stream from stdin. + (curl | mpg123 --icy-interval=n -) +- libmpg123: Fix another invalid read and segfault on damaged (fuzzed) + files with part2_3_length == 0 (set maxband=1, pulled from upcoming 1.26.0). + +1.25.8 +------ +- mpg123: +-- Also disable cursor/video games for empty TERM (not just unset and dumb). +- libmpg123: +-- Accept changing mode extension bits when looking for next header for + detecting free-format streams (bug 257). +-- Fix compute_bpf() for free format streams (needed to estimate track + length and working fuzzy seeking in absence of an Info tag). + +1.25.7 +------ +- mpg123: +-- Do not play with cursor and inverse video for progress bar + when TERM=dumb. +-- Fix parsing of host port for numerical IPv6 addresses (just did + not work before, only for textual host names). +- libmpg123: +-- Proper fix for the xrpnt overflow problems by correctly + initialising certain tables for MPEG 2.x layer III. The checks that + catch the resulting overflow are still in place, but likely superfluous + now. Note that this means certain valid files would have been misdecoded + before, if anyone actually produced them. Thanks to Robert Hegemann for + the fix! +-- Silently handle granules with part2_3_length == 0, but + scalefac_compress != 0 (ignore the latter). + +1.25.6 +------ +- Hotfix for bug 255: Overflow reading frame data bits in layer II decoding. + Now, all-zero data is returned if the frame data is exhausted. This might + have a slight impact on performance, but not easily measurable so far. + +1.25.5 +------ +- Avoid another buffer read overflow in the ID3 parser on 32 bit platforms + (bug 254). + +1.25.4 +------ +- Better configure checks for i?86-apple-darwin (bug 253). +- libmpg123: +-- Prevent harmless call to memcpy(NULL, NULL, 0). +-- More early checking of ID3v2 encoding values to avoid bogus text being + stored. + +1.25.3 +------ +- libmpg123: +-- Better checks for xrpnt overflow in III_dequantize_sample() before each + use, avoiding false positives and catching cases that were rendered + harmless by alignment-enlarged buffers. + +1.25.2 +------ +- libmpg123: +-- Extend pow tables for layer III to properly handle files with i-stereo and + 5-bit scalefactors. Never observed them for real, just as fuzzed input to + trigger the read overflow. Note: This one goes on record as CVE-2017-11126, + calling remote denial of service. While the accesses are out of bounds for + the pow tables, they still are safely within libmpg123's memory (other + static tables). Just wrong values are used for computation, no actual crash + unless you use something like GCC's AddressSanitizer, nor any information + disclosure. +-- Avoid left-shifts of negative integers in layer I decoding. + +1.25.1: Hot Fuzz +------- +- libmpg123: +-- Avoid memset(NULL, 0, 0) to calm down the paranoid. +-- Fix bug 252, invalid read of size 1 in ID3v2 parser due to forgotten + offset from the frame flag bytes (unnoticed in practice for a long + time). Fuzzers are in the house again. This one got CVE-2017-10683. +-- Avoid a mostly harmless conditional jump depending on uninitialised + fr->lay in compute_bpf() (mpg123_position()) when track is not ready yet. +-- Fix undefined shifts on signed long mask in layer3.c (worked in practice, + never right in theory). Code might be a bit faster now, even. + Thanks to Agostino Sarubbo for reporting. + +1.25.0: MP3 now patent-free worldwide! +------- +- Silence test for artsc-config if it is not there. +- Make sure -static-libgcc from LDFLAGS gets through libtool, + fixing 32 bit Windows builds (depend on libgcc DLL otherwise). +- Fix build with non-GNU make by using plain rm -f instead of silly $(RM) + in libout123/modules makefile fragment. +- Make build work on iOS, including coreaudio backend. +- libmpg123: +-- Finally provide position-independent code for x86 with assembly + optimisations.The textrels are gone thanks to Won Kyu Park and Taihei Momma. +-- Clarify some license language in files descending from the original MMX + optimisation. +-- Fix return value overflow check for MPG123_BUFFERFILL. +-- Introduced mpg123_getformat2() to enable the FORMAT command + for the generic control not stealing MPG123_NEW_FORMAT from the main + playback loop. The sequence LOADPAUSED-FORMAT-PAUSE (play) is supposed + to work now. +-- Enable aarch64 optimisations on *BSD by default, too. You can always + override that stupid OS whitelist using --with-optimization, anyway. +-- Use of the i486 decoder is now discouraged more prominently, in configure + output. +- out123: Fix stupid crash with verbose mode and tone generation (print + the string if the pointer is non-null, not if it is null). +- libout123: More consistent error messages for dynamic and legacy + (built-in) modules. Namely, you get a hint how if you choose a different + module than the built-in ones for a static libout123. + +1.24.0: +------- +- Avoid repeating genre in metadata printout for specifications like + (144)Thrash Metal. +- In remote control mode, only enforce --quiet if no verbosity was required. +- Prevent --loop and --shuffle or --random from messing with the remote + control LOADLIST command (printout of the list would loop without reason). +- Fix the mpg123 command (esp. our provided binaries on Windows) to now find + modules again relative to the executable directory, not the current working + directory. This was a regression in 1.23 and might be security-relevant if + you called mpg123 in working directories with untrusted content. + Note that mpg123 1.23 looked for modules relative to the current working + directory only if the installation prefix for modules did not exist. + So, usage on an intact installation (with /usr/lib/mpg123 or the like) was + safe. Nevertheless this new version fixes the search to be relative to the + binary path as it was with 1.22 and before. +- At least consistent behaviour of playlist code in the face of looping. + Looping is about individual tracks, always. They are looped also in random + mode. Jumping (prev/next keys) is between tracks and resets the loop counter. + The display of currently playing track in the playlist is fixed for random + and looped play now (bug 198). +- Looping is now mentioned for a to-be-repeated track with --verbose. +- Move some compiler nagging from --enable-debug to --enable-nagging, fix up + some new build failures by adding some pesky feature test macros. +- Try not to pollute the terminal buffer with old progress bars in inverse + video. Only the currently live one shall be seen. That one is pretty. The + others are not. +- Using plain dlopen()/LoadLibrary() for opening modules instead of libltdl. + This also means that --with-module-suffix is gone in configure. +- Windows builds only work when Unicode support is there (older than Windows + 2000/XP will definitely not work anymore). +- The out123 tool now features tone generation, with a mix of differing + wave patterns. Makes sense to be able to test the audio output by itself, + and it's fun. See --wave-freq and related parameters. +- libmpg123 version 43: +-- Add flags MPG123_NO_PEEK_END and MPG123_FORCE_SEEKABLE, as suggested + by Bent Bisballe Nyeng. +-- Build fix for MSVC (consistent definition of ssize_t, spotted by manx, + bug 243). +-- Build fix for --with-cpu=ppc_nofpu (thanks to Michael Kostylev, bug 244). +-- Add asm optimized MSVC++ Win32|x64 and UWP|x64 builds +-- Remove old, broken MSVC++ builds +- libout123 version 2: +-- Added OUT123_BINDIR. +-- New search order for output plugin directory: MPG123_MODDIR, or (relative + to executable directory OUT123_BINDIR) ../lib/mpg123, plugins + libout123/modules/.libs, libout123/modules, ../libout123/modules/.libs, + ../libout123/modules, and at last the installation prefix $libdir/mpg213/. + This shall ensure that a build inside a source tree does not try to use old + modules from the system prefix. The normal libtool wrapper deals with the + shared libout123 or libmpg123 only, not modules. + Note that if you set MPG123_MODDIR to a non-existing directory, no modules + will be found (earlier versions fell back to other choices). +-- The OUT123_NAME parameter is now copied by out123_param_from(), as is + the newly added OUT123_BINDIR. +-- Coreaudio: Use AudioComponents API on OSX >= 10.6 (thanks to Michael Weiser). +-- Coreaudio: Fix behaviour of out123_drop(), not killing the output anymore + without re-opening the device (bug 236, thanks to Taihei for the fix). + +1.23.8 +------ +- Fix long-standing bad memory read (via integer underflow) in ID3 parser + for crafted ID3v2 tags with tiny size information (bug 240). Thanks to + Han Lee & Jerold Hoong for the detailed report. + +1.23.7 +------ +- Fix the bad RPM spec file (broken since out123 addition, thanks + to Srikanth Rao for noticing). +- More out123_pause() in generic control mode, working around + bug 236. The coreaudio output needs to be more robust, though. +- Do not undef MPG123_EXPORT in the headers, rather be prepared for it + being defined already. This fixes MSVC builds, broken since 1.23.0 + (bug 239). + +1.23.6 +------ +- call out123_pause() instead of out123_stop() in remote control STOP + command, fixing the regression in 1.23.x of not being able to resume + playback with another LOAD unless the new track has differing audio + format (bug 234) + +1.23.5 +------ +- libout123: +-- fix build of portaudio and SDL on win32 (too many parentheses, + thanks to Sandro Cumerlato for pointing it out) +-- make out123_errcode() return OUT123_BAD_HANDLE as documented + (adding that value to the error enum, was documented but missing), + again thanks to Sandro +- fix windows-builds.sh (shell quoting in copying stage) and add some + bits to shipped header to make it directly usable in MSVC (define ssize_t, + bug 232) +- no overwriting of LIBS in Makefile (build system regression in 1.23, + thanks to Peter Korsgaard for reporting that one) +- no printing of message in response to SIGPIPE, as that could trigger + a hang if stderr itself is the piped culprit (regression from 1.22, bug 233) + +1.23.4 +------ +- mpg123: Fix logic of prebuffering small bits for glitch-free start of + playback. The logic as introduced in 1.23.0 actually introduced stuttering! + The fix for this is really minimal and I urge everyone to at least include + that one. It is the changeset of rev. 4041. +- libout123: +-- Actually make OUT123_KEEP_PLAYING on by default, as documented. +-- Fix buffer logic with regard to draining, use common device writing + code to handle resuming from pause. This fixes sdl output with buffer, + possibly other sfifo-based outputs like CoreAudio (those were poorly + tested with buffer, as the combination is indeed unusual, see bug 230). +-- Buffer pauses devices for prebuffering, to avoid underruns. +-- More reliable playback with SDL, Portaudio and CoreAudio outputs. + This includes FIFO draining on close to avoid dropping of the end. + It should fix parts of bug 230. +-- Fixed memory leaks with some outputs where a call to the deinit() + function is necessary during available/working module checking. +- mpg123, out123: Use the default output flags to get OUT123_KEEP_PLAYING. + Without this, there is a good chance to abort on SIGSTOP/CONT while playing. + This is a regression from 1.22 . +- Build fixes (bugs 227 and 228) and some build system hackery. + Gone are libc feature test macros in compat.h . This means always + using our own strdup() implementation. Simpler than being bugged by + feature test macros in strict compiler mode (when _DEFAULT_SOURCE is not + defined). +- ./configure --enable-nagging does something also without --enable-debug, + explictly triggers -std=c89, too (hence the above). +- Some fixup to make things work in pedantic C89 mode again. + It really might be time to swich on some serious C99 for the next release, + since there's a followup standard to _that_ which we can ignore now. +- Update list of renamed internal symbols to reduce conflicts during static + linking of libmpg123 or libout123. +- Internal compatibility functions now handled via libtool convenience + archives, avoiding the hackish code copies. + +1.23.3: +------- +- mpg123: Man page fixes by ESR. +- Actually check for sys/select.h (again?) in configure so that it is used. + Fixes build on a Cygwin install, at least. +- libmpg123: Always default to enabled IEEE 754 hack for rounding on all + platforms, use ./configure --disable-ieeefloat if you do not want it. + As a protection for the exotic machine that does not use IEEE floating + point storage format, mpg123_init() will error out early if the rounding + does not work out. + +1.23.2: +------- +- mpg123: Fix compact ID3 tag printing to take UTF-8 character count + into account again (thoughtless regression in 1.23.0). + +1.23.1: +------- +- libout123: +-- Fix logic to prevent cases of output devices being closed more than once + (stop after pausing triggered multiple close calls, which broke sndio, for + example). +-- Fix JACK output handling of port wishlist, was simply broken for more than + two ports (-o jack -a port1,port2,port3). Now, it is ensured that each + output ports gets some connection to an out123 channel, possibly splitting + one to multiple ports or mixing multiple channels into one port (cyclic + connection scheme). Note that this does only apply for an explicitly given + list of ports. You can still use --stereo to ensure that two output ports + (if found) are used also for mono tracks. +-- Also use jack_free() in JACK output for ports list. +-- And finally, ensure that pthread library is linked to JACK module (would need + hacking to work on non-POSIX, replacing sem_t with equivalent). + +- mpg123: +-- Hide networking-related command-line parameters when disabled. + +1.23.0: +------- +- libmpg123 version 42 +-- This adds mpg123_framelength() and makes mpg123_position() truly obsolete. +-- Equalizer optional now (./configure --disable-equalizer) to save precious + memory +-- Clip decode tables for large amplification with fixed-point decoders. + Without that, high-pitched distortion enters really quickly when + trying to increase volume even if output samples would not be clipped, + weren't it for fixed-point math. +- libout123 version 1: First incarnation of libout123, a basic library to + get audio data written to audio devices (or files) in simple blocking + manner as opposed to callback APIs (which it wraps over). This collects + the output modules of mpg123 and makes them available to the wider + masses. Also, the separate shared memory buffer process (contained + in libout123) got a lot of reworking which should be noticable in the + interaction with terminal control. +-- Some tuning of several output drivers (modules) regarding flexible + buffer size, client names, supported formats. +-- Notably the JACK output got a major overhaul and now does not swallow + audio at the end anymore. Huge latency also reduced and tunable. Encoding + fixed to floating point, so that libmpg123 actually chooses what is + sensible. +- Added mpg123 --no-infoframe. +- Detect terminal on input side and enable control keys automatically. + There is --no-control now to disable terminal control anyway. +- Display stuff: +-- Avoid spillover of status line that caused unwanted terminal scrolling. + If the terminal width is smaller than the full status string, a cut is + made to make it fit. +-- Draw a progress bar on the terminal by inversing colors behind status + line. +-- Rework the format of the status line to be more compact and consistent. +-- Rework smart tag printout for adapting to terminal width. +-- Warning messages also start with a line break now to better fit in with + verbose playback. +-- Doubly-verbose mode now needed for long MPEG header print out. + It is a higher level of verbosity than printing the current position. + The compact header is a better fit. +-- Compact header printout also compacted, example: + MPEG 1.0 L III cbr128 44100 j-s +-- Reporting of clipped samples also includes a line break now. +-- Keep ID3v2 data around for terminal control to be able to print on + demand. That was broken for some time. +- Default for --preload now is 0.2 instead of 1 (fill whole buffer before + playback). The maximum is 0.5 . This is mandated by corrected buffer + interaction in libout123. +- Improved interaction with buffer process in terminal control mode. + Seeking is more transparent now, taking dropped samples from buffer into + account to avoid unintended jumps. Direct seeks with number row do not + pause playback anymore. +- Silently skip APE tags (thanks to Hans de Goede). +- Some reduction in bitrot on AIX (typos in output module, build with + --disable-largefile --with-audio=aix, real test welcome). +- Added '[' and ']' keys to skip to previous/next directory in playlist. +- Added support for Haiku to configure script (thanks to Jerome Duval). +- Remove spurious Frankenstein warning when scanning files that have no + gapless info (the reported value of -1152 gapless sample length should be + a giveaway anyway). +- Fix a bug in the command line parser that was present from the beginning, + apparently, causing certain parameters (--au, --cdr) to kill off parsing + of following ones. Nobody complained in all these years. Astounding. +- Forget content type from HTTP redirects (relate to error pages, not the + stream redirected to), fixes web radio streams that do not send any + content type for the actual stream. +- Accept application/pls+xml for PLS playlists. It happens. Don't ask + mpg123 to actually parse any XML! +- Ignore whitespace after HTTP MIME types (esp. before a ";"). +- Added --name to mpg123 and out123 for providing client name p.ex. for JACK. + There is no default of appending the PID to "mpg123" as client name anymore, + just plain "mpg123" or "out123". +- Added --devbuffer to mpg123 and out123 for influencing device buffer and + possible latency a bit (perhaps more so in future when drivers are adapted + to pay more attention to that). +- Added out123 --channels , --list-encodings, --test-format, + --test-encodings, --query-format. +- Calling ./configure --enable-nagging does not include --enable-debug anymore, + you specify that separately. +- Fix for newer glibc that wants higher POSIX feature test for getaddrinfo() + stuff. + +1.22.4: +------- +- Fix stupid regression introduced with a bugfix in 1.14.1 to make + free format streams work again. It took 3 years for someone to notice. + I added a regression test for that now! + +1.22.3: +------- +- Fix UTF-16 surrogate detection because that used to falsely detect + characters above 0xDFFF as surrogates (bug 216). + +1.22.2: +------- +- Fix buffering for funny sample formats (namely, 24 bit), that do not + fit nicely into 32768 bytes. Effect was a nasty endless loop where + mpg123 needs to be externally killed. + +1.22.1: +------- +- Fix mpg123-id3dump when writing images with funny (manipulated) MIME type. + Stupid mistake in length computation of the fallback file extension caused + junk from memory being appended to the filename if the pointer size + is less than 64 bit. For 64 bit pointers (or longer) it was correct by + accident. +- Fix pedantic build by cleaning up out123 source, also now really showing + the encoding list in --longhelp instead of possibly, again, writing junk + from memory in there. +- Not linking libmpg123 against libltdl anymore (bug 215). +- Update MSVC++ ports a bit to make them work again. + +1.22.0: +------- +- libmpg123 version 41 +- Build fix: Avoid name clash on OSX SDK with "normal" being defined in + an enum already. +- More resilience against folks who do not check errors and rather pass + NULL pointers around (see NEWS.libmpg123). + This changes some return values to MPG123_BAD_HANDLE instead of MPG123_ERR + (always check for != MPG123_OK). +- Fix WAV writing to stdout on Windows (bug 214). +- Rework Xing/Info/Lame tag parsing, also detecting short ones without + the TOC now. + In addition, the warning about file size being off is a _lot_ more + accurate now. + +1.21.0: +------- +- Use LL as shortcut for LOADLIST remote command, L is taken already (bug 210). +- Less namespace pollution (MPG123_EXPORT in header instead of EXPORT, bug 212). + +1.20.1: +------- +- Make feed reader more efficient when skipping junk by early discarding + of data from buffers to avoid re-parsing. + +1.20.0: +------- +- Added NEON optimized decoder for AArch64 (ARM 64bit environment) +-- enabled for --with-cpu=neon64 (NEON only) or --with-cpu=aarch64 (runtime + switch between neon and generic_fpu, like arm_fpu) configuration +-- compatible with aarch64-linux-gnu toolchains (from Ubuntu, debian) + and Xcode 5 +- Added new binary out123 only with the audio output part of mpg123. + This is a precursor to separating out said code into a simple audio + output library. It also allows plugging in some processing in a pipe + before feeding to output. +- Prevent opendir(NULL) for unknown module directory when listing modules. +- some build fixes, among those fixing mpg123-id3dump on Windows + +1.19.0: +------- +- libmpg123 version 40 +- Support float and 32/24 bit integer output also with fixed-point decoders + (conversion from 16 bit precision). +- A-Law output encoding is actually implemented now (Michael introduced + the encoding back in the old days without ever implementing theconversion + table, apparently). +- Added --with-cpu=arm_fpu as decoder choice for runtime switch between + plain fpu code and NEON. +- Fix ARM builds to work properly on debian systems without special CFLAGS + (NEON decoder, specifically). +- Make scripts/benchmark-cpu.pl check the return value instead of delivering + crazy timings for crashed mpg123. +- Trigger track initialization in mpg123_info() to avoid use of uninitialized + variables (watch out for MPG123_NEED_MORE return value!). +- Fix integer code to 32 bit numbers where it would waste 64 bit on + modern systems. +- Add non-executable stack marking also to ARM assembly. + +1.18.1: +------- +- Do not close buffer twice with mpg123 -R (delete outdated code in + control_generic(), fixing bug 207. +- Do not mess around with first command line argument to extract program + name, use a copy instead, fixing bug 205. +- Prevent premature exit on timing of failure to open a track in the + playlist and the user wanting to skip over it (bug 206). +- Fixup of HTTP socket mess, also avoiding unnecessary FILE objects (bug + 204, patch by Rajeev V. Pillai). +- Fix playlist behaviour on slow HTTP streams, jumping back ('d' key) + from first track stays at first track (thanks to Rajeev again, sub-bug of + bug 206). +- Fix Frankenstein check not to stumble over ID3v1 tags. My apologies. As + a bonus, the position of the concerned code in the parser is now far + more logical. + +1.18.0: +------- +- libmpg123 version 39 +- Big version increase for clear distinction regarding the 1.14.x regression + fixes in libmpg123. +- Regression fix: Ensure decoder reinitialization on combination of seek + and resync (buffer overflow bug 201, introduced in 1.14.1). +- Regression fix: Make parsing really end on reaching of junk limit + (introduced in 1.14.4). +- Add check for bad bit allocation value in layer I decoder (removes + audible glitch in bug 201 test file). +- Avoid wrong error message about Frankenstein streams when gapless + decoding disabled. +- Be verbose about big header changes (Frankenstein streams). Note that + changes in samples per frame will confuse the seeking code, but decoding + can get through. +- Actually use the full routine to close tracks. Avoids socket leak when + playing multiple HTTP streams from a playlist (bug 203). +- Send correct host header when connecting through HTTP proxy (bug 202, + figured out by Rajeev V. Pillai). +- The console application now informs about changed major stream properties + (prints out another header line). + +1.17.0: +------- +- mpg123-id3dump --no-scan; for speedup +- hide -C parameter from mpg123 --help when it is not supported +- added tinyalsa Output (by Jarno Lehtinen) +- build system tweaking +- some care for fixing Cygwin builds + +1.16.0: +------- +- Taihei strikes again: +-- New Huffman decoding scheme (configurable, on by default) brings nice + boost to mpg123 to make it the fastest decoder on modern CPUs again. +-- new AVX decoder +-- assembly-optimized DCT36 for SSE and AVX +- added configs for vintage 3DNow(ext) CPUs (AMD K6) utilizing assembly DCT36 +- added configs for vintage SSE CPUs (Pentium M), utilizing C DCT36 +- added FORMAT command to generic control +- added support for ID3v2 APIC frames +- added mpg123-id3dump as official companion to extract meta data + (including writing of album art from APIC to files) +- added mpg123-strip as official companion to strip dirt out of MPEG streams + (including meta data) +- not deleting ID3 data right after printing in generic control +- module loader a bit more flexible with relative MPG123_MODDIR +- Fix chopped-off playback with pulseaudio output: draining the output + now on closing. +- SDL output fixup, a) not chopping off end and b) non-fatal underrun +- Fix obvious errors in win32 output ... does it now play the end of + tracks? Need someone to test this. +- added support for screen and iris-ansi terminals with --title (as prompted + by patch from sf.net user canavan) +- fixes/enhancements for sgi audio output +- libmpg123: proper largefile aliases for proper systems (FreeBSD with + one one-and-only off_t + This enables client software that insists on defining pointless + _FILE_OFFSET_BITS. +- wrapper script src/mpg123-with-modules to ease the pain of running mpg123 + with modules without installation (setting MPG123_MODDIR) +- removed ALSA 0.5 code (unused for longtime, last GPL-only bit) + +1.15.4: +------- +- Writing CDDA data via --cdr works again; had also been broken by attempts + to catch failing writes because of full disk. +- Also, the return values of WAV/CDR writing routines now properly indicate + error to avoid stupid endless loop of "smart" audio writing code that wants + to handle interruptions. Really, --cdr could just go and nobody would miss + it ... +- Fix stupid bug in mpg123_chomp_string() (introduced in 1.15.1), empty + lines were badly treated. Only usage in mpg123 is for parsing HTTP redirect + headers; malicious HTTP servers might exploit that (possibility to zero + bytes in memory). +- some cleanup for nagging mode +- more resync strictness to really catch (all) cases with changing decoder + structure; in practice badly needed when disabling seekbuffer (so it's + your fault, somehow ...) for non-seekable streams, otherwise not really + an issue because of readahead checking + I repeat: This fixes possibly fatal behaviour in the parser when readahead + checking is explicitly disabled (p.ex. via mpg123 --no-seekbuffer on + http streams). By default, readahead checking is _always_ active! +- build system fixed for automake 1.13 (thanks to Nix) + +1.15.3 +--- +- Fix WAV writing. AGAIN. People love to decode WAV to stdout in various + ways that started to get broken with me starting to care for people who + like to write to full disks. I frikkin' HATE this rat race! I'm even + starting to SHOUT. Now, the code prefers to write no header at all (when + there is no actual output) instead of possibly writing too many misleading + ones. Getting the blame for breaking dir2ogg repeatedly while trying to + cope with one fatal situation that you cannot really cope with sucks. Big + time. I hope that's it now! + +1.15.2: +------- +- build fix with older shells (== in configure) + +1.15.1: +------- +- libmpg123 API version 37 +- Fix corner case in HTTP communication with missing path in Location header + (bug 187). +- Prevent nasty alignment issues by not guessing about assembler alignment + when .balign is available (bug 188). + +1.15.0: +------- +- Added --continue (also see scripts/conplay). +- Added number row to terminal control keys for 10% jump points (for + navigating long tracks). +- Set xterm title always if asked, disregarding the -q switch (if you want + fully quiet, don't specify --title). +- Enable terminal mode in OS/2 by explicitly checking for and using + os2term library. +- Getting WAV/AU/CDR writing back to a sane state while still catching + out-of-disk when writing headers (none in case of CDR) but removing + that initial test that prevented writing on any non-seekable file (like, + /dev/stdout to a pipe). +- Added native audio output for QNX (thanks to Mike Gorchak), also improving + portability of configure script while at that. +- more robust recovery from ALSA issues (device suspend) +- Fix crash in module loader on *BSD. +- Extend time display to switch to hours above 60 minutes (hh:mm:ss, + ditching the sub-second precision) +- really include dithering in default x86-64 build. +- Fix mpg123_scan() not properly seeking back for all types of files (bug + 3582628 ... it got a different number on sf.net now ... brilliant, folks!). +- Prevent false positives for "Frankenstein!" when using mpg123_scan(). +- Fix printing of negative positions with buffer (bug 186). +- Accept application/x-scpls as additional MIME type. +- Try to handle certain Windows toolchains that miss EOVERFLOW. + +1.14.4: +------- +Who reworks a parsing and data mangling without really making sure that +things still work like before? I hope I won't do so in future. Not again. + +- Fix resync logic to properly work again (used to prematurely end stream + on bad headers). A regression again, this sucks, but at least we got a + regression test for that now. +- Fix aeon-old regression (since 1.11.0) about short seeks: Bit reservoir + was reset also for short seeks that did not break continuity. +- Another damned regression got fixed: Sample-accurate seek for files + without full gapless info. + +1.14.3: +------- +- Fix regression from 1.14.1 in parsing of bad free format streams, + avoiding apparently endless loops (just very slow reading, in fact). + +1.14.2: +------- +- Fix writing of WAV to stdout. + It is still not the best of ideas to do so, though. At least make sure + to fix rate and channels. + +1.14.1: +------- +- Fix subtle bug that could trigger failure to detect a format change on + resync when using libmpg123's feeder API. + That bug has been there since ages but was neutralized by other (buggy) + behaviour of the parser before the little overhaul. The Law of an Even + Number of Bugs. + +1.14.0: +------- +- libmpg123 API version 36 (see NEWS.libmpg123) +- Add --ignore-streamlength. +- But also deal with concatenated (Frankenstein) streams: Not applying + gapless cutting once we're over the announced number of frames. +- Also, gapless cutting is only applied if relevant information is + present. Previously, at least the decoder delay has been cut. +- Add --lyrics for printout of lyrics (from USLT in ID3v2). +- Added handling of SIGUSR1 and SIGUSER2 to terminal control code, + configurable via --ctrlusr1 and --ctrlusr2. +- Some low-level API added (mpg123_framedata(), mpg123_framepos(), buffering + and resampling control). +- Added info about input buffer fill to mpg123_getstate(). +- ReplayGain: Try to detect LAME below 3.95 for the different reference + level of 83 dB (adding preamp of 6 dB). Version 3.95 itself (not 3.95.1) + I cannot detect. User-set gain values are not touched. +- Keep silent about missing bit reservoir when ignoring frames. That is + the whole point (mostly;-). +- Add the new/old WRITE_SAMPLE variant from MPlayer that makes the generic + decoder faster on older CPUs (x86 at least). Not on x86-64, though (it's + not enabled per default there). +- disable 3DNow and 3DNowExt DCT36, which is slow on modern CPUs +- Handle out-of-disk in the file writers (a bit, see + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=67259) +- Added Xcode project files to build libmpg123 on Mac OS and iOS +- 32 bit output for sndio output (patch by Brad Smith). +- Remote control interface knows LOADLIST command now. +- Now freeing meta data memory after printout. +- Some documentation cleanup, including manpage fixes by quadrispro. +- Re-enabled wildcard expansion on Windows (been broken by unicode file + name support). +- Fix MMX tabinit syntax (thanks to Marcel Müller for pointing that out). +- Fix SGI audio output (been broken since change to modules). +- Fix some fringe behaviour (mpg123_getformat() triggering needless reading + of next frame, possibly hitting bogus MPG123_NEED_MORE). +- Resync limit now also serves to increase amount of skipped junk on + beginning. +- Better separation of stream end and read error (in case there is no + stream opened, even). +- Don't always complain about failed free format header search (only with + verbosity level 3). + +1.13.8: +------- +- Fix build for ARM Thumb (incompatible assembly in some macros). + +1.13.7: +------- +- Fix endless loop in module loader when starting mpg123 in a directory + that does not exist. + +1.13.6: +------- +- Fix output of one random character in -vvv mode for ID3v2.2 frames + (no buffer overflow, move along, folks;-). + +1.13.5: +------- +- Fix reading of ReplayGain values from Lame tag (nobody seen this before?!) + (both actual values and the distinction between audiophile / radio). +- Accept application/octet-stream as input from HTTP. +- Update man page with encodings. +- Build fixes. + +1.13.4: +------- +- Fix bogus error on resync with big offsets (hits systems that have bigger + off_t than int), bug 3393801. +- Fix windows binary package build script again with plugdir. + +1.13.3: +------- +- Fix an endless loop on bad headers, bug 3267863. +- Prevent compiler warnings about unused variables with gcc 4.6 . +- Fix return value handling of getaddrinfo(), bug 3288333. +- Make decwin size computation work for OPT_ARM and sizeof(long) != 4 + (bug 3288360). + +1.13.2: +------- +- Updated .NET wrapper (MPG123_SKIP_ID3V2, encsize and mpg123_strlen + functions) by Malcolm Boczek. +- Fix crash when calling mpg123_decoder() before opening a track -- a rare + use case since one can choose a decoder with mpg123_new() already. +- Fix format change detection for certain (artificial) concatenated streams + (p.ex. MPEG 1 frames following MPEG 2 frames). +- Prevent the nasty of bug 3154889: No change of pitch without a current + audio format. No proper solution, but more like earlier behaviour. +- Fix some compiler warnings. +- Fix a memory leak in the module loader, also some in the examples, + for being pedantic. +- More use of AC_LANG_SOURCE to silence autoconf. + +1.13.1: +------- +- Fix --float and --8bit (MPG123_FORCE_FLOAT, MPG123_FORCE_8BIT) regression, + caused by introduction of 24 bit formats. (bug 3151597). + Btw: The use of specific format choice via `mpg123 -e f32` and friends + is encouraged (meaning mpg123_format_none() / mpg123_format() calls in + libmpg123 API). +- Loosen the parser restrictions: Allow the private header bit to vary. It + is not mpg123's business anyway (finally suggested by Marcel). + +1.13.0: +------- +- libmpg123 API version 29 (see NEWS.libmpg123) +- New optimization: ARM NEON (Cortex A series) -- kudos to Taihei, again! +- Added 24 bit integer output (truncation of 32 bit integer). +- Cleanup of symbols for the static library: Only have global symbols that + are actually needed, prefix them with INT123_ to avoid conflicts. +- Added --streamdump to get a copy of the data libmpg123 used. +- Added --icy-interval and tweaked libmpg123 to make playback of ICY stream + dumps possible. +- Added possibility to set module file suffix at build -- to be able to + avoid .la files for plugins. +- Removed compiler directives for alignment and disable associated tests. + The tests don't work on a wide range of compilers anyway, and newer gccs + do have force_align_arg_pointer to fix bad stacks. +- There is no ChangeLog file anymore... it was autogenerated from subversion + log anyway, so look there if interested. + +1.12.5: +------- +- Fix bug with the new meta data printout of the mpg123 app; embedded + null bytes in UTF-8 strings in non-UTF-8 environment would trigger buffer + overflow. + Thanks to Jakub Bogusz of PLD Linux for the tip. And yes, shame on Thomas + for changing working string handling code. At all. + +1.12.4: +------- +- Fix formatting of meta data printout in UTF-8 (string length computing). + As a collorary, ID3v1 data is reduced to ASCII in UTF-8 environment, + as we do never know what specific encoding that has. + +1.12.3: +------- +- Fix a long-standing bug that subtly broke http streaming with ICY meta + data when reading a bit more quickly, like when using the buffer. + I was a very simple and embarrassing bug, actually ... and it made + me wonder how normal streaming still worked rather well, generally:-/ + Thanks to Lint for staying with us and reporting bug 3022850, to finally + get a grip on streaming reliability. + +1.12.2: +------- +- Fix for nasty memory corruption on configurations that hand out addresses + in the upper half of the memory space (the poiner alignment function broke + in that case, bug 2996045). +- Various build and portability fixes (including making some exotic + configure switches work (again)). +- Add dump_seekindex example +- Sync mpg123_clr to 1.12 feature set, patch provided by Malcolm Boczek + And actually include it in release tarball! +- Rework mpg123.h logic for large file stuff a bit, clients can control + it by defining MPG123_NO_LARGENAME or MPG123_LARGESUFFIX. +- Include dumb wrappers to provide names suffixed with _64 on 64 bit + machines and _32 on 32 bit machines, respectively, to help clients that + insist on defining _FILE_OFFSET_BITS where it is not needed (or with a + non-large value). +- Tuning of the internal buffer code for feeder mode to minimize its + performance impact (works in 4K blocks now). +- Workaround for compiler bugs in Open64/PathScale/SunStudio (bug 3004396, + suggestion by Doug Gilmore). + Note that Sun Studio is still a tricky fellow, at least when it comes + to our preprocessed assembly. + Also, x86-Open64 recently produced another segfault in layer3.c on my + box... GNU and intel compilers are what one can use as something stable. +- Make mpg123_getformat() return more error codes (like MPG123_NEED_MORE). +- Fix handle I/O for clients with small file offset (32 bit when libmpg123 + has 64 bit). +- Fix 3DNow(Ext) standalone builds. + +1.12.1: +------- +- Update INSTALL for the dual-mode library. No code changes. + +1.12.0: +------- +Attention: This reverts the big bad libray name change. People did not +like libmpg123_64.so at all ... so Thomas went along with proving that +being responsible for a open source library package sucks for your life -- +he coded large file dual-mode into libmpg123. One library with both APIs, +like glibc. + +- libmpg123 25.0.25: +-- The separate libraries are gone again, this one is dual-mode (using + ca. 750 lines of not very funny code). +-- The library even translates callbacks between large file support modes. +-- Introduce handle-based custom I/O in libmpg123. +-- The header now defines MPG123_API_VERSION to help compile-time detection + of available functions (lib is version 25.0.25 now... MPG123_API_VERSION + is 25). +- Make the usage of AI_ADDRCONFIG dependend on a configure check. This + flag is not available everywhere. + + +1.11.0: +------- +Attention: There was a re-release of the source archive, because the +initial one missed the actual changes for the library name. +Sorry for the inconvenience:-/ + +- Big bad libray name change for builds with enabled large file support. + That will break libmpg123 binary compatibility on Linux/x86 when upgrading + from mpg123>=1.5.0 with enabled large file support. You need to relink + with the new library called libmpg123_64. + If you do not enable large file support, or it is implicit on your + platform (x86-64), the library keeps the old name of libmpg123 and + everything is fine. +- Assembler cleanup: +-- no use of compiler-based stack alignment (for SSE), helping portability +-- mostly performance neutral, hint at faster decoding for the dynamic + build and slower for static, but small change in any case +- Windows networking (access http streams in mingw builds). +- Do not ask for addresses that do not have matching interfaces configured + (IPv6 on a IPv4-only host, for example). That can help with broken DNS + servers that choke on IPv6 addresses (T-Online Speedport W502V, for example). +- Fix a potential ICY reading problem were ICY metadata could be read as + mp3 data (basically for MPEG frames bigger than the ICY interval). + +1.10.1: +------- +- Help multilib setups that boldly assume that headers are invariant + by removing the consistency check in mpg123.h and instead just adding a + suffix to relevant functions when _FILE_OFFSET_BITS is defined. Invalid + setups will now fail at the linking stage instead of the preprocessing stage. + That should cover bug 2934488. +- Fixes for gapless decoding: +-- Correctly skip padding larger than one MPEG frame (strange, but occurs). +-- Bug 2950218 (proper gapless cuts for seeking near the end). +- Make sure the search for the first header aborts after 64K of one-byte + reads, as always intended (bug 2951334). + Certain files (or even random data) were able to fool mpg123 sufficiently + enough that it basically reads through the whole file in 1-byte steps + in search for MPEG data. + The limit of 64K will very likely be configurable in a future mpg123 + version. +- Fix subtle bug with seeking in feeder mode: A seek close to the current + position (meaning: the needed data offset is already in mpg123's buffer + chain) resulted in skipped bytes. +- Improve the feeder mode for handling large amounts of junk at the + beginning, including proper passing of the request for more data when trying + to determine free format frame size. This also fixes endless looping as + reported in bug 2951334. +- The parser code still needs overhaul. It is not pretty. +- Compile fix for OpenAL. + +1.10.0: +------- +- Confirmed/fixed on OS/2 platform. + At least a static build works with native audio output and generic decoder. +- Make modules work with libtool-2.2.6b . +- Added pitch command to control interface. +- HTTP header field and MIME type parsing now case-insensitive (fixes + bug 2904736). + Also, the MIME-parsing for non-playlist URLs is done the same way as + from playlists now. + And, we interpret MIME types only to before a ";" (see bug 2836904). +- There is a build-time option to enable unicode file names on windows + now. UNIX (Linux) does not need that, UTF-8 works natively. + An unicode-enabled build of libmpg123 expects file names as UTF-8 strings, + opening of non-utf8 strings (by old applications) still works via fallback + when the conversion of the string or opening of the file failed. +- Also, on Windows, --realtime now works, along with added granularity of + the new --priority parameter. Note that you get the latter functionality + through nice/renice on UNIX, no need to add that to mpg123. +- Added experimental framebyframe API. +- Added a new Microsoft common language runtime wrapper (aka .NET wrapper) + written by Malcolm Boczek. See ports\MSVC++\2008clr\mpg123clr\ReadMe.txt + for further information +- Added Visual Studio 2010 Beta 2 project files for libmpg123 +- Updated autotools machinery, autogen.sh is gone, use `autoreconf -iv`. + +1.9.2: +------ +- Fix logic failure in gapless code: The trailing silence was only cut on + the first decode. So, seek-back and decode again never was gapless:-( +- Fix linker flags on MacOS 10.6 . +- Improve portability (mainly for Solaris/x86, possibly others). +- Fix reading from standard input in Windows (use binary mode). + +1.9.1: +------ +- Fix OpenAL output issue (bug 2840085) +- Fix theoretically possible discarding of some audio samples when getting + a new format. +- Fix unwanted verboseness (some error messages from library even when + MPG123_QUIET was specified). +- Fix back-to-beginning for feed_skip (fixes bug 2859531). +- Fix the CPU creep bug with NtoM decoding. + That one has been nasty on you with large files since bad frame fillup + has been introduced. +- Fix regression (since 1.9.0) in ID3 parsing: Now Foobar2000 RVA fields + are interpreted again (among others). +- Fix some compiler warnings, minor cleanup. + +1.9.0: +------ +- Free format support. +- ARM assembly optimizations (yay Taihei again!). +- Dither noise now runtime-generated, thus less bloated binary (thanks + Taihei...). + This means that dithered decoding is now included per default. + Please note that work is ongoing to improve the dithering quality, + more to come. + For example: Accurate rounding to 16bits is now always used for generic + dithered decoder, there are plans to adapt the noise for different + sampling frequencies. +- Buffer plays any audio type now. +- New output module: OpenAL +- Bug fixes: +-- Broken frame fillup for non-signed 8 bit formats with correct zero + (bug 2805665) +-- Crash on invalid UTF-16 in ID3 tags fixed (thanks to Andy Hefner) +-- Bad detection of separated UTF-16 strings in ID3 tags (bug 2834636). +- Topic ID3 and UTF: Now we are more tolerant with UTF16, even accepting + those broken tags that id3v2 produces (multiple conflicing BOMs). +- Build system allows AltiVec on non-Macs now (don't enforce unsupported + gcc flags). +- Terminal control mode is more verbose (gives hint about pressing 'h'). +- The library now offers a switch and small API to defer translation of + ID3 text data until client app wants to do it (or not). + +1.8.1: +------ +- Include improvements to integer decoder from SVN trunk. + They have been accidentally promised on 1.8.0 release announcements, + though they were not there. Here it is: ISO compliant fixed point decoding + (speed optimizations are still reserved for next release). +- Fixed build with ./configure --enable-modules (bug in configure script). +- Fix name of binary in help screen when called with path. +- Build fix for old gcc with AltiVec code. +- Update of Sony PSP build files. + +1.8.0: (The Taihei Monmament) +------ +- New and improved SSE optimizations! For x86-64, too! Also AltiVec! Fast + float output! Faster stereo! + Finally, this should put mpg123 into the efficiency-leading position on + current hardware! Thanks go out to Taihei Monma for pushing lots of new + assembler code. +- Added proper rounding modes to 16bit integer. +-- Use ./configure --enable-int-quality to prefer accuracy over speed. +-- Accurate code (generic, SSE, 3dnow -- i586 has always been good) + delivers ISO compliant quality with 16bit output. +-- Uses fast rounding for IEEE754 floats. +-- Mpg123 can do fully ISO compliant MPEG audio decoding to 16bits (of + course to 32bit float/int, too). +- subtle performance enhancements via broader data alignment +- Prefer SSE code over 3DNowExt. +-- It can be tight, but generally our new SSE code is better on CPUs that + can do both. +- Remove HF cutoff (SFB21), has been introduced in 0.59r . +- Fix layer 1 regression (been there since version 1.x). +-- Layer 1 ISO compliance test is positive now. +- Fix layer 2 regression (false positives header change). +-- Layer 2 ISO compliance test is positive now. +- more sample-accurateness +-- Clear frame buffers before seek. +-- Decode 4 frames in advance for layer 3 (2 for layer 1 and 2) per default. +-- Number of layer 3 frames to decoded in advance (and fill bit reservoir) is + runtime tunable (--preframes). +- Do not stop decoding after stray ID3v1 tags in streams (bug 2793677). +- Fix handling of negative RVA2 values in ID3v2 (bug 2792417). +- Discard bitreservoir of previous frames if a resync is needed. +- improve perceived randomness of --random (do not repeat too early) +- Fix special crash case in UTF16 conversion for ID3v2. +- MPG123_MODDIR environment variable for changing module directory at runtime +- arts output fixes (bug 2715128) +- win32 output swallowing less buffers at end (but still some audio is lost, + bug 2722991) +- tested mpg123 on OS/2; it works, but not the native audio output + (SDL works) +- WAV output announces supported output formats correctly +- fix buffer startup to make sure the first bits of audio are not discarded + (bug 2796802) +- re-enable the --gain parameter (the move to modules disabled that), + untested +- Libltdl is _not_ included anymore. +-- The host system is expected to provide it, otherwise plugins are not used. +-- Our copy does not get in the way anymore. +- enhancements of the MSVC++ builds, including optimizations using yasm +- general build system fixes +- Legacy build system is gone. +- code cleanup +-- signed/unsigned integer usage, make compilers more happy) +-- simplified synth selection code (it is _less_ code now, and does more) +- Fixed behaviour of MPG123_NEW_FORMAT: Now it does not stop you from + just continuing decoding without querying the (new) output format, this + behaviour regression had been there since somewhen after 1.4.3 . + +1.7.3: +------ +- Fix a regression introduced with the --doublespeed fix. Now seeking should + be a lot smoother again. + +1.7.2: +------ +- Fix a possible vulnerability in the ID3 code (negative encoding values). + +1.7.1: +------ +- Just one fix for making the RVA switch in terminal and generic control mode + work again (instead of plain silence). + +1.7.0: +------ +- Lots of output format fun! +-- now supporting 8, 16, 32 bit signed/unsigned integers, + 32bit float (64bit float can be hacked in quickly) +-- optimized decoders use fallback routines for non-optimized + formats transparently +-- flexible resampling is automatically chosen when output does + not support standard rates (like a JACK server) +-- That meant quite some restructuring in the decoder code... +- Lots of core functionality now optional, enabling small-footprint + builds of libmpg123. +-- choosing among the MPEG layer codes +-- NtoM resampling +-- downsampling +-- feeder API (mpg123_open_feed()) +-- ID3v2 +-- String API +-- ICY +-- output formats +-- error/warning message printouts +-- ... a layer3-only shared libmpg123 can be just 107K on x86-64 + or 94K on x86 +- --preload (tune prefill before playback for buffered mode) +- win64 support (one report at least;-), modules working on Windows +- Windows/MSVC++: fixed handling of unicode file names, + mpg123_topen() now actually working there +-- You are obliged to use mpg123_tclose() now! +- using "plugins" subdir relative to mpg123 binary + (in addition to ../lib/mpg123) +- switch to libtool 2.2 and automake 1.10 for the build scripts +-- though no update to new libtool 2 API, yet +- some portability fixes +- prevent user from creating non-working I/O setups + (replacing timeout reader, ICY with feeding) +- JACK output accepts port names for -a, stereo gets mixed down + when only one port is chosen +- added sndio output, contributed by Christian Weisgerber +- Make --doublespeed paramter work, porting of which has been + forgotten in the 1.x series! + Along with that, a regression in decoding has been fixed + (concerning skipping of frames in general). + +1.6.4: +------ +- Fix for consistent NtoM resampled decoding and broken frames fillup. + +1.6.3: +------ +- Fix sf.net bug #2413608: Make sure a new format does not slip through + after early close. +- Include equalizer example file and a piece of wrapper code for MSVC++ + in the distribution. +- Do not claim to support unsigned 16 bit encoding (never been the case). +- Fix default fifo detection, now it actally activates fifo support! + +1.6.2: +------ +- Fix default IPv6 detection in configure.ac (a typo has been introduced + before). + +1.6.1: +------ +- Fix printing of largefile offsets in remote control interface. +- Some portability fixes (reduced compiler warnings on Solaris, p.ex.). + +1.6.0: +------ +- small things inside that I forgot to mention +- some new commands for remote control interface: +-- SCAN +-- SAMPLE +-- EQFILE +-- SHOWEQ +- added --keep-open command line flag (for remote control) +- fixed equalizer file parsing to really handle comment lines as example file + suggests +- more elaborate detection of UTF-8 locale, also --utf8 switch to force it +- added --fuzzy to enable inexact seeking (see below) +- added --index-size parameter for tuning accurate frame seek index +- enabling largefile support via configure +- libmpg123 11.0.11: +-- added mpg123_geteq(), mpg123_tell_stream() and mpg123_getstate() +-- API cleanup (take const char* for mpg123_open()) +-- calm down complainling (C++) compilers by completing the mpg123_channels + enum +-- fixed several possible crashes when user provides NULLs where it isn't + appropriate +-- workaround for frames that fail decoding (bad frame body, missing bit + reservoir): fill up with silence + That also fixes seeking issues related to bad frames since now the + fixed relation between frame and sample offsets is restored. +-- Finally realized what that the resampling code for integer math + (generic_nofpu) was just incomplete! + Now it works, using the defined integer multiplication. +-- Detect UTF-8 in ICY conversion (instead of just assuming CP-1252, + provided by Torsten Glaser). +-- Prevent ugly noise when the bit reservoir is not fully there + (p.ex. ignorantly cut mp3 files). + Concerned frames are silenced, but reservoir for following frames + is kept. + Thanks to Patrick Dehne for the investigation and patch! +-- New option for fuzzy seeking; trading sample accuracy for speed. + With that option, seeks positions are guessed using mean framesize or + the Xing VBR TOC is used. +-- Feeder streams work with seek index now. +-- Seek frame index is runtime tunable. +-- more caution with alignment issues for varying library users +- new project files to build/use libmpg123 with MSVC++ 2005 and 2008, + provided by Patrick Dehne +- fixed a regression that made the pause/loop mode in terminal control + slowly go backwards + +Big note for libmpg123 users: Make sure your application is compiled +with the same largefile setting as libmpg123! If that does not match, +you will get unresolved symbols (which is better than weird errors when +using a nonmatching off_t in arguments;-). + +1.5.1: +------ +- fix wav/au/cdr writing to stdout (bug #2044423) +- add more sensible --no-resync to replace --resync (bug #2044404) +- libmpg123 7.0.7 +-- fix thread safety of SSE decoder (bug #2053181) +-- fix robustness of length handling, added mpg123_set_filesize() (bug #2064322) + +1.5.0: +------ +- libmpg123 6.0.6 +-- Floating point decoding back again, (build time choice for now; + --with-cpu=generic_float). +-- More robust string handling; extended string API. +-- fixed an (so far) unnoticed ID3 bug that may have obscured comment fields +-- added mpg123_feed() as shortcut; using const input buffer now +-- resync is enabled again for ICY streams (the trouble in the past was + due to a reader bug, not the streams) +-- decode ICY text data to UTF-8 (thanks, Thorsten) +-- preserve file flags for timeout mode +- More elaborate (helpful?) error message for output format problems. +- Reworked HTTP code... and added IPv6 support! +- Fix the --proxy parameter (has been accidentally ignored before). +- Added --ignore-mime to work with web streams with funny playlist MIME + types like "audio/megurl". +- Know MIME audio/mpegurl. +- --timeout is now also used for the connection itself (not just reading). +- Now trying to resume ALSA device after suspend. +- subtle build changes (your CFLAGS rule now) + +1.4.3: +------ +- Fix mpg123_tell() and mpg123_seek() return values with respect to the + samples in decoding buffer (bug 1947373). +- Fix (bogus) 3DNow detection on IDT C6 (bug 1947982). +- Fix mono playback of win32 output (bug 1955157). +- Fix ABI compatibility with compilers that don't align the stack like + gcc does (fixing SSE crashes on win32). + +1.4.2: +------ +- Fix build problems (for Cygwin and Win32, perhaps others, too). + +1.4.1: +------ +- Fix a serious regression of terminal control mode (forgot to remove a + term_restore(), bug 1936548). + +1.4.0: +------ +- Enable runtime check for available and working output modules. + Now mpg123 tries all built modules (or a list specified in + mpg123 -o moda,modb,modc) in turn to find a working output. This minimizes the + situation of having to specify a device when default output doesn't work for + some reason. See bug 1910500. +- libmpg123 2.2.2 +-- Fixing an endless loop for ICY streams that suddenly end without error + (just EOF). +-- Further fixes around EOF handling in (buffered/ICY) streams. +- Enable user to interrupt mpg123 when stuck in a loop of failing to open a + track (with --loop). +- This time with correct RPM spec (hopefully... sorry, Michael!). + +1.3.1: +------ +- Enable snd_pcm_sw_params_set_xfer_align() for alsa-lib < 1.0.16 (bug 1908603). +- libmpg123 2.1.2 (no-op change) + +1.3.0: +------ +This is a _major_ fix release for http streaming! +Much more usable than earlier mpg123 1.x versions. + +- libmpg123 libtool-version 2.0.2 +-- Fix nasty bug in ICY reader that failed to account for partial reads + from slower network. +-- Now non-seekable streams can get peek-ahead for MPEG sync, too, triggered + by the MPG123_SEEKBUFFER flag. +-- Do not try to resync on streams with ICY metadata, that won't work. + Consequently, if there's unreliable network, use --loop -1 to make + mpg123 reconnect to the server on errors. +-- Applying a few layer 3 decoder fixes from old mhipp CVS (hail to the + creator;-) That includes the fix for bug 1895025. +-- Fix ID3v2 parser with very invalid claimed ID3v2 frame sizes (could + have triggered DOS before). +-- Oh, and fixed a steady memory leak in ID3 handling. Should mention that;-) +- Print ICY-NAME and ICY-URL again, as mpg123-0.6x did. +- Added --smooth option for not flusing buffer between tracks but at program + end only. +- Included some contributed ports/bindings of libmpg123 under ports/ . + +1.2.1: +------ +- libmpg123 libtool-version 1.2.1 (coincidence!) +-- Earlier check for free format headers to prevent them from screwing up + resync (free format still not supported) +-- bug 1889051: more flexible resync, not insisting on the format of the + first frame (which could have been bogus) +- Add an output write loop to handle SIGSTOP/CONT operation (bug 1890563). +- Fixed a bug where playback status for some http streams was not shown. + +1.2.0: +------ +- libmpg123 libtool-version 1.0.1 +-- See NEWS.libmpg123 for details. +-- This adds --resync-limit parameter to mpg123. +- Some build system work, including: +-- It is now possible to build a mpg123 rpm from the source tarball via + rpmbuild -tb . +-- configure: Accept --with-audio=foo,bar,bla (comma-separated list) in addition + to --with-audio="foo bar bla". +-- autogen.sh included in distribution. +-- Include the forgotten i486 files in the distribution (now that's embarrasing...). + Also a little fix for wrong --list-cpu on i486 build. +-- Fix build with MinGW32. +- Fix -v stat output (time display) for MinGW32 build. + +1.1.0: +------ +- Added arts output. +- More verbosity on lame/xing/info tags (on demand) instead of compile-time + debugging switch. +- XMMS2 plugin cleanup (submitted to XMMS2 for inclusion) +- Improved ID3v2 robustness (let bad tags not affect playback of the important + part). +- Terminal control: +-- Key for going to previous track ([d], because it's left of [f] usually... + no config file yet for that). +-- Key for printing current playlist, [l]. +-- Now possible to switch on verbosity also for mpg123 -q -C +-- Key for (re)printing ID3 tag info ([t]). +-- Key for (re)printing MPEG frame header info ([m]). +- Soften the -q option: Now you are able to increase verbosity after -q + again, like mpg123 -q -v (this fixes cplay's progress display). + +1.0.1: +------ +- Fix module loader to prevent crash in working paths with more than 49 + characters length (bug 1859413). + +1.0.0: +------ +- Fixed Pulseaudio. +- Cleaned up configure. +- Pushed remote control version to v3. +- Updated documentation. +- Fix VPATH build for generated mpg123.h . + +1.0rc3: +------- +- Fixed JACK output. +- Disable buffer when statically building CoreAudio in (MacOSX); with + CoreAudio module the buffer works, with static output it doesn't. + This is the situation because of fork() discrimination by Apple Inc. . +- Added verbosity to tell about ID3v2 text encodings (level 4). +- minor cleanup + +1.0rc2: +------- +- Fixed some bugs, the ID3v2 interface of libmpg123 is safer now (there + were possibly stale pointers in there). +- Buffer mode got vital improvements (yeah, that is sort of feature creep + during release process, but worth it) + The improved communication makes it possible to skip tracks in terminal + control mode without the hack to immediately restart playback. + To be able to do seeking in terminal mode with buffer properly, buffered + playback stops on seek keys. You restart playback after you are done + with seeking. +- Support either portaudio v18 or v19 API (v18 works for me, v19 works + according to user report). +- Audio output handling got safer and more clean, a byproduct of implementing + the above. I stumbled over some things and had to fix it (yeah, feature + creep in parts again, but still: Worth it!;-) + Any audio access is now restricted to either that standalone mpg123 + process or the buffer process, the output being opened _after_ the fork(). + There is hope that this fixes buffered output on MacOSX. +- More feature creep, this time because of something like that was already + included in the Debian mpg123: + --delay parameter to issue a pause before each track (does not make + sense for file writing outputs, though). +- Even more feature creep: remote control can now give ID3v2 data, also + in more raw form via new "tag" command. + This sort of qualifies as bugfix, actually, since it's item 1786430 on + the tracker;-) +- Make flexible rate computations more safe (especially on 32bit platforms) + by switching to the looping code instead of direct multiplication/division + (which blows up with integers). A possible effect was premature track + ending with a forced rate. +- Flexible rate mode works _at_all_ again with fixed output support + detection code (comparison of -1 with a size_t ended a loop all too early). +- check for error in flushing output (this ends mpg123 for a broken pipe, + for example) + +1.0rc1: +------- +- In one word: LOTS! +- Many small things that happened while migrating to the new setup. +- The decoder is now a library (libmpg123) which can be installed also + for other programs to use. This finally provides a heavily improved + replacement for the aged mpglib. We have doxygen API doc, example codes. + You can still choose to compile the decoder statically into the mpg123 + binary, though. +- We have a plugin system for audio output! This should be relieving to + package maintainers for binary distributions, drastically reducing the + number of builds they have to provide. + Here, too, you can choose to build one audio output into the binary + like before; you can have your old-school one-piece mpg123 or the hip + I-am-legion shared-lib-and-plugin flexible mpg123;-) + One exception: For now, you have to compile without modules in + MinGW32/MSYS. +- ID3v2 support has been enhanced and, in the case of specific comments + (those with a description), fixed. + The ID3 parsing is part of libmpg123, offering support for virtually + all textual information in ID3v2.2, ID3v2.3 and ID3v2.4 tags (along with + the usual 128 bytes of ID3v1 or ID3v1.1 in a block). + All tag texts are converted to UTF-8, allowing mpg123 to properly display + special chars in an Unicode terminal without fuzz (for non-UTF locales, + there is still the ASCII reduction). +- Gapless decoding (of layer 3 streams) is now considered to be a standard + feature and is enabled per default both at build- and runtime. +- ... + +0.68: +----- +- Fix bug 1807964: distorted playback of MPEG 2.5 files + +0.67: +----- +Thanks go out to the ROM 106.5FM team (http://www.rom.lu/) for supporting +this release with a donation on sf.net and a bottle of finest Gewuerztraminer +wine from Luxembourg! + +- verified that it builds on SGI IRIX 6.5 for MIPS32 and MIPS64 +- enable flexible rate for stdout decoding, too +- UTF8 filtering to ASCII finally works thanks to Mika Tiainen, see bug 1745847 +- corrected frame offset; -k was off by one + This means now that -k disagrees with mpg123 0.59r on many files because + the old version does play a frame of silence when encountering LAME tag + instead of dropping it for audio. +- added --timeout : Possibility to end playback on a stream that doesn't give + data for seconds. +- added --loop : for ... well... looping playback of a track; motivation was + persistent internet streaming with unreliable connection (together with --timeout) +- build fixes +- use movap instruction in SSE assembly when compiler supports the needed + alignment (idea from MPlayer) +- show decoder options in their priority order in --list-cpu/--test-cpu +- added Perl script to benchmark each of mpg123's CPU optimizations +- portability enhancements and cleanups along with testing on SunOS 4.1.2 + with gcc-2.7.0 +- workaround for ugly flexible rate for MMX/SSE/3DNowExt code: + --with-cpu=mmx also includes i586 code as fallback; similar with the others + +0.66: +----- +- support for a combined build of x86 optimizations and runtime selection + among these The (supposedly) "highest" CPU-supported optimization is chosen + by default, --cpu, --list-cpu and --test-cpu parameters are there for you to + take control. +- default build for x86 systems is combined "x86" with generic, i386, + i586, MMX, 3DNow, SSE, 3DNowExt; "x86_dither" also includes the dithering + i586 decoder +- no automatic -march compiler flags anymore; the --with-cpu configure option + selects specific assembler code but special CFLAGS are up to you +- extended 3DNow and SSE optmizations from MPlayer's mp3lib +- x86 assembler optimizations adapted for MacOS X/Intel +- straight support for Windows using MinGW32, reactivated the native + WinMM output. Core functionality including assembler optmimizations + and WAV writing is there. +- assembler optimizations also for cygwin +- set remote-err automatically when putting audio to stdout +- a bit more general portability in the new build system +- fix file creation mode for -O +- experimental decoding to 32bit float (raw and WAV file): ./configure + --with-cpu=generic_float +- generic control interface (-R) can create and read from a named pipe, + parameter --fifo +- audio bugfix: playback of mono file on stereo-only hardware, better + error reporting there +- ALSA output handling underruns +- MMX, SSE and 3DNowExt fallback to i586 and below or 3Dnow for forced + sample rate +- more terminal control: volume, RVA and verbosity controls + +0.65: +----- +- now allow crc bit to vary over stream (fixes files with bad lame tag + and some internet streams) +- do not try to parse id3v2.2 (as opposed to 2.3 and 2.4) +- correct id3v2.3 parsing for not expecting syncsafe integers for framesize, + 2.4 introduced that +- omit gcc specific compiler flags when gcc is not there +- initital attempt to support sgi/irix with configure (please test) + +0.64: +----- +- fixing a potential denial of service problem; broken connection to server + could trigger an endless loop + +0.63: +----- +- build fixes, only relevant to developers and people who had problems building + +0.62: +----- +- JUMP command in generic frontend accepts offsets/positions in seconds + (JUMP 4s vs. JUMP 4) +- initial support for ICY meta data in SHOUTcast streams +- a bit of fixing with rva code, added rva and general volume control to + generic frontend +- accepting more MIME types for http streaming (application/pls and + audio/x-mpeg) +- ID3v2 info output taking less space per default - more resembling the + old ID3v1 view for short tags, full view with always one line per item + via extra --long-tag switch +- generally less verbosity (i.e. noise on console) per default +- ID3v2 now having some kind of support for unicode; trying to print what's + latin1-compatible and prevent messing up of terminal with unknown bytes +- several bug fixes and small improvements + +0.61: +----- +- improved AltiVec code from Taihei Monma +- an i486 optimization by Petr Salinger +- improving interactive experience (terminal, frontends) +-- prevent/lessen bad effect after seeking while paused +-- show targeted position while seeking in terminal mode while paused +-- not messing up terminal on unexpected errors +- decoder robustness - better file sync (weird junk at beginning, some vbr + frames) +- build system improvements: +-- fixing configure isses on some platforms +-- adding cygwin, kfreebsd +- extended fix for CVE-2006-1655 +- generic code should compiling again... + +0.60 final: (The Team!) +----------- +- no functional changes + +0.60-beta6: (Thomas Orgis) +----------- +- more use of ID3v2 tags, mpg123 now displays both (merged) info from + ID3v2 and ID3v1; trying to support both ID3v2.3 and ID3v2.4, but ignoring + encoding (UTF8 should still work if your terminal supports it, straight + unicode should work except for parsing genre numbers and multiline strings) + +0.60-beta5: (Thomas Orgis) +----------- +- more robust playlist support: +-- path/url length not limited to 1023 characters anymore +-- reading in of whole playlist at program start (old operation was not + really safe with playlist from http) +-- fixed bug where reading of playlist form stdin caused segfault (introduced + with the pls format support) +- smaller cleanups, screen output cosmetics + +0.60-beta4: (Nicholas Humfrey & Thomas Orgis) +----------- +- proper seeking, also for VBR streams +- real two-way seeking in remote control mode at all +- better estimates of remaining frames (on vbr files), exact if Xing header + is found +- Removed libao support (as it is GPL and we aren't - and we don't need + it with native Alsa) +- Added ALSA 0.9/1.0 support by Clemens Ladisch (old alsa is in + audio_alsa05.c but will most likely vanish soon) +- Added PortAudio audio-output support +- Added SDL audio-output support +- Fixed NAS audio-output support +- re-enabled MPEG 2.5, code just seems to work +- improved stream checking; being more willing in general (favor resync + instead of bail out) but directly give up if free format stream is obvious +- Whee! Initial Relative Volume Adjustment (buzz) support with reading of + ReplayGain values in lame/info tag, the RVA2 frames in ID3v2.4, ID3v2 TXXX + tags from foobar2000 (please test, someone!) and custom ID3v2.3 comments + entitled RVA / RVA_ALBUM / RVA_AUDIOPHILE / RVA_RADIO / RVA_MIX +- more persistence in trying to get http streams + +0.60-beta3: (Thomas Orgis) +----------- +- fixed bug with segfault in http code on stream from live365.com - + bug id 1529266 +- made http request HTTP/1.0 compilant again (tested only without proxy) - + bug id 1529319 +- now using http content-type header to check for correct types mpg123 can + understand +-- you can now always use -@ for a single http resource (direct stream or + playlist) since a stream will be reopened based on MIME type, + though omitting it will save you one http request to the server in the + direct stream case... +- now simple parsing of shoutcast pls playlists (how did you people use + shoutcast before?) +- playlist mode enhanced with selective playback of one entry in list + (--listentry parameter) + +0.60-beta2: (Thomas Orgis) +----------- +- fixed bug in terminal control mode that caused the f key to quit program + isntead of advance to next file (introduced by the first attempt to restore + "normal" Ctrl+C behaviour in terminal control mode) + +0.60-beta1: (Thomas Orgis & Nicholas Humfrey) +----------- +On the way to the first new offical realease since years! + +- new license: all LGPL except the old audio_alsa.c +- merge with Nicholas' sourceforge package +-- autooled configure/make system +-- MacOSX, Jack, libao (alsa 0.9/1.x support through that) +- experimental gapless playback for layer 3 +- merged in MMX and AltiVec optimizations +- security bug fix of GLSA 200607-01 and catching possible crashes found by fuzzing +- fixed many issues here and there +- polished help messages, updated man page... + +UNDERGROUND 0.59r-thor7: (Thomas Orgis ) (well, I'm going to +------------------------ release a _really_ official mpg123 in future) +- applied relevant stuff from Debian's 22: +-- fix for CVE-2006-1655 (buffer overflow in III_i_stereo()) +-- strict aliasing hack in WRITE_SAMPLE of decode_i386.c +-- fixed http streaming through proxy by actually using the request url... +-- buffer resync on Ctrl-C (cleaning, reducing pauses with multiple files) +-- removed unused esdserver variable from mpg123.h +-- did NOT apply the Debian Makefile/manpage changes (going to rewrite that + stuff anyway) +- made the netbsd-i386 targets visible as netbsd-x86 + +UNOFFICIAL 0.59r-thor6 (Thomas Orgis ) +---------------------- +- split nedbsd targets for realtime priority selection code; since one + needs -lpthread with it. standard netbsd target doesn't use realtime code -- + I won't recommend running mpg123 as root anyway! + +UNOFFICIAL 0.59r-thor5 (Thomas Orgis ) +---------------------- +- Separated the the use of char* equalfile as filename from the use as + TRUE/FALSE flag by introducing int have_eq_settings. Compilers kept nagging + about assigning and integer (TRUE) to char* ... and it feels more right + this way. +- Made control_generic aware of real being possibly different than float (seq + command used to raise an FPE on OSF1 when this assumption was not the case. +- Fixed the command line arg parsing to work properly on Alpha (32 and 64 + bit mixup) + +UNOFFICIAL 0.59r-thor4 (Thomas Orgis ) +---------------------- +- merged with 0.59r-19 from Debian project (Daniel Kobras + ), hopefully fixing all those security vulnerabilities + -> my dirty http_open and open_stream variants now replaced by more + proper code + -> still my (rather workloaded) parsing/processing in control_generic, + but now including the idea to watch out for \n, \r\n and \r (or \n\r, + for that matter;-) + +UNOFFICIAL 0.59r-thor3: (Thomas Orgis ) +----------------------- +- hacked additional variants of http_open and open_stream that return + errors instead of exit()ing; makes more sense when used by a frontend +- further cleanup (and return to using continue instead of nested + if(){}else{if()else{}}) in command processing, better error messages there + +UNOFFICIAL 0.59r-ThOr(remote-err,eq,flushing): (Thomas Orgis ) +---------------------------------------------- +- added audio_flush() calls to various places in control_generic.c to + make sure there is nothing left in there that hurts later (not sure if + this has effects) +- (re?)enabled (?) code for stream info +- corrected answer of JUMP (now gives actual reached position, +/- 1 frame + since I'll still have to figure out what frame 0 really is...) + +UNOFFICIAL 0.59r-realeq-remoteerr: (Thomas Orgis ) +---------------------------------- +- applied patch from Cool Feet Audio project (nutcase@dtfm.org, see + README.cfa) to use real-time equalizer in remote mode +- applied patch from AMF (amf.sourceforge.net) by Steve Grundell for remote + communication not polluting the STDOUT where the audio data is read from + (instead using STDERR) ... and faster seeking, maybe + The patches go not cleanly together, but rejects are trivial. Thus, + a combined patch with both would makes sense. +- modified (IMHO improved) the control_generic command reading: now + always making sure that the full command is read up to a mandatory \n; + also reworked the application of the commands afterwards +- added SEQ command: simple eq with only 3 bands +- added SILENCE command: I don't want the playback messages when I don't + read them (since my frontend is reading the STDOUT it knows what is going on) +- added SLJ command: SILENCE-LOAD-JUMP... a hack for my hacked + mixplayd... maybe one should remove that again. + +0.59r: (MH) +------ +- applied audio_alib changes from Ralf Hildebrandt +- some 'paetsches' from DK +- minor optimizations in layer3 (dequantize/huffman) +- BSDOS 4.0 with gcc added to Makefile () +- Solaris-ESD patch from Ryan Prosser +- Added Frontend changes from Bertrand Petit +- more DK 'paetsches' (final dk7-clubhaus edition), includes extended term + control +- SGI audio fix for non RAD machines from Erik Mouw +- fixed ugly bug in layer3 dequant for bt==2 (may cause high frequency clitchs) +- AMD-3DNow optimizations in decode and dct64 +- OS/2 reworked from Samuel Audet (see audio_os2.c for more) +- added freebsd-esd make-entry from Daniel O'Connor (darius@guppy.dons.net.au) +- added enhanced head_check from D. Skarda <0rfelyus@atrey.karlin.mff.cuni.cz> +- applied 'xterm-title-patch' from "Wilson, Jeff D" +- more esd changes from Robert Bihlmeyer +- applied Hannu Napari's SGI audio patches +- minor changes in httpget.c and mpg123.c +- added native AIX support from Juergen.Schoew@unix-ag.uni-siegen.de +- applied playlist patch from +- more SGI audio patches from Gilles Zunino +- applied esdserver patch from Matthew Parslow +- added some fixes for control_generic + +0.59q: (MH) +------ +- ESD fixes +- minor bugfixes (DK patch ;) +- au and cdr 'support' (it's a hack) +- Fixed 'VBR' Bug in get_scale_fac1(). Thanx to for + this. (Wasn't really a VBR Bug. The new encoders just triggered it.) +- Added equalizer patch from + +0.59p: (MH) +------ +- Added mpglib (see mpglib directory) +- 'make generic' is more generic now +- Added HPUX/ALib support from Ducroquet Erwan (ducroque@ufr-info-p7.ibp.fr) +- Added EsoundD support from +- Added exp. relatime support (compile with -DSET_RT) +- Added linux-sparc patch from +- Added wav-File patch Samuel Audet +- Added SGI-RAD support from "J. Dean Brederson" +- Added sajberplay/FreeBSD patch from Chou Ye-chi +- Added 486 optimizations from Fabrice Bellard +- Added combined output devices on SUN (ie Speaker and headphones together) +- Added audio_alsa.c (under GPL license) for the ALSA sound system from + A. Hermansen and J. Kysela +- Added K6-3DNow patches from KIMURA Takuhiro +- Added MINT patches from Petr Stehlik +- Fixed minor bug for linux-i486 and mono + +0.59o: (MH) +------ +- fixed Bug with stereo streams on mono audio hardware for OSS +- fixed a bug with mono output and 1:1 (no) rate conversion +- again changes in the probe code +- fix in the buffer code for the case, that audio parameters are changing +- more changes to the flexibel rate converter, should now work when + writing to STDOUT. +- Added Andy's () float2int speed up proposal + (check WRITE_SAMPLE in decode_i386.c) .. Maybe someone wanna take the + idea and put it into the decode_i586.s part? +- Added TK3Play support from Brian Foutz + (compiles but untested) +- RIFF Header fix (according to Thomas Niederreiter's + patch) +- m68k patch from Stefan Gybas applied +- minor additional PPC changes applied +- resync and EOF hang fixed +- resync and bitrate correction relaxed +- Slightly change verbose output; added countdown + +0.59n: (MH) +------ +- fixed shuffle bug +- added memory mapped IO for file reading +- added MPEG 2.5 12kHz and 8kHz table entry +- started flexibel rate conversion .. +- new '-Z' / '--random' option +- minor clean-up +- splitted audio file in audio system dependend smaller parts +- started system stream support (external program: system.c) +- unsigned 8 bit (instead of ulaw) is now default for 8bit operation +- Linux PPC patch from Grant Erickson applied +- added BSDi patch from Peter Berger , who reported + a failure when catching signals +- minor bug fix in the control interface for sajber jukebox +- fixed the ugly 'Ctrl-Z in buffer mode' bug .. YES ;) +- added buffer preload when underrun occurs (preload = 1/8 buffer size) +- minor SUN audio clean up + +0.59m: (MH) +------ +- Bug with RIFF header streams fixed. +- HTTP auth option patch from Henrik P Johnson +- NetBSD patch(s) added from and +- Added advanced shuffle support from Steven Tiger Lang +- fixed bug with too large big_value field +- fixed (hopefully) the bug with the '-a' option +- work-around for some pedantic compilers in fr->synth init +- some changes for the 'generic' version +- applied NAS bug-fix patch +- new (good) MPEG 2.5 tables (from Niklas Beisert) +- added WIN32 support from Tony Million +- added some bug fixes from Niklas Beisert +- fixed another ugly bug in layer3 dequantize (wrote over the border + of the 'xr' field) +- a minor HPUX clean up +- added BSD patch from Kevin Brintnall +- added Makefile.win32 +- added NAS big endian fix + +0.59l: (MH) +------ +- simple equalizer support (to be continued) +- added NAS patch from Martin Denn +- real mono support +- added pentium optimized decode_i586 from Stefan Bieschewski +- fixed a bug in MS dequantize function + +0.59k: (OF) +------ +- fixed "Accept" header in httpget.c +- fixed buffer overflow (causing core dumps) in httpget.c +- fixed display of song length +- fixed -b (buffer) problem on SGI / IRIX -- it definitely works now +- fixed problem when files with different sample rates where played, + it now works with -b (buffer), too +- fixed order of local variables in decode.c to work around a + compiler bug in ultrix +- fixed Makefile for ultrix +- reverted to old getbits.s (the new one could cause coredumps) +- more compact MPEG header display in non-verbose mode +- small fixes in buffer code and elsewhere + +0.59j: (MH) +------ +- added sajber jukebox control interface (it's currently a big hack) + (see 'JUKEBOX' file for more) +- added simple rewind facility .. (only used by sajber interface at the moment) + +0.59i: (MH) +----------- +- added front-end (remote) patch from "Brian J. Swetland" +- added OS2 patches from Niclas Lindstrom +- fixed 'rewind bug' +- added patches from Leo Broukhis +- added shuffle patch from Tillmann Steinbrecher +- added i386-getbits from M.Stekelenburg +- added fallback to 8bit if no 16bit samples support (currently linux only) +- added (slightly changed) outburst patch + from Antti Andreimann +- added 'http accept' patch from Hur TaeSung +- fixed buffer mode bug + +0.59h: (MH) +------ +- added '--8bit' option to force 'ULAW 8 BIT' playing +- pcm buffer type changed to 'unsigned char *' +- plays 2:1 and 4:1 with the real frequency (ie 11025/22050 instead of 44100) +- program (re)sets (changed) frequency for every frame +- buffer mode is broken + +0.59g: (MH) +------ +- added support for MPEG 2.5 (it's a HACK!) .. mpg123 understands and plays + 2.5 but it does it wrong. (you will hear this!) +- Fixed wrong values in BandInfo struct for 32kHz mode +- Some performance improvements and minor changes and bug-fixes. +- Tried the new imdct from the maplay1.2+ (version 1.81) package. (but + it was slightly slower on my system, currently disabled) + +0.59f: (OF) +------ +- HP-UX audio fix (provided by Damien Clermonte) +- Buffering (-b option) hopefully fixed. Please test! + +0.59e: +------ +- added Audio MPEG 2.0 support (but near untested) (MH) + +0.59d: (MH) +------ +- minor modifications to dct64_i386.c +- removed duplicated dependency 'dct64.o' in Makefile + +0.59c: (OF) +------ +- Another complete rework of the buffer system (-b option) (normally uses + mmap(), but it can also use SYSV-ShMem because mmap() is broken on linux). + +0.59: (MH) +----- +- extracted dct64() from decode*.c files. +- some changes to dct64() and decode*.c to allow auto-increment/decrement +- removed bit-counter in getbit-functions. Layer3 part2 now counts it itself. + +0.58: (OF) +----- +- Bugfix: not closing the audio device caused a few samples to be lost. +- Bugfix: audio_set_rate() was not called (!?!). +- Additional command line options "--doublespeed" and "--halfspeed" (couldn't + find better names). See the manpage. +- Complete redesign of command line options. See the manpage. +- Changed the buffer algorithm (-b). I'm not sure whether it's better or worse + now. +- Supports multiple files on the command line. Pressing Ctrl-C will skip to the + next MPEG file, pressing it twice within one second will abort mpg123 + completely. See the "INTERRUPT" section in the manpage. +- Support for http URLs. See also the -p option in the manpage. +- Support for list files. See also the -@ option in the manpage. + +0.57: (MH) +----- +- Put the downsampling code together with the full quality decode into one + binary. (new options -2to1,-4to1) +- Optimizations in the dct12. +- Removed the 'int' version. + +0.56: (OF) +----- +- Additional command line option "-rs" to try to resync on "broken" MPEG streams + (now called "--resync" or "-y"). +- Additional command line option "-b" to use audio output buffering. See the + manpage for additional information. +- Changed a few variable names and some other minor fixes, so the + source compiles more cleanly (without warnings) on most platforms (for + example, the FreeBSD port compiles without warnings using "-Wall -ansi + -pedantic"). +- Makefile changes: moved "solaris" to "solaris-gcc", new target + "solaris" (using Sun's SparcWorks cc, faster tha gcc!), new targets + "aix" and "generic". + +0.55: +----- +- removed some obsolete code from layer3.c (MH) +- changed scalefac stoing in layer3 (MH) +- decode_4to1.c added again. Renamed decode_lp.c to decode_2to1.c (MH) + (both not optimized .. still expterimental) +- Minor cleanups and optimizations in layer3. (MH) +- Removed some (probable) minor bugs. (MH) +- Changed 2**(...) scaling (and omitted a few muls) (MH) +- Changed Makefile (OF) +- Changed dequantize to reorder with a mapping table + (you can disable this by undefining MAP in layer3.c) (MH) +- removed the 'dummy' scale step for mixed mode (MH) +- Changed copy policy (MH) +- Modified dequant-reorder-mapping (MH) + +0.54: (MH) +----- +- Minor changes in the documents .. +- huffman.c: x->len,y->len removed .. always '15' for the important cases +- audio.c: some additions to the SOLARIS audio code + +0.53b: (OF) +------ +- Makefile: +-- Renamed SPARC10 to SUNOS (which is more appropriate). + Tested with SunOS 4.1.4 on a SPARCstation SLC, 20 MHz (322% CPU, + so no realtime decoding). +-- Added SOLARIS. Tested with Solaris 2.5.1 on an Ultra 1, 167 MHz (14% + CPU), a SPARCstation 5, 110 MHz (47% CPU), and a SPARCstation 10, 33 MHz + (68% CPU). +-- Added FreeBSD. Tested with 2.1.7 on a Pentium-90 (38% CPU) and 2.2 on a + Pentium-166 (20% CPU). +-- Added Digital Unix. Tested with DU 3.2 on a DEC 3000/500 (Alpha AXP + 150 MHz, 33% CPU). Does not support DEC's audio interface ("AudioFile"), + decodes to stdout only. +-- Improved "clean" target to remove core files and editor backup files. +-- Added "install" target. +-- Added "dist" target to create a .tar.gz file of the source directory. +-- In the distributed Makefile, all system sections are commented out. When + you type "make" without uncommenting one of the sections, an appropriate + error message will be displayed. +- audio.c + Fixed problem when opening /dev/audio on Solaris: I had to remove O_NDELAY, + because writing to /dev/audio didn't block until the requested number of + samples could be written, but instead it wrote only as much samples as + it was able too. Sounded funny. Removing O_NDELAY fixed the problem. + I don't think that it hurts SunOS either, so I didn't make another #ifdef. +- common.c + Fixed bug by adding function finish_output(): The decoder writes the audio + samples into a buffer, and each time the buffer is full, it is written + to the audio device (or to stdout). But when the decoding is done, + there are some samples left in the buffer which aren't written yet -- + they were just discarded. This additional function fixes the problem by + writing the remaining samples from the buffer. It is called immediately + after the main frame loop in mpg123.c. +- decode*.c + Fixed compiler warning on symbol "div": Some compilers issue warnings + because the symbol div is already used for something else (see "man div"), + so I changed it to "divv". +- layer*.c Functions do_layer*: +-- Moved the declaration for audio_play_samples into mpg123.h. Makes the + code cleaner. +-- I moved the variables pcm_samples and pcm_point to common.c, so they are + shared between all modules. This was necessary because the finish_output() + function (see common.c above) needs to access them. +-- Renamed loop variables "i" and "j" to "k" in order to fix compiler warnings + for duplicate/hidden symbols (similar to "div" in decode*.c, see above). + Changed the preprocessor symbol AUDIOBUFSIZE into a global variable + "audiobufsize". This makes it possible to change it by a command + line option. +- layer1.c + Fixed error in function I_step_one, second parameter: unsigned int + scale_index[2][] --> ...[2][SBLIMIT] This caused an error with the DU + compiler (which is ok, because [2][] is incorrect according to ANSI). + I don't know whether [2][SBLIMIT] actually works correctly (I have no + layer-1 streams to test it), but at least it compiles without error, and + it appears to be correct (looking at the rest of the source). Heaven knows + why gcc doesn't issue an error, and what it actually makes from it. +- mpg123.1 + A simple manual page. Type "nroff -man mpg123.1 | more" to view it, or + install it in /usr/local/man/man1 (this is done automatically by "make + install"). +- mpg123.c + New boolean variable "quiet": If this variable is set to TRUE (command line + option -q), no messages are printed. diff --git a/NEWS.libmpg123 b/NEWS.libmpg123 new file mode 100644 index 0000000..ae33d99 --- /dev/null +++ b/NEWS.libmpg123 @@ -0,0 +1,198 @@ +Changes in libmpg123 libtool interface versions... + +44.0.44 + - added mpg123_getformat2() + +43.0.43 + - added MPG123_NO_PEEK_END and MPG123_FORCE_SEEKABLE + +42.0.42 + - added mpg123_framelength() + Now mpg123_position() is truly obsolete! + - hardened string API to not crash if given NULL pointers + (except mpg123_init_string()) + - equalizer feature optional + +41.0.41 + - Add checks for NULL handles in some API functions that missed that, changed return value in others to MPG123_BAD_HANDLE where appropriate: + - mpg123_format_none(NULL) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_format_all(NULL) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_format(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_reset_eq(NULL) == MPG123_BAD_HANDLE (was: undefined) + - mpg123_replace_buffer(NULL, ...) == MPG123_BAD_HANDLE (was: undefined) + - mpg123_framedata(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_decoder(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_param(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_getparam(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_getstate(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_eq(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_open(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_open_handle(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_open_feed(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_replace_reader(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_replace_reader_handle(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_decode_frame(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_feed(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_decode(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_info(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_getformat(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_set_filesize(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_scan(NULL) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_id3(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_icy(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_index(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_set_index(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - mpg123_close(NULL, ...) == MPG123_BAD_HANDLE (was: MPG123_ERR) + - Changed return value of mpg123_geteq() to 0 for NULL handle to be consistent with itself. + + +40.0.40 + - Bump for marking the first actual implementation of A-Law encoding. + Not that it matters to anyone, though --- I wonder why not even the + Asterisk users wanted this. It's for telephony, dammit! + - Added arm_fpu decoder for runtime switch between NEON and generic fpu. + +39.2.39 + - Added more elaborate post-processing to enable 32 and 24 bit output also with low-precision decoder (16 bit, fixed-point). + +39.0.39 + - Added MPG123_FRESH_DECODER. + - Also containing several regression fixes. + +38.0.38 + - Added MPG123_PICTURE and associated addition to mpg123_id3v2 struct. + +37.0.37 + - Added mpg123_chomp_string. + +36.0.36 + - Extended MPG123_RESYNC_LIMIT to initial header search. + - Not cutting decoder delay unconditionally anymore (only in combination with known encoder delay / padding). + +35.0.35 + - Added mpg123_meta_free(). + +34.0.34 + - Added flag MPG123_AUTO_RESAMPLE. + - Changed (improved;-) outbuffer behaviour. + +33.0.33 + - Added MPG123_BUFFERFILL. + +32.0.32 + - Added mpg123_framepos() + +31.0.31 + - Added mpg123_framedata() and MPG123_IGNORE_INFOFRAME. + +30.0.30 + - Added MPG123_FEEDPOOL and MPG123_FEEDBUFFER. + +29.0.29 + - New decoder: ARM neon. + - Added support for 24 bit output (dumb byte-chopping of 32 bit output). + +28.0.28 + - Add mpg123_strlen(). + +27.0.27 + - Implictly disable seeking on streams when client enforced ICY parsing. + This helps debugging dumps of http streams. + +26.0.26 + - Added mpg123_encsize(). + - Added flag MPG123_SKIP_ID3V2. + +25.0.25 + - Version increase to mark the point where the split between normal and large-file-enabled library vanishes again. The world did not like it. + Now Thomas lost some days of recreation and sleep to give it a dual-mode libmpg123 on large-file-sensitive systems. + +24.0.24 + - Introduce mpg123_replace_reader_handle() and mpg123_open_handle() + ... this is also in preparation for the next version which will drop the separated large-file library again, due to public display of dismay. + - Add the experimental mpg123_framebyframe_decode to the off_t-sensitive functions. + +23.0.23 + - Version increase to mark the point where the explicit split between normal and large-file-enabled library has been introduced. + +22.0.22 + - Experimental framebyframe API added. + +21.0.21 + - Added support of unicode file names under windows via UTF-8 argument to mpg123_open. + - Added mpg123_feature(), for example to test for the above behaviour. + +20.0.20 + - New flag: MPG123_PLAIN_ID3TEXT + - Corresponding text encoding handling API added: + mpg123_enc_from_id3, mpg123_store_utf8 + +19.0.19 + - Hm, what was it exactly now... there are candidates: + - runtime dithering + - free format + - ARM optimizations + +18.0.18 + - new parameter: MPG123_PREFRAMES is now tunable (the number of frames to decode and skip before a seek point), also default value increased + +17.0.17 + - introduction optimized stereo synths + +16.0.16 + - introducing floating point x86-64 SSE synth + +15.0.15 + - first addition of x86-64 SSE optimizations + +14.0.14 + - the first libmpg123 with actually working MPG123_UPSPEED + - also important regression fix concerning skipping of frames + +13.0.13 + - The whole set of output formats is generally available (8, 16 and 32 bit integer, signed/unsigned, float) + - Many features can be absent from libary as build decision (minimize binary size). + +12.0.12 + - added mpg123_current_decoder + - fixed value of MPG123_ENC_FLOAT + - float output now is a real runtime option + +11.0.11 + - added mpg123_getstate + - run-time tunable frame index + - officially configured with largefile support where available + +10.0.10 + - new flag MPG123_FUZZY (along with the fuzzy seek functionality) + +9.0.9 + - added mpg123_tell_stream + +8.0.8 + - added mpg123_get_eq + +7.0.7 + - added mpg123_set_filesize + +6.0.6 + - added mpg123_icy2utf8 + +5.0.5 + - added mpg123_feed + - input buffers now const + +4.0.4 + - extended mpg123_string api (mpg123_add_substring, mpg123_grow_string) + +3.0.3 + - Initial floating point support as compile-time option. + +2.0.2 + - New flag MPG123_SEEKBUFFER. + +1.0.1 + - Added MPG123_RESYNC_LIMIT parameter. + - Added MPG123_OUT_OF_SYNC and MPG123_RESYNC_FAIL error codes. + - Fix for uninitialized framesize value in handle. + diff --git a/NEWS.libout123 b/NEWS.libout123 new file mode 100644 index 0000000..6ae51be --- /dev/null +++ b/NEWS.libout123 @@ -0,0 +1,5 @@ +1.0.1 + - initial version + +2.0.2 + - added OUT123_BINDIR diff --git a/README b/README new file mode 100644 index 0000000..830b0ab --- /dev/null +++ b/README @@ -0,0 +1,203 @@ +* * * * * * * * * * * * * * * * * * * * * * * * * * * * +* mpg123 - MPEG 1.0/2.0/2.5 audio player * +* README for version 1.x.y, dated at 14.06.2009 * +* * +* ...still the fastest MPEG audio player for UNIX ;) * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * +(This file has very long lines - die-hard terminal nostalgists can be satisfied by `fmt -s -w 75 < README | less`. I think it's better to let the reader's preference rule than to preformat the stuff to some arbitrary width.) + + +0. Stuff + +For building/installation info see INSTALL. + +The mpg123 project was started by Michel Hipp and is now being maintained by Thomas Orgis and Nicholas J. Humfrey, who initiated the Sourceforge project. +The source code contains contributions from quite a few people - see AUTHORS for more info. +It is Open Source software licensed mostly under the LGPL with some parts restricted to GPL. See COPYING for details. +As for every mp3 player, some of mpg123's functionality may be covered by patents in a country where these are valid. See PATENTS for details. + +Project's official website URL is + + http://mpg123.org +(or http://mpg123.orgis.org as fallback address if there is a problem with the DNS forwarding) + +for the traditional home page and + + http://sourceforge.net/projects/mpg123 + +for sourceforge.net based services like download mirrors, mailing lists and bug/feature trackers. +Please use the sourceforge download mirrors when possible to minimize load on the mpg123.org server. + + +1. Introduction + +This is a console based decoder/player for mono/stereo mpeg audio files, probably more familiar as MP3 or MP2 files. +It's focus is speed. We still need some low-end benchmarks for the current version, but playback should be possible even on i486 CPUs. There is hand-optimized assembly code for i586, MMX, 3DNow, SEE and 3DNowExt instructions, while generic code runs on a variety of different platforms and CPUs. +It can play MPEG1.0/2.0/2.5 layer I, II, II (1, 2, 3;-) files (VBR files are fine, too) and produce output on a number of different ways: raw data to stdout and different sound systems depending on your platform (see INSTALL). +Most tested are Linux on x86 and Alpha/AXP and MacOSX on ppc as the environments the current developers work in. +We are always thankful for user reports on success (and failure) on any platform! + + +2. Contact + +short: + + mpg123-devel@lists.sourceforge.net + mpg123-users@lists.sourceforge.net +or + maintainer@mpg123.org + +long: see doc/CONTACT + + +3. Interface/Usage + +Please consult the manpage mpg123(1). Some starter info follows. + +3.1 Simple Console Usage + +Mpg123 is a console program - normally it just plays a list of files you specify on command line and that's it. See the included manpage or + + mpg123 --help + +or, for the full story, + + mpg123 --longhelp + +on command line syntax/options. I encourage you to check out the --gapless and --rva-album/--rva-mix options:-) + +In the simple "mpg123 file1.mp3 file2.mp3" mode, the only thing you can do to interact is to press Ctrl+C to skip to next track or end the whole playback if pressing it twice. + +Note that this Ctrl+C behaviour is special to this mode; when any of the following is activated, Ctrl+C will just kill the program like you would expect normally (this changed from earlier versions). + +3.2 Advanced Console Usage + +You can specify the option -C to enable a terminal control interface enabling to influence playback on current title/playlist by pressing some key: + + -= terminal control keys =- +[s] or [ ] interrupt/restart playback (i.e. 'pause') +[f] next track +[d] previous track +[b] back to beginning of track +[p] pause while looping current sound chunk +[.] forward +[,] rewind +[:] fast forward +[;] fast rewind +[>] fine forward +[<] fine rewind +[+] volume up +[-] volume down +[r] RVA switch +[v] verbose switch +[l] list current playlist, indicating current track there +[t] display tag info (again) +[m] print MPEG header info (again) +[h] this help +[q] quit + +You can change these bindings to key to your liking by modifying term.h . + +Note: This interface needs not to be available on _every_ platform/build. + +Another note: The volume up and down is performed by changing the scale factor (like the -f parameter) ... so the audio is scaled digitally in the given range of the output format (usually 16bits). That means the lowering the volume will decrease the dynamic range and possibly lessen the quality while increasing volume can in fact increase the dynamic range and thus make it better, if you deal with a silent source and no clipping is necessary. +It is a good idea to use RVA values stored in the file for adjusting low volume files, though - mpg123 handles that in addition to your volume setting. + +3.3 Control Interface for Frontends + +There used to be several interfaces for frontends left over from that past, but only one of them remains for the present and future: + + The Generic Control Interface + +It contains of communication of textual messages via standard input to mpg123 and responses to standard output unless the -s switch for output of audio data on stdout is used - then the responses come via stderr. + +See doc/README.remote for usage. + + +4. Speed + +mpg123 is fast. Any faster software player is probably based on some hacked mpg123;-) +MPlayer included mpg123 source code in it's mp3lib and we have to be thankful for the MPlayer folks adding SSE, 3DNowExt and AltiVec optimizations over the years, which we were able to backport. + +mpg123 includes the AltiVec optimization since version 0.61 and the SSE and 3DNowExt optimizations since 0.66 . +Also, version 0.66 adds the merged x86 optimization build, which includes every applicable optimization for x86 cpus except the one for i486, wich is a bit special. + +Now mpg123 catched up with MPlayer's mp3lib concerning decoding speed on my Pentium M (which supports SSE): +Decoding a certain album (Queensryche's Rage for Order) to /dev/null took 22.4s user time with mpg123-0.66 compared to 24.7s with MPlayer-1.0rc1 . + +Also, beginning with mpg123 1.8.0, there are fresh x86-64 SSE optimizations (provided by Taihei Monma) which make mpg123 the fastest MPEG audio decoder in my knowledge also on current 64bit x86 systems. + +5. Accuracy + +The mpg123 engine is able to decode in full compliance to ISO/IEC 11172-3, for all three layers, using floating point or integer math (the latter since 1.8.1). +Accuracy of 16bit output depends on specific optimization in use and compile-time choice about the rounding mode (which is performance relevant). + +The ISO test suite is incorporated in the mpg123 subversion repository under svn://orgis.org/mpg123/test, nightly tests of a build (with high-quality 16bit rounding) are published on the mpg123 website. + +Dithered 16bit output is available as an option (the --cpu choices ending with _dither). See + + http://dither123.dyndns.org + +on the whereabouts. + +6. History + +A looooong time ago (mid-90s), Michael Hipp wrote some initial mpg123 and made it _the_ Unix console mp3 player in the following years. +The exact date of birth is fuzzy in human memory, but according to the master himself (Michael) mpg123 started in 1994 as an MP2 player which a year later, 1995, gained MP3 ability. +The core decoder files have mostly 1995 as their birth year listed, so one can say that mpg123 as the layer1,2,3 player was born in 1995. +In any case, that is a looooong time ago for a media player - especially for one that is still alive! + +This is the historic description: + + This isn't a new player. It's a fully rewritten version originally based + on the mpegaudio (FHG-version) package. The DCT algorithm in the + synthesis filter is a rewritten version of the DCT first seen in the maplay + package, which was written by Tobias Bading (bading@cs.tu-berlin.de). The + rewrite was necessary, because the GPL may not allow this copyright mix. + The mpegaudio package was written by various people from the MPEG/audio + software simulation group. The maplay is under GPL .. You can find the + original source code and the mpegaudio package on: ftp.tnt.uni-hannover.de. + + Especially layer3.c common.c and mpg123.h is based on the dist10 package. + The code is fully rewritten but I'm using sometimes the + same variable names or similar function names as in the + original package. + + In the current layer3.c I'm using a DCT36 first seen in Jeff Tsay's + (ctsay@pasteur.eecs.berkeley.edu) maplay 1.2+ package. His code is + under GPL .. I also tried the enhancement from Mikko Tommila. His + code is also in layer3.c (but it's disabled at the moment, because + it was slightly slower than the unrolled 9 point DCT (at least on + _my_ system)). Theoretically it should be faster. You may try it on + your system. + +Well, that's how it started... +Official development ceased due to the typical lack-of-time syndrome around 2002 and the free-floating patches began to seize the day. + +But before that, Michael wrote or rewrote the essential code; others contributed their bits. +The main message is: + +Code is copyrighted by Michael Hipp, who made it free software under the terms of the LGPL 2.1. + +Please see doc/ROAD_TO_LGPL, COPYING and AUTHORS for details on that. Note that the only notable legacy non-LGPL file was the old alsa output that didn't work with alsa 0.9/1.0 anymore. +Also, there has been a libao output in the betas 0.60 for a short period. Libao being generally problematic for us because of its GPL license, this output is not distributed anymore in the release packages. There is now a new, LGPLed alsa output that made both the old alsa and libao obsolete for our purposes. +So, the distributed mpg123 releases actually only contain LGPL code, but you get the other files from our subversion repository if you checkout the trunk / version tags. + +There has been quite some confusion about the licensing and "freeness" of mpg123 in the past. +The initial "free for private use, ask me when you want to do something commercial" license caused some people to avoid mpg123 and even to write a replacement mimicking the interface but using a different decoding engine - what was not actively developed for too long but entered the "free" software sections. + +The Debian (non-free section) and Gentoo distributions cared about the last stable and the last development release of mpg123 over the years with mainly applying security fixes. Thanks go to the distribution maintainers for not letting it alone to bitrot over the years. + +Thomas Orgis started to hack on mpg123 in 2004 while working on his personal audio experience with mixplayd and later DerMixD, utilizing the generic control interface. In Feb 2005, he crammed control interface improvements together with Debian's r19 fixes and released the personal fork/patch named mpg123-thor. +Little later that year, Nicholas J. Humphrey independently created the sourceforge project and released an autotooled 0.59r under official GPL flag with Debian and MacOSX fixes. +In the beginning of 2006, Thomas finally decided that he could work "officially" on mpg123 and contacted Michael Hipp for taking over maintainership. +Michael was all-positive about letting mpg123 really live again (and perhaps see version 1.0 some time;-) and also pointed at the sourceforge project that didn't see much activity since the initial release. +A lot of emails and some weeks later there was the two-developer team of Nicholas and Thomas working on merging their mpg123 variants as well as adding some features and fixes to let it shine again. + +And there we are now... + +7. End + +Have fun! +____________ +Thomas Orgis diff --git a/TODO b/TODO new file mode 100644 index 0000000..04fa639 --- /dev/null +++ b/TODO @@ -0,0 +1,40 @@ +BEFORE 1.23 RELEASE: + +- add client name as libout123 parameter, to be used by jack backend + PID still needed? JACK handles possibly non-unique names. + +Things that need to be done... + +... as always, mostly outdated. + +0. Fix that ugly crash that happens sometimes when Ctrl+C-ing with jack output active: + +Program terminated with signal 11, Segmentation fault. +[New process 6293] +[New process 6291] +[New process 6292] +[New process 6284] +#0 0x00002aced607695b in memcpy () from /lib/libc.so.6 +(gdb) bt +#0 0x00002aced607695b in memcpy () from /lib/libc.so.6 +#1 0x00002aced5b4f092 in jack_ringbuffer_read () from /usr/lib/libjack.so.0 +#2 0x00000000004151dd in process_callback () +#3 0x00002aced5b4bf40 in Jack::JackClient::Execute () from /usr/lib/libjack.so.0 +#4 0x00002aced5b5f8da in Jack::JackPosixThread::ThreadHandler () from /usr/lib/libjack.so.0 +#5 0x00002aced6354fa7 in start_thread () from /lib/libpthread.so.0 +#6 0x00002aced60c802d in clone () from /lib/libc.so.6 + + +1. mpg123 could pick up new sample rates suggested by the output modules (like a jack server fixed to 96kHz) and adapt to that. + +Though the practical rates for MPEG audio are up to 48kHz ... but one could easily upsample. +Currently, we detect standard rates and resample when needed... but not new ones. + +4. Prevent ID3v2 tags from being parsed multiple times after seek. + +I need to carry a list of ID3v2 frame addresses that already have been parsed into the data structures. +Currently, this is a possible memory leak when the seek index is disabled (tag data at file beginning) or id3 data is just somewhere in the stream. +That being said, in the "normal" case, there is no leak. + +5. What's about SINGLE_MIX? +Check what is _really_ happening there, make some test file... diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..9c57264 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,2303 @@ +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_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],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- +# +# Copyright (C) 1999-2008, 2011-2015 Free Software Foundation, Inc. +# Written by Thomas Tanner, 1999 +# +# 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 20 LTDL_INIT + +# LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) +# ------------------------------------------ +# DIRECTORY contains the libltdl sources. It is okay to call this +# function multiple times, as long as the same DIRECTORY is always given. +AC_DEFUN([LT_CONFIG_LTDL_DIR], +[AC_BEFORE([$0], [LTDL_INIT]) +_$0($*) +])# LT_CONFIG_LTDL_DIR + +# We break this out into a separate macro, so that we can call it safely +# internally without being caught accidentally by the sed scan in libtoolize. +m4_defun([_LT_CONFIG_LTDL_DIR], +[dnl remove trailing slashes +m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) +m4_case(_LTDL_DIR, + [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply '.' + m4_if(_ARG_DIR, [.], + [], + [m4_define([_LTDL_DIR], _ARG_DIR) + _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], + [m4_if(_ARG_DIR, _LTDL_DIR, + [], + [m4_fatal([multiple libltdl directories: ']_LTDL_DIR[', ']_ARG_DIR['])])]) +m4_popdef([_ARG_DIR]) +])# _LT_CONFIG_LTDL_DIR + +# Initialise: +m4_define([_LTDL_DIR], []) + + +# _LT_BUILD_PREFIX +# ---------------- +# If Autoconf is new enough, expand to '$(top_build_prefix)', otherwise +# to '$(top_builddir)/'. +m4_define([_LT_BUILD_PREFIX], +[m4_ifdef([AC_AUTOCONF_VERSION], + [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), + [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], + [$(top_build_prefix)], + [$(top_builddir)/])], + [$(top_build_prefix)])], + [$(top_builddir)/])[]dnl +]) + + +# LTDL_CONVENIENCE +# ---------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with +# '$(top_build_prefix)' if available, otherwise with '$(top_builddir)/', +# and LTDLINCL will be prefixed with '$(top_srcdir)/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_build_prefix, top_builddir, and top_srcdir appropriately +# in your Makefiles. +AC_DEFUN([LTDL_CONVENIENCE], +[AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +])# LTDL_CONVENIENCE + +# AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, +# now we have LT_CONFIG_LTDL_DIR: +AU_DEFUN([AC_LIBLTDL_CONVENIENCE], +[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_CONVENIENCE]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) + + +# _LTDL_CONVENIENCE +# ----------------- +# Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). +m4_defun([_LTDL_CONVENIENCE], +[case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; +esac +LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" +LTDLDEPS=$LIBLTDL +LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" + +AC_SUBST([LIBLTDL]) +AC_SUBST([LTDLDEPS]) +AC_SUBST([LTDLINCL]) + +# For backwards non-gettext consistent compatibility... +INCLTDL=$LTDLINCL +AC_SUBST([INCLTDL]) +])# _LTDL_CONVENIENCE + + +# LTDL_INSTALLABLE +# ---------------- +# sets LIBLTDL to the link flags for the libltdl installable library +# and LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl +# is not found, LIBLTDL will be prefixed with '$(top_build_prefix)' if +# available, otherwise with '$(top_builddir)/', and LTDLINCL will be +# prefixed with '$(top_srcdir)/' (note the single quotes!). If your +# package is not flat and you're not using automake, define top_build_prefix, +# top_builddir, and top_srcdir appropriately in your Makefiles. +# In the future, this macro may have to be called after LT_INIT. +AC_DEFUN([LTDL_INSTALLABLE], +[AC_BEFORE([$0], [LTDL_INIT])dnl +dnl Although the argument is deprecated and no longer documented, +dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one +dnl here make sure it is the same as any other declaration of libltdl's +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is +dnl not yet using an explicit LT_CONFIG_LTDL_DIR. +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl +_$0() +])# LTDL_INSTALLABLE + +# AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, +# now we have LT_CONFIG_LTDL_DIR: +AU_DEFUN([AC_LIBLTDL_INSTALLABLE], +[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) +_LTDL_INSTALLABLE]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) + + +# _LTDL_INSTALLABLE +# ----------------- +# Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). +m4_defun([_LTDL_INSTALLABLE], +[if test -f "$prefix/lib/libltdl.la"; then + lt_save_LDFLAGS=$LDFLAGS + LDFLAGS="-L$prefix/lib $LDFLAGS" + AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) + LDFLAGS=$lt_save_LDFLAGS + if test yes = "${lt_lib_ltdl-no}"; then + if test yes != "$enable_ltdl_install"; then + # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install + AC_MSG_WARN([not overwriting libltdl at $prefix, force with '--enable-ltdl-install']) + enable_ltdl_install=no + fi + elif test no = "$enable_ltdl_install"; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + fi +fi + +# If configure.ac declared an installable ltdl, and the user didn't override +# with --disable-ltdl-install, we will install the shipped libltdl. +case $enable_ltdl_install in + no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL=-lltdl + LTDLDEPS= + LTDLINCL= + ;; + *) enable_ltdl_install=yes + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" + LTDLDEPS=$LIBLTDL + LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" + ;; +esac + +AC_SUBST([LIBLTDL]) +AC_SUBST([LTDLDEPS]) +AC_SUBST([LTDLINCL]) + +# For backwards non-gettext consistent compatibility... +INCLTDL=$LTDLINCL +AC_SUBST([INCLTDL]) +])# LTDL_INSTALLABLE + + +# _LTDL_MODE_DISPATCH +# ------------------- +m4_define([_LTDL_MODE_DISPATCH], +[dnl If _LTDL_DIR is '.', then we are configuring libltdl itself: +m4_if(_LTDL_DIR, [], + [], + dnl if _LTDL_MODE was not set already, the default value is 'subproject': + [m4_case(m4_default(_LTDL_MODE, [subproject]), + [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) + _LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir])], + [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir; lt_libobj_prefix=$lt_ltdl_dir/])], + [recursive], [], + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl +dnl Be careful not to expand twice: +m4_define([$0], []) +])# _LTDL_MODE_DISPATCH + + +# _LT_LIBOBJ(MODULE_NAME) +# ----------------------- +# Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead +# of into LIBOBJS. +AC_DEFUN([_LT_LIBOBJ], [ + m4_pattern_allow([^_LT_LIBOBJS$]) + _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" +])# _LT_LIBOBJS + + +# LTDL_INIT([OPTIONS]) +# -------------------- +# Clients of libltdl can use this macro to allow the installer to +# choose between a shipped copy of the ltdl sources or a preinstalled +# version of the library. If the shipped ltdl sources are not in a +# subdirectory named libltdl, the directory name must be given by +# LT_CONFIG_LTDL_DIR. +AC_DEFUN([LTDL_INIT], +[dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +dnl We need to keep our own list of libobjs separate from our parent project, +dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while +dnl we look for our own LIBOBJs. +m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) +m4_pushdef([AC_LIBSOURCES]) + +dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: +m4_if(_LTDL_MODE, [], + [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) + m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) + +AC_ARG_WITH([included_ltdl], + [AS_HELP_STRING([--with-included-ltdl], + [use the GNU ltdl sources included here])]) + +if test yes != "$with_included_ltdl"; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_DECL([lt_dlinterface_register], + [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], + [with_included_ltdl=no], + [with_included_ltdl=yes])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT + #include ])], + [with_included_ltdl=yes], + [AC_INCLUDES_DEFAULT] + ) +fi + +dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE +dnl was called yet, then for old times' sake, we assume libltdl is in an +dnl eponymous directory: +AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) + +AC_ARG_WITH([ltdl_include], + [AS_HELP_STRING([--with-ltdl-include=DIR], + [use the ltdl headers installed in DIR])]) + +if test -n "$with_ltdl_include"; then + if test -f "$with_ltdl_include/ltdl.h"; then : + else + AC_MSG_ERROR([invalid ltdl include directory: '$with_ltdl_include']) + fi +else + with_ltdl_include=no +fi + +AC_ARG_WITH([ltdl_lib], + [AS_HELP_STRING([--with-ltdl-lib=DIR], + [use the libltdl.la installed in DIR])]) + +if test -n "$with_ltdl_lib"; then + if test -f "$with_ltdl_lib/libltdl.la"; then : + else + AC_MSG_ERROR([invalid ltdl library directory: '$with_ltdl_lib']) + fi +else + with_ltdl_lib=no +fi + +case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in + ,yes,no,no,) + m4_case(m4_default(_LTDL_TYPE, [convenience]), + [convenience], [_LTDL_CONVENIENCE], + [installable], [_LTDL_INSTALLABLE], + [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) + ;; + ,no,no,no,) + # If the included ltdl is not to be used, then use the + # preinstalled libltdl we found. + AC_DEFINE([HAVE_LTDL], [1], + [Define this if a modern libltdl is already installed]) + LIBLTDL=-lltdl + LTDLDEPS= + LTDLINCL= + ;; + ,no*,no,*) + AC_MSG_ERROR(['--with-ltdl-include' and '--with-ltdl-lib' options must be used together]) + ;; + *) with_included_ltdl=no + LIBLTDL="-L$with_ltdl_lib -lltdl" + LTDLDEPS= + LTDLINCL=-I$with_ltdl_include + ;; +esac +INCLTDL=$LTDLINCL + +# Report our decision... +AC_MSG_CHECKING([where to find libltdl headers]) +AC_MSG_RESULT([$LTDLINCL]) +AC_MSG_CHECKING([where to find libltdl library]) +AC_MSG_RESULT([$LIBLTDL]) + +_LTDL_SETUP + +dnl restore autoconf definition. +m4_popdef([AC_LIBOBJ]) +m4_popdef([AC_LIBSOURCES]) + +AC_CONFIG_COMMANDS_PRE([ + _ltdl_libobjs= + _ltdl_ltlibobjs= + if test -n "$_LT_LIBOBJS"; then + # Remove the extension. + _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do + _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" + _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" + done + fi + AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) + AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) +]) + +# Only expand once: +m4_define([LTDL_INIT]) +])# LTDL_INIT + +# Old names: +AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) +AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) +AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIB_LTDL], []) +dnl AC_DEFUN([AC_WITH_LTDL], []) +dnl AC_DEFUN([LT_WITH_LTDL], []) + + +# _LTDL_SETUP +# ----------- +# Perform all the checks necessary for compilation of the ltdl objects +# -- including compiler checks and header checks. This is a public +# interface mainly for the benefit of libltdl's own configure.ac, most +# other users should call LTDL_INIT instead. +AC_DEFUN([_LTDL_SETUP], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_SYS_MODULE_EXT])dnl +AC_REQUIRE([LT_SYS_MODULE_PATH])dnl +AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl +AC_REQUIRE([LT_LIB_DLLOAD])dnl +AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl +AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl +AC_REQUIRE([LT_FUNC_ARGZ])dnl + +m4_require([_LT_CHECK_OBJDIR])dnl +m4_require([_LT_HEADER_DLFCN])dnl +m4_require([_LT_CHECK_DLPREOPEN])dnl +m4_require([_LT_DECL_SED])dnl + +dnl Don't require this, or it will be expanded earlier than the code +dnl that sets the variables it relies on: +_LT_ENABLE_INSTALL + +dnl _LTDL_MODE specific code must be called at least once: +_LTDL_MODE_DISPATCH + +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS +# the user used. This is so that ltdl.h can pick up the parent projects +# config.h file, The first file in AC_CONFIG_HEADERS must contain the +# definitions required by ltdl.c. +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). +AC_CONFIG_COMMANDS_PRE([dnl +m4_pattern_allow([^LT_CONFIG_H$])dnl +m4_ifset([AH_HEADER], + [LT_CONFIG_H=AH_HEADER], + [m4_ifset([AC_LIST_HEADERS], + [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's|^[[ ]]*||;s|[[ :]].*$||'`], + [])])]) +AC_SUBST([LT_CONFIG_H]) + +AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], + [], [], [AC_INCLUDES_DEFAULT]) + +AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) +AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) + +m4_pattern_allow([LT_LIBEXT])dnl +AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) + +name= +eval "lt_libprefix=\"$libname_spec\"" +m4_pattern_allow([LT_LIBPREFIX])dnl +AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) + +name=ltdl +eval "LTDLOPEN=\"$libname_spec\"" +AC_SUBST([LTDLOPEN]) +])# _LTDL_SETUP + + +# _LT_ENABLE_INSTALL +# ------------------ +m4_define([_LT_ENABLE_INSTALL], +[AC_ARG_ENABLE([ltdl-install], + [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) + +case ,$enable_ltdl_install,$enable_ltdl_convenience in + *yes*) ;; + *) enable_ltdl_convenience=yes ;; +esac + +m4_ifdef([AM_CONDITIONAL], +[AM_CONDITIONAL(INSTALL_LTDL, test no != "${enable_ltdl_install-no}") + AM_CONDITIONAL(CONVENIENCE_LTDL, test no != "${enable_ltdl_convenience-no}")]) +])# _LT_ENABLE_INSTALL + + +# LT_SYS_DLOPEN_DEPLIBS +# --------------------- +AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_CACHE_CHECK([whether deplibs are loaded by dlopen], + [lt_cv_sys_dlopen_deplibs], + [# PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + lt_cv_sys_dlopen_deplibs=unknown + case $host_os in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this 'case' here to explicitly catch those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + aix[[4-9]]*) + lt_cv_sys_dlopen_deplibs=yes + ;; + amigaos*) + case $host_cpu in + powerpc) + lt_cv_sys_dlopen_deplibs=no + ;; + esac + ;; + bitrig*) + lt_cv_sys_dlopen_deplibs=yes + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + lt_cv_sys_dlopen_deplibs=yes + ;; + freebsd* | dragonfly*) + lt_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + lt_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + lt_cv_sys_dlopen_deplibs=yes + ;; + interix*) + lt_cv_sys_dlopen_deplibs=yes + ;; + irix[[12345]]*|irix6.[[01]]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + lt_cv_sys_dlopen_deplibs=yes + ;; + netbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + osf[[1234]]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explicitly say 'no'. + lt_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to 'yes'. Without it, it would be 'no'. + lt_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say 'yes'. + lt_cv_sys_dlopen_deplibs=yes + ;; + qnx*) + lt_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + lt_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac + ]) +if test yes != "$lt_cv_sys_dlopen_deplibs"; then + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], + [Define if the OS needs help to load dependent libraries for dlopen().]) +fi +])# LT_SYS_DLOPEN_DEPLIBS + +# Old name: +AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) + + +# LT_SYS_MODULE_EXT +# ----------------- +AC_DEFUN([LT_SYS_MODULE_EXT], +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([what extension is used for runtime loadable modules], + [libltdl_cv_shlibext], +[ +module=yes +eval libltdl_cv_shlibext=$shrext_cmds +module=no +eval libltdl_cv_shrext=$shrext_cmds + ]) +if test -n "$libltdl_cv_shlibext"; then + m4_pattern_allow([LT_MODULE_EXT])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], + [Define to the extension used for runtime loadable modules, say, ".so".]) +fi +if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then + m4_pattern_allow([LT_SHARED_EXT])dnl + AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], + [Define to the shared library suffix, say, ".dylib".]) +fi +if test -n "$shared_archive_member_spec"; then + m4_pattern_allow([LT_SHARED_LIB_MEMBER])dnl + AC_DEFINE_UNQUOTED([LT_SHARED_LIB_MEMBER], ["($shared_archive_member_spec.o)"], + [Define to the shared archive member specification, say "(shr.o)".]) +fi +])# LT_SYS_MODULE_EXT + +# Old name: +AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) + + +# LT_SYS_MODULE_PATH +# ------------------ +AC_DEFUN([LT_SYS_MODULE_PATH], +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([what variable specifies run-time module search path], + [lt_cv_module_path_var], [lt_cv_module_path_var=$shlibpath_var]) +if test -n "$lt_cv_module_path_var"; then + m4_pattern_allow([LT_MODULE_PATH_VAR])dnl + AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], + [Define to the name of the environment variable that determines the run-time module search path.]) +fi +])# LT_SYS_MODULE_PATH + +# Old name: +AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) + + +# LT_SYS_DLSEARCH_PATH +# -------------------- +AC_DEFUN([LT_SYS_DLSEARCH_PATH], +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +AC_CACHE_CHECK([for the default library search path], + [lt_cv_sys_dlsearch_path], + [lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec]) +if test -n "$lt_cv_sys_dlsearch_path"; then + sys_dlsearch_path= + for dir in $lt_cv_sys_dlsearch_path; do + if test -z "$sys_dlsearch_path"; then + sys_dlsearch_path=$dir + else + sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir + fi + done + m4_pattern_allow([LT_DLSEARCH_PATH])dnl + AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], + [Define to the system default library search path.]) +fi +])# LT_SYS_DLSEARCH_PATH + +# Old name: +AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) + + +# _LT_CHECK_DLPREOPEN +# ------------------- +m4_defun([_LT_CHECK_DLPREOPEN], +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], + [libltdl_cv_preloaded_symbols], + [if test -n "$lt_cv_sys_global_symbol_pipe"; then + libltdl_cv_preloaded_symbols=yes + else + libltdl_cv_preloaded_symbols=no + fi + ]) +if test yes = "$libltdl_cv_preloaded_symbols"; then + AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], + [Define if libtool can extract symbol lists from object files.]) +fi +])# _LT_CHECK_DLPREOPEN + + +# LT_LIB_DLLOAD +# ------------- +AC_DEFUN([LT_LIB_DLLOAD], +[m4_pattern_allow([^LT_DLLOADERS$]) +LT_DLLOADERS= +AC_SUBST([LT_DLLOADERS]) + +AC_LANG_PUSH([C]) +lt_dlload_save_LIBS=$LIBS + +LIBADD_DLOPEN= +AC_SEARCH_LIBS([dlopen], [dl], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + if test "$ac_cv_search_dlopen" != "none required"; then + LIBADD_DLOPEN=-ldl + fi + libltdl_cv_lib_dl_dlopen=yes + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H +# include +#endif + ]], [[dlopen(0, 0);]])], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + libltdl_cv_func_dlopen=yes + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) +if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" +then + lt_save_LIBS=$LIBS + LIBS="$LIBS $LIBADD_DLOPEN" + AC_CHECK_FUNCS([dlerror]) + LIBS=$lt_save_LIBS +fi +AC_SUBST([LIBADD_DLOPEN]) + +LIBADD_SHL_LOAD= +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" + LIBADD_SHL_LOAD=-ldld])]) +AC_SUBST([LIBADD_SHL_LOAD]) + +case $host_os in +darwin[[1567]].*) +# We only want this for pre-Mac OS X 10.4. + AC_CHECK_FUNC([_dyld_func_lookup], + [AC_DEFINE([HAVE_DYLD], [1], + [Define if you have the _dyld_func_lookup function.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) + ;; +beos*) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" + ;; +cygwin* | mingw* | pw32*) + AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" + ;; +esac + +AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) +AC_SUBST([LIBADD_DLD_LINK]) + +m4_pattern_allow([^LT_DLPREOPEN$]) +LT_DLPREOPEN= +if test -n "$LT_DLLOADERS" +then + for lt_loader in $LT_DLLOADERS; do + LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " + done + AC_DEFINE([HAVE_LIBDLLOADER], [1], + [Define if libdlloader will be built on this platform]) +fi +AC_SUBST([LT_DLPREOPEN]) + +dnl This isn't used anymore, but set it for backwards compatibility +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" +AC_SUBST([LIBADD_DL]) + +LIBS=$lt_dlload_save_LIBS +AC_LANG_POP +])# LT_LIB_DLLOAD + +# Old name: +AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_DLLIB], []) + + +# LT_SYS_SYMBOL_USCORE +# -------------------- +# does the compiler prefix global symbols with an underscore? +AC_DEFUN([LT_SYS_SYMBOL_USCORE], +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +AC_CACHE_CHECK([for _ prefix in compiled symbols], + [lt_cv_sys_symbol_underscore], + [lt_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext <<_LT_EOF +void nm_test_func(){} +int main(){nm_test_func;return 0;} +_LT_EOF + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + ac_nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + lt_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.c >&AS_MESSAGE_LOG_FD + fi + rm -rf conftest* + ]) + sys_symbol_underscore=$lt_cv_sys_symbol_underscore + AC_SUBST([sys_symbol_underscore]) +])# LT_SYS_SYMBOL_USCORE + +# Old name: +AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) + + +# LT_FUNC_DLSYM_USCORE +# -------------------- +AC_DEFUN([LT_FUNC_DLSYM_USCORE], +[AC_REQUIRE([_LT_COMPILER_PIC])dnl for lt_prog_compiler_wl +AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl for lt_cv_sys_symbol_underscore +AC_REQUIRE([LT_SYS_MODULE_EXT])dnl for libltdl_cv_shlibext +if test yes = "$lt_cv_sys_symbol_underscore"; then + if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then + AC_CACHE_CHECK([whether we have to add an underscore for dlsym], + [libltdl_cv_need_uscore], + [libltdl_cv_need_uscore=unknown + dlsym_uscore_save_LIBS=$LIBS + LIBS="$LIBS $LIBADD_DLOPEN" + libname=conftmod # stay within 8.3 filename limits! + cat >$libname.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" +/* 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; }] +_LT_EOF + + # ltfn_module_cmds module_cmds + # Execute tilde-delimited MODULE_CMDS with environment primed for + # $module_cmds or $archive_cmds type content. + ltfn_module_cmds () + {( # subshell avoids polluting parent global environment + module_cmds_save_ifs=$IFS; IFS='~' + for cmd in @S|@1; do + IFS=$module_cmds_save_ifs + libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext + rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. + major=; versuffix=; verstring=; deplibs= + ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= + eval $cmd + done + IFS=$module_cmds_save_ifs + )} + + # Compile a loadable module using libtool macro expansion results. + $CC $pic_flag -c $libname.$ac_ext + ltfn_module_cmds "${module_cmds:-$archive_cmds}" + + # Try to fetch fnord with dlsym(). + libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 + cat >conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" +#if HAVE_DLFCN_H +#include +#endif +#include +#ifndef RTLD_GLOBAL +# ifdef DL_GLOBAL +# define RTLD_GLOBAL DL_GLOBAL +# else +# define RTLD_GLOBAL 0 +# endif +#endif +#ifndef RTLD_NOW +# ifdef DL_NOW +# define RTLD_NOW DL_NOW +# else +# define RTLD_NOW 0 +# endif +#endif +int main () { + void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); + int status = $libltdl_dlunknown; + if (handle) { + if (dlsym (handle, "fnord")) + status = $libltdl_dlnouscore; + else { + if (dlsym (handle, "_fnord")) + status = $libltdl_dluscore; + else + puts (dlerror ()); + } + dlclose (handle); + } 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 + libltdl_status=$? + case x$libltdl_status in + x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; + x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; + x*) libltdl_cv_need_uscore=unknown ;; + esac + fi + rm -rf conftest* $libname* + LIBS=$dlsym_uscore_save_LIBS + ]) + fi +fi + +if test yes = "$libltdl_cv_need_uscore"; then + AC_DEFINE([NEED_USCORE], [1], + [Define if dlsym() requires a leading underscore in symbol names.]) +fi +])# LT_FUNC_DLSYM_USCORE + +# Old name: +AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|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]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# 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 +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +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` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + 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 --cflags --libs "$2" 2>&1` + else + $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 + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# 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 + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --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 + + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# 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 +])# PKG_CHECK_VAR + +# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +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.15.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.15.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001-2017 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_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[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-2017 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_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2017 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. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2017 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_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # 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 + shift + for 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 + # 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 + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This 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]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.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 +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$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])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +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: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# 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 +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +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: + +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: . + +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 +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +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. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2017 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. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2017 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_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.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 +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2017 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_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it 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 +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +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 +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2017 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_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2017 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) 2001-2017 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_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-2017 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 +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2017 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_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-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2017 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_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# 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' + +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 + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/addrconfig.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]) diff --git a/build/compile b/build/compile new file mode 100755 index 0000000..2ab71e4 --- /dev/null +++ b/build/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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 . + +# 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 or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +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 'write-file-hooks '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/build/config.guess b/build/config.guess new file mode 100755 index 0000000..2193702 --- /dev/null +++ b/build/config.guess @@ -0,0 +1,1473 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-05-27' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2017 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + 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 + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + 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-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # 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 + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build/config.sub b/build/config.sub new file mode 100755 index 0000000..40ea5df --- /dev/null +++ b/build/config.sub @@ -0,0 +1,1836 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2017 Free Software Foundation, Inc. + +timestamp='2017-04-02' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2017 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | wasm32 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + 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) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + wasm32) + basic_machine=wasm32-unknown + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + pru-*) + os=-elf + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build/depcomp b/build/depcomp new file mode 100755 index 0000000..b39f98f --- /dev/null +++ b/build/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1999-2017 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 . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build/install-sh b/build/install-sh new file mode 100755 index 0000000..0360b79 --- /dev/null +++ b/build/install-sh @@ -0,0 +1,501 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2016-01-11.22; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -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) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) 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. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + 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 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build/ltmain.sh b/build/ltmain.sh new file mode 100644 index 0000000..0f0a2da --- /dev/null +++ b/build/ltmain.sh @@ -0,0 +1,11147 @@ +#! /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 , 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 . + + +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 . + +# 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.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.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='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + 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 . + +# 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 '_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 . +GNU libtool home page: . +General help using GNU software: ." + 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 </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 . + $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 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 *) <_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 < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#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 <= 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 + # -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=*) + 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 </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: diff --git a/build/missing b/build/missing new file mode 100755 index 0000000..c6e3795 --- /dev/null +++ b/build/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2016-01-11.22; # UTC + +# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..9114a9f --- /dev/null +++ b/configure @@ -0,0 +1,22094 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for mpg123 1.25.10. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +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 + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +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 + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="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 +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + 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 -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 + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: maintainer@mpg123.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO 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'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +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 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='mpg123' +PACKAGE_TARNAME='mpg123' +PACKAGE_VERSION='1.25.10' +PACKAGE_STRING='mpg123 1.25.10' +PACKAGE_BUGREPORT='maintainer@mpg123.org' +PACKAGE_URL='' + +ac_unique_file="src/mpg123.c" +ac_unique_file="doc" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +WIN32_CODES_FALSE +WIN32_CODES_TRUE +BUILD_BUFFER_FALSE +BUILD_BUFFER_TRUE +BUILD_OPENAL_FALSE +BUILD_OPENAL_TRUE +BUILD_MINT_FALSE +BUILD_MINT_TRUE +BUILD_SGI_FALSE +BUILD_SGI_TRUE +BUILD_OS2_FALSE +BUILD_OS2_TRUE +BUILD_HP_FALSE +BUILD_HP_TRUE +BUILD_ARTS_FALSE +BUILD_ARTS_TRUE +BUILD_ALIB_FALSE +BUILD_ALIB_TRUE +BUILD_AIX_FALSE +BUILD_AIX_TRUE +BUILD_WIN32_WASAPI_FALSE +BUILD_WIN32_WASAPI_TRUE +BUILD_WIN32_FALSE +BUILD_WIN32_TRUE +BUILD_SUN_FALSE +BUILD_SUN_TRUE +BUILD_SNDIO_FALSE +BUILD_SNDIO_TRUE +BUILD_SDL_FALSE +BUILD_SDL_TRUE +BUILD_PULSE_FALSE +BUILD_PULSE_TRUE +BUILD_PORTAUDIO_FALSE +BUILD_PORTAUDIO_TRUE +BUILD_OSS_FALSE +BUILD_OSS_TRUE +BUILD_NAS_FALSE +BUILD_NAS_TRUE +BUILD_JACK_FALSE +BUILD_JACK_TRUE +BUILD_ESD_FALSE +BUILD_ESD_TRUE +BUILD_COREAUDIO_FALSE +BUILD_COREAUDIO_TRUE +BUILD_QSA_FALSE +BUILD_QSA_TRUE +BUILD_ALSA_FALSE +BUILD_ALSA_TRUE +BUILD_TINYALSA_FALSE +BUILD_TINYALSA_TRUE +BUILD_DUMMY_FALSE +BUILD_DUMMY_TRUE +output_modules_la +output_modules +HAVE_DUMMY_FALSE +HAVE_DUMMY_TRUE +DUMMY_CFLAGS +DUMMY_LDFLAGS +DUMMY_LIBS +HAVE_OPENAL_FALSE +HAVE_OPENAL_TRUE +OPENAL_CFLAGS +OPENAL_LDFLAGS +OPENAL_LIBS +HAVE_MINT_FALSE +HAVE_MINT_TRUE +MINT_CFLAGS +MINT_LDFLAGS +MINT_LIBS +HAVE_SGI_FALSE +HAVE_SGI_TRUE +SGI_CFLAGS +SGI_LDFLAGS +SGI_LIBS +HAVE_OS2_FALSE +HAVE_OS2_TRUE +OS2_CFLAGS +OS2_LDFLAGS +OS2_LIBS +HAVE_HP_FALSE +HAVE_HP_TRUE +HP_CFLAGS +HP_LDFLAGS +HP_LIBS +HAVE_ARTS_FALSE +HAVE_ARTS_TRUE +ARTS_CFLAGS +ARTS_LDFLAGS +ARTS_LIBS +HAVE_ALIB_FALSE +HAVE_ALIB_TRUE +ALIB_CFLAGS +ALIB_LDFLAGS +ALIB_LIBS +HAVE_AIX_FALSE +HAVE_AIX_TRUE +AIX_CFLAGS +AIX_LDFLAGS +AIX_LIBS +HAVE_NAS_FALSE +HAVE_NAS_TRUE +NAS_CFLAGS +NAS_LDFLAGS +NAS_LIBS +HAVE_SDL_FALSE +HAVE_SDL_TRUE +SDL_LDFLAGS +HAVE_PULSE_FALSE +HAVE_PULSE_TRUE +PULSE_LDFLAGS +HAVE_PORTAUDIO_FALSE +HAVE_PORTAUDIO_TRUE +PORTAUDIO_CFLAGS +PORTAUDIO_LDFLAGS +PORTAUDIO_LIBS +HAVE_JACK_FALSE +HAVE_JACK_TRUE +JACK_LDFLAGS +HAVE_ESD_FALSE +HAVE_ESD_TRUE +ESD_LDFLAGS +HAVE_WIN32_WASAPI_FALSE +HAVE_WIN32_WASAPI_TRUE +WIN32_WASAPI_CFLAGS +WIN32_WASAPI_LDFLAGS +WIN32_WASAPI_LIBS +HAVE_WIN32_FALSE +HAVE_WIN32_TRUE +WIN32_CFLAGS +WIN32_LDFLAGS +WIN32_LIBS +HAVE_SUN_FALSE +HAVE_SUN_TRUE +SUN_CFLAGS +SUN_LDFLAGS +SUN_LIBS +HAVE_SNDIO_FALSE +HAVE_SNDIO_TRUE +SNDIO_CFLAGS +SNDIO_LDFLAGS +SNDIO_LIBS +HAVE_COREAUDIO_FALSE +HAVE_COREAUDIO_TRUE +COREAUDIO_CFLAGS +COREAUDIO_LDFLAGS +COREAUDIO_LIBS +HAVE_OSS_FALSE +HAVE_OSS_TRUE +OSS_CFLAGS +OSS_LDFLAGS +OSS_LIBS +HAVE_QSA_FALSE +HAVE_QSA_TRUE +QSA_CFLAGS +QSA_LDFLAGS +QSA_LIBS +HAVE_ALSA_FALSE +HAVE_ALSA_TRUE +ALSA_CFLAGS +ALSA_LDFLAGS +ALSA_LIBS +HAVE_TINYALSA_FALSE +HAVE_TINYALSA_TRUE +TINYALSA_CFLAGS +TINYALSA_LDFLAGS +TINYALSA_LIBS +SDL_LIBS +SDL_CFLAGS +ESD_LIBS +ESD_CFLAGS +PULSE_LIBS +PULSE_CFLAGS +JACK_LIBS +JACK_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +DECODER_LOBJ +DECODER_OBJ +YASM_FORMAT +USE_YASM_FOR_AVX_FALSE +USE_YASM_FOR_AVX_TRUE +INCLUDE_SYS_TYPE_H +INCLUDE_STDLIB_H +INCLUDE_STDIO_H +LFS_LOBJ +YASMFLAGS +YASM +EXEC_LT_LDFLAGS +LT_LDFLAGS +HAVE_MODULES_FALSE +HAVE_MODULES_TRUE +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +EGREP +GREP +LIBM +CPP +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +CCASFLAGS +CCAS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +OUTAPI_VERSION +LIBOUT123_VERSION +API_VERSION +LIBMPG123_VERSION +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_modules +enable_static +enable_shared +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_debug +enable_nagging +enable_gapless +enable_fifo +enable_ipv6 +enable_network +enable_id3v2 +enable_string +enable_icy +enable_ntom +enable_downsample +enable_feeder +enable_messages +enable_new_huffman +enable_int_quality +enable_16bit +enable_8bit +enable_32bit +enable_real +enable_equalizer +with_cpu +enable_yasm +enable_ieeefloat +enable_buffer +enable_newoldwritesample +enable_layer1 +enable_layer2 +enable_layer3 +with_audio +with_default_audio +with_optimization +with_seektable +enable_largefile +enable_lfs_alias +enable_feature_report +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCAS +CCASFLAGS +CPP +LT_SYS_LIBRARY_PATH +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +JACK_CFLAGS +JACK_LIBS +PULSE_CFLAGS +PULSE_LIBS +ESD_CFLAGS +ESD_LIBS +SDL_CFLAGS +SDL_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +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 +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +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 mpg123 1.25.10 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --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] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/mpg123] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of mpg123 1.25.10:";; + esac + cat <<\_ACEOF + +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") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-modules=no/yes dynamically loadable output modules + --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-debug=no/yes turn on debugging + --enable-nagging=no/yes turn on GCC's pedantic nagging with error on warnings, does not include --enable-debug anymore + --enable-gapless=no/yes turn on gapless (enabled per default) + --enable-fifo=no/yes FIFO support for control interface (auto-enabled on linux) + --enable-ipv6=no/yes IPv6 support (actually any protocol your libc does with getaddrinfo) + --enable-network=no/yes network support (http streams / webradio) + --disable-id3v2=no/yes no ID3v2 parsing + --disable-string=no/yes no string API (this will disable ID3v2; main mpg123 won't build anymore) + --disable-icy=no/yes no ICY metainfo parsing/conversion (main mpg123 won't build!) + --disable-ntom=no/yes no flexible resampling + --disable-downsample=no/yes no downsampled decoding + --disable-feeder=no/yes no feeder decoding, no buffered readers + --disable-messages=no/yes no error/warning messages on the console + --enable-new-huffman=yes/no use new huffman decoding scheme by Taihei (faster on modern CPUs at least, so on by default) + --enable-int-quality=yes/no use rounding instead of fast truncation for integer output, where possible + --disable-16bit=no/yes no 16 bit integer output + --disable-8bit=no/yes no 8 bit integer output + --disable-32bit=no/yes no 32 bit integer output (also 24 bit) + --disable-real=no/yes no real (floating point) output + --disable-equalizer=no/yes no equalizer support + --enable-yasm=no/yes enforce yasm instad of default assembler for some optimizations (AVX, currently) + --enable-ieeefloat=yes/no use special hackery relying on IEEE 754 floating point storage format (to accurately round to 16 bit integer at bit more efficiently in generic decoder, enabled by default, disable in case you have a very special computer) + --enable-buffer=yes/no disable audio buffer code (default uses system whitelist... proper checks later) + --enable-newoldwritesample=no/yes enable new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on x86-32) + --disable-layer1=no/yes no layer I decoding + --disable-layer2=no/yes no layer II decoding + --disable-layer3=no/yes no layer III decoding + --disable-largefile omit support for large files + --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 or mpg123_seek_64 in addition to mpg123_seek, or the other way around; It is a mess, do not play with this!) + --disable-feature_report Disable feature report function + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --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-cpu=generic[_fpu] Use generic processor code with floating point arithmetic + --with-cpu=generic_float Plain alias to generic_fpu now... float output is a normal runtime option! + --with-cpu=generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM) + --with-cpu=generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding. + --with-cpu=i386[_fpu] Use code optimized for i386 processors with floating point arithmetic + --with-cpu=i386_nofpu Use code optimized for i386 processors with fixed point arithmetic + --with-cpu=i486 Use code optimized for i486 processors (only usable alone!) + --with-cpu=i586 Use code optimized for i586 processors + --with-cpu=i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size + --with-cpu=3dnow Use code optimized for 3DNow processors + --with-cpu=3dnow_vintage Use code optimized for older 3DNow processors (K6 family) + --with-cpu=3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon) + --with-cpu=3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate + --with-cpu=3dnow_vintage Use code optimized for older extended 3DNow processors (like K6-III+) + --with-cpu=mmx Use code optimized for MMX processors + --with-cpu=mmx_alone Really only MMX decoder, without i586 fallback for flexible rate + --with-cpu=sse Use code optimized for SSE processors + --with-cpu=sse_vintage Use code optimized for older SSE processors (plain C DCT36) + --with-cpu=sse_alone Really only SSE decoder, without i586 fallback for flexible rate + --with-cpu=avx Use code optimized for x86-64 with AVX processors + --with-cpu=x86 Pack all x86 opts into one binary (excluding i486, including dither) + --with-cpu=x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic) + --with-cpu=altivec Use code optimized for Altivec processors (PowerPC G4 and G5) + --with-cpu=ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic + --with-cpu=neon Use code optimized for ARM NEON SIMD engine (Cortex-A series) + --with-cpu=arm_fpu Pack neon and generic[_dither] decoders, for ARM processors with FPU and/or NEON + --with-cpu=arm_nofpu Use code optimized for ARM processors with fixed point arithmetic + --with-cpu=neon64 Use code optimized for AArch64 NEON SIMD engine + --with-cpu=aarch64 Pack neon64 and generic[_dither] decoders, for 64bit ARM processors + + + --with-audio= Select a list (or only one) of audio output modules (comma or space separated list). + + + --with-default-audio=aix Use AIX as default audio output sub-system + --with-default-audio=alib Use Alib as default audio output sub-system (for HPUX) + --with-default-audio=alsa Use ALSA as default audio output sub-system (libasound) + --with-default-audio=tinyalsa Use ALSA as default audio output sub-system (tinyalsa) + --with-default-audio=arts Use aRts as default audio output sub-system (KDE sound server) + --with-default-audio=dummy Use dummy as default audio (when no sound card is available) + --with-default-audio=esd Use ESoundD as default audio output sub-system + --with-default-audio=hp Use HP as default audio output sub-system + --with-default-audio=jack Use JACK as default low-latency audio server + --with-default-audio=coreaudio Use Mac OS X as default audio output sub-system (CoreAudio) + --with-default-audio=mint Use MinT as default audio output sub-system (Atari) + --with-default-audio=nas Use NAS as default audio output (Network Audio System) + --with-default-audio=os2 Use OS2 as default audio output sub-system + --with-default-audio=oss Use OSS as default audio output sub-system (/dev/dsp) + --with-default-audio=portaudio Use PortAudio as default audio output sub-system + --with-default-audio=pulse Use Pulse audio server as default audio output sub-system + --with-default-audio=qsa Use QSA as default audio output sub-system + --with-default-audio=sdl Use SDL as default audio output sub-system (Simple DirectMedia Layer) + --with-default-audio=sgi Use SGI as default audio output sub-system (IRIX) + --with-default-audio=sndio Use OpenBSD's sndio as default audio output sub-system + --with-default-audio=sun Use Sun as default audio output sub-system (/dev/audio) + --with-default-audio=win32 Use Win32 audio as default audio output sub-system + --with-default-audio=win32_wasapi Use Win32 wasapi audio as default audio output sub-system + + + --with-optimization=0 No Optimization + --with-optimization=1 Limited Optimization (-O) (for gcc) + --with-optimization=2 Default Optimization (-O2 ...) (for gcc) + --with-optimization=3 More Optimize than default (-O3 ...) (for gcc) + --with-optimization=4 Optimize yet more (-O4 ...) (for gcc) + + + --with-seektable= choose size of seek index table (0 disables it), default 1000 + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + 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 + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + JACK_CFLAGS C compiler flags for JACK, overriding pkg-config + JACK_LIBS linker flags for JACK, overriding pkg-config + PULSE_CFLAGS + C compiler flags for PULSE, overriding pkg-config + PULSE_LIBS linker flags for PULSE, overriding pkg-config + ESD_CFLAGS C compiler flags for ESD, overriding pkg-config + ESD_LIBS linker flags for ESD, overriding pkg-config + SDL_CFLAGS C compiler flags for SDL, overriding pkg-config + SDL_LIBS linker flags for SDL, 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. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +mpg123 configure 1.25.10 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # 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_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $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 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------ ## +## Report this to maintainer@mpg123.org ## +## ------------------------------------ ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $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 + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + 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. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* 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 $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext 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_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + 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 + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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_type + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 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 mpg123 $as_me 1.25.10, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " sys/param.h" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 + + + +API_VERSION=44 +LIB_PATCHLEVEL=8 + +OUTAPI_VERSION=2 +OUTLIB_PATCHLEVEL=2 + +LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION +LIBOUT123_VERSION=$OUTAPI_VERSION:$OUTLIB_PATCHLEVEL:$OUTAPI_VERSION + + + + + + + +ac_aux_dir= +for ac_dir in build "$srcdir"/build; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in build \"$srcdir\"/build" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +am__api_version='1.15' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +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` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +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+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + 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 + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +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_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # 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_AWK="$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 +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# 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." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='mpg123' + VERSION='1.25.10' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +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: +# +# +mkdir_p='$(MKDIR_P)' + +# 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 -' + + + + + + +# 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: + +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: . + +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 + +ac_config_headers="$ac_config_headers src/config.h" + + + +# You get strange symptoms like jack module build failing because the AC_C_CONST failed to detect the working const support. +# In that case, the test failed because -Werror, not because no const there... +# After looking again, there are possibly more tests being obscured by false failures. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Werror in CFLAGS (It breaks tests)" >&5 +$as_echo_n "checking for -Werror in CFLAGS (It breaks tests)... " >&6; } +if echo "$CFLAGS" | grep Werror; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You have -Werror in CFLAGS. That may break some tests and make this configure bogus. +If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc. +Also note that you shall not run make distcheck after configuring with --enable-nagging. +distcheck uses the generated CFLAGS... +Anyhow, continuing at your own risk." >&5 +$as_echo "$as_me: WARNING: You have -Werror in CFLAGS. That may break some tests and make this configure bogus. +If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc. +Also note that you shall not run make distcheck after configuring with --enable-nagging. +distcheck uses the generated CFLAGS... +Anyhow, continuing at your own risk." >&2;} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +buffer=enabled # try to build with buffer by default + + +LT_LDFLAGS=-export-dynamic +EXEC_LT_LDFLAGS= +be_static=no +all_static=no +lib_static=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if you are up to something totally static with LDFLAGS/CFLAGS" >&5 +$as_echo_n "checking if you are up to something totally static with LDFLAGS/CFLAGS... " >&6; } +for f in $LDFLAGS $CFLAGS +do + case "$f" in + -all-static) + be_static=yes + all_static=yes + lib_static=yes + ;; + -static) + be_static=yes + lib_static=yes + ;; + -static-libgcc) + lib_static=yes + ;; + esac +done +if test "x$be_static" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LT_LDFLAGS=-all-static + EXEC_LT_LDFLAGS="$LT_LDFLAGS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +if test "x$all_static" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. " >&5 +$as_echo "$as_me: WARNING: Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. " >&2;} +fi + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.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 + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +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 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}gcc" + $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 +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="gcc" + $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_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + 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 + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}cc" + $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 +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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 + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $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 + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_CC="$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 +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="$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_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + 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 + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 + +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 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + +depcc="$CCAS" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CCAS_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CCAS_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' +else + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= +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 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}gcc" + $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 +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="gcc" + $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_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + 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 + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}cc" + $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 +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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 + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $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 + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # 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_CC="$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 +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +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_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="$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_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + 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 + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 + +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 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +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 + + + +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 +$as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } +if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmw $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 _mwvalidcheckl (); +int +main () +{ +return _mwvalidcheckl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mw__mwvalidcheckl=yes +else + ac_cv_lib_mw__mwvalidcheckl=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_mw__mwvalidcheckl" >&5 +$as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } +if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : + LIBM=-lmw +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if ${ac_cv_lib_m_cos+:} 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. */ + +/* 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 cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=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_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes; then : + LIBM="$LIBM -lm" +fi + + ;; +*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if ${ac_cv_lib_m_cos+:} 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. */ + +/* 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 cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=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_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes; then : + LIBM=-lm +fi + + ;; +esac + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_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 grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_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 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_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_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_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 egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_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 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "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_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_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_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +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 +#include +#include +#include + +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 + +_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 + +_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 +#include +#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 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +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_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +if test "x$lib_static" = xyes; then + CC="$CC -static-libgcc" + CCLD="$CC" + echo "Adding -static-libgcc" +fi + + +modules=auto +OUTPUT_OBJ="module.\$(OBJEXT)" +# Check whether --enable-modules was given. +if test "${enable_modules+set}" = set; then : + enableval=$enable_modules; + if test "x$enableval" = xyes + then + modules=enabled + else + modules=disabled + fi + +else + + if test "x$be_static" = "xyes"; then + modules=disabled + else + modules=auto + fi + +fi + + +# 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 + + + + + + + + + +# 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 + + + + + + + + + + +if test x"$enable_shared" = xno; then + modules=disabled + LT_LDFLAGS= +else + +$as_echo "#define DYNAMIC_BUILD 1" >>confdefs.h + +fi + +for ac_header in windows.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + +fi + +done + + +if test x"$modules" = xdisabled +then + echo "Modules disabled, not checking for dynamic loading." +else + have_dl=no + # The dlopen() API is either in libc or in libdl. + if test x$ac_cv_header_windows_h = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if LoadLibrary should be used" >&5 +$as_echo_n "checking if LoadLibrary should be used... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef __CYGWIN__ +#error Cygwin should use dlopen +#endif + +#include + +int main() { + LoadLibraryW(0); + GetProcAddress(0, 0); + FreeLibrary(0); +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + have_dl=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using LoadLibrary" >&5 +$as_echo "Using LoadLibrary" >&6; } + +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_exeext conftest.$ac_ext + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if ${ac_cv_search_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$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 +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_dlopen+:} false; then : + break +fi +done +if ${ac_cv_search_dlopen+:} false; then : + +else + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + +fi + + + for ac_func in dlopen dlsym dlclose +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + have_dl=yes +fi +done + + fi + if test x"$modules" = xenabled -a x"$have_dl" = xno; then + as_fn_error $? "Modules enabled but no runtime loader found! This will not work..." "$LINENO" 5 + fi + if test x"$modules" = xauto; then + if test x"$have_dl" = xyes; then + modules=enabled + echo "We found a runtime loader: Modules enabled." + else + echo "We did not find a runtime loader: Modules disabled." + modules=disabled + fi + fi +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; 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_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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_AS="${ac_tool_prefix}as" + $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 +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; 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_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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_AS="as" + $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_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="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 + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + 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 + + 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 + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +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 + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# 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 &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 &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; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; 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, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# 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 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 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 +} + +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 + + + + + + +# 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 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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + 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 + + # 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="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +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 +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* 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 +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* 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"$modules" = xdisabled +then + echo "Modules disabled." +else + # Enable module support in source code + +$as_echo "#define USE_MODULES 1" >>confdefs.h + + # Export the module file suffix as LT_MODULE_EXT + { $as_echo "$as_me:${as_lineno-$LINENO}: checking what extension is used for runtime loadable modules" >&5 +$as_echo_n "checking what extension is used for runtime loadable modules... " >&6; } +if ${libltdl_cv_shlibext+:} false; then : + $as_echo_n "(cached) " >&6 +else + +module=yes +eval libltdl_cv_shlibext=$shrext_cmds +module=no +eval libltdl_cv_shrext=$shrext_cmds + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 +$as_echo "$libltdl_cv_shlibext" >&6; } +if test -n "$libltdl_cv_shlibext"; then + +cat >>confdefs.h <<_ACEOF +#define LT_MODULE_EXT "$libltdl_cv_shlibext" +_ACEOF + +fi +if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then + +cat >>confdefs.h <<_ACEOF +#define LT_SHARED_EXT "$libltdl_cv_shrext" +_ACEOF + +fi +if test -n "$shared_archive_member_spec"; then + +cat >>confdefs.h <<_ACEOF +#define LT_SHARED_LIB_MEMBER "($shared_archive_member_spec.o)" +_ACEOF + +fi + +fi + if test "x$modules" = xenabled ; then + HAVE_MODULES_TRUE= + HAVE_MODULES_FALSE='#' +else + HAVE_MODULES_TRUE='#' + HAVE_MODULES_FALSE= +fi + + + + + + +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; + if test "x$enableval" = xyes + then + debugging="enabled" + else + debugging="disabled" + fi + +else + debugging="disabled" + +fi + + +# Check whether --enable-nagging was given. +if test "${enable_nagging+set}" = set; then : + enableval=$enable_nagging; + if test "x$enableval" = xyes + then + nagging="enabled" + else + nagging="disabled" + fi + +else + nagging="disabled" + +fi + + +if test x"$debugging" = xenabled; then + +$as_echo "#define DEBUG 1" >>confdefs.h + +fi + +# Check whether --enable-gapless was given. +if test "${enable_gapless+set}" = set; then : + enableval=$enable_gapless; + if test "x$enableval" = xyes + then + gapless="enabled" + +$as_echo "#define GAPLESS 1" >>confdefs.h + + else + gapless="disabled" + fi + +else + + gapless="enabled" + +$as_echo "#define GAPLESS 1" >>confdefs.h + + + +fi + + +# Check whether --enable-fifo was given. +if test "${enable_fifo+set}" = set; then : + enableval=$enable_fifo; + if test "x$enableval" = xyes + then + fifo="enabled" + else + fifo="disabled" + fi + +else + + fifo="auto" + + +fi + + +# Check whether --enable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then : + enableval=$enable_ipv6; + if test "x$enableval" = xyes + then + ipv6="enabled" + else + ipv6="disabled" + fi + +else + + ipv6="auto" + + +fi + + +# Check whether --enable-network was given. +if test "${enable_network+set}" = set; then : + enableval=$enable_network; + if test "x$enableval" = xyes + then + network="enabled" + else + network="disabled" + fi + +else + + network="auto" + + +fi + + +s_fpu= +DECODER_OBJ= +DECODER_LOBJ= + + +id3v2=enabled +# Check whether --enable-id3v2 was given. +if test "${enable_id3v2+set}" = set; then : + enableval=$enable_id3v2; + if test "x$enableval" = xno; then + id3v2="disabled" + fi + +fi + + +# id3v2 depends on strings... so check that in between. +string=enabled +# Check whether --enable-string was given. +if test "${enable_string+set}" = set; then : + enableval=$enable_string; + if test "x$enableval" = xno; then + string="disabled" + fi + +fi + + +if test "x$string" = "xdisabled"; then + +$as_echo "#define NO_STRING 1" >>confdefs.h + + id3v2=disabled + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ID3v2 support disabled because of string API being disabled." >&5 +$as_echo "$as_me: WARNING: ID3v2 support disabled because of string API being disabled." >&2;} +else + DECODER_OBJ="$DECODER_OBJ stringbuf.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ stringbuf.lo" +fi + +if test "x$id3v2" = "xdisabled"; then + +$as_echo "#define NO_ID3V2 1" >>confdefs.h + +fi + +icy=enabled +# Check whether --enable-icy was given. +if test "${enable_icy+set}" = set; then : + enableval=$enable_icy; + if test "x$enableval" = xno; then + icy="disabled" + fi + +fi + + +if test "x$icy" = "xdisabled"; then + +$as_echo "#define NO_ICY 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ icy.\$(OBJEXT) icy2utf8.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ icy.lo icy2utf8.lo" +fi + +ntom=enabled +# Check whether --enable-ntom was given. +if test "${enable_ntom+set}" = set; then : + enableval=$enable_ntom; + if test "x$enableval" = xno; then + ntom="disabled" + fi + +fi + + +if test "x$ntom" = "xdisabled"; then + +$as_echo "#define NO_NTOM 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ ntom.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ ntom.lo" +fi + +downsample=enabled +# Check whether --enable-downsample was given. +if test "${enable_downsample+set}" = set; then : + enableval=$enable_downsample; + if test "x$enableval" = xno; then + downsample="disabled" + fi + +fi + + +if test "x$downsample" = "xdisabled"; then + +$as_echo "#define NO_DOWNSAMPLE 1" >>confdefs.h + +fi + +feeder=enabled +# Check whether --enable-feeder was given. +if test "${enable_feeder+set}" = set; then : + enableval=$enable_feeder; + if test "x$enableval" = xno; then + feeder="disabled" + fi + +fi + + +if test "x$feeder" = "xdisabled"; then + +$as_echo "#define NO_FEEDER 1" >>confdefs.h + +fi + +messages=enabled +# Check whether --enable-messages was given. +if test "${enable_messages+set}" = set; then : + enableval=$enable_messages; + if test "x$enableval" = xno; then + messages="disabled" + fi + +fi + + +if test "x$messages" = "xdisabled"; then + +$as_echo "#define NO_WARNING 1" >>confdefs.h + + +$as_echo "#define NO_ERRORMSG 1" >>confdefs.h + + +$as_echo "#define NO_ERETURN 1" >>confdefs.h + +fi + +newhuff=enabled +# Check whether --enable-new-huffman was given. +if test "${enable_new_huffman+set}" = set; then : + enableval=$enable_new_huffman; + if test "x$enableval" = xno; then + newhuff=disabled + fi + + +fi + + +if test "x$newhuff" = "xenabled"; then + +$as_echo "#define USE_NEW_HUFFTABLE 1" >>confdefs.h + +fi + +integers=fast +# Check whether --enable-int-quality was given. +if test "${enable_int_quality+set}" = set; then : + enableval=$enable_int_quality; + if test "x$enableval" = xyes; then + integers=quality + +$as_echo "#define ACCURATE_ROUNDING 1" >>confdefs.h + + fi + +fi + + +int16=enabled +# Check whether --enable-16bit was given. +if test "${enable_16bit+set}" = set; then : + enableval=$enable_16bit; + if test "x$enableval" = xno; then + int16="disabled" + fi + +fi + + +int8=enabled +# Check whether --enable-8bit was given. +if test "${enable_8bit+set}" = set; then : + enableval=$enable_8bit; + if test "x$enableval" = xno; then + int8="disabled" + fi + +fi + + +int32=enabled +# Check whether --enable-32bit was given. +if test "${enable_32bit+set}" = set; then : + enableval=$enable_32bit; + if test "x$enableval" = xno; then + int32="disabled" + fi + +fi + + +real=enabled +# Check whether --enable-real was given. +if test "${enable_real+set}" = set; then : + enableval=$enable_real; + if test "x$enableval" = xno; then + real="disabled" + fi + +fi + + +equalizer=enabled +# Check whether --enable-equalizer was given. +if test "${enable_equalizer+set}" = set; then : + enableval=$enable_equalizer; + if test "x$enableval" = xno; then + equalizer="disabled" + fi + +fi + + + + +# Check whether --with-cpu was given. +if test "${with_cpu+set}" = set; then : + withval=$with_cpu; +fi + + +use_yasm=auto +# Check whether --enable-yasm was given. +if test "${enable_yasm+set}" = set; then : + enableval=$enable_yasm; + if test "x$enableval" = xyes; then + use_yasm="enabled" + else + use_yasm="disabled" + fi + +fi + + +# Check whether --enable-ieeefloat was given. +if test "${enable_ieeefloat+set}" = set; then : + enableval=$enable_ieeefloat; + if test "x$enableval" = xyes; then + ieee=enabled + else + ieee=disabled + fi + +else + ieee=enabled +fi + + +if test "x$ieee" = xenabled; then + echo "We assume IEEE754 floating point format." + +$as_echo "#define IEEE_FLOAT 1" >>confdefs.h + +fi + +sys_cppflags= +newoldwritesample=disabled +case $host in + aarch64-*linux*|arm64-*linux*|aarch64-*bsd*|arm64-*bsd*|aarch64-apple-darwin*|arm64-apple-darwin*) + cpu_type="aarch64" + ;; + arm*-*-linux*-*eabihf|armv7hl*-*-linux*) + cpu_type="arm_fpu" + ;; + arm*-*-linux*) + # check that... perhaps we are better off on arm with kernel math emulation + cpu_type="arm_nofpu" + ;; + armv7*-apple-darwin*) + cpu_type="arm_fpu" + ;; + i386-*-linux*|i386-*-kfreebsd*-gnu) + cpu_type="i386_fpu" + newoldwritesample=enabled + ;; + i486-*-linux*|i486-*-kfreebsd*-gnu) + cpu_type="i486" + newoldwritesample=enabled + ;; + i586-*-linux*|i586-*-kfreebsd*-gnu) + cpu_type="x86" + newoldwritesample=enabled + ;; + i686-*-linux*|i686-*-kfreebsd*-gnu) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-linux*|x86_64-*-kfreebsd*-gnu) + cpu_type="x86-64" + ;; + *-*-linux*|*-*-kfreebsd*-gnu) + cpu_type="generic_fpu" + ;; + i?86-apple-darwin10*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CPU type supports x86-64" >&5 +$as_echo_n "checking if CPU type supports x86-64... " >&6; } + case `sysctl -n hw.optional.x86_64` in + 1) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + cpu_type="x86-64" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cpu_type="x86" + newoldwritesample=enabled + ;; + esac + ;; + i?86-apple-darwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-apple-darwin*) + cpu_type="x86-64" + ;; + *-apple-darwin*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CPU type supports AltiVec" >&5 +$as_echo_n "checking if CPU type supports AltiVec... " >&6; } + case `machine` in + ppc7400 | ppc7450 | ppc970) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + cpu_type="altivec" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cpu_type="generic_fpu" + ;; + esac + ;; + i?86-*-dragonfly* | i?86-*-freebsd* | i?86-*-midnightbsd* | i?86-*-mirbsd* | i?86-*-netbsd* | i?86-*-openbsd* | i?86-*-haiku*) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-dragonfly* | x86_64-*-freebsd* | x86_64-*-midnightbsd* | x86_64-*-mirbsd* | x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-haiku*) + cpu_type="x86-64" + ;; + *-*-dragonfly* | *-*-freebsd* | *-*-midnightbsd* | *-*-mirbsd* | *-*-netbsd* | *-*-openbsd*) + cpu_type="generic_fpu" + ;; + i386-*-solaris*) + cpu_type=x86 + newoldwritesample=enabled + ;; + x86_64-*-solaris*) + cpu_type=x86-64 + ;; + *-*-solaris*) + cpu_type="generic_fpu" + ;; + # os2-emx = OS/2 with some Unix fun; so p.ex. buffer works. + # Till we sorted out the assembler troubles, generic CPU is default. + i386-pc-os2-emx) + cpu_type=generic_fpu + newoldwritesample=enabled + ;; + x86_64-pc-os2-emx) + # We are optimistic hat the future knows OS/2 on x86-64;-) + cpu_type=generic_fpu + ;; + *-pc-os2-emx) + cpu_type="generic_fpu" + ;; + *-dec-osf*) + cpu_type="generic_fpu" + ;; + x86_64-*-cygwin*) + cpu_type="x86-64" + ;; + i686-*-cygwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + i586-*-cygwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + i486-*-cygwin*) + cpu_type="i486" + newoldwritesample=enabled + ;; + i386-*-cygwin*) + cpu_type="i386" + newoldwritesample=enabled + ;; + *-cygwin*) + cpu_type="generic_fpu" + ;; + i[3-7]86-*-mingw32*) + LIBS="$LIBS" + buffer=disabled + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-mingw32*) + LIBS="$LIBS" + buffer=disabled + cpu_type="x86-64" + ;; + i386-*-nto-qnx*) + cpu_type="x86" + newoldwritesample=enabled + ;; + *-ibm-aix*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: AIX system detected. You might want to --disable-largefile when trouble about conflicting types for lseek64 and friends occurs." >&5 +$as_echo "$as_me: WARNING: AIX system detected. You might want to --disable-largefile when trouble about conflicting types for lseek64 and friends occurs." >&2;} + # Altivec instead? It is developed for MacOS ... + cpu_type=generic_fpu + # no struct winsize without _ALL_SOURCE + sys_cppflags=-D_ALL_SOURCE + ;; + i386-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="i386" + buffer=disabled + sys_cppflags=-DGENERIC + newoldwritesample=enabled + ;; + i486-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="i486" + buffer=disabled + sys_cppflags=-DGENERIC + newoldwritesample=enabled + ;; + i586-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="x86" + buffer=disabled + sys_cppflags=-DGENERIC + newoldwritesample=enabled + ;; + i686-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="x86" + buffer=disabled + sys_cppflags=-DGENERIC + newoldwritesample=enabled + ;; + x86_64-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="x86-64" + buffer=disabled + sys_cppflags=-DGENERIC + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="generic_fpu" + buffer=disabled + sys_cppflags=-DGENERIC + ;; +esac + +# Check whether --enable-buffer was given. +if test "${enable_buffer+set}" = set; then : + enableval=$enable_buffer; + if test "x$enableval" = xyes + then + echo "Note: Enabling buffer per request... perhaps it will not build anyway." + buffer="enabled" + else + echo "Note: Disabling buffer per request." + buffer="disabled" + fi + + +fi + + +# Check whether --enable-newoldwritesample was given. +if test "${enable_newoldwritesample+set}" = set; then : + enableval=$enable_newoldwritesample; + if test "x$enableval" = xyes + then + newoldwritesample=enabled + else + newoldwritesample=disabled + fi + +fi + + +if test "x$with_cpu" != "x"; then + cpu_type=$with_cpu +fi + +# Flag for 32 bit synth output or post-processing. +case "$cpu_type" in +*_nofpu) + synth32=false + +$as_echo "#define NO_SYNTH32 1" >>confdefs.h + +;; +*) + synth32=true +;; +esac + +if test "x$int16" = "xdisabled"; then + +$as_echo "#define NO_16BIT 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ synth.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ synth.lo" +fi + +# 8bit works only through 16bit +if test "x$int16" = "xdisabled"; then + int8=disabled +fi +if test "x$int8" = "xdisabled"; then + +$as_echo "#define NO_8BIT 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ synth_8bit.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ synth_8bit.lo" +fi + +if test "x$int32" = "xdisabled"; then + +$as_echo "#define NO_32BIT 1" >>confdefs.h + +else + if $synth32; then + s_fpu="$s_fpu synth_s32" + fi +fi + +if test "x$real" = "xdisabled"; then + +$as_echo "#define NO_REAL 1" >>confdefs.h + +else + if $synth32; then + s_fpu="$s_fpu synth_real" + fi +fi + +if test "x$equalizer" = "xdisabled"; then + +$as_echo "#define NO_EQUALIZER 1" >>confdefs.h + +fi + +layer1=enabled +# Check whether --enable-layer1 was given. +if test "${enable_layer1+set}" = set; then : + enableval=$enable_layer1; + if test "x$enableval" = xno; then + layer1="disabled" + fi + +fi + + +if test "x$layer1" = "xdisabled"; then + +$as_echo "#define NO_LAYER1 1" >>confdefs.h + +else + # layer1 needs code in layer2 + DECODER_OBJ="$DECODER_OBJ layer1.\$(OBJEXT) layer2.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer1.lo layer2.lo" +fi + +layer2=enabled +# Check whether --enable-layer2 was given. +if test "${enable_layer2+set}" = set; then : + enableval=$enable_layer2; + if test "x$enableval" = xno; then + layer2="disabled" + fi + +fi + + +if test "x$layer2" = "xdisabled"; then + +$as_echo "#define NO_LAYER2 1" >>confdefs.h + +else + # layer1 may have added the objects already + if test "x$layer1" = "xdisabled"; then + DECODER_OBJ="$DECODER_OBJ layer2.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer2.lo" + fi +fi + +layer3=enabled +# Check whether --enable-layer3 was given. +if test "${enable_layer3+set}" = set; then : + enableval=$enable_layer3; + if test "x$enableval" = xno; then + layer3="disabled" + fi + +fi + + +if test "x$layer3" = "xdisabled"; then + +$as_echo "#define NO_LAYER3 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ layer3.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer3.lo" +fi + + +# Check whether --with-audio was given. +if test "${with_audio+set}" = set; then : + withval=$with_audio; +fi + + +# Check whether --with-default-audio was given. +if test "${with_default_audio+set}" = set; then : + withval=$with_default_audio; +fi + + + +# Check whether --with-optimization was given. +if test "${with_optimization+set}" = set; then : + withval=$with_optimization; +fi + + + +# Check whether --with-seektable was given. +if test "${with_seektable+set}" = set; then : + withval=$with_seektable; +fi + + + + +# Dummy audio output module is always supported +output_modules="dummy" + + +# based on posting from John Dalgliesh on ffmpeg (LGPL) mailing list +# extended to use balign if present +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if .balign is present" >&5 +$as_echo_n "checking if .balign is present... " >&6; } +echo '.balign 4' > conftest.s +if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define ASMALIGN_BALIGN 1" >>confdefs.h + + +else + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +# find if .align arg is power-of-two or not +asmalign_exp="unknown" +if test x"$asmalign_exp" = xunknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if .align takes 2-exponent" >&5 +$as_echo_n "checking if .align takes 2-exponent... " >&6; } + asmalign_exp="no" + echo '.align 3' > conftest.s + if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then + asmalign_exp="yes" + { $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 + rm -f conftest.o conftest.s +fi +if test x"$asmalign_exp" = xyes; then + +$as_echo "#define ASMALIGN_EXP 1" >>confdefs.h + +else + +$as_echo "#define ASMALIGN_BYTE 1" >>confdefs.h + +fi + +fi + +ccalign="unknown" +if test x"$ccalign" = xunknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking __attribute__((aligned(16)))" >&5 +$as_echo_n "checking __attribute__((aligned(16)))... " >&6; } + ccalign="no" + echo '__attribute__((aligned(16))) float var;' > conftest.c + if $CC -c -o conftest.o conftest.c >/dev/null 2>&1; then + ccalign="yes" + { $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 + rm -f conftest.o conftest.c +fi + + +avx_support="unknown" +if test x"$avx_support" = xunknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if assembler supports AVX instructions" >&5 +$as_echo_n "checking if assembler supports AVX instructions... " >&6; } + avx_support="no" + echo '.text' > conftest.s + echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s + if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then + avx_support="yes" + { $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 + rm -f conftest.o conftest.s +fi + +check_yasm=no +if test x"$avx_support" = xno || test x"$use_yasm" = xenabled; then + check_yasm=yes +fi +if test x"$use_yasm" = xdisabled; then + check_yasm=no +fi + +if test x"$check_yasm" = xyes; then + for ac_prog in yasm +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_YASM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YASM"; then + ac_cv_prog_YASM="$YASM" # 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_YASM="$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 +YASM=$ac_cv_prog_YASM +if test -n "$YASM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YASM" >&5 +$as_echo "$YASM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YASM" && break +done +test -n "$YASM" || YASM="no" + + if test x"$YASM" != xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $YASM supports GAS syntax and AVX instructions" >&5 +$as_echo_n "checking if $YASM supports GAS syntax and AVX instructions... " >&6; } + echo '.text' > conftest.s + echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s + if $YASM -pgas -rcpp -o conftest.o conftest.s 1>/dev/null 2>&1; then + avx_support="yes" + YASMFLAGS="-pgas -rgas -mamd64" + { $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 + rm -f conftest.o conftest.s + else + if test x"$use_yasm" = xenabled; then + as_fn_error $? "Yasm enforced but not found!" "$LINENO" 5 + fi + fi +else + YASM="no" +fi + +if test "x$cpu_type" = "xavx"; then + if test "x$avx_support" != "xyes"; then + as_fn_error $? "Assembler doesn't understand AVX instructions." "$LINENO" 5 + fi +fi + + + + + +{ $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 +#include +#include +#include + +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 + +_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 + +_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 +#include +#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 + +for ac_header in stdio.h stdlib.h string.h unistd.h sched.h sys/ioctl.h sys/types.h stdint.h limits.h inttypes.h sys/time.h sys/wait.h sys/resource.h sys/signal.h signal.h sys/select.h dirent.h sys/stat.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 + + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +fi + +if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP '[^0-9]' > /dev/null; then + LFS_LOBJ= + largefile_sensitive=no +else + # Add dual-mode wrapper code. + LFS_LOBJ=lfs_wrap.lo + largefile_sensitive=yes +fi + +# Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf. +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define uintptr_t unsigned long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" +if test "x$ac_cv_type_int32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define int32_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default" +if test "x$ac_cv_type_int64_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define int64_t long long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" +if test "x$ac_cv_type_uint32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define uint32_t unsigned int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" +if test "x$ac_cv_type_int16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define int16_t short +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" +if test "x$ac_cv_type_uint16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define uint16_t unsigned short +_ACEOF + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } +if ${ac_cv_sizeof_size_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_size_t" = yes; 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 77 "cannot compute sizeof (size_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_size_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ssize_t" >&5 +$as_echo_n "checking size of ssize_t... " >&6; } +if ${ac_cv_sizeof_ssize_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ssize_t))" "ac_cv_sizeof_ssize_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_ssize_t" = yes; 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 77 "cannot compute sizeof (ssize_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_ssize_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ssize_t" >&5 +$as_echo "$ac_cv_sizeof_ssize_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } +if ${ac_cv_sizeof_off_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_off_t" = yes; 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 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int32_t" >&5 +$as_echo_n "checking size of int32_t... " >&6; } +if ${ac_cv_sizeof_int32_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int32_t))" "ac_cv_sizeof_int32_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int32_t" = yes; 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 77 "cannot compute sizeof (int32_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int32_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int32_t" >&5 +$as_echo "$ac_cv_sizeof_int32_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT32_T $ac_cv_sizeof_int32_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; 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 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + +if test "x$largefile_sensitive" = xyes; then + lfs_alias_type=long + lfs_alias_size=$ac_cv_sizeof_long +else + lfs_alias_type=off_t + lfs_alias_size=$ac_cv_sizeof_off_t +fi + +if test "x$lfs_alias_size" = "x"; then + as_fn_error $? "Cannot determine sizeof(lfs_alias_t)?" "$LINENO" 5 +else + LFS_ALIAS_BITS=`expr "$lfs_alias_size" "*" "8"` + +cat >>confdefs.h <<_ACEOF +#define lfs_alias_t $lfs_alias_type +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define LFS_ALIAS_BITS $LFS_ALIAS_BITS +_ACEOF + +fi + +lfs_alias=enabled +# Check whether --enable-lfs-alias was given. +if test "${enable_lfs_alias+set}" = set; then : + enableval=$enable_lfs_alias; + if test "x$enableval" = xno; then + lfs_alias="disabled" + fi + +else + + case $host in + *-cygwin*) + lfs_alias="disabled" + { $as_echo "$as_me:${as_lineno-$LINENO}: lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing" >&5 +$as_echo "$as_me: lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing" >&6;} + ;; + esac + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to enable alias wrappers for largefile" >&5 +$as_echo_n "checking if we want to enable alias wrappers for largefile... " >&6; } +if test "x$lfs_alias" = "xenabled"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LFS_LOBJ="$LFS_LOBJ lfs_alias.lo" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +# Again, prepend path for non-recursive make. +LFS_LOBJ=`for i in $LFS_LOBJ; do printf ' src/libmpg123/%s' $i; done` + + + + + + + + for ac_header in $ac_header_list +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_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + + +# Check if system supports termios +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX termios" >&5 +$as_echo_n "checking POSIX termios... " >&6; } +if ${ac_cv_sys_posix_termios+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +/* SunOS 4.0.3 has termios.h but not the library calls. */ + tcgetattr(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_posix_termios=yes +else + ac_cv_sys_posix_termios=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_posix_termios" >&5 +$as_echo "$ac_cv_sys_posix_termios" >&6; } + +if test "x$ac_cv_sys_posix_termios" = "xyes"; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_TERMIOS 1 +_ACEOF + +fi + +for ac_func in random +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Check for sched_setscheduler +for ac_func in sched_setscheduler setuid getuid +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Check for setpriority +for ac_func in setpriority +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in strerror +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in setlocale nl_langinfo +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in atoll +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in mkfifo +do : + ac_fn_c_check_func "$LINENO" "mkfifo" "ac_cv_func_mkfifo" +if test "x$ac_cv_func_mkfifo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MKFIFO 1 +_ACEOF + have_mkfifo=yes +else + have_mkfifo=no +fi +done + + + +# locale headers +for ac_header in locale.h langinfo.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 + +# Headers for network (http) stuff +network_type=Unknown +for ac_header in netdb.h sys/param.h sys/socket.h netinet/in.h arpa/inet.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 + +if test "x$ac_cv_header_netdb_h" = "xyes" && + test "x$ac_cv_header_sys_param_h" = "xyes" && + test "x$ac_cv_header_sys_socket_h" = "xyes" && + test "x$ac_cv_header_netinet_in_h" = "xyes" && + test "x$ac_cv_header_arpa_inet_h" = "xyes"; then + have_network=yes + network_type=Posix +else + have_network=no +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 +$as_echo_n "checking for library containing gethostbyname... " >&6; } +if ${ac_cv_search_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$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 gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl socket network; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_gethostbyname=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_gethostbyname+:} false; then : + break +fi +done +if ${ac_cv_search_gethostbyname+:} false; then : + +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 +$as_echo "$ac_cv_search_gethostbyname" >&6; } +ac_res=$ac_cv_search_gethostbyname +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 +$as_echo_n "checking for library containing socket... " >&6; } +if ${ac_cv_search_socket+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$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 socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_socket=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_socket+:} false; then : + break +fi +done +if ${ac_cv_search_socket+:} false; then : + +else + ac_cv_search_socket=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 +$as_echo "$ac_cv_search_socket" >&6; } +ac_res=$ac_cv_search_socket +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +for ac_func in getaddrinfo +do : + ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" +if test "x$ac_cv_func_getaddrinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETADDRINFO 1 +_ACEOF + have_ipv6=yes +else + have_ipv6=no +fi +done + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working AI_ADDRCONFIG" >&5 +$as_echo_n "checking for working AI_ADDRCONFIG... " >&6; } +if ${apr_cv_gai_addrconfig+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + apr_cv_gai_addrconfig=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +int main(int argc, char **argv) { + struct addrinfo hints, *ai; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_ADDRCONFIG; + return getaddrinfo("localhost", NULL, &hints, &ai) != 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + apr_cv_gai_addrconfig=yes +else + apr_cv_gai_addrconfig=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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_gai_addrconfig" >&5 +$as_echo "$apr_cv_gai_addrconfig" >&6; } + +if test $apr_cv_gai_addrconfig = yes; then + +$as_echo "#define HAVE_GAI_ADDRCONFIG 1" >>confdefs.h + +fi + + +# Substitutions for the installable mpg123.h header +if test "x$ac_cv_header_stdio_h" = "xyes"; then + INCLUDE_STDIO_H="#include " +else + INCLUDE_STDIO_H="/* #include is not available on this system */" +fi + + +if test "x$ac_cv_header_stdlib_h" = "xyes"; then + INCLUDE_STDLIB_H="#include " +else + INCLUDE_STDLIB_H="/* #include is not available on this system */" +fi + + +if test "x$ac_cv_header_sys_types_h" = "xyes"; then + INCLUDE_SYS_TYPE_H="#include " +else + INCLUDE_SYS_TYPE_H="/* #include is not available on this system */" +fi + + + +# Checks for maths libraries. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 +$as_echo_n "checking for sqrt in -lm... " >&6; } +if ${ac_cv_lib_m_sqrt+:} 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. */ + +/* 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 sqrt (); +int +main () +{ +return sqrt (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_sqrt=yes +else + ac_cv_lib_m_sqrt=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_sqrt" >&5 +$as_echo "$ac_cv_lib_m_sqrt" >&6; } +if test "x$ac_cv_lib_m_sqrt" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for powf in -lmx" >&5 +$as_echo_n "checking for powf in -lmx... " >&6; } +if ${ac_cv_lib_mx_powf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmx $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 powf (); +int +main () +{ +return powf (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mx_powf=yes +else + ac_cv_lib_mx_powf=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_mx_powf" >&5 +$as_echo "$ac_cv_lib_mx_powf" >&6; } +if test "x$ac_cv_lib_mx_powf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMX 1 +_ACEOF + + LIBS="-lmx $LIBS" + +fi + + +# attempt to make the signal stuff work... also with GENERIC - later +#if test x"$ac_cv_header_sys_signal_h" = xyes; then +# AC_CHECK_FUNCS( sigemptyset sigaddset sigprocmask sigaction ) +# if test x"$ac_cv_func_sigemptyset" = xyes && +# test x"$ac_cv_func_sigaddset" = xyes && +# test x"$ac_cv_func_sigprocmask" = xyes && +# test x"$ac_cv_func_sigaction" = xyes; then +# AC_DEFINE( +#fi + + +# do not assume gcc here, so no flags by default +ADD_CFLAGS="" +ADD_CPPFLAGS="$sys_cppflags" +ADD_LDFLAGS="" +LIBS="$LIBS" + +# Consider moving that stuff. +ac_fn_c_check_header_mongrel "$LINENO" "os2.h" "ac_cv_header_os2_h" "$ac_includes_default" +if test "x$ac_cv_header_os2_h" = xyes; then : + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOS2" +fi + + +# On OS/2, we need to link to os2term to make terminal control actually work. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcsetattr in -los2term" >&5 +$as_echo_n "checking for tcsetattr in -los2term... " >&6; } +if ${ac_cv_lib_os2term_tcsetattr+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-los2term $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 tcsetattr (); +int +main () +{ +return tcsetattr (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_os2term_tcsetattr=yes +else + ac_cv_lib_os2term_tcsetattr=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_os2term_tcsetattr" >&5 +$as_echo "$ac_cv_lib_os2term_tcsetattr" >&6; } +if test "x$ac_cv_lib_os2term_tcsetattr" = xyes; then : + ADD_LDFLAGS="$ADD_LDFLAGS -los2term" +fi + + +# If debugging is enabled, just enable debugging symbols. +# All other stuff enters nagging territory. +if test x"$debugging" = xenabled; then + ADD_CFLAGS="-g" +fi +# gcc specific... +if test x"$GCC" = xyes; then + if test x"$nagging" = xenabled; then + ADD_CFLAGS="$ADD_CFLAGS -Wall -Werror -std=c89 -pedantic -DPLAIN_C89" + fi +fi + +case $host in + i?86-*) + +$as_echo "#define ABI_ALIGN_FUN 1" >>confdefs.h + + ;; +esac + +s_altivec="synth_altivec dct64_altivec" +s_i386="dct64_i386" +s_i486="$s_i386 synth_i486 dct64_i486" +s_i586="$s_i386 synth_i586" +s_i586d="$s_i386 synth_i586_dither" +s_3dnow="$s_i386 synth_3dnow dct64_3dnow equalizer_3dnow" +s_3dnowext="$s_i386 dct64_3dnowext tabinit_mmx synth_3dnowext" +s_3dnow_vintage=$s_3dnow +s_3dnowext_vintage=$s_3dnowext +if test "x$layer3" = "xenabled"; then + s_3dnow_vintage="$s_3dnow_vintage dct36_3dnow" + s_3dnowext_vintage="$s_3dnowext_vintage dct36_3dnowext" +fi +s_mmx="$s_i386 dct64_mmx tabinit_mmx synth_mmx" +s_sse_vintage="$s_i386 tabinit_mmx dct64_sse_float synth_sse_float synth_stereo_sse_float synth_sse_s32 synth_stereo_sse_s32 " +s_sse="$s_sse_vintage dct36_sse" +s_x86_64="dct36_x86_64 dct64_x86_64_float synth_x86_64_float synth_x86_64_s32 synth_stereo_x86_64_float synth_stereo_x86_64_s32" +s_x86_64_mono_synths="synth_x86_64_float synth_x86_64_s32" +s_x86_64_avx="dct36_avx dct64_avx_float synth_stereo_avx_float synth_stereo_avx_s32" +s_x86multi="getcpuflags" +s_x86_64_multi="getcpuflags_x86_64" +s_dither="dither" +s_neon="dct36_neon dct64_neon_float synth_neon_float synth_neon_s32 synth_stereo_neon_float synth_stereo_neon_s32" +s_neon64="dct36_neon64 dct64_neon64_float synth_neon64_float synth_neon64_s32 synth_stereo_neon64_float synth_stereo_neon64_s32" +s_arm_multi="getcpuflags_arm check_neon" + +# choose optimized 16bit decoder for SSE, quality or fast +# note: supporting deactivation of output formats for these decoders would need more logic here +if test "x$integers" = "xquality"; then + s_sse="$s_sse synth_sse_accurate synth_stereo_sse_accurate" + s_sse_vintage="$s_sse_vintage synth_sse_accurate synth_stereo_sse_accurate" + s_x86_64="$s_x86_64 synth_x86_64_accurate synth_stereo_x86_64_accurate" + s_x86_64_mono_synths="$s_x86_64_mono_synths synth_x86_64_accurate" + s_x86_64_avx="$s_x86_64_avx synth_stereo_avx_accurate" + s_arm="synth_arm_accurate" + s_neon="$s_neon synth_neon_accurate synth_stereo_neon_accurate" + s_neon64="$s_neon64 synth_neon64_accurate synth_stereo_neon64_accurate" +else + s_sse="$s_sse dct64_sse synth_sse" # no stereo + s_sse_vintage="$s_sse_vintage dct64_sse synth_sse" # no stereo + s_x86_64="$s_x86_64 synth_x86_64 dct64_x86_64 synth_stereo_x86_64" + s_x86_64_mono_synths="$s_x86_64_mono_synths synth_x86_64" + s_x86_64_avx="$s_x86_64_avx dct64_avx synth_stereo_avx" + s_arm="synth_arm" + s_neon="$s_neon dct64_neon synth_neon synth_stereo_neon" + s_neon64="$s_neon64 dct64_neon64 synth_neon64 synth_stereo_neon64" +fi + +case $cpu_type in + generic) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" + more_sources="$s_fpu" + ccalign=no + ;; + generic_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_dither" + ccalign=no + ;; + generic_fpu | generic_float) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" + more_sources="$s_fpu" + ccalign=no + ;; + generic_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FIXED" + more_sources= + ccalign=no + ;; + ppc_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DOPT_PPC -DREAL_IS_FIXED" + more_sources= + ccalign=no + ;; + arm_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_ARM -DREAL_IS_FIXED" + more_sources="$s_arm" + ccalign=no + ;; + altivec) + ADD_CFLAGS="$ADD_CFLAGS -maltivec" + ADD_CPPFLAGS="$ADD_CPPFLAGS -DREAL_IS_FLOAT -DOPT_ALTIVEC" + more_sources="$s_altivec $s_fpu" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -faltivec" >&5 +$as_echo_n "checking if $CC accepts -faltivec... " >&6; } + touch conftest.c + if $CC -faltivec -c -o conftest.o conftest.c >/dev/null 2>&1; then + ADD_CFLAGS="$ADD_CFLAGS -faltivec" + { $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 + rm -f conftest.o conftest.c + ;; + neon) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON -DREAL_IS_FLOAT" + more_sources="$s_neon $s_fpu" + ;; + arm_fpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON -DREAL_IS_FLOAT" + more_sources="$s_neon $s_fpu $s_dither $s_arm_multi" + ;; + neon64) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON64 -DREAL_IS_FLOAT" + more_sources="$s_neon64 $s_fpu" + ;; + aarch64) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON64 -DREAL_IS_FLOAT" + more_sources="$s_neon64 $s_fpu $s_dither $s_arm_multi" + ;; + i386) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386" + ccalign=no + ;; + i386_fpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386" + ccalign=no + ;; + i386_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FIXED" + more_sources="$s_i386" + ccalign=no + ;; + i486) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I486 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i486" + ccalign=no + ;; + i586) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586" + ;; + i586_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586d $s_dither" + ;; + 3dnow) + # legacy 3dnow had the 3dnow paired with i586... + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586 $s_3dnow $s_x86multi " + ;; + 3dnow_vintage) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW_VINTAGE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586 $s_3dnow_vintage $s_x86multi " + ;; + 3dnow_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOW -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnow" + ;; + 3dnowext_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOWEXT -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext" + ;; + 3dnowext_vintage) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT_VINTAGE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext_vintage $s_3dnow $s_x86multi" + ;; + 3dnowext) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext $s_3dnow $s_x86multi" + ;; + mmx_alone|mmx) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MMX -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_mmx" + ;; + sse_alone|sse) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_sse" + ;; + sse_vintage) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_sse_vintage" + ;; + avx) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64_avx $s_x86_64_mono_synths" + if test "x$YASM" != "xno"; then + use_yasm_for_avx="yes" + fi + ;; + x86|x86_dither) + # plain C dct36 always there, for vintage/non-vintage + # Selection of non-/vintage sources implies that + # $s_3dnow_vintage contains $s_3dnow, + # $s_sse contains $s_sse_vintage. + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOW_VINTAGE -DOPT_3DNOWEXT -DOPT_3DNOWEXT_VINTAGE -DOPT_SSE -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386 $s_i586 $s_i586d $s_mmx $s_3dnow_vintage $s_3dnowext_vintage $s_sse $s_x86multi $s_dither" + ;; + x86-64_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_X86_64 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64" + ;; + x86-64|x86-64_all|x86-64_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_X86_64 -DOPT_GENERIC -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64 $s_dither $s_x86_64_multi" + if test "x$avx_support" = "xyes"; then + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX" + more_sources="$more_sources $s_x86_64_avx" + if test "x$YASM" != "xno"; then + use_yasm_for_avx="yes" + fi + fi + ;; + *) + as_fn_error $? "Unknown CPU type '$cpu_type'" "$LINENO" 5 + ;; +esac + +# Use yasm instead of the default assembler for AVX sources +if test "x$use_yasm_for_avx" = "xyes"; then + case $host_os in + *cygwin*|*mingw*) + YASM_FORMAT="-f win64" + ;; + *darwin*) + YASM_FORMAT="-f macho" + ;; + *) + YASM_FORMAT="-f elf" + ;; + esac + +$as_echo "#define USE_YASM_FOR_AVX 1" >>confdefs.h + +fi + if test "x$use_yasm_for_avx" = xyes ; then + USE_YASM_FOR_AVX_TRUE= + USE_YASM_FOR_AVX_FALSE='#' +else + USE_YASM_FOR_AVX_TRUE='#' + USE_YASM_FOR_AVX_FALSE= +fi + + + +# Check if we want feature report function. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want feature report function" >&5 +$as_echo_n "checking if we want feature report function... " >&6; } +feature_report=enabled +# Check whether --enable-feature_report was given. +if test "${enable_feature_report+set}" = set; then : + enableval=$enable_feature_report; + if test "x$enableval" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + feature_report=disabled + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi + + +if test "x$feature_report" = xenabled; then + more_sources="$more_sources feature" +fi + +# Return 0 if first arg appears in list of following arguments. +# Return 1 otherwise. +word_in_list() { + word=$1 + shift + # Avoid naming conflict with the outside! + # Is local not POSIX sh? + for given_word in "$@" + do + if test "x$word" = "x$given_word"; then + return 0 + fi + done + return 1 +} + +for i in $more_sources +do + # Make sure every file is only once in the list. + word_in_list "$i.\$(OBJEXT)" $DECODER_OBJ || DECODER_OBJ="$DECODER_OBJ $i.\$(OBJEXT)" + word_in_list "$i.lo" $DECODER_LOBJ || DECODER_LOBJ="$DECODER_LOBJ $i.lo" +done + +# Another preprocessing step: Append prefix for non-recursive make. +# Just because $(addprefix ...) is a GNU extension. + +DECODER_OBJ=`for i in $DECODER_OBJ; do printf ' src/libmpg123/%s' $i; done` +DECODER_LOBJ=`for i in $DECODER_LOBJ; do printf ' src/libmpg123/%s' $i; done` + + + + +if test x"$ccalign" = xyes; then + +$as_echo "#define CCALIGN 1" >>confdefs.h + +fi + + + +# The full list of supported modules to check, first come, first serve. +check_modules="alsa tinyalsa oss coreaudio sndio sun win32 win32_wasapi os2 esd jack portaudio pulse sdl nas arts openal dummy" +# Only check qsa before all else on QNX. +# It would mask ALSA otherwise. +case $host in + *-nto-qnx*) + check_modules="qsa $check_modules" + ;; +esac + +# The final list. +output_modules= + +check_forced=no +check_failed=no +if test "x$with_audio" != "x"; then + check_modules="`echo $with_audio|tr , ' '` dummy" + echo "Limiting outputs to build according to your preference: $check_modules" + check_forced=yes +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 + + ;; +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 + +# Now go through the modules to check and do the chores. +for m in $check_modules +do + case "$m" in + dummy) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if you are too dumbing dumb for the dummy" >&5 +$as_echo_n "checking if you are too dumbing dumb for the dummy... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + output_modules="$output_modules dummy" + HAVE_DUMMY=yes + ;; + oss) + for ac_header in sys/soundcard.h linux/soundcard.h machine/soundcard.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 + + if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" \ + -o "x${ac_cv_header_linux_soundcard_h}" = "xyes" \ + -o "x${ac_cv_header_machine_soundcard_h}" = "xyes"; + then + output_modules="$output_modules oss" + HAVE_OSS="yes" + else + check_failed=yes + fi + ;; + tinyalsa) + TINYALSA_LIBS="-ltinyalsa" + # Check for ALSA + { $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. */ + +/* 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 +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tinyalsa_pcm_open=yes +else + ac_cv_lib_tinyalsa_pcm_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_tinyalsa_pcm_open" >&5 +$as_echo "$ac_cv_lib_tinyalsa_pcm_open" >&6; } +if test "x$ac_cv_lib_tinyalsa_pcm_open" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "tinyalsa/asoundlib.h" "ac_cv_header_tinyalsa_asoundlib_h" "$ac_includes_default" +if test "x$ac_cv_header_tinyalsa_asoundlib_h" = xyes; then : + output_modules="$output_modules tinyalsa" HAVE_TINYALSA="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found TINYALSA library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found TINYALSA library but NOT header files on your system" >&2;} +fi + + + + +fi + + if test "x$HAVE_TINYALSA" != xyes; then + check_failed=yes + fi + ;; + # QSA and ALSA are not distinguishable in these tests, need to block + # each other and play with test order depending on platform. + alsa) + if test "x$HAVE_QSA" = xyes; then + HAVE_ALSA=no + else + + ALSA_LIBS="-lasound" + # Check for ALSA + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5 +$as_echo_n "checking for snd_pcm_open in -lasound... " >&6; } +if ${ac_cv_lib_asound_snd_pcm_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_pcm_open (); +int +main () +{ +return snd_pcm_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_asound_snd_pcm_open=yes +else + ac_cv_lib_asound_snd_pcm_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_pcm_open" >&5 +$as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; } +if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" +if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then : + output_modules="$output_modules alsa" HAVE_ALSA="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found ALSA library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found ALSA library but NOT header files on your system" >&2;} +fi + + + + +fi + + if test "x$HAVE_ALSA" != xyes; then + check_failed=yes + fi + + fi # HAVE_QSA + ;; + qsa) + if test "x$HAVE_ALSA" = xyes; then + HAVE_QSA=no + else + + QSA_LIBS="-lasound" + # Check for QSA + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5 +$as_echo_n "checking for snd_pcm_open in -lasound... " >&6; } +if ${ac_cv_lib_asound_snd_pcm_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_pcm_open (); +int +main () +{ +return snd_pcm_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_asound_snd_pcm_open=yes +else + ac_cv_lib_asound_snd_pcm_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_pcm_open" >&5 +$as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; } +if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "sys/asoundlib.h" "ac_cv_header_sys_asoundlib_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_asoundlib_h" = xyes; then : + output_modules="$output_modules qsa" HAVE_QSA="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found QSA library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found QSA library but NOT header files on your system" >&2;} +fi + + + + +fi + + if test "x$HAVE_QSA" != xyes; then + check_failed=yes + fi + + fi # HAVE_ALSA + ;; + jack) + # JACK module uses semaphores, hence -lpthread. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_post in -lpthread" >&5 +$as_echo_n "checking for sem_post in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_sem_post+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $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 sem_post (); +int +main () +{ +return sem_post (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_sem_post=yes +else + ac_cv_lib_pthread_sem_post=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_sem_post" >&5 +$as_echo "$ac_cv_lib_pthread_sem_post" >&6; } +if test "x$ac_cv_lib_pthread_sem_post" = xyes; then : + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JACK" >&5 +$as_echo_n "checking for JACK... " >&6; } + +if test -n "$JACK_CFLAGS"; then + pkg_cv_JACK_CFLAGS="$JACK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack\""; } >&5 + ($PKG_CONFIG --exists --print-errors "jack") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JACK_CFLAGS=`$PKG_CONFIG --cflags "jack" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$JACK_LIBS"; then + pkg_cv_JACK_LIBS="$JACK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack\""; } >&5 + ($PKG_CONFIG --exists --print-errors "jack") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JACK_LIBS=`$PKG_CONFIG --libs "jack" 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 + JACK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "jack" 2>&1` + else + JACK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "jack" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$JACK_PKG_ERRORS" >&5 + + HAVE_JACK="no" check_failed=yes +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_JACK="no" check_failed=yes +else + JACK_CFLAGS=$pkg_cv_JACK_CFLAGS + JACK_LIBS=$pkg_cv_JACK_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + output_modules="$output_modules jack" + HAVE_JACK="yes" + JACK_LIBS="$JACK_LIBS -lpthread" + +fi + +else + HAVE_JACK=no check_failed=yes + +fi + + ;; + pulse) + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PULSE" >&5 +$as_echo_n "checking for PULSE... " >&6; } + +if test -n "$PULSE_CFLAGS"; then + pkg_cv_PULSE_CFLAGS="$PULSE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse-simple\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse-simple") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PULSE_CFLAGS=`$PKG_CONFIG --cflags "libpulse-simple" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PULSE_LIBS"; then + pkg_cv_PULSE_LIBS="$PULSE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse-simple\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse-simple") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PULSE_LIBS=`$PKG_CONFIG --libs "libpulse-simple" 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 + PULSE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpulse-simple" 2>&1` + else + PULSE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpulse-simple" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PULSE_PKG_ERRORS" >&5 + + HAVE_PULSE="no" check_failed=yes +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_PULSE="no" check_failed=yes +else + PULSE_CFLAGS=$pkg_cv_PULSE_CFLAGS + PULSE_LIBS=$pkg_cv_PULSE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules pulse" HAVE_PULSE="yes" +fi + ;; + esd) + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ESD" >&5 +$as_echo_n "checking for ESD... " >&6; } + +if test -n "$ESD_CFLAGS"; then + pkg_cv_ESD_CFLAGS="$ESD_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"esound\""; } >&5 + ($PKG_CONFIG --exists --print-errors "esound") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ESD_CFLAGS=`$PKG_CONFIG --cflags "esound" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$ESD_LIBS"; then + pkg_cv_ESD_LIBS="$ESD_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"esound\""; } >&5 + ($PKG_CONFIG --exists --print-errors "esound") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ESD_LIBS=`$PKG_CONFIG --libs "esound" 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 + ESD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "esound" 2>&1` + else + ESD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "esound" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ESD_PKG_ERRORS" >&5 + + HAVE_ESD="no" check_failed=yes +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_ESD="no" check_failed=yes +else + ESD_CFLAGS=$pkg_cv_ESD_CFLAGS + ESD_LIBS=$pkg_cv_ESD_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules esd" HAVE_ESD="yes" +fi + ;; + portaudio) + # Remember: This looks only insane because you chose an insane tab width! + PORTAUDIO_LIBS="-lportaudio" + PORTAUDIO_CFLAGS= + case $host in + *-*-mingw32) + # We tested portaudio with MME + if test "x$HAVE_PORTAUDIO" != "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pa_Initialize in -lportaudio" >&5 +$as_echo_n "checking for Pa_Initialize in -lportaudio... " >&6; } +if ${ac_cv_lib_portaudio_Pa_Initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio -lwinmm + $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 Pa_Initialize (); +int +main () +{ +return Pa_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_portaudio_Pa_Initialize=yes +else + ac_cv_lib_portaudio_Pa_Initialize=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_portaudio_Pa_Initialize" >&5 +$as_echo "$ac_cv_lib_portaudio_Pa_Initialize" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_Initialize" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "portaudio.h" "ac_cv_header_portaudio_h" "$ac_includes_default" +if test "x$ac_cv_header_portaudio_h" = xyes; then : + output_modules="$output_modules portaudio" HAVE_PORTAUDIO_WINMM="yes" HAVE_PORTAUDIO="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found PortAudio library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found PortAudio library but NOT header files on your system" >&2;} +fi + + + PORTAUDIO_LIBS="$PORTAUDIO_LIBS -lwinmm" + +else + HAVE_PORTAUDIO="no" +fi + + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pa_Initialize in -lportaudio" >&5 +$as_echo_n "checking for Pa_Initialize in -lportaudio... " >&6; } +if ${ac_cv_lib_portaudio_Pa_Initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio $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 Pa_Initialize (); +int +main () +{ +return Pa_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_portaudio_Pa_Initialize=yes +else + ac_cv_lib_portaudio_Pa_Initialize=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_portaudio_Pa_Initialize" >&5 +$as_echo "$ac_cv_lib_portaudio_Pa_Initialize" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_Initialize" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "portaudio.h" "ac_cv_header_portaudio_h" "$ac_includes_default" +if test "x$ac_cv_header_portaudio_h" = xyes; then : + output_modules="$output_modules portaudio" HAVE_PORTAUDIO="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found PortAudio library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found PortAudio library but NOT header files on your system" >&2;} +fi + + + + +fi + + ;; + esac + if test "x$HAVE_PORTAUDIO" != xyes; then + check_failed=yes + else + # See if we have v19 or v18 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pa_GetVersion in -lportaudio" >&5 +$as_echo_n "checking for Pa_GetVersion in -lportaudio... " >&6; } +if ${ac_cv_lib_portaudio_Pa_GetVersion+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio $PORTAUDIO_LIBS $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 Pa_GetVersion (); +int +main () +{ +return Pa_GetVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_portaudio_Pa_GetVersion=yes +else + ac_cv_lib_portaudio_Pa_GetVersion=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_portaudio_Pa_GetVersion" >&5 +$as_echo "$ac_cv_lib_portaudio_Pa_GetVersion" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_GetVersion" = xyes; then : + : +else + +$as_echo "#define PORTAUDIO18 1" >>confdefs.h + +fi + + fi + ;; + sdl) + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL" >&5 +$as_echo_n "checking for SDL... " >&6; } + +if test -n "$SDL_CFLAGS"; then + pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SDL_LIBS"; then + pkg_cv_SDL_LIBS="$SDL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl" 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 + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl" 2>&1` + else + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_PKG_ERRORS" >&5 + + HAVE_SDL="no" check_failed=yes +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_SDL="no" check_failed=yes +else + SDL_CFLAGS=$pkg_cv_SDL_CFLAGS + SDL_LIBS=$pkg_cv_SDL_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules sdl" HAVE_SDL="yes" +fi + ;; + nas) + NAS_LIBS=-laudio + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AuOpenServer in -laudio" >&5 +$as_echo_n "checking for AuOpenServer in -laudio... " >&6; } +if ${ac_cv_lib_audio_AuOpenServer+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-laudio $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 AuOpenServer (); +int +main () +{ +return AuOpenServer (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_audio_AuOpenServer=yes +else + ac_cv_lib_audio_AuOpenServer=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_audio_AuOpenServer" >&5 +$as_echo "$ac_cv_lib_audio_AuOpenServer" >&6; } +if test "x$ac_cv_lib_audio_AuOpenServer" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "audio/audiolib.h" "ac_cv_header_audio_audiolib_h" "$ac_includes_default" +if test "x$ac_cv_header_audio_audiolib_h" = xyes; then : + output_modules="$output_modules nas" HAVE_NAS="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found NAS library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found NAS library but NOT header files on your system" >&2;} +fi + + + + +fi + + if test "x$HAVE_NAS" != xyes; then + check_failed=yes + fi + ;; + win32) + # Check for windows ... and win32 audio + # Does not work... instead just check for header + # AC_CHECK_LIB( [winmm], [waveOutOpen] ) + WIN32_LIBS=-lwinmm + if test x$ac_cv_header_windows_h = xyes; then + output_modules="$output_modules win32" + HAVE_WIN32=yes + else + HAVE_WIN32=no + check_failed=yes + fi + ;; + win32_wasapi) + # Check for windows ... and win32 wasapi audio + # Does not work... instead just check for header + # AC_CHECK_LIB( [avrt], [] ) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have wasapi headers" >&5 +$as_echo_n "checking if we have wasapi headers... " >&6; } + OLD_LIBS=$LIBS + LIBS="$LIBS -lole32 -lavrt" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define COBJMACROS 1 +#define _WIN32_WINNT 0x601 +#include +#include +#include +#include +int main(){ + /* UUID Checks */ + GUID *IDs = { + &CLSID_MMDeviceEnumerator, + &IID_IMMDeviceEnumerator, + &IID_IAudioClient, + &IID_IAudioRenderClient + }; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + HAVE_WIN32_WASAPI=yes +else + HAVE_WIN32_WASAPI=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$OLD_LIBS + WIN32_WASAPI_LIBS="-lole32 -lavrt" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_WIN32_WASAPI" >&5 +$as_echo "$HAVE_WIN32_WASAPI" >&6; } + if test "x$HAVE_WIN32_WASAPI" = xyes; then + output_modules="$output_modules win32_wasapi" + else + check_failed=yes + fi + ;; + sndio) + SNDIO_LIBS=-lsndio + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sio_open in -lsndio" >&5 +$as_echo_n "checking for sio_open in -lsndio... " >&6; } +if ${ac_cv_lib_sndio_sio_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsndio $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 sio_open (); +int +main () +{ +return sio_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sndio_sio_open=yes +else + ac_cv_lib_sndio_sio_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_sndio_sio_open" >&5 +$as_echo "$ac_cv_lib_sndio_sio_open" >&6; } +if test "x$ac_cv_lib_sndio_sio_open" = xyes; then : + for ac_header in sndio.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sndio.h" "ac_cv_header_sndio_h" "$ac_includes_default" +if test "x$ac_cv_header_sndio_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SNDIO_H 1 +_ACEOF + output_modules="$output_modules sndio" HAVE_SNDIO="yes" +fi + +done + + + +fi + + if test "x$HAVE_SNDIO" != xyes; then + check_failed=yes + fi + ;; + sun) + for ac_header in sun/audioio.h sys/audioio.h asm/audioio.h sys/audio.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 + + if test "x${ac_cv_header_sun_audioio_h}" = "xyes" \ + -o "x${ac_cv_header_sys_audioio_h}" = "xyes" \ + -o "x${ac_cv_header_asm_audioio_h}" = "xyes"; + then + output_modules="$output_modules sun" + HAVE_SUN="yes" + else + check_failed=yes + fi + ;; + coreaudio) + COREAUDIO_LIBS="-framework AudioToolbox" + for ac_header in AudioUnit/AudioUnit.h AudioToolbox/AudioToolbox.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 + + if test "x${ac_cv_header_AudioUnit_AudioUnit_h}" = "xyes" \ + -a "x${ac_cv_header_AudioToolbox_AudioToolbox_h}" = "xyes"; + then + OLD_LIBS=$LIBS + LIBS="$LIBS $COREAUDIO_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if AudioUnit functions are available within AudioToolbox" >&5 +$as_echo_n "checking if AudioUnit functions are available within AudioToolbox... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +AudioUnitInitialize(NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; 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; } + COREAUDIO_LIBS="$COREAUDIO_LIBS -framework AudioUnit" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$OLD_LIBS + for ac_header in CoreServices/CoreServices.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "CoreServices/CoreServices.h" "ac_cv_header_CoreServices_CoreServices_h" "$ac_includes_default" +if test "x$ac_cv_header_CoreServices_CoreServices_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CORESERVICES_CORESERVICES_H 1 +_ACEOF + COREAUDIO_LIBS="$COREAUDIO_LIBS -framework CoreServices" + +fi + +done + + if test x"$modules" = xdisabled; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer." >&5 +$as_echo "$as_me: WARNING: Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer." >&2;} + buffer=disabled + fi + output_modules="$output_modules coreaudio" + HAVE_COREAUDIO="yes" + else + check_failed=yes + fi + ;; + arts) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for artsc" >&5 +$as_echo_n "checking for artsc... " >&6; } + if artsc-config > /dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules arts" + HAVE_ARTS=yes + ARTS_LIBS=`artsc-config --libs` + ARTS_CFLAGS=`artsc-config --cflags` + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + check_failed=yes + fi + ;; + openal) + for ac_header in OpenAL/al.h OpenAL/alc.h AL/al.h AL/alc.h al.h alc.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 + + if test "x${ac_cv_header_OpenAL_al_h}" = "xyes" \ + -a "x${ac_cv_header_OpenAL_alc_h}" = "xyes"; + then #Mac OS X + output_modules="$output_modules openal" + OPENAL_LIBS="-framework OpenAL" + OPENAL_CFLAGS="-DOPENAL_SUBDIR_OPENAL" + HAVE_OPENAL="yes" + elif test "x${ac_cv_header_AL_al_h}" = "xyes" \ + -a "x${ac_cv_header_AL_alc_h}" = "xyes"; + then #Linux + output_modules="$output_modules openal" + OPENAL_LIBS="-lopenal" + OPENAL_CFLAGS="-DOPENAL_SUBDIR_AL" + HAVE_OPENAL="yes" + elif test "x${ac_cv_header_al_h}" = "xyes" \ + -a "x${ac_cv_header_alc_h}" = "xyes"; + then #Windows? + output_modules="$output_modules openal" + OPENAL_LIBS="-lopenal" + OPENAL_CFLAGS="" + HAVE_OPENAL="yes" + else + check_failed=yes + fi + ;; + os2) + OS2_LIBS="-los2me -lmmpm2 -lsocket" + for ac_header in os2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "os2.h" "ac_cv_header_os2_h" "$ac_includes_default" +if test "x$ac_cv_header_os2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OS2_H 1 +_ACEOF + +fi + +done + + # os2me.h depends on os2.h + # Yes, that way of coding it is ugly. + if test "x${ac_cv_header_os2_h}" = xyes + then + # We mimick exactly the way how the header will be used. + # It seems to be picky... + for ac_header in os2me.h +do : + ac_fn_c_check_header_compile "$LINENO" "os2me.h" "ac_cv_header_os2me_h" "#define INCL_OS2MM +#define INCL_DOS +#define INCL_VIO +#define INCL_KBD +#include +# +" +if test "x$ac_cv_header_os2me_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OS2ME_H 1 +_ACEOF + +fi + +done + + fi + if test "x${ac_cv_header_os2_h}" = xyes \ + -a "x${ac_cv_header_os2me_h}" = xyes + then + output_modules="$output_modules os2" + HAVE_OS2=yes + else + check_failed=yes + fi + ;; +# from here on only forced tests, untested code + hp) + # What's the deal with that and alib? + UNSUPPORTED_AUDIO=yes + ac_fn_c_check_header_mongrel "$LINENO" "sys/audio.h" "ac_cv_header_sys_audio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_audio_h" = xyes; then : + output_modules="$output_modules hp" HAVE_HP=yes +else + check_failed=yes +fi + + + ;; + alib) + UNSUPPORTED_AUDIO=yes + # ALIB_CFLAGS="-I/opt/audio/include" + ALIB_LIBS=-lAlib + # These headers may not be all about audio but they are used. + for ac_header in Alib.h CUlib.h netdb.h netinet/in.h netinet/tcp.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 + + if test "x${ac_cv_header_Alib_h}" = xyes \ + -a "x${ac_cv_header_CUlib_h}" = xyes \ + -a "x${ac_cv_header_netdb_h}" = xyes \ + -a "x${ac_cv_header_netinet_in_h}" = xyes \ + -a "x${ac_cv_header_netinet_tcp_h}" = xyes + then + output_modules="$output_modules alib" + HAVE_ALIB=yes + else + check_failed=yes + fi + ;; + mint) + UNSUPPORTED_AUDIO=yes + for ac_header in audios.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "audios.h" "ac_cv_header_audios_h" "$ac_includes_default" +if test "x$ac_cv_header_audios_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_AUDIOS_H 1 +_ACEOF + output_modules="$output_modules mint" HAVE_MINT=yes +else + check_failes=yes +fi + +done + + ;; + aix) + UNSUPPORTED_AUDIO=yes + for ac_header in sys/audio.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/audio.h" "ac_cv_header_sys_audio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_audio_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_AUDIO_H 1 +_ACEOF + output_modules="$output_modules aix" HAVE_AIX=yes +else + check_failed=yes +fi + +done + + ;; + sgi) + UNSUPPORTED_AUDIO=yes + SGI_LIBS=-laudio + ac_fn_c_check_header_mongrel "$LINENO" "dmedia/audio.h" "ac_cv_header_dmedia_audio_h" "$ac_includes_default" +if test "x$ac_cv_header_dmedia_audio_h" = xyes; then : + output_modules="$output_modules sgi" HAVE_SGI=yes +else + check_failed=yes +fi + + + ;; + *) + as_fn_error $? "Unsupported/-known output '$m' demanded!" "$LINENO" 5 + ;; + esac +done + +if test "x$check_forced" = xyes -a "x$UNSUPPORTED_AUDIO" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!" >&5 +$as_echo "$as_me: WARNING: You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!" >&2;} +fi + +if test "x$check_forced" = xyes -a "x$check_failed" = "xyes"; then + as_fn_error $? "One/some of your requested audio modules failed the test!" "$LINENO" 5 +fi + +# When you extend check_modules, you should extend this: +#for i in alsa qsa oss coreaudio sndio sun win32 win32_wasapi esd jack portaudio pulse sdl nas aix alib arts hp os2 sgi mint openal dummy +#do echo $i; done | +#perl -ne 'chomp; $big = uc($_); print <>confdefs.h <<_ACEOF +#define DEFAULT_OUTPUT_MODULE "$default_output_modules" +_ACEOF + + + +CFLAGS="$ADD_CFLAGS $CFLAGS" + if test x"$buffer" = xenabled ; then + BUILD_BUFFER_TRUE= + BUILD_BUFFER_FALSE='#' +else + BUILD_BUFFER_TRUE='#' + BUILD_BUFFER_FALSE= +fi + +if test x"$buffer" = xdisabled; then + ADD_CPPFLAGS="$ADD_CPPFLAGS -DNOXFERMEM" +fi +if test x"$newoldwritesample" = xenabled; then + ADD_CPPFLAGS="$ADD_CPPFLAGS -DNEWOLD_WRITE_SAMPLE" +fi +CPPFLAGS="$ADD_CPPFLAGS $CPPFLAGS" +LDFLAGS="$ADD_LDFLAGS $LDFLAGS" + +# None chosen? +if test "x$with_optimization" = "x"; then + if test x"$debugging" = xenabled; then + with_optimization="0" + else + # enable (gcc specific) default opts only with gcc + if test "x$GCC" = xyes; then + with_optimization="2" + else + with_optimization="0" + fi + fi +fi + +case $with_optimization in + 0) + # No Optimizations + CFLAGS="$CFLAGS" + ;; + 1) + CFLAGS="-O $CFLAGS" + ;; + 2) + CFLAGS="-O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + 3) + CFLAGS="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + 4) + CFLAGS="-O4 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + *) + as_fn_error $? "Unknown optimizations level '$with_optimization'" "$LINENO" 5 + ;; +esac + +if test "x$GCC" = xyes && echo "$CFLAGS" | $GREP 'mpreferred-stack-boundary=' > /dev/null; then + case $cpu_type in + x86 | i586* | mmx | sse | 3dnow* | altivec) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are trying to mess with stack alignment. I know better. " >&5 +$as_echo "$as_me: WARNING: You are trying to mess with stack alignment. I know better. " >&2;} + CFLAGS="$CFLAGS -mpreferred-stack-boundary=4" + ;; + esac +fi + + +if test "x$with_seektable" = "x"; then + seektable=1000 +else + seektable=$with_seektable +fi + +if test "$seektable" -gt 0; then + +$as_echo "#define FRAME_INDEX 1" >>confdefs.h + +fi +# Define that always... also without frame index enabled. + +cat >>confdefs.h <<_ACEOF +#define INDEX_SIZE $seektable +_ACEOF + + +# Check if we want Unicode for Win32. Cygwin does not need _wopen +if test x$ac_cv_header_windows_h = xyes && test "x$host_os" != "xcygwin"; then + win32_specific_codes=enabled +else + win32_specific_codes=disabled +fi +win32_unicode=unneeded +win32_sockets=disabled +win32_sockets_working=no +win32_wide_working=no +win32_winver_bump=no + +if test "x$win32_specific_codes" = xenabled; then +#### Check for Wide functions + ac_fn_c_check_func "$LINENO" "_wopen" "ac_cv_func__wopen" +if test "x$ac_cv_func__wopen" = xyes; then : + win32_unicode=enabled +else + win32_unicode=disabled +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want Unicode File Open for Win32" >&5 +$as_echo_n "checking if we want Unicode File Open for Win32... " >&6; } + if test "x$win32_unicode" = xenabled; then + oldlibs=$LIBS + LIBS="$LIBS -lshlwapi" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Unicode functions working" >&5 +$as_echo_n "checking if Unicode functions working... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + int main() + { + MultiByteToWideChar (0, 0, NULL, 0, NULL, 0); + WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL); + PathCombineW(0,0,0); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_wide_working=yes +else + win32_winver_bump=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "x$win32_wide_working" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include + #include + #include + int main() + { + MultiByteToWideChar (0, 0, NULL, 0, NULL, 0); + WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL); + PathCombineW(0,0,0); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_wide_working=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_exeext conftest.$ac_ext + fi + if test "x$win32_wide_working" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WANT_WIN32_UNICODE 1" >>confdefs.h + + else + LIBS=$oldlibs + as_fn_error $? "Unicode support for Win32 not working" "$LINENO" 5 + fi + else + as_fn_error $? "Unicode File Open for Win32 not available" "$LINENO" 5 + fi + +#### Check for Network functions + for ac_header in ws2tcpip.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WS2TCPIP_H 1 +_ACEOF + win32_sockets=enabled +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please update your headers to support winsock 2.2." >&5 +$as_echo "$as_me: WARNING: Please update your headers to support winsock 2.2." >&2;} +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want Win32 sockets" >&5 +$as_echo_n "checking if we want Win32 sockets... " >&6; } + if test "x$win32_sockets" = "xenabled" && test "x$network" != "xdisabled"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if winsock2 API is available" >&5 +$as_echo_n "checking if winsock2 API is available... " >&6; } + wsoldlibs="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + int main() + { + getaddrinfo(NULL, NULL, NULL, NULL); + freeaddrinfo(NULL); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_sockets_working=yes +else + win32_winver_bump=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "x$win32_sockets_working" = "xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking deeper if winsock2 API is available" >&5 +$as_echo_n "checking deeper if winsock2 API is available... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include + #include + #include + int main() + { + getaddrinfo(NULL, NULL, NULL, NULL); + freeaddrinfo(NULL); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_sockets_working=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_exeext conftest.$ac_ext + fi + if test "x$win32_sockets_working" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WANT_WIN32_SOCKETS 1" >>confdefs.h + + network_type=Winsock2 + have_network=yes + have_ipv6=yes + else + LIBS="$wsoldlibs" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please update your headers to support winsock 2.2." >&5 +$as_echo "$as_me: WARNING: Please update your headers to support winsock 2.2." >&2;} + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + +#### Check for Win32 Named Pipe functions +win32_fifo_working=no +if test x$win32_specific_codes = xenabled; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have Named Pipes" >&5 +$as_echo_n "checking if we have Named Pipes... " >&6; } + if test "x$fifo" != "xdisabled"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + int main(){ + CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + return 0; + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_fifo_working=yes +else + win32_winver_bump=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "x$win32_fifo_working" != "xyes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include + int main(){ + CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + return 0; + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_fifo_working=yes +else + win32_fifo_working=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + fi + have_mkfifo=$win32_fifo_working + if test "x$win32_fifo_working" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WANT_WIN32_FIFO 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +fi + +#### WINVER Bump +if test x$win32_specific_codes = xenabled; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if WINVER and _WIN32_WINNT needs version bumps" >&5 +$as_echo_n "checking if WINVER and _WIN32_WINNT needs version bumps... " >&6; } + if test "x$win32_winver_bump" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WINVER 0x0501" >>confdefs.h + + +$as_echo "#define _WIN32_WINNT 0x0501" >>confdefs.h + + # getaddrinfo and freeaddrinfo are available for Win2K and above + # Bug: MinGW.org w32api ws2tcpip.h incorrectly wants (_WIN32_WINNT >= 0x0501) for getaddrinfo and freeaddrinfo + # MultiByteToWideChar and WideCharToMultiByte are available for Win2K and above + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +fi + +fi #END OF WIN32 CHECKS + +#### Check mingw.org for EOVERFLOW +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have EOVERFLOW macro" >&5 +$as_echo_n "checking if we have EOVERFLOW macro... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int i = (EOVERFLOW) + 0; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eoverflow_present=yes +else + eoverflow_present=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $eoverflow_present" >&5 +$as_echo "$eoverflow_present" >&6; } +if test "x$eoverflow_present" = "xyes"; then : + +else + +$as_echo "#define EOVERFLOW EFBIG" >>confdefs.h + +fi + +#### Use Win32 support codes + if test "x$win32_specific_codes" = xenabled ; then + WIN32_CODES_TRUE= + WIN32_CODES_FALSE='#' +else + WIN32_CODES_TRUE='#' + WIN32_CODES_FALSE= +fi + + +if test x"$network" = xauto; then + if test x"$have_network" = xyes; then + network=enabled + else + network=disabled + fi +fi +if test x"$ipv6" = xauto; then + if test x"$have_ipv6" = xyes; then + ipv6=enabled + else + ipv6=disabled + fi +fi + + +if test x"$fifo" = xauto; then + if test x"$have_mkfifo" = xyes; then + fifo=enabled + else + fifo=disabled + fi +fi + +if test x"$fifo" = xenabled; then + +$as_echo "#define FIFO 1" >>confdefs.h + + if test x"$have_mkfifo" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You forced FIFO code while I think there is no mkfifo() available! " >&5 +$as_echo "$as_me: WARNING: You forced FIFO code while I think there is no mkfifo() available! " >&2;} + fi +fi + +if test x"$network" = xenabled; then + +$as_echo "#define NETWORK 1" >>confdefs.h + + if test x"$have_network" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You forced network code while I think there is support missing! " >&5 +$as_echo "$as_me: WARNING: You forced network code while I think there is support missing! " >&2;} + fi +fi + +if test x"$ipv6" = xenabled; then + +$as_echo "#define IPV6 1" >>confdefs.h + + if test x"$have_ipv6" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You forced IPv6 code while I think there is no getaddrinfo() available! " >&5 +$as_echo "$as_me: WARNING: You forced IPv6 code while I think there is no getaddrinfo() available! " >&2;} + fi +fi + + +ac_config_files="$ac_config_files Makefile libmpg123.pc libout123.pc mpg123.spec src/libmpg123/mpg123.h src/libout123/out123.h" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${HAVE_MODULES_TRUE}" && test -z "${HAVE_MODULES_FALSE}"; then + as_fn_error $? "conditional \"HAVE_MODULES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_YASM_FOR_AVX_TRUE}" && test -z "${USE_YASM_FOR_AVX_FALSE}"; then + as_fn_error $? "conditional \"USE_YASM_FOR_AVX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_TINYALSA_TRUE}" && test -z "${HAVE_TINYALSA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_TINYALSA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ALSA_TRUE}" && test -z "${HAVE_ALSA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ALSA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_QSA_TRUE}" && test -z "${HAVE_QSA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_QSA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OSS_TRUE}" && test -z "${HAVE_OSS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OSS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_COREAUDIO_TRUE}" && test -z "${HAVE_COREAUDIO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_COREAUDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SNDIO_TRUE}" && test -z "${HAVE_SNDIO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SNDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SUN_TRUE}" && test -z "${HAVE_SUN_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SUN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_WIN32_TRUE}" && test -z "${HAVE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"HAVE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_WIN32_WASAPI_TRUE}" && test -z "${HAVE_WIN32_WASAPI_FALSE}"; then + as_fn_error $? "conditional \"HAVE_WIN32_WASAPI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ESD_TRUE}" && test -z "${HAVE_ESD_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ESD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_JACK_TRUE}" && test -z "${HAVE_JACK_FALSE}"; then + as_fn_error $? "conditional \"HAVE_JACK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_PORTAUDIO_TRUE}" && test -z "${HAVE_PORTAUDIO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_PORTAUDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_PULSE_TRUE}" && test -z "${HAVE_PULSE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_PULSE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SDL_TRUE}" && test -z "${HAVE_SDL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SDL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_NAS_TRUE}" && test -z "${HAVE_NAS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_NAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_AIX_TRUE}" && test -z "${HAVE_AIX_FALSE}"; then + as_fn_error $? "conditional \"HAVE_AIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ALIB_TRUE}" && test -z "${HAVE_ALIB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ALIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ARTS_TRUE}" && test -z "${HAVE_ARTS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ARTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_HP_TRUE}" && test -z "${HAVE_HP_FALSE}"; then + as_fn_error $? "conditional \"HAVE_HP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OS2_TRUE}" && test -z "${HAVE_OS2_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OS2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SGI_TRUE}" && test -z "${HAVE_SGI_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SGI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_MINT_TRUE}" && test -z "${HAVE_MINT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_MINT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENAL_TRUE}" && test -z "${HAVE_OPENAL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_DUMMY_TRUE}" && test -z "${HAVE_DUMMY_FALSE}"; then + as_fn_error $? "conditional \"HAVE_DUMMY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_DUMMY_TRUE}" && test -z "${BUILD_DUMMY_FALSE}"; then + as_fn_error $? "conditional \"BUILD_DUMMY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_TINYALSA_TRUE}" && test -z "${BUILD_TINYALSA_FALSE}"; then + as_fn_error $? "conditional \"BUILD_TINYALSA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_ALSA_TRUE}" && test -z "${BUILD_ALSA_FALSE}"; then + as_fn_error $? "conditional \"BUILD_ALSA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_QSA_TRUE}" && test -z "${BUILD_QSA_FALSE}"; then + as_fn_error $? "conditional \"BUILD_QSA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_COREAUDIO_TRUE}" && test -z "${BUILD_COREAUDIO_FALSE}"; then + as_fn_error $? "conditional \"BUILD_COREAUDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_ESD_TRUE}" && test -z "${BUILD_ESD_FALSE}"; then + as_fn_error $? "conditional \"BUILD_ESD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_JACK_TRUE}" && test -z "${BUILD_JACK_FALSE}"; then + as_fn_error $? "conditional \"BUILD_JACK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_NAS_TRUE}" && test -z "${BUILD_NAS_FALSE}"; then + as_fn_error $? "conditional \"BUILD_NAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_OSS_TRUE}" && test -z "${BUILD_OSS_FALSE}"; then + as_fn_error $? "conditional \"BUILD_OSS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_PORTAUDIO_TRUE}" && test -z "${BUILD_PORTAUDIO_FALSE}"; then + as_fn_error $? "conditional \"BUILD_PORTAUDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_PULSE_TRUE}" && test -z "${BUILD_PULSE_FALSE}"; then + as_fn_error $? "conditional \"BUILD_PULSE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_SDL_TRUE}" && test -z "${BUILD_SDL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SDL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_SNDIO_TRUE}" && test -z "${BUILD_SNDIO_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SNDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_SUN_TRUE}" && test -z "${BUILD_SUN_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SUN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_WIN32_TRUE}" && test -z "${BUILD_WIN32_FALSE}"; then + as_fn_error $? "conditional \"BUILD_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_WIN32_WASAPI_TRUE}" && test -z "${BUILD_WIN32_WASAPI_FALSE}"; then + as_fn_error $? "conditional \"BUILD_WIN32_WASAPI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_AIX_TRUE}" && test -z "${BUILD_AIX_FALSE}"; then + as_fn_error $? "conditional \"BUILD_AIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_ALIB_TRUE}" && test -z "${BUILD_ALIB_FALSE}"; then + as_fn_error $? "conditional \"BUILD_ALIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_ARTS_TRUE}" && test -z "${BUILD_ARTS_FALSE}"; then + as_fn_error $? "conditional \"BUILD_ARTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_HP_TRUE}" && test -z "${BUILD_HP_FALSE}"; then + as_fn_error $? "conditional \"BUILD_HP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_OS2_TRUE}" && test -z "${BUILD_OS2_FALSE}"; then + as_fn_error $? "conditional \"BUILD_OS2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_SGI_TRUE}" && test -z "${BUILD_SGI_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SGI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_MINT_TRUE}" && test -z "${BUILD_MINT_FALSE}"; then + as_fn_error $? "conditional \"BUILD_MINT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_OPENAL_TRUE}" && test -z "${BUILD_OPENAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_OPENAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_BUFFER_TRUE}" && test -z "${BUILD_BUFFER_FALSE}"; then + as_fn_error $? "conditional \"BUILD_BUFFER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WIN32_CODES_TRUE}" && test -z "${WIN32_CODES_FALSE}"; then + as_fn_error $? "conditional \"WIN32_CODES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +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 + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +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 + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +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'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by mpg123 $as_me 1.25.10, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +mpg123 config.status 1.25.10 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# 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"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $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"`' +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"`' +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"`' +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 AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +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 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libmpg123.pc") CONFIG_FILES="$CONFIG_FILES libmpg123.pc" ;; + "libout123.pc") CONFIG_FILES="$CONFIG_FILES libout123.pc" ;; + "mpg123.spec") CONFIG_FILES="$CONFIG_FILES mpg123.spec" ;; + "src/libmpg123/mpg123.h") CONFIG_FILES="$CONFIG_FILES src/libmpg123/mpg123.h" ;; + "src/libout123/out123.h") CONFIG_FILES="$CONFIG_FILES src/libout123/out123.h" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # 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 + shift + for 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 + # 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 '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + 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\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "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 . + + +# 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 + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# 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 + +# 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 + +# 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 +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + + + + +echo " + $PACKAGE_NAME $PACKAGE_VERSION + + Install path ............ $prefix + CPU Optimization ........ $cpu_type + Compiler Optimization ... $with_optimization + Gapless Support ......... $gapless + Debugging ............... $debugging + Seek table size ......... $seektable + FIFO support ............ $fifo + Buffer .................. $buffer + Network (http streams) .. $network + Network Sockets ......... $network_type + IPv6 (getaddrinfo) ...... $ipv6" +if test x"$LARGEFILE_BITS" = x; then + echo " File offsets ............ default" +else + echo " File offsets ............ $LARGEFILE_BITS" + echo " The lib will (try to) support default offset size, too." +fi +echo " LFS alias symbols ....... $lfs_alias ($LFS_ALIAS_BITS)" +echo " LFS alias type .......... $lfs_alias_type" +if test x"$use_yasm_for_avx" = xyes; then + echo " Use yasm (for AVX only) . enabled" +else + echo " Use yasm (for AVX only) . disabled" +fi + +echo " + Core libmpg123 features: + Layer I ................. $layer1 + Layer II ................ $layer2 + Layer III ............... $layer3 + NtoM resampling ......... $ntom + downsampled decoding .... $downsample + Feeder/buffered input ... $feeder + ID3v2 parsing ........... $id3v2 + String API .............. $string + ICY parsing/conversion .. $icy + Error/warning messages .. $messages + Win32 Unicode File Open.. $win32_unicode + Feature Report Function.. $feature_report + Output formats (nofpu will disable all but 16 or 8 bit!): + 8 bit integer ........... $int8 + 16 bit integer .......... $int16 + 32/24 bit integer ....... $int32 + real (32 bit float) ..... $real + Equalizer ............... $equalizer + Optimization detail: + Integer conversion ...... $integers + IEEE 754 hackery ........ $ieee + New/old WRITE_SAMPLE .... $newoldwritesample + new Huffman scheme ...... $newhuff + +Note: Disabling core features is not commonly done and some combinations might not build/work. If you encounter such a case, help yourself (and provide a patch) or just poke the maintainers." +# just an empty line +echo + +echo " Modules ................. $modules" +echo " Checked audio modules ... $check_modules + Detected audio support ..$output_modules + Default output module ... $default_output_module +" +if test x"$modules" = xdisabled; then +echo "The _single_ active output module is being statically linked in. +" +fi +if test x"$with_optimization" = x0; then + echo "No optimization flags chosen, make sure you have something basic in your CFLAGS at least... +" +fi + +if test x"$cpu_type" = xi486; then + echo "WARNING: You selected the i486 decoder. This is not recommened for regular use." + echo "It was designed for actual i486 CPUs a long time ago. Generic C code is likely" + echo "to perform better nowadays. Also, the decoder misses features like volume" + echo "scaling and has clipping issues. Continue if you are into software archeology" + echo "only." +fi + +echo +echo " CPPFLAGS='$CPPFLAGS'" +echo " CFLAGS='$CFLAGS'" +echo " LIBS='$LIBS'" +echo +echo "Next type 'make' and then 'make install'." diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..6216d4f --- /dev/null +++ b/configure.ac @@ -0,0 +1,2496 @@ +dnl configure.ac: source for the configure script + +dnl copyright by the mpg123 project - free software under the terms of the LGPL 2.1 +dnl see COPYING and AUTHORS files in distribution or http://mpg123.org +dnl initially written by Nicholas J. Humfrey + +dnl Require autoconf version >= 2.57 +AC_PREREQ(2.57) + +dnl ############# Initialisation +AC_INIT([mpg123], [1.25.10], [maintainer@mpg123.org]) +dnl Increment API_VERSION when the API gets changes (new functions). + +dnl libmpg123 +API_VERSION=44 +LIB_PATCHLEVEL=8 + +dnl libout123 +OUTAPI_VERSION=2 +OUTLIB_PATCHLEVEL=2 + +dnl Since we want to be backwards compatible, both sides get set to API_VERSION. +LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION +LIBOUT123_VERSION=$OUTAPI_VERSION:$OUTLIB_PATCHLEVEL:$OUTAPI_VERSION +AC_SUBST(LIBMPG123_VERSION) +AC_SUBST(API_VERSION) +AC_SUBST(LIBOUT123_VERSION) +AC_SUBST(OUTAPI_VERSION) + + +AC_CONFIG_SRCDIR(src/mpg123.c) +AC_CONFIG_AUX_DIR(build) +AC_CONFIG_SRCDIR(doc) +AC_CONFIG_MACRO_DIR([m4]) +AC_CANONICAL_HOST + +dnl Version 1.7 of automake is recommended +dnl Not sure what minimal version does not choke on sub directories. +dnl Testing with 1.14. +AM_INIT_AUTOMAKE([subdir-objects]) +AC_CONFIG_HEADERS([src/config.h]) + + +# You get strange symptoms like jack module build failing because the AC_C_CONST failed to detect the working const support. +# In that case, the test failed because -Werror, not because no const there... +# After looking again, there are possibly more tests being obscured by false failures. +AC_MSG_CHECKING([for -Werror in CFLAGS (It breaks tests)]) +if echo "$CFLAGS" | grep Werror; then + AC_MSG_RESULT([yes]) + AC_MSG_WARN([You have -Werror in CFLAGS. That may break some tests and make this configure bogus. +If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc. +Also note that you shall not run make distcheck after configuring with --enable-nagging. +distcheck uses the generated CFLAGS... +Anyhow, continuing at your own risk.]) +else + AC_MSG_RESULT([no]) +fi + +buffer=enabled # try to build with buffer by default + +dnl ############# Compiler and tools Checks + +LT_LDFLAGS=-export-dynamic +EXEC_LT_LDFLAGS= +be_static=no +all_static=no +lib_static=no +AC_MSG_CHECKING([if you are up to something totally static with LDFLAGS/CFLAGS]) +for f in $LDFLAGS $CFLAGS +do + case "$f" in + -all-static) + be_static=yes + all_static=yes + lib_static=yes + ;; + -static) + be_static=yes + lib_static=yes + ;; + -static-libgcc) + lib_static=yes + ;; + esac +done +if test "x$be_static" = xyes; then + AC_MSG_RESULT([yes]) + LT_LDFLAGS=-all-static + EXEC_LT_LDFLAGS="$LT_LDFLAGS" +else + AC_MSG_RESULT([no]) +fi +if test "x$all_static" = xyes; then + AC_MSG_WARN( Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. ) +fi + +AM_PROG_AS +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_CPP +AC_PROG_INSTALL +AC_CHECK_LIBM +AC_SUBST(LIBM) +dnl "Checking for egrep is broken after removal of libltdl stuff... checks use $EGREP, so searching it here." +AC_PROG_EGREP +AC_C_CONST +AC_INLINE +AC_C_BIGENDIAN + +if test "x$lib_static" = xyes; then + CC="$CC -static-libgcc" + CCLD="$CC" + echo "Adding -static-libgcc" +fi + +dnl ############# Use Libtool for dynamic module loading + +modules=auto +OUTPUT_OBJ="module.\$(OBJEXT)" +AC_ARG_ENABLE(modules, +[ --enable-modules=[no/yes] dynamically loadable output modules], +[ + if test "x$enableval" = xyes + then + modules=enabled + else + modules=disabled + fi +], +[ + if test "x$be_static" = "xyes"; then + modules=disabled + else + modules=auto + fi +]) + +dnl We only want shared libraries by default +AC_DISABLE_STATIC +AC_ENABLE_SHARED + +if test x"$enable_shared" = xno; then + modules=disabled + LT_LDFLAGS= +else + AC_DEFINE(DYNAMIC_BUILD, 1, [ Define if building with dynamcally linked libmpg123]) +fi + +dnl We need the windows header also for checking the module mechanism. +AC_CHECK_HEADERS([windows.h]) + +if test x"$modules" = xdisabled +then + echo "Modules disabled, not checking for dynamic loading." +else + have_dl=no + # The dlopen() API is either in libc or in libdl. + if test x$ac_cv_header_windows_h = xyes; then + AC_MSG_CHECKING([if LoadLibrary should be used]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + +#ifdef __CYGWIN__ +#error Cygwin should use dlopen +#endif + +#include + +int main() { + LoadLibraryW(0); + GetProcAddress(0, 0); + FreeLibrary(0); +} + ])], [ + have_dl=yes + AC_MSG_RESULT([Using LoadLibrary]) + ], + [AC_MSG_RESULT([no])]) + else + AC_SEARCH_LIBS(dlopen, dl) + AC_CHECK_HEADER(dlfcn.h) + AC_CHECK_FUNCS(dlopen dlsym dlclose, [ have_dl=yes ]) + fi + if test x"$modules" = xenabled -a x"$have_dl" = xno; then + AC_MSG_ERROR([Modules enabled but no runtime loader found! This will not work...]) + fi + if test x"$modules" = xauto; then + if test x"$have_dl" = xyes; then + modules=enabled + echo "We found a runtime loader: Modules enabled." + else + echo "We did not find a runtime loader: Modules disabled." + modules=disabled + fi + fi +fi + +dnl Configure libtool + +AC_LIBTOOL_WIN32_DLL +AM_PROG_LIBTOOL + +if test x"$modules" = xdisabled +then + echo "Modules disabled." +else + # Enable module support in source code + AC_DEFINE( USE_MODULES, 1, [Define if modules are enabled] ) + # Export the module file suffix as LT_MODULE_EXT + LT_SYS_MODULE_EXT +fi +AM_CONDITIONAL( [HAVE_MODULES], [test "x$modules" = xenabled] ) + +AC_SUBST(LT_LDFLAGS) +AC_SUBST(EXEC_LT_LDFLAGS) + +dnl ############## Configurable Options + +AC_ARG_ENABLE(debug, + [ --enable-debug=[no/yes] turn on debugging], + [ + if test "x$enableval" = xyes + then + debugging="enabled" + else + debugging="disabled" + fi + ], + [ debugging="disabled" ] +) + +AC_ARG_ENABLE(nagging, + [ --enable-nagging=[no/yes] turn on GCC's pedantic nagging with error on warnings, does not include --enable-debug anymore ], + [ + if test "x$enableval" = xyes + then + nagging="enabled" + else + nagging="disabled" + fi + ], + [ nagging="disabled" ] +) + +if test x"$debugging" = xenabled; then + AC_DEFINE(DEBUG, 1, [ Define if debugging is enabled. ]) +fi + +AC_ARG_ENABLE(gapless, + [ --enable-gapless=[no/yes] turn on gapless (enabled per default)], + [ + if test "x$enableval" = xyes + then + gapless="enabled" + AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ]) + else + gapless="disabled" + fi + ], + [ + gapless="enabled" + AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ]) + ] +) + +AC_ARG_ENABLE(fifo, + [ --enable-fifo=[no/yes] FIFO support for control interface (auto-enabled on linux) ], + [ + if test "x$enableval" = xyes + then + fifo="enabled" + else + fifo="disabled" + fi + ], + [ + fifo="auto" + ] +) + +AC_ARG_ENABLE(ipv6, + [ --enable-ipv6=[no/yes] IPv6 support (actually any protocol your libc does with getaddrinfo) ], + [ + if test "x$enableval" = xyes + then + ipv6="enabled" + else + ipv6="disabled" + fi + ], + [ + ipv6="auto" + ] +) + +AC_ARG_ENABLE(network, + [ --enable-network=[no/yes] network support (http streams / webradio) ], + [ + if test "x$enableval" = xyes + then + network="enabled" + else + network="disabled" + fi + ], + [ + network="auto" + ] +) + +dnl Optional objects list, depends on decoder choice and core feature selection. +dnl Not just for specific decoders anymore... +s_fpu= +DECODER_OBJ= +DECODER_LOBJ= + +dnl Core features that can be disabled to reduce binary size. + +id3v2=enabled +AC_ARG_ENABLE(id3v2, + [ --disable-id3v2=[no/yes] no ID3v2 parsing ], + [ + if test "x$enableval" = xno; then + id3v2="disabled" + fi + ], []) + +# id3v2 depends on strings... so check that in between. +string=enabled +AC_ARG_ENABLE(string, + [ --disable-string=[no/yes] no string API (this will disable ID3v2; main mpg123 won't build anymore) ], + [ + if test "x$enableval" = xno; then + string="disabled" + fi + ], []) + +if test "x$string" = "xdisabled"; then + AC_DEFINE(NO_STRING, 1, [ Define to disable string functions. ]) + id3v2=disabled + AC_MSG_WARN([ID3v2 support disabled because of string API being disabled.]) +else + DECODER_OBJ="$DECODER_OBJ stringbuf.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ stringbuf.lo" +fi + +if test "x$id3v2" = "xdisabled"; then + AC_DEFINE(NO_ID3V2, 1, [ Define to disable ID3v2 parsing. ]) +fi + +icy=enabled +AC_ARG_ENABLE(icy, + [ --disable-icy=[no/yes] no ICY metainfo parsing/conversion (main mpg123 won't build!) ], + [ + if test "x$enableval" = xno; then + icy="disabled" + fi + ], []) + +if test "x$icy" = "xdisabled"; then + AC_DEFINE(NO_ICY, 1, [ Define to disable ICY handling. ]) +else + DECODER_OBJ="$DECODER_OBJ icy.\$(OBJEXT) icy2utf8.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ icy.lo icy2utf8.lo" +fi + +ntom=enabled +AC_ARG_ENABLE(ntom, + [ --disable-ntom=[no/yes] no flexible resampling ], + [ + if test "x$enableval" = xno; then + ntom="disabled" + fi + ], []) + +if test "x$ntom" = "xdisabled"; then + AC_DEFINE(NO_NTOM, 1, [ Define to disable ntom resampling. ]) +else + DECODER_OBJ="$DECODER_OBJ ntom.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ ntom.lo" +fi + +downsample=enabled +AC_ARG_ENABLE(downsample, + [ --disable-downsample=[no/yes] no downsampled decoding ], + [ + if test "x$enableval" = xno; then + downsample="disabled" + fi + ], []) + +if test "x$downsample" = "xdisabled"; then + AC_DEFINE(NO_DOWNSAMPLE, 1, [ Define to disable downsampled decoding. ]) +fi + +feeder=enabled +AC_ARG_ENABLE(feeder, + [ --disable-feeder=[no/yes] no feeder decoding, no buffered readers ], + [ + if test "x$enableval" = xno; then + feeder="disabled" + fi + ], []) + +if test "x$feeder" = "xdisabled"; then + AC_DEFINE(NO_FEEDER, 1, [ Define to disable feeder and buffered readers. ]) +fi + +messages=enabled +AC_ARG_ENABLE(messages, + [ --disable-messages=[no/yes] no error/warning messages on the console ], + [ + if test "x$enableval" = xno; then + messages="disabled" + fi + ], []) + +if test "x$messages" = "xdisabled"; then + AC_DEFINE(NO_WARNING, 1, [ Define to disable warning messages. ]) + AC_DEFINE(NO_ERRORMSG, 1, [ Define to disable error messages. ]) + AC_DEFINE(NO_ERETURN, 1, [ Define to disable error messages in combination with a return value (the return is left intact). ]) +fi + +newhuff=enabled +AC_ARG_ENABLE(new-huffman, +[ --enable-new-huffman=[yes/no] use new huffman decoding scheme by Taihei (faster on modern CPUs at least, so on by default) ], +[ + if test "x$enableval" = xno; then + newhuff=disabled + fi +] +, []) + +if test "x$newhuff" = "xenabled"; then + AC_DEFINE(USE_NEW_HUFFTABLE, 1, [ Define for new Huffman decoding scheme. ]) +fi + +integers=fast +AC_ARG_ENABLE(int-quality, +[ --enable-int-quality=[yes/no] use rounding instead of fast truncation for integer output, where possible ], +[ + if test "x$enableval" = xyes; then + integers=quality + AC_DEFINE(ACCURATE_ROUNDING, 1, [ Define to use proper rounding. ]) + fi +], []) + +int16=enabled +AC_ARG_ENABLE(16bit, + [ --disable-16bit=[no/yes] no 16 bit integer output ], + [ + if test "x$enableval" = xno; then + int16="disabled" + fi + ], []) + +int8=enabled +AC_ARG_ENABLE(8bit, + [ --disable-8bit=[no/yes] no 8 bit integer output ], + [ + if test "x$enableval" = xno; then + int8="disabled" + fi + ], []) + +int32=enabled +AC_ARG_ENABLE(32bit, + [ --disable-32bit=[no/yes] no 32 bit integer output (also 24 bit) ], + [ + if test "x$enableval" = xno; then + int32="disabled" + fi + ], []) + +real=enabled +AC_ARG_ENABLE(real, + [ --disable-real=[no/yes] no real (floating point) output ], + [ + if test "x$enableval" = xno; then + real="disabled" + fi + ], []) + +equalizer=enabled +AC_ARG_ENABLE(equalizer, + [ --disable-equalizer=[no/yes] no equalizer support ], + [ + if test "x$enableval" = xno; then + equalizer="disabled" + fi + ], []) + + +AC_ARG_WITH([cpu], [ + --with-cpu=generic[[_fpu]] Use generic processor code with floating point arithmetic + --with-cpu=generic_float Plain alias to generic_fpu now... float output is a normal runtime option! + --with-cpu=generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM) + --with-cpu=generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding. + --with-cpu=i386[[_fpu]] Use code optimized for i386 processors with floating point arithmetic + --with-cpu=i386_nofpu Use code optimized for i386 processors with fixed point arithmetic + --with-cpu=i486 Use code optimized for i486 processors (only usable alone!) + --with-cpu=i586 Use code optimized for i586 processors + --with-cpu=i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size + --with-cpu=3dnow Use code optimized for 3DNow processors + --with-cpu=3dnow_vintage Use code optimized for older 3DNow processors (K6 family) + --with-cpu=3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon) + --with-cpu=3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate + --with-cpu=3dnow_vintage Use code optimized for older extended 3DNow processors (like K6-III+) + --with-cpu=mmx Use code optimized for MMX processors + --with-cpu=mmx_alone Really only MMX decoder, without i586 fallback for flexible rate + --with-cpu=sse Use code optimized for SSE processors + --with-cpu=sse_vintage Use code optimized for older SSE processors (plain C DCT36) + --with-cpu=sse_alone Really only SSE decoder, without i586 fallback for flexible rate + --with-cpu=avx Use code optimized for x86-64 with AVX processors + --with-cpu=x86 Pack all x86 opts into one binary (excluding i486, including dither) + --with-cpu=x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic) + --with-cpu=altivec Use code optimized for Altivec processors (PowerPC G4 and G5) + --with-cpu=ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic + --with-cpu=neon Use code optimized for ARM NEON SIMD engine (Cortex-A series) + --with-cpu=arm_fpu Pack neon and generic[[_dither]] decoders, for ARM processors with FPU and/or NEON + --with-cpu=arm_nofpu Use code optimized for ARM processors with fixed point arithmetic + --with-cpu=neon64 Use code optimized for AArch64 NEON SIMD engine + --with-cpu=aarch64 Pack neon64 and generic[[_dither]] decoders, for 64bit ARM processors +]) + +use_yasm=auto +AC_ARG_ENABLE(yasm, + [ --enable-yasm=[no/yes] enforce yasm instad of default assembler for some optimizations (AVX, currently) ], + [ + if test "x$enableval" = xyes; then + use_yasm="enabled" + else + use_yasm="disabled" + fi + ], []) + +AC_ARG_ENABLE(ieeefloat, + [ --enable-ieeefloat=[yes/no] use special hackery relying on IEEE 754 floating point storage format (to accurately round to 16 bit integer at bit more efficiently in generic decoder, enabled by default, disable in case you have a very special computer) ], + [ + if test "x$enableval" = xyes; then + ieee=enabled + else + ieee=disabled + fi + ], [ ieee=enabled ]) + +if test "x$ieee" = xenabled; then + echo "We assume IEEE754 floating point format." + AC_DEFINE(IEEE_FLOAT, 1, [ Define to indicate that float storage follows IEEE754. ]) +fi + +sys_cppflags= +newoldwritesample=disabled +case $host in + aarch64-*linux*|arm64-*linux*|aarch64-*bsd*|arm64-*bsd*|aarch64-apple-darwin*|arm64-apple-darwin*) + cpu_type="aarch64" + ;; + arm*-*-linux*-*eabihf|armv7hl*-*-linux*) + cpu_type="arm_fpu" + ;; + arm*-*-linux*) + # check that... perhaps we are better off on arm with kernel math emulation + cpu_type="arm_nofpu" + ;; + armv7*-apple-darwin*) + cpu_type="arm_fpu" + ;; + i386-*-linux*|i386-*-kfreebsd*-gnu) + cpu_type="i386_fpu" + newoldwritesample=enabled + ;; + i486-*-linux*|i486-*-kfreebsd*-gnu) + cpu_type="i486" + newoldwritesample=enabled + ;; + i586-*-linux*|i586-*-kfreebsd*-gnu) + cpu_type="x86" + newoldwritesample=enabled + ;; + i686-*-linux*|i686-*-kfreebsd*-gnu) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-linux*|x86_64-*-kfreebsd*-gnu) + cpu_type="x86-64" + ;; + *-*-linux*|*-*-kfreebsd*-gnu) + cpu_type="generic_fpu" + ;; + i?86-apple-darwin10*) + AC_MSG_CHECKING([if CPU type supports x86-64]) + case `sysctl -n hw.optional.x86_64` in + 1) + AC_MSG_RESULT([yes]) + cpu_type="x86-64" + ;; + *) + AC_MSG_RESULT([no]) + cpu_type="x86" + newoldwritesample=enabled + ;; + esac + ;; + i?86-apple-darwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-apple-darwin*) + cpu_type="x86-64" + ;; + *-apple-darwin*) + AC_MSG_CHECKING([if CPU type supports AltiVec]) + case `machine` in + ppc7400 | ppc7450 | ppc970) + AC_MSG_RESULT([yes]) + cpu_type="altivec" + ;; + *) + AC_MSG_RESULT([no]) + cpu_type="generic_fpu" + ;; + esac + ;; + i?86-*-dragonfly* | i?86-*-freebsd* | i?86-*-midnightbsd* | i?86-*-mirbsd* | i?86-*-netbsd* | i?86-*-openbsd* | i?86-*-haiku*) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-dragonfly* | x86_64-*-freebsd* | x86_64-*-midnightbsd* | x86_64-*-mirbsd* | x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-haiku*) + cpu_type="x86-64" + ;; + *-*-dragonfly* | *-*-freebsd* | *-*-midnightbsd* | *-*-mirbsd* | *-*-netbsd* | *-*-openbsd*) + cpu_type="generic_fpu" + ;; + i386-*-solaris*) + cpu_type=x86 + newoldwritesample=enabled + ;; + x86_64-*-solaris*) + cpu_type=x86-64 + ;; + *-*-solaris*) + cpu_type="generic_fpu" + ;; + # os2-emx = OS/2 with some Unix fun; so p.ex. buffer works. + # Till we sorted out the assembler troubles, generic CPU is default. + i386-pc-os2-emx) + cpu_type=generic_fpu + newoldwritesample=enabled + ;; + x86_64-pc-os2-emx) + # We are optimistic hat the future knows OS/2 on x86-64;-) + cpu_type=generic_fpu + ;; + *-pc-os2-emx) + cpu_type="generic_fpu" + ;; + *-dec-osf*) + cpu_type="generic_fpu" + ;; + x86_64-*-cygwin*) + cpu_type="x86-64" + ;; + i686-*-cygwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + i586-*-cygwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + i486-*-cygwin*) + cpu_type="i486" + newoldwritesample=enabled + ;; + i386-*-cygwin*) + cpu_type="i386" + newoldwritesample=enabled + ;; + *-cygwin*) + cpu_type="generic_fpu" + ;; + i@<:@3-7@:>@86-*-mingw32*) + LIBS="$LIBS" + buffer=disabled + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-mingw32*) + LIBS="$LIBS" + buffer=disabled + cpu_type="x86-64" + ;; + i386-*-nto-qnx*) + cpu_type="x86" + newoldwritesample=enabled + ;; + *-ibm-aix*) + AC_MSG_WARN([AIX system detected. You might want to --disable-largefile when trouble about conflicting types for lseek64 and friends occurs.]) + # Altivec instead? It is developed for MacOS ... + cpu_type=generic_fpu + # no struct winsize without _ALL_SOURCE + sys_cppflags=-D_ALL_SOURCE + ;; + i386-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="i386" + buffer=disabled + sys_cppflags=-DGENERIC + newoldwritesample=enabled + ;; + i486-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="i486" + buffer=disabled + sys_cppflags=-DGENERIC + newoldwritesample=enabled + ;; + i586-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="x86" + buffer=disabled + sys_cppflags=-DGENERIC + newoldwritesample=enabled + ;; + i686-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="x86" + buffer=disabled + sys_cppflags=-DGENERIC + newoldwritesample=enabled + ;; + x86_64-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="x86-64" + buffer=disabled + sys_cppflags=-DGENERIC + ;; + *) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="generic_fpu" + buffer=disabled + sys_cppflags=-DGENERIC + ;; +esac + +AC_ARG_ENABLE(buffer, + [ --enable-buffer=[yes/no] disable audio buffer code (default uses system whitelist... proper checks later) ], + [ + if test "x$enableval" = xyes + then + echo "Note: Enabling buffer per request... perhaps it will not build anyway." + buffer="enabled" + else + echo "Note: Disabling buffer per request." + buffer="disabled" + fi + ] +) + +AC_ARG_ENABLE(newoldwritesample, +[ --enable-newoldwritesample=[no/yes] enable new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on x86-32)], +[ + if test "x$enableval" = xyes + then + newoldwritesample=enabled + else + newoldwritesample=disabled + fi +]) + +dnl Did user choose other CPU type ? +if test "x$with_cpu" != "x"; then + cpu_type=$with_cpu +fi + +# Flag for 32 bit synth output or post-processing. +case "$cpu_type" in +*_nofpu) + synth32=false + AC_DEFINE(NO_SYNTH32, 1, [ Define for post-processed 32 bit formats. ]) +;; +*) + synth32=true +;; +esac + +if test "x$int16" = "xdisabled"; then + AC_DEFINE(NO_16BIT, 1, [ Define to disable 16 bit integer output. ]) +else + DECODER_OBJ="$DECODER_OBJ synth.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ synth.lo" +fi + +# 8bit works only through 16bit +if test "x$int16" = "xdisabled"; then + int8=disabled +fi +if test "x$int8" = "xdisabled"; then + AC_DEFINE(NO_8BIT, 1, [ Define to disable 8 bit integer output. ]) +else + DECODER_OBJ="$DECODER_OBJ synth_8bit.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ synth_8bit.lo" +fi + +if test "x$int32" = "xdisabled"; then + AC_DEFINE(NO_32BIT, 1, [ Define to disable 32 bit and 24 bit integer output. ]) +else + if $synth32; then + s_fpu="$s_fpu synth_s32" + fi +fi + +if test "x$real" = "xdisabled"; then + AC_DEFINE(NO_REAL, 1, [ Define to disable real output. ]) +else + if $synth32; then + s_fpu="$s_fpu synth_real" + fi +fi + +if test "x$equalizer" = "xdisabled"; then + AC_DEFINE(NO_EQUALIZER, 1, [ Define to disable equalizer. ]) +fi + +layer1=enabled +AC_ARG_ENABLE(layer1, + [ --disable-layer1=[no/yes] no layer I decoding ], + [ + if test "x$enableval" = xno; then + layer1="disabled" + fi + ], []) + +if test "x$layer1" = "xdisabled"; then + AC_DEFINE(NO_LAYER1, 1, [ Define to disable layer I. ]) +else + # layer1 needs code in layer2 + DECODER_OBJ="$DECODER_OBJ layer1.\$(OBJEXT) layer2.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer1.lo layer2.lo" +fi + +layer2=enabled +AC_ARG_ENABLE(layer2, + [ --disable-layer2=[no/yes] no layer II decoding ], + [ + if test "x$enableval" = xno; then + layer2="disabled" + fi + ], []) + +if test "x$layer2" = "xdisabled"; then + AC_DEFINE(NO_LAYER2, 1, [ Define to disable layer II. ]) +else + # layer1 may have added the objects already + if test "x$layer1" = "xdisabled"; then + DECODER_OBJ="$DECODER_OBJ layer2.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer2.lo" + fi +fi + +layer3=enabled +AC_ARG_ENABLE(layer3, + [ --disable-layer3=[no/yes] no layer III decoding ], + [ + if test "x$enableval" = xno; then + layer3="disabled" + fi + ], []) + +if test "x$layer3" = "xdisabled"; then + AC_DEFINE(NO_LAYER3, 1, [ Define to disable layer III. ]) +else + DECODER_OBJ="$DECODER_OBJ layer3.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer3.lo" +fi + +AC_ARG_WITH([audio], [ + --with-audio= Select a list (or only one) of audio output modules (comma or space separated list). +]) +AC_ARG_WITH([default-audio], [ + --with-default-audio=aix Use AIX as default audio output sub-system + --with-default-audio=alib Use Alib as default audio output sub-system (for HPUX) + --with-default-audio=alsa Use ALSA as default audio output sub-system (libasound) + --with-default-audio=tinyalsa Use ALSA as default audio output sub-system (tinyalsa) + --with-default-audio=arts Use aRts as default audio output sub-system (KDE sound server) + --with-default-audio=dummy Use dummy as default audio (when no sound card is available) + --with-default-audio=esd Use ESoundD as default audio output sub-system + --with-default-audio=hp Use HP as default audio output sub-system + --with-default-audio=jack Use JACK as default low-latency audio server + --with-default-audio=coreaudio Use Mac OS X as default audio output sub-system (CoreAudio) + --with-default-audio=mint Use MinT as default audio output sub-system (Atari) + --with-default-audio=nas Use NAS as default audio output (Network Audio System) + --with-default-audio=os2 Use OS2 as default audio output sub-system + --with-default-audio=oss Use OSS as default audio output sub-system (/dev/dsp) + --with-default-audio=portaudio Use PortAudio as default audio output sub-system + --with-default-audio=pulse Use Pulse audio server as default audio output sub-system + --with-default-audio=qsa Use QSA as default audio output sub-system + --with-default-audio=sdl Use SDL as default audio output sub-system (Simple DirectMedia Layer) + --with-default-audio=sgi Use SGI as default audio output sub-system (IRIX) + --with-default-audio=sndio Use OpenBSD's sndio as default audio output sub-system + --with-default-audio=sun Use Sun as default audio output sub-system (/dev/audio) + --with-default-audio=win32 Use Win32 audio as default audio output sub-system + --with-default-audio=win32_wasapi Use Win32 wasapi audio as default audio output sub-system +]) + +AC_ARG_WITH([optimization], [ + --with-optimization=0 No Optimization + --with-optimization=1 Limited Optimization (-O) (for gcc) + --with-optimization=2 Default Optimization (-O2 ...) (for gcc) + --with-optimization=3 More Optimize than default (-O3 ...) (for gcc) + --with-optimization=4 Optimize yet more (-O4 ...) (for gcc) +]) + +AC_ARG_WITH([seektable], [ + --with-seektable= choose size of seek index table (0 disables it), default 1000 +]) + + +dnl ############## Modules + +# Dummy audio output module is always supported +output_modules="dummy" + +dnl ############## Assembler, compiler properties + +# based on posting from John Dalgliesh on ffmpeg (LGPL) mailing list +# extended to use balign if present +AC_MSG_CHECKING([if .balign is present]) +echo '.balign 4' > conftest.s +if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then + + AC_MSG_RESULT([yes]) + AC_DEFINE(ASMALIGN_BALIGN, 1, [ Define if .balign is present. ]) + +else + +AC_MSG_RESULT([no]) + +# find if .align arg is power-of-two or not +asmalign_exp="unknown" +if test x"$asmalign_exp" = xunknown; then + AC_MSG_CHECKING([if .align takes 2-exponent]) + asmalign_exp="no" + echo '.align 3' > conftest.s + if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then + asmalign_exp="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + rm -f conftest.o conftest.s +fi +if test x"$asmalign_exp" = xyes; then + AC_DEFINE(ASMALIGN_EXP, 1, [ Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. ]) +else + AC_DEFINE(ASMALIGN_BYTE, 1, [ Define if .align just takes byte count. ]) +fi + +fi + +ccalign="unknown" +if test x"$ccalign" = xunknown; then + AC_MSG_CHECKING([__attribute__((aligned(16)))]) + ccalign="no" + echo '__attribute__((aligned(16))) float var;' > conftest.c + if $CC -c -o conftest.o conftest.c >/dev/null 2>&1; then + ccalign="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + rm -f conftest.o conftest.c +fi + +dnl We apply alignment hints only to cpus that need it. +dnl See further below for the definition of CCALIGN + +avx_support="unknown" +if test x"$avx_support" = xunknown; then + AC_MSG_CHECKING([if assembler supports AVX instructions]) + avx_support="no" + echo '.text' > conftest.s + echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s + if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then + avx_support="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + rm -f conftest.o conftest.s +fi + +check_yasm=no +if test x"$avx_support" = xno || test x"$use_yasm" = xenabled; then + check_yasm=yes +fi +if test x"$use_yasm" = xdisabled; then + check_yasm=no +fi + +if test x"$check_yasm" = xyes; then + AC_CHECK_PROGS(YASM,[yasm],no) + if test x"$YASM" != xno; then + AC_MSG_CHECKING([if $YASM supports GAS syntax and AVX instructions]) + echo '.text' > conftest.s + echo 'vaddps %ymm0,%ymm0,%ymm0' >> conftest.s + if $YASM -pgas -rcpp -o conftest.o conftest.s 1>/dev/null 2>&1; then + avx_support="yes" + YASMFLAGS="-pgas -rgas -mamd64" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + rm -f conftest.o conftest.s + else + if test x"$use_yasm" = xenabled; then + AC_MSG_ERROR([Yasm enforced but not found!]) + fi + fi +else + YASM="no" +fi + +if test "x$cpu_type" = "xavx"; then + if test "x$avx_support" != "xyes"; then + AC_MSG_ERROR([Assembler doesn't understand AVX instructions.]) + fi +fi + +AC_SUBST(YASM) +AC_SUBST(YASMFLAGS) + +dnl ############## Really basic headers, needed for other checks. + +AC_HEADER_STDC +dnl Is it too paranoid to specifically check for stdint.h and limits.h? +AC_CHECK_HEADERS([stdio.h stdlib.h string.h unistd.h sched.h sys/ioctl.h sys/types.h stdint.h limits.h inttypes.h sys/time.h sys/wait.h sys/resource.h sys/signal.h signal.h sys/select.h dirent.h sys/stat.h]) + +dnl ############## Types + +dnl Large file support stuff needs cleanup. There are superfluous variables. + +dnl Detect large file support, enable switches if needed. +AC_SYS_LARGEFILE +dnl If we do have a switch for large files, rename off_t-aware API calls. +dnl Using the file_offset_bits variable here is fine for linux (possibly Solaris), +dnl Others... we'll have to see. +dnl Note: I started writing this with with multiline replacements. +dnl Does not work. Automake insists on putting these into Makefiles where they break things. +dnl It is also assumed that a system that does not set file offset bits is not +dnl sensitive to largefile changes, i.e. FreeBSD always using 64 bit off_t. +if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP '@<:@^0-9@:>@' > /dev/null; then + dnl if it has non-numeric chars or is empty... ignore... + LFS_LOBJ= + largefile_sensitive=no +else + # Add dual-mode wrapper code. + LFS_LOBJ=lfs_wrap.lo + largefile_sensitive=yes +fi + +# Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf. +AC_CHECK_TYPE(size_t, unsigned long) +AC_CHECK_TYPE(uintptr_t, unsigned long) +AC_CHECK_TYPE(ssize_t, long) +AC_CHECK_TYPE(off_t, long int) +AC_CHECK_TYPE(int32_t, int) +AC_CHECK_TYPE(int64_t, long long) +AC_CHECK_TYPE(uint32_t, unsigned int) +AC_CHECK_TYPE(int16_t, short) +AC_CHECK_TYPE(uint16_t, unsigned short) +AC_CHECK_SIZEOF(size_t,4) +AC_CHECK_SIZEOF(ssize_t,4) +AC_CHECK_SIZEOF(off_t,4) +AC_CHECK_SIZEOF(int32_t) +AC_CHECK_SIZEOF(long,4) + +dnl The native type used for aliases is what off_t maps to without any largefile- +dnl enabling switches. So, it's long int if the system is largefile-senstive, +dnl but it is actual plain off_t if the system does not have such switches. +if test "x$largefile_sensitive" = xyes; then + lfs_alias_type=long + lfs_alias_size=$ac_cv_sizeof_long +else + lfs_alias_type=off_t + lfs_alias_size=$ac_cv_sizeof_off_t +fi + +if test "x$lfs_alias_size" = "x"; then + AC_MSG_ERROR([Cannot determine sizeof(lfs_alias_t)?]) +else + LFS_ALIAS_BITS=`expr "$lfs_alias_size" "*" "8"` + AC_DEFINE_UNQUOTED([lfs_alias_t], $lfs_alias_type, + [Define to the native offset type (long or actually off_t).]) + AC_DEFINE_UNQUOTED([LFS_ALIAS_BITS], $LFS_ALIAS_BITS, + [Define this to the size of native offset type in bits, used for LFS alias functions.]) +fi + +lfs_alias=enabled +AC_ARG_ENABLE(lfs-alias, + [ --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 or mpg123_seek_64 in addition to mpg123_seek, or the other way around; It is a mess, do not play with this!) ], + [ + if test "x$enableval" = xno; then + lfs_alias="disabled" + fi + ], + [ + case $host in + *-cygwin*) + lfs_alias="disabled" + AC_MSG_NOTICE([lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing]) + ;; + esac + + ]) + +AC_MSG_CHECKING([if we want to enable alias wrappers for largefile]) +if test "x$lfs_alias" = "xenabled"; then + AC_MSG_RESULT([yes]) + LFS_LOBJ="$LFS_LOBJ lfs_alias.lo" +else + AC_MSG_RESULT([no]) +fi + +# Again, prepend path for non-recursive make. +LFS_LOBJ=`for i in $LFS_LOBJ; do printf ' src/libmpg123/%s' $i; done` +AC_SUBST(LFS_LOBJ) + + +dnl ############## Function Checks + +AC_FUNC_MMAP + +# Check if system supports termios +AC_SYS_POSIX_TERMIOS +if test "x$ac_cv_sys_posix_termios" = "xyes"; then + AC_DEFINE_UNQUOTED([HAVE_TERMIOS], 1, + [Define this if you have the POSIX termios library]) +fi + +AC_CHECK_FUNCS( random ) + +# Check for sched_setscheduler +AC_CHECK_FUNCS( sched_setscheduler setuid getuid) + +# Check for setpriority +AC_CHECK_FUNCS( setpriority ) + +AC_CHECK_FUNCS( strerror ) + +AC_CHECK_FUNCS( setlocale nl_langinfo ) + +AC_CHECK_FUNCS( atoll ) + +AC_CHECK_FUNCS( mkfifo, [ have_mkfifo=yes ], [ have_mkfifo=no ] ) + +dnl ############## Header and Library Checks + +# locale headers +AC_CHECK_HEADERS([locale.h langinfo.h]) +# Headers for network (http) stuff +network_type=Unknown +AC_CHECK_HEADERS([netdb.h sys/param.h sys/socket.h netinet/in.h arpa/inet.h]) +if test "x$ac_cv_header_netdb_h" = "xyes" && + test "x$ac_cv_header_sys_param_h" = "xyes" && + test "x$ac_cv_header_sys_socket_h" = "xyes" && + test "x$ac_cv_header_netinet_in_h" = "xyes" && + test "x$ac_cv_header_arpa_inet_h" = "xyes"; then + have_network=yes + network_type=Posix +else + have_network=no +fi + +dnl trying to get that socket lib settled in one line +AC_SEARCH_LIBS(gethostbyname, nsl socket network) +dnl OK, two lines... Solaris needs -lnsl -lsocket +AC_SEARCH_LIBS(socket, socket) + +AC_CHECK_FUNCS( getaddrinfo, [ have_ipv6=yes ], [ have_ipv6=no ] ) + +APR_CHECK_GETADDRINFO_ADDRCONFIG() + +# Substitutions for the installable mpg123.h header +if test "x$ac_cv_header_stdio_h" = "xyes"; then + INCLUDE_STDIO_H="#include " +else + INCLUDE_STDIO_H="/* #include is not available on this system */" +fi +AC_SUBST(INCLUDE_STDIO_H) + +if test "x$ac_cv_header_stdlib_h" = "xyes"; then + INCLUDE_STDLIB_H="#include " +else + INCLUDE_STDLIB_H="/* #include is not available on this system */" +fi +AC_SUBST(INCLUDE_STDLIB_H) + +if test "x$ac_cv_header_sys_types_h" = "xyes"; then + INCLUDE_SYS_TYPE_H="#include " +else + INCLUDE_SYS_TYPE_H="/* #include is not available on this system */" +fi +AC_SUBST(INCLUDE_SYS_TYPE_H) + + +# Checks for maths libraries. +AC_CHECK_LIB([m], [sqrt]) +AC_CHECK_LIB([mx], [powf]) + +# attempt to make the signal stuff work... also with GENERIC - later +#if test x"$ac_cv_header_sys_signal_h" = xyes; then +# AC_CHECK_FUNCS( sigemptyset sigaddset sigprocmask sigaction ) +# if test x"$ac_cv_func_sigemptyset" = xyes && +# test x"$ac_cv_func_sigaddset" = xyes && +# test x"$ac_cv_func_sigprocmask" = xyes && +# test x"$ac_cv_func_sigaction" = xyes; then +# AC_DEFINE( +#fi + +dnl ############## Choose compiler flags and CPU + +# do not assume gcc here, so no flags by default +ADD_CFLAGS="" +ADD_CPPFLAGS="$sys_cppflags" +ADD_LDFLAGS="" +LIBS="$LIBS" + +# Consider moving that stuff. +AC_CHECK_HEADER([os2.h], [ADD_CPPFLAGS="$ADD_CPPFLAGS -DOS2"]) +# On OS/2, we need to link to os2term to make terminal control actually work. +AC_CHECK_LIB([os2term], [tcsetattr], [ADD_LDFLAGS="$ADD_LDFLAGS -los2term"]) + +# If debugging is enabled, just enable debugging symbols. +# All other stuff enters nagging territory. +if test x"$debugging" = xenabled; then + ADD_CFLAGS="-g" +fi +# gcc specific... +if test x"$GCC" = xyes; then + if test x"$nagging" = xenabled; then + ADD_CFLAGS="$ADD_CFLAGS -Wall -Werror -std=c89 -pedantic -DPLAIN_C89" + fi +fi + +dnl Only try the attribute_align_arg mumbo-jumbo on x86, x86-64 warns/errors out on that attribute. +dnl ...dunno even what about other architectures. +case $host in + i?86-*) + AC_DEFINE(ABI_ALIGN_FUN, 1, [ Define if your architecture wants/needs/can use attribute_align_arg and alignment checks. It is for 32bit x86... ]) + ;; +esac + +s_altivec="synth_altivec dct64_altivec" +s_i386="dct64_i386" +s_i486="$s_i386 synth_i486 dct64_i486" +s_i586="$s_i386 synth_i586" +s_i586d="$s_i386 synth_i586_dither" +s_3dnow="$s_i386 synth_3dnow dct64_3dnow equalizer_3dnow" +s_3dnowext="$s_i386 dct64_3dnowext tabinit_mmx synth_3dnowext" +s_3dnow_vintage=$s_3dnow +s_3dnowext_vintage=$s_3dnowext +if test "x$layer3" = "xenabled"; then + s_3dnow_vintage="$s_3dnow_vintage dct36_3dnow" + s_3dnowext_vintage="$s_3dnowext_vintage dct36_3dnowext" +fi +s_mmx="$s_i386 dct64_mmx tabinit_mmx synth_mmx" +s_sse_vintage="$s_i386 tabinit_mmx dct64_sse_float synth_sse_float synth_stereo_sse_float synth_sse_s32 synth_stereo_sse_s32 " +s_sse="$s_sse_vintage dct36_sse" +s_x86_64="dct36_x86_64 dct64_x86_64_float synth_x86_64_float synth_x86_64_s32 synth_stereo_x86_64_float synth_stereo_x86_64_s32" +s_x86_64_mono_synths="synth_x86_64_float synth_x86_64_s32" +s_x86_64_avx="dct36_avx dct64_avx_float synth_stereo_avx_float synth_stereo_avx_s32" +s_x86multi="getcpuflags" +s_x86_64_multi="getcpuflags_x86_64" +s_dither="dither" +s_neon="dct36_neon dct64_neon_float synth_neon_float synth_neon_s32 synth_stereo_neon_float synth_stereo_neon_s32" +s_neon64="dct36_neon64 dct64_neon64_float synth_neon64_float synth_neon64_s32 synth_stereo_neon64_float synth_stereo_neon64_s32" +s_arm_multi="getcpuflags_arm check_neon" + +# choose optimized 16bit decoder for SSE, quality or fast +# note: supporting deactivation of output formats for these decoders would need more logic here +if test "x$integers" = "xquality"; then + s_sse="$s_sse synth_sse_accurate synth_stereo_sse_accurate" + s_sse_vintage="$s_sse_vintage synth_sse_accurate synth_stereo_sse_accurate" + s_x86_64="$s_x86_64 synth_x86_64_accurate synth_stereo_x86_64_accurate" + s_x86_64_mono_synths="$s_x86_64_mono_synths synth_x86_64_accurate" + s_x86_64_avx="$s_x86_64_avx synth_stereo_avx_accurate" + s_arm="synth_arm_accurate" + s_neon="$s_neon synth_neon_accurate synth_stereo_neon_accurate" + s_neon64="$s_neon64 synth_neon64_accurate synth_stereo_neon64_accurate" +else + s_sse="$s_sse dct64_sse synth_sse" # no stereo + s_sse_vintage="$s_sse_vintage dct64_sse synth_sse" # no stereo + s_x86_64="$s_x86_64 synth_x86_64 dct64_x86_64 synth_stereo_x86_64" + s_x86_64_mono_synths="$s_x86_64_mono_synths synth_x86_64" + s_x86_64_avx="$s_x86_64_avx dct64_avx synth_stereo_avx" + s_arm="synth_arm" + s_neon="$s_neon dct64_neon synth_neon synth_stereo_neon" + s_neon64="$s_neon64 dct64_neon64 synth_neon64 synth_stereo_neon64" +fi + +dnl CPU specific compiler flags and sources +case $cpu_type in + generic) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" + more_sources="$s_fpu" + ccalign=no + ;; + generic_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_dither" + ccalign=no + ;; +dnl Not disabling buffer for float mode... check that this is OK now! + generic_fpu | generic_float) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" + more_sources="$s_fpu" + ccalign=no + ;; + generic_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FIXED" + more_sources= + ccalign=no + ;; + ppc_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DOPT_PPC -DREAL_IS_FIXED" + more_sources= + ccalign=no + ;; + arm_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_ARM -DREAL_IS_FIXED" + more_sources="$s_arm" + ccalign=no + ;; + altivec) + ADD_CFLAGS="$ADD_CFLAGS -maltivec" + ADD_CPPFLAGS="$ADD_CPPFLAGS -DREAL_IS_FLOAT -DOPT_ALTIVEC" + more_sources="$s_altivec $s_fpu" + AC_MSG_CHECKING([if $CC accepts -faltivec]) + touch conftest.c + if $CC -faltivec -c -o conftest.o conftest.c >/dev/null 2>&1; then + ADD_CFLAGS="$ADD_CFLAGS -faltivec" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + rm -f conftest.o conftest.c + ;; + neon) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON -DREAL_IS_FLOAT" + more_sources="$s_neon $s_fpu" + ;; + arm_fpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON -DREAL_IS_FLOAT" + more_sources="$s_neon $s_fpu $s_dither $s_arm_multi" + ;; + neon64) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON64 -DREAL_IS_FLOAT" + more_sources="$s_neon64 $s_fpu" + ;; + aarch64) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON64 -DREAL_IS_FLOAT" + more_sources="$s_neon64 $s_fpu $s_dither $s_arm_multi" + ;; + i386) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386" + ccalign=no + ;; + i386_fpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386" + ccalign=no + ;; + i386_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FIXED" + more_sources="$s_i386" + ccalign=no + ;; + i486) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I486 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i486" + ccalign=no + ;; + i586) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586" + ;; + i586_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586d $s_dither" + ;; + 3dnow) + # legacy 3dnow had the 3dnow paired with i586... + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586 $s_3dnow $s_x86multi " + ;; + 3dnow_vintage) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW_VINTAGE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586 $s_3dnow_vintage $s_x86multi " + ;; + 3dnow_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOW -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnow" + ;; + 3dnowext_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOWEXT -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext" + ;; + 3dnowext_vintage) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT_VINTAGE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext_vintage $s_3dnow $s_x86multi" + ;; + 3dnowext) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext $s_3dnow $s_x86multi" + ;; + mmx_alone|mmx) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MMX -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_mmx" + ;; + sse_alone|sse) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_sse" + ;; + sse_vintage) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_sse_vintage" + ;; + avx) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64_avx $s_x86_64_mono_synths" + if test "x$YASM" != "xno"; then + use_yasm_for_avx="yes" + fi + ;; + x86|x86_dither) + # plain C dct36 always there, for vintage/non-vintage + # Selection of non-/vintage sources implies that + # $s_3dnow_vintage contains $s_3dnow, + # $s_sse contains $s_sse_vintage. + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOW_VINTAGE -DOPT_3DNOWEXT -DOPT_3DNOWEXT_VINTAGE -DOPT_SSE -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386 $s_i586 $s_i586d $s_mmx $s_3dnow_vintage $s_3dnowext_vintage $s_sse $s_x86multi $s_dither" + ;; + x86-64_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_X86_64 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64" + ;; + x86-64|x86-64_all|x86-64_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_X86_64 -DOPT_GENERIC -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64 $s_dither $s_x86_64_multi" + if test "x$avx_support" = "xyes"; then + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_AVX" + more_sources="$more_sources $s_x86_64_avx" + if test "x$YASM" != "xno"; then + use_yasm_for_avx="yes" + fi + fi + ;; + *) + AC_MSG_ERROR([Unknown CPU type '$cpu_type']) + ;; +esac + +# Use yasm instead of the default assembler for AVX sources +if test "x$use_yasm_for_avx" = "xyes"; then + case $host_os in + *cygwin*|*mingw*) + YASM_FORMAT="-f win64" + ;; + *darwin*) + YASM_FORMAT="-f macho" + ;; + *) + YASM_FORMAT="-f elf" + ;; + esac + AC_DEFINE(USE_YASM_FOR_AVX, 1, [Define to use yasm for assemble AVX sources.]) +fi +AM_CONDITIONAL( [USE_YASM_FOR_AVX], [test "x$use_yasm_for_avx" = xyes] ) +AC_SUBST(YASM_FORMAT) + +# Check if we want feature report function. +AC_MSG_CHECKING([if we want feature report function]) +feature_report=enabled +AC_ARG_ENABLE(feature_report, + [ --disable-feature_report Disable feature report function ], + [ + if test "x$enableval" = xno; then + AC_MSG_RESULT([no]) + feature_report=disabled + else + AC_MSG_RESULT([yes]) + fi + ], + [AC_MSG_RESULT([yes])]) + +if test "x$feature_report" = xenabled; then + more_sources="$more_sources feature" +fi + +# Return 0 if first arg appears in list of following arguments. +# Return 1 otherwise. +word_in_list() { + word=$1 + shift + # Avoid naming conflict with the outside! + # Is local not POSIX sh? + for given_word in "$@" + do + if test "x$word" = "x$given_word"; then + return 0 + fi + done + return 1 +} + +for i in $more_sources +do + # Make sure every file is only once in the list. + word_in_list "$i.\$(OBJEXT)" $DECODER_OBJ || DECODER_OBJ="$DECODER_OBJ $i.\$(OBJEXT)" + word_in_list "$i.lo" $DECODER_LOBJ || DECODER_LOBJ="$DECODER_LOBJ $i.lo" +done + +# Another preprocessing step: Append prefix for non-recursive make. +# Just because $(addprefix ...) is a GNU extension. + +DECODER_OBJ=`for i in $DECODER_OBJ; do printf ' src/libmpg123/%s' $i; done` +DECODER_LOBJ=`for i in $DECODER_LOBJ; do printf ' src/libmpg123/%s' $i; done` + +AC_SUBST(DECODER_OBJ) +AC_SUBST(DECODER_LOBJ) + +dnl Finally insert the code switch for alignment, above cpu selection having possibly changed the setting. +if test x"$ccalign" = xyes; then + AC_DEFINE(CCALIGN, 1, [ Define if __attribute__((aligned(16))) shall be used ]) +fi + + +dnl ############## Output module choice + +# The full list of supported modules to check, first come, first serve. +check_modules="alsa tinyalsa oss coreaudio sndio sun win32 win32_wasapi os2 esd jack portaudio pulse sdl nas arts openal dummy" +# Only check qsa before all else on QNX. +# It would mask ALSA otherwise. +case $host in + *-nto-qnx*) + check_modules="qsa $check_modules" + ;; +esac + +# The final list. +output_modules= + +check_forced=no +check_failed=no +if test "x$with_audio" != "x"; then + check_modules="`echo $with_audio|tr , ' '` dummy" + echo "Limiting outputs to build according to your preference: $check_modules" + check_forced=yes +fi + +PKG_PROG_PKG_CONFIG([]) + +# Now go through the modules to check and do the chores. +for m in $check_modules +do + case "$m" in + dummy) + AC_MSG_CHECKING([if you are too dumbing dumb for the dummy]) + AC_MSG_RESULT([no]) + output_modules="$output_modules dummy" + HAVE_DUMMY=yes + ;; + oss) + AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h]) + if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" \ + -o "x${ac_cv_header_linux_soundcard_h}" = "xyes" \ + -o "x${ac_cv_header_machine_soundcard_h}" = "xyes"; + then + output_modules="$output_modules oss" + HAVE_OSS="yes" + else + check_failed=yes + fi + ;; + tinyalsa) + TINYALSA_LIBS="-ltinyalsa" + # Check for ALSA + AC_CHECK_LIB( [tinyalsa], [pcm_open], + [ AC_CHECK_HEADER( [tinyalsa/asoundlib.h], + [ output_modules="$output_modules tinyalsa" HAVE_TINYALSA="yes"], + [ AC_MSG_WARN([Found TINYALSA library but NOT header files on your system]) ] ) + ] + ) + if test "x$HAVE_TINYALSA" != xyes; then + check_failed=yes + fi + ;; + # QSA and ALSA are not distinguishable in these tests, need to block + # each other and play with test order depending on platform. + alsa) + if test "x$HAVE_QSA" = xyes; then + HAVE_ALSA=no + else + + ALSA_LIBS="-lasound" + # Check for ALSA + AC_CHECK_LIB( [asound], [snd_pcm_open], + [ AC_CHECK_HEADER( [alsa/asoundlib.h], + [ output_modules="$output_modules alsa" HAVE_ALSA="yes"], + [ AC_MSG_WARN([Found ALSA library but NOT header files on your system]) ] ) + ] + ) + if test "x$HAVE_ALSA" != xyes; then + check_failed=yes + fi + + fi # HAVE_QSA + ;; + qsa) + if test "x$HAVE_ALSA" = xyes; then + HAVE_QSA=no + else + + QSA_LIBS="-lasound" + # Check for QSA + AC_CHECK_LIB( [asound], [snd_pcm_open], + [ AC_CHECK_HEADER( [sys/asoundlib.h], + [ output_modules="$output_modules qsa" HAVE_QSA="yes"], + [ AC_MSG_WARN([Found QSA library but NOT header files on your system]) ] ) + ] + ) + if test "x$HAVE_QSA" != xyes; then + check_failed=yes + fi + + fi # HAVE_ALSA + ;; + jack) + # JACK module uses semaphores, hence -lpthread. + AC_CHECK_LIB( [pthread], [sem_post], + [ PKG_CHECK_MODULES(JACK, jack, + [ + output_modules="$output_modules jack" + HAVE_JACK="yes" + JACK_LIBS="$JACK_LIBS -lpthread" + ], [ HAVE_JACK="no" check_failed=yes ] ) + ], + [ HAVE_JACK=no check_failed=yes ] + ) + ;; + pulse) + PKG_CHECK_MODULES(PULSE, libpulse-simple, output_modules="$output_modules pulse" HAVE_PULSE="yes", HAVE_PULSE="no" check_failed=yes) + ;; + esd) + PKG_CHECK_MODULES(ESD, esound, output_modules="$output_modules esd" HAVE_ESD="yes", HAVE_ESD="no" check_failed=yes) + ;; + portaudio) + # Remember: This looks only insane because you chose an insane tab width! + PORTAUDIO_LIBS="-lportaudio" + PORTAUDIO_CFLAGS= + case $host in + *-*-mingw32) + # We tested portaudio with MME + if test "x$HAVE_PORTAUDIO" != "xyes"; then + AC_CHECK_LIB( [portaudio], [Pa_Initialize], + [ AC_CHECK_HEADER( [portaudio.h], + [ output_modules="$output_modules portaudio" HAVE_PORTAUDIO_WINMM="yes" HAVE_PORTAUDIO="yes" ], + [ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] ) + PORTAUDIO_LIBS="$PORTAUDIO_LIBS -lwinmm" + ], + [ HAVE_PORTAUDIO="no"], + [ -lwinmm ] + ) + fi + ;; + *) + AC_CHECK_LIB( [portaudio], [Pa_Initialize], + [ AC_CHECK_HEADER( [portaudio.h], + [ output_modules="$output_modules portaudio" HAVE_PORTAUDIO="yes" ], + [ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] ) + ] + ) + ;; + esac + if test "x$HAVE_PORTAUDIO" != xyes; then + check_failed=yes + else + # See if we have v19 or v18 + AC_CHECK_LIB( [portaudio], [Pa_GetVersion], [:], [AC_DEFINE( [PORTAUDIO18], 1, [Define if portaudio v18 API is wanted.]) ], [$PORTAUDIO_LIBS] ) + fi + ;; + sdl) + PKG_CHECK_MODULES(SDL, sdl, output_modules="$output_modules sdl" HAVE_SDL="yes", HAVE_SDL="no" check_failed=yes) + ;; + nas) + NAS_LIBS=-laudio + AC_CHECK_LIB( [audio], [AuOpenServer], + [ AC_CHECK_HEADER( [audio/audiolib.h], + [ output_modules="$output_modules nas" HAVE_NAS="yes"], + [ AC_MSG_WARN([Found NAS library but NOT header files on your system]) ] ) + ] + ) + if test "x$HAVE_NAS" != xyes; then + check_failed=yes + fi + ;; + win32) + # Check for windows ... and win32 audio + # Does not work... instead just check for header + # AC_CHECK_LIB( [winmm], [waveOutOpen] ) + WIN32_LIBS=-lwinmm + if test x$ac_cv_header_windows_h = xyes; then + output_modules="$output_modules win32" + HAVE_WIN32=yes + else + HAVE_WIN32=no + check_failed=yes + fi + ;; + win32_wasapi) + # Check for windows ... and win32 wasapi audio + # Does not work... instead just check for header + # AC_CHECK_LIB( [avrt], [] ) + AC_MSG_CHECKING([if we have wasapi headers]) + OLD_LIBS=$LIBS + LIBS="$LIBS -lole32 -lavrt" + AC_LINK_IFELSE([AC_LANG_SOURCE([ +#define COBJMACROS 1 +#define _WIN32_WINNT 0x601 +#include +#include +#include +#include +int main(){ + /* UUID Checks */ + GUID *IDs[] = { + &CLSID_MMDeviceEnumerator, + &IID_IMMDeviceEnumerator, + &IID_IAudioClient, + &IID_IAudioRenderClient + }; + return 0; +} + ])], [HAVE_WIN32_WASAPI=yes], [HAVE_WIN32_WASAPI=no]) + LIBS=$OLD_LIBS + WIN32_WASAPI_LIBS="-lole32 -lavrt" + AC_MSG_RESULT([$HAVE_WIN32_WASAPI]) + if test "x$HAVE_WIN32_WASAPI" = xyes; then + output_modules="$output_modules win32_wasapi" + else + check_failed=yes + fi + ;; + sndio) + SNDIO_LIBS=-lsndio + AC_CHECK_LIB([sndio], [sio_open], + [AC_CHECK_HEADERS([sndio.h], + [output_modules="$output_modules sndio" HAVE_SNDIO="yes"]) + ] + ) + if test "x$HAVE_SNDIO" != xyes; then + check_failed=yes + fi + ;; + sun) + AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h asm/audioio.h sys/audio.h]) + if test "x${ac_cv_header_sun_audioio_h}" = "xyes" \ + -o "x${ac_cv_header_sys_audioio_h}" = "xyes" \ + -o "x${ac_cv_header_asm_audioio_h}" = "xyes"; + then + output_modules="$output_modules sun" + HAVE_SUN="yes" + else + check_failed=yes + fi + ;; + coreaudio) + COREAUDIO_LIBS="-framework AudioToolbox" + AC_CHECK_HEADERS([AudioUnit/AudioUnit.h AudioToolbox/AudioToolbox.h]) + if test "x${ac_cv_header_AudioUnit_AudioUnit_h}" = "xyes" \ + -a "x${ac_cv_header_AudioToolbox_AudioToolbox_h}" = "xyes"; + then + OLD_LIBS=$LIBS + LIBS="$LIBS $COREAUDIO_LIBS" + AC_MSG_CHECKING([if AudioUnit functions are available within AudioToolbox]) + AC_TRY_LINK( + [#include ], + [AudioUnitInitialize(NULL);], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + COREAUDIO_LIBS="$COREAUDIO_LIBS -framework AudioUnit"] + ) + LIBS=$OLD_LIBS + AC_CHECK_HEADERS([CoreServices/CoreServices.h], + [COREAUDIO_LIBS="$COREAUDIO_LIBS -framework CoreServices"] + ) + if test x"$modules" = xdisabled; then + AC_MSG_WARN([Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer.]) + buffer=disabled + fi + output_modules="$output_modules coreaudio" + HAVE_COREAUDIO="yes" + else + check_failed=yes + fi + ;; + arts) + AC_MSG_CHECKING([for artsc]) + if artsc-config > /dev/null 2>&1; then + AC_MSG_RESULT([yes]) + output_modules="$output_modules arts" + HAVE_ARTS=yes + ARTS_LIBS=`artsc-config --libs` + ARTS_CFLAGS=`artsc-config --cflags` + else + AC_MSG_RESULT([no]) + check_failed=yes + fi + ;; + openal) + AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h AL/al.h AL/alc.h al.h alc.h]) + if test "x${ac_cv_header_OpenAL_al_h}" = "xyes" \ + -a "x${ac_cv_header_OpenAL_alc_h}" = "xyes"; + then #Mac OS X + output_modules="$output_modules openal" + OPENAL_LIBS="-framework OpenAL" + OPENAL_CFLAGS="-DOPENAL_SUBDIR_OPENAL" + HAVE_OPENAL="yes" + elif test "x${ac_cv_header_AL_al_h}" = "xyes" \ + -a "x${ac_cv_header_AL_alc_h}" = "xyes"; + then #Linux + output_modules="$output_modules openal" + OPENAL_LIBS="-lopenal" + OPENAL_CFLAGS="-DOPENAL_SUBDIR_AL" + HAVE_OPENAL="yes" + elif test "x${ac_cv_header_al_h}" = "xyes" \ + -a "x${ac_cv_header_alc_h}" = "xyes"; + then #Windows? + output_modules="$output_modules openal" + OPENAL_LIBS="-lopenal" + OPENAL_CFLAGS="" + HAVE_OPENAL="yes" + else + check_failed=yes + fi + ;; + os2) + OS2_LIBS="-los2me -lmmpm2 -lsocket" + AC_CHECK_HEADERS([os2.h]) + # os2me.h depends on os2.h + # Yes, that way of coding it is ugly. + if test "x${ac_cv_header_os2_h}" = xyes + then + # We mimick exactly the way how the header will be used. + # It seems to be picky... + AC_CHECK_HEADERS([os2me.h], [], [], [#define INCL_OS2MM +#define INCL_DOS +#define INCL_VIO +#define INCL_KBD +#include +#]) + fi + if test "x${ac_cv_header_os2_h}" = xyes \ + -a "x${ac_cv_header_os2me_h}" = xyes + then + output_modules="$output_modules os2" + HAVE_OS2=yes + else + check_failed=yes + fi + ;; +# from here on only forced tests, untested code + hp) + # What's the deal with that and alib? + UNSUPPORTED_AUDIO=yes + AC_CHECK_HEADER([sys/audio.h], [output_modules="$output_modules hp" HAVE_HP=yes], [check_failed=yes]) + ;; + alib) + UNSUPPORTED_AUDIO=yes + # ALIB_CFLAGS="-I/opt/audio/include" + ALIB_LIBS=-lAlib + # These headers may not be all about audio but they are used. + AC_CHECK_HEADERS([ Alib.h CUlib.h netdb.h netinet/in.h netinet/tcp.h]) + if test "x${ac_cv_header_Alib_h}" = xyes \ + -a "x${ac_cv_header_CUlib_h}" = xyes \ + -a "x${ac_cv_header_netdb_h}" = xyes \ + -a "x${ac_cv_header_netinet_in_h}" = xyes \ + -a "x${ac_cv_header_netinet_tcp_h}" = xyes + then + output_modules="$output_modules alib" + HAVE_ALIB=yes + else + check_failed=yes + fi + ;; + mint) + UNSUPPORTED_AUDIO=yes + AC_CHECK_HEADERS([audios.h], [output_modules="$output_modules mint" HAVE_MINT=yes], [check_failes=yes]) + ;; + aix) + UNSUPPORTED_AUDIO=yes + AC_CHECK_HEADERS([sys/audio.h], [output_modules="$output_modules aix" HAVE_AIX=yes], [check_failed=yes]) + ;; + sgi) + UNSUPPORTED_AUDIO=yes + SGI_LIBS=-laudio + AC_CHECK_HEADER([dmedia/audio.h], [output_modules="$output_modules sgi" HAVE_SGI=yes], [check_failed=yes]) + ;; + *) + AC_MSG_ERROR([Unsupported/-known output '$m' demanded!]) + ;; + esac +done + +if test "x$check_forced" = xyes -a "x$UNSUPPORTED_AUDIO" = xyes; then + AC_MSG_WARN([You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!]) +fi + +if test "x$check_forced" = xyes -a "x$check_failed" = "xyes"; then + AC_MSG_ERROR([One/some of your requested audio modules failed the test!]) +fi + +# When you extend check_modules, you should extend this: +#for i in alsa qsa oss coreaudio sndio sun win32 win32_wasapi esd jack portaudio pulse sdl nas aix alib arts hp os2 sgi mint openal dummy +#do echo $i; done | +#perl -ne 'chomp; $big = uc($_); print < /dev/null +if you additionally want to measure the I/O time. + +If you find a player, which claims to be 10 or even more times faster than the +current players: just don't believe it. A factor of 2 MAY BE possible. + + +Thomas's mpg123 decision process +-------------------------------- + +I made some tests back then when I wondered if there is a point in using another "modern" mp3 decoder for my mixing daemon. This was around Dec. 2004 till Feb. 2005 with current versions (0.59r-thorX in the case of mpg123). What follows is a copy of the DECODERS file in the dermixd distribution: + +What decoder should one use? + +----- + MP3 +----- + +mpg123 is the old-fashioned way, uncertain license, may have some problems with extraordinary files (huge id3v2 tags, other specialities?), but fast. Has EQ control; interactive frontend interface (in parts hacked by me...). + +mpg321: is popular these days... interface? speed? + +madplay: is becoming popular these days, handles RVA2 by itself... can't provide an interface nor EQ + + +speed: + +decoding Dirty Guitar with NULL output, pentium-optimized (not more): + +decoder user time/s +mpg123 23 +madplay(hq) 46 +madplay(speed) 34 +mpg321(hq) 62 +mpg321(speed) 49 + + +So, there is still a strong technical point in using mpg123... even when my 366MHz-Laptop can easily handle several decoders at once with either of the programs, every percent cpu usage drags on the battery... and takes the cpu time from the real work + +----- + OGG +----- + +7,9M /tmp/dirty_guitar-q3.ogg +11M /tmp/dirty_guitar-q5.ogg +13M /tmp/dirty_guitar-q6.ogg +15M /tmp/dirty_guitar-q7.ogg +22M /tmp/dirty_guitar-q9.ogg +29M /tmp/dirty_guitar-q10.ogg +14M /tmp/dirty_guitar-std.mp3 +101M /tmp/dirty_guitar.wav + +speed of ogg123: + +quality user time/s +3 31 +5 36 +6 38 +7 39 +10 55 + +So, with similar care as mpg123 concerning some (assembler?) optimization, ogg could well come close to "fast" mp3 decoding. +Does ist sound better, then? + + +A review from the new maintainer +-------------------------------- + +Now it's 2006, 23th of July. Still the same laptop, still the same mp3 file. +I just want to update the number for current mpg123 with the mmx optimization. +I should also see if competition (well, ogg, at least?) improved in the year that passed... but looking only at mp3, that reduces to the question if mpg123 got faster or slower. +Neither on the mpg321 site or the MAD site (ftp dir) did I find any new version. MAD is still 0.15.1b (0.15.2b for madplay), mpg321 still 0.2.10 . +Well, I can look at mplayer's mpg123 spawn called mp3lib that has been taken care for over the time. +But apart from that, will mpg123 stand alone on the field of console mp3 engines that are actively maintained??? +To have at least some twist, I now measured the output of raw data to stdout (to /dev/null) instead of decoding alone. The hardware and largely the software is still the same (now kernel 2.6.11 instead of 2.6.?). +I've only used the "high quality" mad players - the earlier measurements give a hint about the difference to the "speed" variant. + +mpg123-0.60-beta1, underworld_@_dirty_guitar.mp3 + +gcc-3.3.3 +CFLAGS=-O2 -finline-functions -march=pentium2 +built with the new autoconf/make system +machine in X11 running fluxbox, no active load (like a year ago) +measuring second run (with cached file) + +time for -s > /dev/null decode... +pentium: 24s +pentium, MMX: 19s +pentium, MMX, gapless (runtime-disabled): 19s +pentium, MMX, gapless (also runtime-enabled): 19s +mpg321 0.2.10, high quality: 64s +madplay 0.15.2b, high quality: 56s + +With the file length being m:s 9:58 (598s), for mpg123 that makes theoretical realtime cpu 3-4% for the PII-366. +Incidentally, `top` agrees there: it shows 3.0-3.3% CPU usage for the MMX/gapless binary during normal OSS playback. + +I feel unable to benchmark the mp3 playback of mplayer - I don't see an option to make it decode audio as fast as possible (I only know -benhcmark and -noaudio; with esp. the latter not helping me there). diff --git a/doc/BUGS b/doc/BUGS new file mode 100644 index 0000000..22139c8 --- /dev/null +++ b/doc/BUGS @@ -0,0 +1,3 @@ +If you find a bug, please check for and report it in the sourceforge bug tracking system: + + http://sourceforge.net/tracker/?atid=733194&group_id=135704&func=browse diff --git a/doc/CONTACT b/doc/CONTACT new file mode 100644 index 0000000..3bfc2cd --- /dev/null +++ b/doc/CONTACT @@ -0,0 +1,17 @@ +If you have a problem with some mp3 file or with your platform that should be supported by mpg123, please post on the mpg123 user mailing list + + mpg123-users@lists.sourceforge.net + +Any ideas for feature improvements or any other suggestions concerning development may be better placed at + + mpg123-devel@lists.sourceforge.net + +If you don't want to subscribe to these, you can also drop a note to + + maintainer@mpg123.org + +But if you want to subscribe and participate in the open discussion or just browse the mailing list archives, see + + http://sourceforge.net/mail/?group_id=135704 + +(or just http://sourceforge.net/projects/mpg123 and click through). diff --git a/doc/LARGEFILE b/doc/LARGEFILE new file mode 100644 index 0000000..01f77dc --- /dev/null +++ b/doc/LARGEFILE @@ -0,0 +1,82 @@ +Regarding largefile setup, client apps can be built three ways: + +1. _FILE_OFFSET_BITS == 64 (header maps to mpg123_open_64) +2. _FILE_OFFSET_BITS == 32 (header maps to mpg123_open_32) +3. _FILE_OFFSET_BITS == (header maps to mpg123_open) + +The libmpg123 build needs to be prepared for everything. Also, it needs to keep +in mind the days before introducing large file support --- binaries should still +work with updated libmpg123. So, mpg123_open should always match what is the +default build on a platform without added settings. Those are the platform +variants: + +1. 64 bit native system, long == off_t +libmpg123: mpg123_open +lfs_alias: mpg123_open_64 -> mpg123_open +lfs_wrap: + +2. largefile-sensitive, long = 32, off_t = 64 (if enabled) +libmpg123: mpg123_open_64 +lfs_alias: mpg123_open_32 -> mpg123_open +lfs_wrap: mpg123_open -> mpg123_open_64 + +3. largefile, long = 32, off_t = 64 (FreeBSD) +libmpg123: mpg123_open +lfs_alias: mpg123_open_64 -> mpg123_open +lfs_wrap: + +This is what mpg123 does in version 1.15.4 and it works. Well, for cases 1 +(Linux/Solaris x86-64) and 2 (Linux/Solaris x86). Case 3 needs to be added +properly. Actually, let's have a second look at case 2: When mpg123 is built +with --disable-largefile: + +2a. largefile-sensitive, mpg123 built with off_t = 32 == long +libmpg123: mpg123_open +lfs_alias: mpg123_open_32 -> mpg123_open +lfs_wrap: + +So, this is still correct. Now, what about case 3? What does mpg123 do +currently, as of 1.15.4? + +3a. largefile, long = 32, off_t = 64 (... and mpg123 not really aware of that) +libmpg123: mpg123_open +lfs_alias: mpg123_open_32(long) -> mpg123_open(off_t) +lfs_wrap: + +This is _wrong_. Luckily, this does not cause binary compatibility issues, as +mpg123_open_32 won't be called by anyone unless that someone tries to define +_FILE_OFFSET_BITS=32, which is nonsense. Perhaps old FreeBSD binaries before +LFS times? Well, back then, there was no libmpg123. So let's ignore that case. +The issue at hand is that the alias should be from mpg123_open_64 to +mpg123_open, for clients that insist on defining _FILE_OFFSET_BITS=64. + +The change needed now is to fix the naming and also change the type the +alias functions use: It is not long int anymore! + +Let's revisit case 1 for a moment: My old lfs_alias.c provides for the case +lfs_alias: mpg123_open -> mpg123_open_64. Is that actually possible? +What means enforcing _FILE_OFFSET_BITS=64 from the outside, which _could_ +happen when libmpg123 is included someplace and folks are on the wrong side +of paranoid regarding this. So, there is + +1a. 64 bit native system, long == off_t = 64 and _FILE_OFFSET_BITS=64 +libmpg123: mpg123_open_64 +lfs_alias: mpg123_open -> mpg123_open_64 +lfs_wrap: + +(Works also for any system with long == off_t in any width) +Likewise, there is largefile-sensitive system with enforced 32 bits: + +2b. largefile-sensitive, mpg123 with enforced _FILE_OFFSET_BITS=32 +libmpg123: mpg123_open_32 +lfs_alias: mpg123_open -> mpg123_open_32 +lfs_wrap: + +All cases are supported with this significant change from 1.15.4: +Make the aliases use a defined lfs_alias_t, which can be long or off_t, +depending on what is the default type for offsets on the platform. +Folks who try _FILE_OFFSET_BITS=32 on a system that only supports +64 bit get a linking error during mpg123 build (from the _64 aliases), +which I consider to be a feature. + +I salute anyone who is not confused after reading this. diff --git a/doc/LICENSE b/doc/LICENSE new file mode 100644 index 0000000..0ede421 --- /dev/null +++ b/doc/LICENSE @@ -0,0 +1,22 @@ +GNU says that the license terms go into a file called COPYING. +Go over to COPYING to read the license, then. + +Or... + +You stay a bit with me here and read some not really important text. +You could imagine that there was some important text here, though. +You could also imagine that you were not sitting + in your office / living room / bathroom + in front of one of these evil electronic brains + (you didn't _print_ this file, did you?) + but being at some happy place, far, far away. +You could also imagine being at some unhappy place. +If you indeed are at such an unhappy place, imagine you were sitting + in your office / living room / bathroom + in front of this shiny, though evil, electronic brain. + Reading this pointless text. + Wondering about what you could have achieved in the past moments + if you wouldn't have continued reading this pointless text. + Wondering if anything is worth being achieved at all. + Or if it all is just... +pointless. diff --git a/doc/Makemodule.am b/doc/Makemodule.am new file mode 100644 index 0000000..4bb91c8 --- /dev/null +++ b/doc/Makemodule.am @@ -0,0 +1,29 @@ +# Module for non-recursive mpg123 build system. + +EXTRA_DIST += \ + doc/BENCHMARKING \ + doc/BUGS \ + doc/CONTACT \ + doc/PATENTS \ + doc/README.3DNOW \ + doc/README.gain \ + doc/README.remote \ + doc/ROAD_TO_LGPL \ + doc/TODO \ + doc/LICENSE \ + doc/THANKS \ + doc/ACCURACY \ + doc/LARGEFILE \ + doc/libmpg123_speed.txt \ + doc/doxyhead.xhtml \ + doc/doxyfoot.xhtml \ + doc/doxy_examples.c \ + doc/doxygen.conf \ + doc/examples/mpg123_to_out123.c \ + doc/examples/scan.c \ + doc/examples/mpglib.c \ + doc/examples/id3dump.c \ + doc/examples/feedseek.c \ + doc/examples/dump_seekindex.c \ + doc/examples/extract_frames.c \ + doc/examples/Makefile diff --git a/doc/PATENTS b/doc/PATENTS new file mode 100644 index 0000000..7197e09 --- /dev/null +++ b/doc/PATENTS @@ -0,0 +1,39 @@ +Some notes about patents and mpg123 by Thomas Orgis +--------------------------------------------------- + +There has been a lot of confusion over mp3 (or more generic mpeg audio) patents and licensing issues due to the patents held by Fraunhofer and marketed by Thomson. +So, yes, there are patents held by Fraunhofer that are claimed to cover mpeg audio technology. There are also claims that they cover any similar technology (like OGG). +You may argue if these patents are valid at all (being illegal software patents, or being preceeded by known scientific publications), but they are internationally accepted by patent authorities and if you want to use mp3 commercially you should check + + http://www.mp3licensing.org + +for the Fraunhofer/Thomson opinion and their terms. + +Since mpg123 is only a mpeg audio player, a good deal of patents that describe the encoding process (the tricky part) will not apply. +Also, statements from the patent holders up to now always allowed the non-commercial distribution of mpeg audio decoders without any fee. +They want you to pay for a license when you want to make money by selling a decoder, though. We don't sell mpg123. +Additionally, one should not forget the fact that the ideas are getting old; the basic (funded by government, btw.) research was somewhen back around the 80s and many patents are going to expire soon, best example in Germany: + +P/DE 35 06 912 Method of transmission of an audio signal using grouping of amplitude values + +Application was 22.02.1986 in Germany (and around Europe in the same time Jan/Feb 1986). +German patents last 20 years... now we have 24.07.2006. Time has come... + +The idea of a patent is to make the inventor open the invention to the public by giving him some safe time to turn this invention into economical benefit. +People using (and improving!) the technology freely after that time is _the_ most important aspect of that idea. + +Oh, I should mention the "core" mp3 patent (from http://gauss.ffii.org/PatentView/EP287578): + +DE 3629434 / EP287578 Digital coding process + +Application date in Germany was 29.08.1986 - that means that in a month from now (remember: 24.07.2006) this patent finds its natural end. + +Then, there are other patents listed on the Fraunhofer/Thomson website that came very late... The one about join stereo coding was aplied for in Feb 1995. Did mpg123 implement that already back then? History is a bit blurry there... +There is a patent applied for in 1997, but probably covering encoding only. Still, even if that weren't the case - the basic decoding functionality of mpg123 didn't change that much after 1997; and they couldn't have patented existing functionality. +In general, few patents seem to cover decoders at all. Of course, with me being no lawyer, that statement is not trustworthy... + +Bottom line is: + +While Fraunhofer/Thomson don't want to charge free software players - they said that a long time ago, the time for they being able to place such charges is expiring or has already expired. One should really think before adding mp3pro/surround support to mpg123, though, since there are for sure more recent patents for that. + +And don't forget: The progress bar is covered by a patent, too. diff --git a/doc/README.3DNOW b/doc/README.3DNOW new file mode 100644 index 0000000..98aae5a --- /dev/null +++ b/doc/README.3DNOW @@ -0,0 +1,56 @@ +************************************************************************ +* 3DNow! support by KIMURA Takuhiro * +* * +* (http://hannah.ipc.miyakyo-u.ac.jp/kim/) * +* Syuuhei Kashiyama * +* (http://user.ecc.u-tokyo.ac.jp/~g810370/)* +************************************************************************ + +----------------------------- +What's new in patch for 0.59r +----------------------------- +- 3DNow! optimized decode routine (decode_3dnow.s,dct36_3dnow.s ; + these code based Syuuhei Kashiyama's 3DNow! patch for mpg123-0.59o) +- 3DNow! optimized equalizer (equalizer_3dnow.s ; do_equalizer() only) +- target "linux-3dnow-alsa" "linux-3dnow-esd" added (untested) +- automatic detect 3DNow! support CPU from CPUFLAGS (getcpuflags.s) + (i.e. use floating-pointer decode routine if your CPU isn't support + 3DNow! or MMX instructions) + +------------- +Added options +------------- +"--test-3dnow" : display result of autodetect and exit +"--force-3dnow" : force use of 3DNow! optimized decoder + (it will cause SIGILL if your CPU isn't support 3DNow! or MMX + instructions) +"--no-3dnow" : force use of floating-pointer decoder + +----------- +How to make +----------- +[1] To make 3DNow! optimized mpg123,you need binutils-2.9.1.0.15 or later. + You can find the most recent binutils (2.9.1.0.25 until 23.Jun.1999) at + - kernel.org (and mirrors) : /pub/linux/devel/gcc/ + - http://hannah.ipc.miyakyo-u.ac.jp/kim/Linux/binutils/ + (Takuhiro's local copy) + etc. +[2] Type "make linux-3dnow" (OSS) + or "make linux-3dnow-alsa" (ALSA). +[3] Enjoy! + +------------------ +Precompiled binary +------------------ +You can get precompiled binary of mpg123 (with 3DNow! support) from + http://hannah.ipc.miyakyo-u.ac.jp/kim/Linux/mpg123/ + +---------- +References +---------- +Useful sources of information on optimizing 3DNow! code include: +- AMD 3DNow! Technology Manual (Publication #21928) + English: http://www.amd.com/K6/k6docs/pdf/21928d.pdf + (Japanese: http://www.amd.com/japan/K6/k6docs/j21928c.pdf) +- AMD-K6-2 Processor Code Optimization Application Note (Publication #21924) + English: http://www.amd.com/K6/k6docs/pdf/21924b.pdf diff --git a/doc/README.gain b/doc/README.gain new file mode 100644 index 0000000..e12fc5a --- /dev/null +++ b/doc/README.gain @@ -0,0 +1,171 @@ +Thomas Orgis on RVA, Gain and Pain + + +Ok, so I'm going to add RVA/ReplayGain support... the problem there is not to read these valus from ID3 or Lame, not even to do the adjustment itself. +The problem is more to figure out how to interpret the dB values one gets there. + +Main players in the field of relative volume adjustment / soft gain (without modifying actual audio data): + +http://www1.cs.columbia.edu/~cvaill/normalize/ + ...writing RVA2 ID3v2tags for dB offset to user target amplitude, default being -12dB(FS) +http://www.replaygain.org/ + ...store the difference to reference of 83dB(SPL) ... somewhere + +Both calculate some running RMS and do statistics with this - the main difference is the potentially different target level. +Also both know two basic types of adjustment: Per track to make all tracks sound at the same sevel (track / radio) and the one with default meaning to keep the loudness relations over albums (batch / audiophile). + +dB can mean many things and also the raw value of a PCM sample doesn't equal directly to loudness (power of a wave != amplitude). + +So that says the ReplayGain about applying the adjustment: + + scale=10.^(replay_gain/20); + +luckily, this is the same that I worked out on my own for the normalize RVA values in my mixplayer script: + + return 10**($s/20); + +I'll take that interpretaion of dB -> linear scale factor for samples for granted, then. + +The replay_gain value is meant in the standard to represent the offset to 83dB(SPL - depending on your amplifier...), having in mind that actual most wanted average playback level should be 83dB(SPL) (defined by movie ppl as the loudness of a -20dB(FS) signal, leaving room for louder stuff). +But then there is the proposal to add 6dB preamp for pop music - am I judging music types with mpg123?? +These 6dB are in fact the real world since lots of programs use 89dB(SPL...) as reference. +Thus, lame since 3.95.1 (according to MADplay's Rob Leslie who discussed with Lame ppl, verified in 3.96 source) stores the adjustment to 89dB. +To make that all sound the same, one should add 6bB to lame <3.95.1 ReplayGain values and use later ones verbatim - achieving 89dB everytime, whatever that may mean in reality out of my speakers (my Marantz' volume knob doesn't have a scale at all - be it dB or percent;-). + +A funny aspect of this 6dB issue is to tell lame 3.95.1 from lame 3.95 + +As for normalize... the desired playback level is essentially undefined. Ignoring that and realizing that mpg123 has no way to determine real world sound power anyway, one has to just take the provided dB values and apply with the formula above. +The user is responsible for providing files with his desired settings... for that reason I also won't follow the ReplayGain demand/suggestion that a player should apply an average of gains of previous tracks if the current one lacks a setting. + +So, well. Considering that ReplayGain (at least the radio one) being stored by current lame on encoding, I suppose that if there are RVA2 values in ID3v2 tags, these were added by a conscious user act and are overriding the ReplayGain ones. + +I already read ReplayGain entries in Lame tag... should add ID3v2 parsing. Especially since the lame tag is ambignous because of the 6dB issue... I cannot distinguish 3.95.1 from 3.95 by reading the tag - frick! +But wait... 6dB? + +[thomas@thorvas /home/thomas-data/mpg123-neu/lame-3.96.1]$ frontend/lame --cbr -T /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 ../testfiles/happy_man_lame-3.96.1.mp3 +ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding. +LAME version 3.96.1 (http://lame.sourceforge.net/) +Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz +Encoding /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 + to ../testfiles/happy_man_lame-3.96.1.mp3 +Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3 + Frame | CPU time/estim | REAL time/estim | play/CPU | ETA + 6371/6374 (100%)| 1:41/ 1:41| 1:47/ 1:47| 1.6353x| 0:00 +average: 128.0 kbps LR: 754 (11.83%) MS: 5620 (88.17%) + +Writing LAME Tag...done +ReplayGain: -7.4dB +revmethod = 1 +encoder padding: 1728 + +[thomas@thorvas /home/thomas-data/mpg123-neu/lame-3.95.1]$ frontend/lame --cbr -T /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 ../testfiles/happy_man.mp3 +ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding. +LAME version 3.95 (http://www.mp3dev.org/) +Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz +Encoding /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 + to ../testfiles/happy_man.mp3 +Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3 + Frame | CPU time/estim | REAL time/estim | play/CPU | ETA + 6371/6374 (100%)| 1:36/ 1:36| 1:48/ 1:48| 1.7289x| 0:00 +average: 128.0 kbps LR: 759 (11.91%) MS: 5615 (88.09%) + +Writing LAME Tag...done +ReplayGain: -7.4dB + +[thomas@thorvas /home/thomas-data/mpg123-neu/lame-3.95]$ frontend/lame --cbr -T /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 ../testfiles/happy_man_lame-3.95.mp3 +ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding. +LAME version 3.95 (http://www.mp3dev.org/) +Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz +Encoding /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 + to ../testfiles/happy_man_lame-3.95.mp3 +Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3 + Frame | CPU time/estim | REAL time/estim | play/CPU | ETA + 6371/6374 (100%)| 1:37/ 1:37| 1:43/ 1:43| 1.7041x| 0:00 +average: 128.0 kbps LR: 759 (11.91%) MS: 5615 (88.09%) + +Writing LAME Tag...done +ReplayGain: -13.4dB + + +Together with the gain values read from tags: + +3.96.1: -1.0dB (claimed -7.4dB) +3.95: -1.0dB (claimed -7.4dB) +3.95: -0.6dB (claimed -13.4dB) + +So, the difference of 6dB shows in the values lame prints on the command line... but the lame tags only have 0.4dB difference and are much lower anyway - do I parse them correctly? + +Opinion of normalize of these files: -2dB. Great. I guess the -1 is what lame really meant, then... + + +Storage places +============== + +Points 1, 2 and 4 implemented to some respect. + + +1. Lame/Info tag + +supposedly in format according to the proposed standard - but I yet have to verify if Lame really does this. +see http://gabriel.mp3-tech.org/mp3infotag.html + + +2. ID3v2 RVA2 frame(s) + +Normalize does that. Rare is the software reading that. +I've never seen those frames since id3v2 -l doesn't know them. + + +3. APE tags + +Gah, another Tag format. Foobar2000 uses this as default. +It's getting real-hy messy folks + + +4. Per convention in ID3 tags + +Well, I myself once used the ID3v1 comment field for storing the mix rva value (textual) ... but that is a tad too unspecific. +I then also used user-defined ID3v2 comments like that: + +[thomas@thorvas /home/thomas-data/mpg123-neu/svn/trunk]$ id3v2 -l /mnt/knecht_mp3/music/underworld/second_toughest_in_the_infants/02-banstyle_sappys_curry.mp3 +id3v1 tag info for /mnt/knecht_mp3/music/underworld/second_toughest_in_the_infants/02-banstyle_sappys_curry.mp3: +Title : banstyle sappys curry Artist: underworld +Album : second toughest in the infants Year: 0 , Genre: Other (12) +Comment: Created by Grip Track: 2 +id3v2 tag info for /mnt/knecht_mp3/music/underworld/second_toughest_in_the_infants/02-banstyle_sappys_curry.mp3: +TYER (Year): 0 +TRCK (Track number/Position in set): 2 +COMM (Comments): (ID3v1 Comment)[XXX]: Created by Grip +TCON (Content type): Other (12) +TPE1 (Lead performer(s)/Soloist(s)): underworld +TALB (Album/Movie/Show title): second toughest in the infants +TIT2 (Title/songname/content description): banstyle sappys curry +COMM (Comments): (RVA)[]: 4.3291 +COMM (Comments): (RVA_ALBUM)[]: 3.666101 + +That still doesn't look like a bad Idea to me. Not bothering with byte ordering and whatnot. Just atof(id3v2_comm_rva). +One could still add dB, though. + +Another convention is (rockbox mailinglist, not checked myself) used by Foobar: + +TXXX (User defined text information): (replaygain_track_gain): -7.17 dB +TXXX (User defined text information): (replaygain_track_peak): 1.057122 +TXXX (User defined text information): (replaygain_album_gain): -6.53 dB +TXXX (User defined text information): (replaygain_album_peak): 1.107456 + +So what are custom comment fields for when there are also custom text fields? They look very similar to me. + + +5. Leave the haunted music file alone and store metadata externally. + +That's the only sane way for stuff like album art... and it's the way I do it in my music archive. the wrapper script reads the adjustment values and then sets an adjusted volume. +That's fine for my mixing daemon that manupulates the pcm data anyway, but it would be nice to have this functionality in the minimalist console mode. too. +Even more since it can be done without additional cpu power during decoding (well, one-time set up of the decode tables is needed for every track) similar to the equalizer. +I could simply start with text files with lines like + +RVA_MIX: 3.4dB +RVA_ALBUM: 1.7dB + +Prob here is that the effort to open and parse that extra file may hinder gapless decoding between tracks... +Well, one could parse all metadata files for a list of tracks before playback starts. +But all this won't work for streams via stdin (hm, one could argue if the stream needs RVA at all). diff --git a/doc/README.remote b/doc/README.remote new file mode 100644 index 0000000..c4a77fe --- /dev/null +++ b/doc/README.remote @@ -0,0 +1,218 @@ +Control interface to generic frontends + +The generic remote interface allows frontends to easily control +mpg123 by commands through stdin/stdout. To start the generic +remote interface, start mpg123 with parameter -R. + +In case of a frontend that starts mpg123 with the -s option to read the audio from stdout, the --remote-err option is automatically activated to send responses to stderr so that stdout stays clean for audio. + +(Still the case?) +As an example it's used by IRMP3, a tool that allows you to +control mpg123 with a standard infrared remote control. See +http://www.fasta.fh-dortmund.de/users/andy/irmp3/ for more +information. + +You can also specify --fifo to create a named pipe at and listen on that for commands instead stdin. +That way, you can deliberately control mpg123 by echoing into the named pipe from any terminal / program. +The command respones are still sent to standard out or standard error (depending on -s or --remote-err switches). + + +COMMAND CODES +------------- + +You can get this info via the control command "help". + +HELP/H: command listing (LONG/SHORT forms), command case insensitve + +LOAD/L : load and start playing resource + +LOADPAUSED/LP : load but do not start playing resource + +LOADLIST/LL : load a playlist from given , and display its entries, optionally load and play one of these specificed by the integer (<0: just list, 0: play last track, >0:play track with that position in list) + +PAUSE/P: pause playback + +STOP/S: stop playback (closes file) + +JUMP/J |<+offset>|<-offset>|<[+|-]seconds>s: jump to mpeg frame or change position by offset, same in seconds if number followed by "s" + +VOLUME/V : set volume in % (0..100...); float value + +RVA off|(mix|radio)|(album|audiophile): set rva mode + +EQ/E : set equalizer value for frequency band 0 to 31 on channel 1 (left) or 2 (right) or 3 (both) + +EQFILE : load EQ settings from a file + +SHOWEQ: show all equalizer settings (as lines in a SHOWEQ block (like TAG)) + +SEEK/K |<+offset>|<-offset>: jump to output sample position or change position by offset + +SCAN: scan through the file, building seek index + +SAMPLE: print out the sample position and total number of samples + +SEQ : simple eq setting... + +PITCH <[+|-]value>: adjust playback speed (+0.01 is 1 % faster) + +SILENCE: be silent during playback (meaning silence in text form) + +STATE: Print auxilliary state info in several lines (just try it to see what info is there). + +TAG/T: Print all available (ID3) tag info, for ID3v2 that gives output of all collected text fields, using the ID3v2.3/4 4-character names. + The output is multiple lines, begin marked by "@T {", end by "@T }". + ID3v1 data is like in the @I info lines (see below), just with "@T" in front. + An ID3v2 data field is introduced via ([ ... ] means optional): + @T ID3v2.[ [lang()] desc()]: + The lines of data follow with "=" prefixed: + @T = +meaning of the @S stream info: + +S +The @I lines after loading a track give some ID3 info, the format: + @I ID3:artist album year comment genretext + where artist,album and comment are exactly 30 characters each, year is 4 characters, genre text unspecified. + You will encounter "@I ID3.genre:" and "@I ID3.track:". + Then, there is an excerpt of ID3v2 info in the structure + @I ID3v2.title:Blabla bla Bla + for every line of the "title" data field. Likewise for other fields (author, album, etc). + + +RESPONSE CODES +-------------- + +Note: mpg123 returns errors on stderr, so your frontend should + look not only at stdout but also at stderr for responses. + It is a good idea to use --remote-err and just look at stderr. + +@R MPG123 (ThOr) v7 + Startup version message. Everything after MPG123 is auxilliary information about behaviour and command support, ID3v2 tag support is new in v3. + +@I ID3: + Status message after loading a song (ID3 song info) + a = title (exactly 30 chars) + b = artist (exactly 30 chars) + c = album (exactly 30 chars) + d = year (exactly 4 chars) + e = comment (exactly 30 chars) + f = genre (string) + +@I ID3.genre: +@I ID3.track: + Optional lines with additional ID3v1 info (if present): Genre ID and track number in set. + +@I ID3v2.title: + After loading a track with ID3v2 info, such lines occur for every line of the "title" data field and likewise for other fields (author, album, etc). + +@I + Status message after loading a song (no ID3 song info) + a = filename without path and extension + +@I LISTENTRY : + printout of playlists loaded with LOADLIST + +@S ... + Stream info at beginning of playback, meaning + S + +@S + Status message after loading a song (stream info) + a = mpeg type (string) + b = layer (int) + c = sampling frequency (int) + d = mode (string) + e = mode extension (int) + f = framesize (int) + g = stereo (int) + h = copyright (int) + i = error protection (int) + j = emphasis (int) + k = bitrate (int) + l = extension (int) + +@F + Status message during playing (frame info) + a = framecount (int) + b = frames left this song (int) + c = seconds (float) + d = seconds left (float) + +@P + Playing status + a = 0: playing stopped + a = 1: playing paused + a = 2: playing unpaused + +@E + An error occured + Errors may be also reported by mpg123 through + stderr (without @E) + a = error message (string) + +@J + Jumped to frame n. + +@RVA + Switched to specified RVA mode. + +@V % + Set volume to specified value (float, percent). + +@ : : + Set equalizer value z for band y of channel x. + +@bass: mid: treble: + Set simple equalizer control for bass, mid, treble. + +@T + The output is multiple lines, begin marked by "@T {", end by "@T }". + ID3v1 data is like in the @I info lines, just with "@T" in front. + An ID3v2 data field is introduced via ([ ... ] means optional): + @T ID3v2.[ [lang()] desc()]: + The lines of data follow with "=" prefixed: + @T = + + +EQUALIZER CONTROL (History) +--------------------------- + +WARNING: The interpretation of the command arguments changed. The channel is either 1 or 2 or 3 (left, right, both). +It used to be 0 or 1 for left or right but the change slipped through during libmpg123 work and now it is a fact. +Sorry. + +Cold Feet Audio Patch for MPG123 + +10.07.2002 + +This is a dirty little hack to enable the equalizer in mpg123's +generic_control interface. It works like this, there are two +different channels on the equalizer and 32 frequencys. + +The hack just enables mpg123's built in equalizer to run real-time. +We haven't built in any capability to save the eq, you're frontend +will have to handle that part, and init the eq on the startup of +mpg123. + +K, it works like this: + +#./mpg123 -R - <---- This command will start mpg123 in 'frontend' mode. + +If you want to send it some eq values you'd send it: +eq X Y V[ENTER] + +X = The channel. It can be either 0 or 1. I haven't put any error checking + in, so it probably wouldn't be a good idea to go out of bounds. (integer) +Y = This is the frequency, it can be 0 to 31. 0 being closer to treble and + 31 being closer to bass. (integer) +V = The raw value of your equalizer setting. I've found that the values work + best between 0.00 and 3.00. When mpg123 starts up, all of them are set + to 1.00. + +OK, have fun! If you have any questions or found some bugs, please contact +nutcase@dtmf.org + +Thanks, +nut + +Note by Thomas Orgis: The contact appears to be dead. diff --git a/doc/ROAD_TO_LGPL b/doc/ROAD_TO_LGPL new file mode 100644 index 0000000..c2d2313 --- /dev/null +++ b/doc/ROAD_TO_LGPL @@ -0,0 +1,270 @@ +The License of mpg123 +===================== + + by Thomas Orgis + +1. Story: The Odyssey, The Decision +----------------------------------- + +This is the 17th of July in the year 2006, after half a year of preparation and the contributor email campaign running for over 3 months, I'm going to draw a conclusion about the licensing of the mpg123 project. + + +The license conditions of mpg123 have been subject to dispute and rejection by parts of the free software world in the past... +We want to have it straight now. +Michael doesn't have much freetime to maintain the code and bother with requests by companies wanting to use mpglib. +So, he already decided to place mpglib under LGPL and mpg123 under GPL in the past. +Now, after I applied for taking over maintainership we decided on placing as much code of the whole project as possible under LGPL to ease future code migration and merging between mpg123 and mpglib. + +That decision was followed by a lot of work to track down as many contributors to both Michael's development tree and my -thor one as possible to ask them for explicit LGPL support statements. +I wrote to every Name/eMail address I could track down (including internet search for new addresses), regardless of the question if there indeed is some code left by that person. +I asked them to utter any problem they may have with LGPL license as well as contacting me if there are _no_ issues. + +Of course, without having to ask again, supporters of LGPL are the initial author and the two current maintainers: + + Michael Hipp + Nicholas J. Humfrey + Thomas Orgis + +Also, new stuff was included with explicit LGPL permission from + + Adrian Bacon + Romain Dolbeau + Guillaume Outters + +Plus there is stuff pending with permission from + + Zuxy Meng + +Now for the folks having made suggestions and contributions over the years... +In the first round starting in March 2006 I wrote the initial mail to anyone I could get. That resulted in some positive responses - examples: + + "I don't remember what I did, but LGPL is fine by me." + + "No problem for me." + + "Any code I may have contributed to the mpg123 project at any time in the +past are hereby licensed to you under the GNU Lesser General Public" + + "it's fine with me if mpg123 goes LGPL. + However, my contribution to mpg123 was very minor, and I'm not even sure if + any of my code is still in the current version." + +A good number of eMail addresses is just broken (years have passed...) and another good number of addresses are either totally unknown or not known to be good or bad since no response (not even bounce - thanks, spam!) came back in over 3 months. + +Some statistics for the first run: 86 total , 15 positive, 37 broken email, 34 unknown + +Positive: + Andreas Neuhaus + Chris Butler + Colin Watson + Daniel Kobras + Daniel O'Connor + Daniel Skarda + Erik B. Andersen + Helge Deller + Juergen Schoew + Martin Denn + Munechika SUMIKAWA + Oliver Fromme + Petr Stehlik + Robert Bihlmeyer + Samuel Audet + Shane Wegner + Stefan Bieschewski + Steven Schultz + Tillmann Steinbrecher + Tomas Oegren + Tommi Virtanen + +Then, an investigation of the code revealed a core of people having actually left traces in the code. +Some more effort was put in tracking them down, with the partial success of having found some new, working email addresses and thus having some more positive responses . +But also, it showed that the main number of people is not reachable anymore. + +Creators (of a whole file, driver...): 16 total, 5 positive, 2 broken email, 9 unknown + +Positive: + Andreas Neuhaus + Juergen Schoew + Oliver Fromme + Petr Stehlik + Samuel Audet + +Modders: 7 total, 1 positive, 2 broken mail, 4 unknown + +Positive: + Tomas Oegren + + +That shows two things: + + 1. It's impossible to get a response from everyone having contributed in some way. + 2. Everyone who I reached supports the license change to LGPL + + +So, for the sake of getting a reasonable step forward, I'm going to close the case. +There are three categories of code: + +1. written by Michael or some other contributor who explicitly supports LGPL + + Clear case: LGPL + +2. contributed years ago without license notice + + The grounded assumption of can be made that the contributor accepted Michael's conditions, esp. the part about the software being available without cost. + Furthermore they gave the code into Michael's hands or placed patches in the internet without any claims concerning commercial uses - wich were not covered by the old COPYING file. + Based on the assumption of acceptance for the mpg123 COPYING file and the included rule of Michael's decision for any further use, this code is to be placed under LGPL by Michael's decision. + +3. contributed with notice + + Some code includes a note about it being GPL. Well, one has to respect that. + + +That results in the bulk of mpg123 being LGPL and possibly some parts GPL only. + + +2. The Inventory +---------------- + +I will now examine the files of the mpg123 svn trunk as of 17.07.2006 with their respective legal status: + +Stuff added by current maintainers, thus being LGPL: + + scripts/debugdef.pl + AUTHORS + autogen.sh + configure.ac + Makefile.am + MakeLegacy.sh + src/audio_jack.c + src/audio_libao.c + src/Makefile.am + src/audio_alsa09.c + src/config.h.legacy + src/debug.h + src/layer3.h + +Non-Code files from Michael, maintainers or just trivial content (safely LGPL, then): + + BENCHMARKING + BUGS + CHANGES + equalize.dat + INSTALL + mpg123.1 + COPYING + TODO + README + README.3DNOW + README.cfa + README.new + README.remote + README.thor + README.WIN32 + test.pl + BENCHMARKING.thor + CONTACT + +sources under LGPLv2.1: + +by Michael: + + audio.c + audio_dummy.c + audio.h + audio_hp.c + audio_oss.c + audio_sun.c + common.c + common.h + dct64.c + dct64_i386.c + decode_2to1.c + decode_4to1.c + decode.c + decode_i386.c + decode_ntom.c + Makefile.legacy + equalizer.c + getbits.c + getbits.h + huffman.h + l2tables.h + layer1.c + layer2.c + layer3.c + mpg123.c + mpg123.h + readers.c + system.c + tabinit.c + term.c + term.h + +by contributors: + + audio_aix.c: Juergen Schoew, Tomas Oegren, Niklas Edmundsson + audio_alib.c: Erwan Ducroquet + audio_esd.c: Eric B. Mitchell + audio_macosx.c: Guillaume Outters + audio_mint.c: Petr Stehlik + audio_nas.c: Martin Denn + audio_os2.c: Samuel Audet + audio_sgi.c: Thomas Woerner + audio_win32.c: Tony Million + buffer.c: Oliver Fromme + buffer.h: Daniel Kobras / Oliver Fromme + control_generic.c: Andreas Neuhaus, Michael Hipp, Thomas Orgis + dct36_3dnow.s: Syuuhei Kashiyama + dct64_3dnow.s: Syuuhei Kashiyama + dct64_altivec.c: Romain Dolbeau + dct64_i486.c: Fabrice Bellard + decode_3dnow.s: Syuuhei Kashiyama + decode_i486.c: Fabrice Bellard + decode_i586_dither.s: Stefan Bieschewski, Adrian Bacon + decode_i586.s: Stefan Bieschewski + decode_MMX.s: higway + dct64_MMX.s: higway + tabinit_MMX.s: higway + equalizer_3dnow.s: KIMURA Takuhiro + genre.h: Shane Wegner + getcpuflags.s: KIMURA Takuhiro + getlopt.c: Oliver Fromme + getlopt.h: Oliver Fromme + httpget.c: Oliver Fromme + wav.c: Samuel Audet + xfermem.c: Oliver Fromme + xfermem.h: Oliver Fromme + Makefile.win32: Michael Hipp / Tony Million + +GPLv2 + + audio_alsa.c: by Anders Semb Hermansen, Jaroslav Kysela, Ville Syrjala + + +To be removed from distribution and thus not licensed in any special way: + +precompiled/ +tools/ + +The mpglib source is not part of the core mpg123 distribution anymore - it's written by Michael, it's LGPL, it shall become a real library with own distribution and be married to mpg123 again. + + +3. Conclusion +------------- + +The decoder core Michael's work and under LGPL without question. +Oliver Fromme is more of a co-author than "just" a project contributor, but he explicitly agreed to LGPL anyway. +So, the core functionality is really safe without doubt. + +Contributors added mainly output drivers (perhaps coming from some freely available reference implementation) and CPU optimizations. +Having explicit permission from a good deal of major contributors, the LGPL is quite comfortable here, too. +I won't hide that there are explicit statements missing for MMX and 3DNow! optimizations (and the i486 opt, for that matter) due to unreachable authors. +But I feel safe to make it LGPL there, too, because of the argument of them having given the code to Michael to incorporate it into mpg123 - without any own terms, implying that they agree to Michael's terms. + +There is one file left that carries an explicit GPL (_no_ LGPL) statement: the old alsa output. This file won't work on current Linux systems, anyway. +Alsa is available through libao. There will probably be a new alsa output. +So, even that one GPL exception may vanish in future, but I'll keep it for now as there may be someone who still has an alsa installation for that it works. + +For now that means mpg123 is LGPL with the exception of one file that is GPL only. + +End. diff --git a/doc/THANKS b/doc/THANKS new file mode 100644 index 0000000..b01b668 --- /dev/null +++ b/doc/THANKS @@ -0,0 +1,13 @@ +There are authors who write code and there are people who point us to what code to write, show us our errors and generally are trying hard to compensate the time the developers spent coding and not actually using the software. +These people are very valuable, indeed - let's thank our + +Testers (alphapetical): + +- Gabor Z. Papp +- "Gates Fan" +- JonY +- Serge Simon and the R.O.M. 106.5 FM Team (http://www.rom.lu/) + who motivated the --loop and --timeout modes and furthermore supported the maintainer with a donation on sf.net and a real bottle of wine from Luxembourg! +- Willy Tarreau + +Heck, let's thank all of you who contributed bug reports, suggestions... those who took mpg123 source and compiled it on uncommon platforms. diff --git a/doc/TODO b/doc/TODO new file mode 100644 index 0000000..72eb9f5 --- /dev/null +++ b/doc/TODO @@ -0,0 +1,8 @@ +From Michael (some time after/around pre-0.59s): + +- add CRC check. +- optimize layer2.c: + step_two: fraction as pointer .. + process first channel 0 than channel 1 + copy channel 0 to channel 1 for: i >= jsbound +- MPEG system stream decoder diff --git a/doc/doxy_examples.c b/doc/doxy_examples.c new file mode 100644 index 0000000..a5f5f25 --- /dev/null +++ b/doc/doxy_examples.c @@ -0,0 +1,21 @@ +/** \defgroup mpg123_examples example programs using libmpg123 and libout123 + @{ */ + +/** \file mpg123_to_out123.c A simple MPEG audio to WAV converter using libmpg123 (read) and libout123 (write). + ...an excersize on two simple APIs. */ + +/** \file mpglib.c Example program mimicking the old mpglib test program. + It takes an MPEG bitstream from standard input and writes raw audio to standard output. + This is an use case of the mpg123_decode() in and out function in the feeder mode, quite close to classic mpglib usage and thus a template to convert from that to libmpg123. +*/ + +/** \file scan.c Example program that examines the exact length of an MPEG file. + It opens a list of files and does mpg123_scan() on each and reporting the mpg123_length() before and after that. */ + +/** \file id3dump.c Parse ID3 info and print to standard output. */ + +/** \file extract_frames.c Parse stream and extract only the valid MPEG frames to standard output. */ + +/** \file feedseek.c Fuzzy feeder seeking. */ + +/* @} */ diff --git a/doc/doxyfoot.xhtml b/doc/doxyfoot.xhtml new file mode 100644 index 0000000..5330c6d --- /dev/null +++ b/doc/doxyfoot.xhtml @@ -0,0 +1 @@ + diff --git a/doc/doxygen.conf b/doc/doxygen.conf new file mode 100644 index 0000000..c1bb7e8 --- /dev/null +++ b/doc/doxygen.conf @@ -0,0 +1,52 @@ + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# + +PROJECT_NAME = "libmpg123 & libout123" +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +FULL_PATH_NAMES = NO + +INPUT = \ + doxy_examples.c \ + examples/mpg123_to_out123.c \ + examples/mpglib.c \ + examples/scan.c \ + examples/feedseek.c \ + examples/extract_frames.c \ + examples/id3dump.c \ + ../src/libmpg123/mpg123.h \ + ../src/libmpg123/fmt123.h \ + ../src/libout123/out123.h +OPTIMIZE_OUTPUT_FOR_C = YES +EXTRACT_ALL = NO +HIDE_UNDOC_MEMBERS = NO +QUIET = YES +WARNINGS = YES +SOURCE_BROWSER = YES + +GENERATE_HTML = YES +HTML_OUTPUT = html +DISABLE_INDEX = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +ENUM_VALUES_PER_LINE = 2 + + +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +PREDEFINED = EXPORT= + +GENERATE_HTML = YES +GENERATE_LATEX = NO +GENERATE_RTF = NO +GENERATE_MAN = YES +MAN_LINKS = YES +GENERATE_XML = NO + +HTML_HEADER = doxyhead.xhtml +HTML_FOOTER = doxyfoot.xhtml +HTML_FILE_EXTENSION = .shtml diff --git a/doc/doxyhead.xhtml b/doc/doxyhead.xhtml new file mode 100644 index 0000000..d5569d6 --- /dev/null +++ b/doc/doxyhead.xhtml @@ -0,0 +1,17 @@ + +$title + + + + +

API documentation for libmpg123 and libout123

+
+
diff --git a/doc/examples/Makefile b/doc/examples/Makefile new file mode 100644 index 0000000..1429978 --- /dev/null +++ b/doc/examples/Makefile @@ -0,0 +1,62 @@ +targets = \ + mpg123_test \ + feedseek \ + mpg123_to_out123 \ + mpg123_to_wav_replaced_io \ + scan \ + id3dump \ + mpglib \ + dump_seekindex \ + extract_frames + +all: $(targets) + +# On largefile-aware systems you might want to use these instead: +#MPG123_CFLAGS := $(shell pkg-config --cflags libmpg123_64) +#MPG123_LDFLAGS := $(shell pkg-config --libs libmpg123_64) +# This works on sane setups where off_t is off_t, and just that. +ifeq ($(MPG123_PREFIX),) + MPG123_CFLAGS := $(shell pkg-config --cflags libmpg123) + MPG123_LDFLAGS := $(shell pkg-config --libs libmpg123) + OUT123_CFLAGS := $(shell pkg-config --cflags libout123) + OUT123_LDFLAGS := $(shell pkg-config --libs libout123) +else # Yeah, that's with GNU/Linux in mind, at least GNU ld ... + MPG123_CFLAGS := -I$(MPG123_PREFIX)/include + MPG123_LDFLAGS := -L$(MPG123_PREFIX)/lib -Wl,-rpath $(MPG123_PREFIX)/lib -lmpg123 + OUT123_CFLAGS := -I$(MPG123_PREFIX)/include + OUT123_LDFLAGS := -L$(MPG123_PREFIX)/lib -Wl,-rpath $(MPG123_PREFIX)/lib -lout123 +endif + +# Oder of libs not that important here... +compile = $(CC) $(CPPFLAGS) $(CFLAGS) $(MPG123_CFLAGS) +linkflags = $(MPG123_LDFLAGS) $(LDFLAGS) + +mpg123_to_out123: mpg123_to_out123.c + $(compile) -o $@ $< $(OUT123_CFLAGS) $(OUT123_LDFLAGS) $(linkflags) + +mpg123_to_wav_replaced_io: mpg123_to_wav_replaced_io.c + $(compile) -o $@ $< $(OUT123_CFLAGS) $(OUT123_LDFLAGS) $(linkflags) + +feedseek: feedseek.c + $(compile) -o feedseek feedseek.c $(linkflags) + +scan: scan.c + $(compile) -o scan scan.c $(linkflags) + +id3dump:id3dump.c + $(compile) -o id3dump id3dump.c $(linkflags) + +dump_seekindex: dump_seekindex.c + $(compile) -o dump_seekindex dump_seekindex.c $(linkflags) + +mpglib: mpglib.c + $(compile) -o mpglib mpglib.c $(linkflags) + +mpg123_test: mpg123_test.c + $(compile) -o $@ $< $(linkflags) + +extract_frames: extract_frames.c + $(compile) -o $@ $< $(linkflags) + +clean: + rm -vf $(targets) diff --git a/doc/examples/dump_seekindex.c b/doc/examples/dump_seekindex.c new file mode 100644 index 0000000..9b6dae0 --- /dev/null +++ b/doc/examples/dump_seekindex.c @@ -0,0 +1,41 @@ +/* + dump_seekindex: Scan a mpeg file and dump its seek index. + + copyright 2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Patrick Dehne +*/ + +#include +#include + +int main(int argc, char **argv) +{ + mpg123_handle *m; + off_t* offsets; + off_t step; + size_t fill, i; + + if(argc != 2) + { + fprintf(stderr, "\nI will dump the frame index of an MPEG audio file.\n"); + fprintf(stderr, "\nUsage: %s \n\n", argv[0]); + return -1; + } + mpg123_init(); + m = mpg123_new(NULL, NULL); + mpg123_param(m, MPG123_RESYNC_LIMIT, -1, 0); + mpg123_param(m, MPG123_INDEX_SIZE, -1, 0); + mpg123_open(m, argv[1]); + mpg123_scan(m); + + mpg123_index(m, &offsets, &step, &fill); + for(i=0; i + +/* unistd.h is not available under MSVC, + io.h defines the read and write functions */ +#ifndef _MSC_VER +#include +#else +#include +#endif + +#include + +int do_work(mpg123_handle *m); + +int main(int argc, char **argv) +{ + int ret = 0; + mpg123_handle *m; + + mpg123_init(); + m = mpg123_new(NULL, &ret); + + if(m == NULL) + { + fprintf(stderr, "Cannot create handle: %s", mpg123_plain_strerror(ret)); + } + else + { + fprintf(stderr, "I'll take your dirty MPEG audio from standard input and will write the extracted pure MPEG data to standard output.\n"); + if(argc > 1 && strcmp(argv[1], "--noinfo") == 0) + { + fprintf(stderr, "Enabling parsing/consuming of the Info frame so that it will not appear in output.\n"); + ret = mpg123_param(m, MPG123_REMOVE_FLAGS, MPG123_IGNORE_INFOFRAME, 0.); + } + else + { + fprintf(stderr, "If you'd have given --noinfo as argument, I would omit a LAME/Xing info frame.\n"); + ret = mpg123_param(m, MPG123_ADD_FLAGS, MPG123_IGNORE_INFOFRAME, 0.); + } + if(ret == 0) ret = do_work(m); + + if(ret != 0) fprintf(stderr, "Some error occured: %s\n", mpg123_strerror(m)); + + + mpg123_delete(m); /* Closes, too. */ + } + mpg123_exit(); + + return ret; +} + +int do_work(mpg123_handle *m) +{ + int ret; + size_t count = 0; + ret = mpg123_open_fd(m, STDIN_FILENO); + if(ret != MPG123_OK) return ret; + + while( (ret = mpg123_framebyframe_next(m)) == MPG123_OK || ret == MPG123_NEW_FORMAT ) + { + unsigned long header; + unsigned char *bodydata; + size_t bodybytes; + if(mpg123_framedata(m, &header, &bodydata, &bodybytes) == MPG123_OK) + { + /* Need to extract the 4 header bytes from the native storage in the correct order. */ + unsigned char hbuf[4]; + int i; + for(i=0; i<4; ++i) hbuf[i] = (unsigned char) ((header >> ((3-i)*8)) & 0xff); + + /* Now write out both header and data, fire and forget. */ + write(STDOUT_FILENO, hbuf, 4); + write(STDOUT_FILENO, bodydata, bodybytes); + fprintf(stderr, "%zu: header 0x%08x, %zu body bytes\n", ++count, header, bodybytes); + } + } + + if(ret != MPG123_DONE) + fprintf(stderr, "Some error occured (non-fatal?): %s\n", mpg123_strerror(m)); + + fprintf(stderr, "Done with %zu MPEG frames.\n", count); + + return 0; +} diff --git a/doc/examples/feedseek.c b/doc/examples/feedseek.c new file mode 100644 index 0000000..8f68d17 --- /dev/null +++ b/doc/examples/feedseek.c @@ -0,0 +1,238 @@ +/* + feedseek: test program for libmpg123, showing how to use fuzzy seeking in feeder mode + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#include +#include + +#define INBUFF 16384 * 2 * 2 +#define WAVE_FORMAT_PCM 0x0001 +#define WAVE_FORMAT_IEEE_FLOAT 0x0003 + +FILE *out; +size_t totaloffset, dataoffset; +long rate; +int channels, enc; +unsigned short bitspersample, wavformat; + +// write wav header +void initwav() +{ + unsigned int tmp32 = 0; + unsigned short tmp16 = 0; + + fwrite("RIFF", 1, 4, out); + totaloffset = ftell(out); + + fwrite(&tmp32, 1, 4, out); // total size + fwrite("WAVE", 1, 4, out); + fwrite("fmt ", 1, 4, out); + tmp32 = 16; + fwrite(&tmp32, 1, 4, out); // format length + tmp16 = wavformat; + fwrite(&tmp16, 1, 2, out); // format + tmp16 = channels; + fwrite(&tmp16, 1, 2, out); // channels + tmp32 = rate; + fwrite(&tmp32, 1, 4, out); // sample rate + tmp32 = rate * bitspersample/8 * channels; + fwrite(&tmp32, 1, 4, out); // bytes / second + tmp16 = bitspersample/8 * channels; // float 16 or signed int 16 + fwrite(&tmp16, 1, 2, out); // block align + tmp16 = bitspersample; + fwrite(&tmp16, 1, 2, out); // bits per sample + fwrite("data ", 1, 4, out); + tmp32 = 0; + dataoffset = ftell(out); + fwrite(&tmp32, 1, 4, out); // data length +} + +// rewrite wav header with final length infos +void closewav() +{ + unsigned int tmp32 = 0; + unsigned short tmp16 = 0; + + long total = ftell(out); + fseek(out, totaloffset, SEEK_SET); + tmp32 = total - (totaloffset + 4); + fwrite(&tmp32, 1, 4, out); + fseek(out, dataoffset, SEEK_SET); + tmp32 = total - (dataoffset + 4); + + fwrite(&tmp32, 1, 4, out); +} + +// determine correct wav format and bits per sample +// from mpg123 enc value +void initwavformat() +{ + if(enc & MPG123_ENC_FLOAT_64) + { + bitspersample = 64; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if(enc & MPG123_ENC_FLOAT_32) + { + bitspersample = 32; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if(enc & MPG123_ENC_16) + { + bitspersample = 16; + wavformat = WAVE_FORMAT_PCM; + } + else + { + bitspersample = 8; + wavformat = WAVE_FORMAT_PCM; + } +} + +int main(int argc, char **argv) +{ + unsigned char buf[INBUFF]; + unsigned char *audio; + FILE *in; + mpg123_handle *m; + int ret, state; + size_t inc, outc; + off_t len, num; + size_t bytes; + off_t inoffset; + inc = outc = 0; + + if(argc < 3) + { + fprintf(stderr,"Please supply in and out filenames\n"); + return -1; + } + + mpg123_init(); + + m = mpg123_new(NULL, &ret); + if(m == NULL) + { + fprintf(stderr,"Unable to create mpg123 handle: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + mpg123_param(m, MPG123_VERBOSE, 2, 0); + + ret = mpg123_param(m, MPG123_FLAGS, MPG123_FUZZY | MPG123_SEEKBUFFER | MPG123_GAPLESS, 0); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set library options: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + // Let the seek index auto-grow and contain an entry for every frame + ret = mpg123_param(m, MPG123_INDEX_SIZE, -1, 0); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set index size: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + ret = mpg123_format_none(m); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to disable all output formats: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + // Use float output + ret = mpg123_format(m, 44100, MPG123_MONO | MPG123_STEREO, MPG123_ENC_FLOAT_32); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set float output formats: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + ret = mpg123_open_feed(m); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable open feed: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + in = fopen(argv[1], "rb"); + if(in == NULL) + { + fprintf(stderr,"Unable to open input file %s\n", argv[1]); + return -1; + } + + out = fopen(argv[2], "wb"); + if(out == NULL) + { + fclose(in); + fprintf(stderr,"Unable to open output file %s\n", argv[2]); + return -1; + } + + fprintf(stderr, "Seeking...\n"); + /* That condition is tricky... parentheses are crucial... */ + while((ret = mpg123_feedseek(m, 95000, SEEK_SET, &inoffset)) == MPG123_NEED_MORE) + { + len = fread(buf, sizeof(unsigned char), INBUFF, in); + if(len <= 0) + break; + inc += len; + + state = mpg123_feed(m, buf, len); + if(state == MPG123_ERR) + { + fprintf(stderr, "Error: %s", mpg123_strerror(m)); + return -1; + } + } + if(ret == MPG123_ERR) + { + fprintf(stderr, "Feedseek failed: %s\n", mpg123_strerror(m)); + return -1; + } + + fseek(in, inoffset, SEEK_SET); + + fprintf(stderr, "Starting decode...\n"); + while(1) + { + len = fread(buf, sizeof(unsigned char), INBUFF, in); + if(len <= 0) + break; + inc += len; + ret = mpg123_feed(m, buf, len); + + while(ret != MPG123_ERR && ret != MPG123_NEED_MORE) + { + ret = mpg123_decode_frame(m, &num, &audio, &bytes); + if(ret == MPG123_NEW_FORMAT) + { + mpg123_getformat(m, &rate, &channels, &enc); + initwavformat(); + initwav(); + fprintf(stderr, "New format: %li Hz, %i channels, encoding value %i\n", rate, channels, enc); + } + fwrite(audio, sizeof(unsigned char), bytes, out); + outc += bytes; + } + + if(ret == MPG123_ERR) + { + fprintf(stderr, "Error: %s", mpg123_strerror(m)); + break; + } + } + + fprintf(stderr, "Finished\n", (unsigned long)inc, (unsigned long)outc); + + closewav(); + fclose(out); + fclose(in); + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/doc/examples/id3dump.c b/doc/examples/id3dump.c new file mode 100644 index 0000000..649e331 --- /dev/null +++ b/doc/examples/id3dump.c @@ -0,0 +1,178 @@ +/* + id3dump: Print ID3 tags of files, scanned using libmpg123. + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "mpg123.h" +#include +#include "stdio.h" +#include "sys/types.h" + +/* Helper for v1 printing, get these strings their zero byte. */ +void safe_print(char* name, char *data, size_t size) +{ + char safe[31]; + if(size>30) return; + + memcpy(safe, data, size); + safe[size] = 0; + printf("%s: %s\n", name, safe); +} + +/* Print out ID3v1 info. */ +void print_v1(mpg123_id3v1 *v1) +{ + safe_print("Title", v1->title, sizeof(v1->title)); + safe_print("Artist", v1->artist, sizeof(v1->artist)); + safe_print("Album", v1->album, sizeof(v1->album)); + safe_print("Year", v1->year, sizeof(v1->year)); + safe_print("Comment", v1->comment, sizeof(v1->comment)); + printf("Genre: %i", v1->genre); +} + +/* Split up a number of lines separated by \n, \r, both or just zero byte + and print out each line with specified prefix. */ +void print_lines(const char* prefix, mpg123_string *inlines) +{ + size_t i; + int hadcr = 0, hadlf = 0; + char *lines = NULL; + char *line = NULL; + size_t len = 0; + + if(inlines != NULL && inlines->fill) + { + lines = inlines->p; + len = inlines->fill; + } + else return; + + line = lines; + for(i=0; ititle); + print_lines("Artist: ", v2->artist); + print_lines("Album: ", v2->album); + print_lines("Year: ", v2->year); + print_lines("Comment: ", v2->comment); + print_lines("Genre: ", v2->genre); +} + +/* Print out all stored ID3v2 fields with their 4-character IDs. */ +void print_raw_v2(mpg123_id3v2 *v2) +{ + size_t i; + for(i=0; itexts; ++i) + { + char id[5]; + char lang[4]; + memcpy(id, v2->text[i].id, 4); + id[4] = 0; + memcpy(lang, v2->text[i].lang, 3); + lang[3] = 0; + if(v2->text[i].description.fill) + printf("%s language(%s) description(%s)\n", id, lang, v2->text[i].description.p); + else printf("%s language(%s)\n", id, lang); + + print_lines(" ", &v2->text[i].text); + } + for(i=0; iextras; ++i) + { + char id[5]; + memcpy(id, v2->extra[i].id, 4); + id[4] = 0; + printf( "%s description(%s)\n", + id, + v2->extra[i].description.fill ? v2->extra[i].description.p : "" ); + print_lines(" ", &v2->extra[i].text); + } + for(i=0; icomments; ++i) + { + char id[5]; + char lang[4]; + memcpy(id, v2->comment_list[i].id, 4); + id[4] = 0; + memcpy(lang, v2->comment_list[i].lang, 3); + lang[3] = 0; + printf( "%s description(%s) language(%s): \n", + id, + v2->comment_list[i].description.fill ? v2->comment_list[i].description.p : "", + lang ); + print_lines(" ", &v2->comment_list[i].text); + } +} + +int main(int argc, char **argv) +{ + int i; + mpg123_handle* m; + if(argc < 2) + { + fprintf(stderr, "\nI will print some ID3 tag fields of MPEG audio files.\n"); + fprintf(stderr, "\nUsage: %s \n\n", argv[0]); + return -1; + } + mpg123_init(); + m = mpg123_new(NULL, NULL); + + for(i=1; i < argc; ++i) + { + mpg123_id3v1 *v1; + mpg123_id3v2 *v2; + int meta; + if(mpg123_open(m, argv[i]) != MPG123_OK) + { + fprintf(stderr, "Cannot open %s: %s\n", argv[i], mpg123_strerror(m)); + continue; + } + mpg123_scan(m); + meta = mpg123_meta_check(m); + if(meta & MPG123_ID3 && mpg123_id3(m, &v1, &v2) == MPG123_OK) + { + printf("Tag data on %s:\n", argv[i]); + printf("\n==== ID3v1 ====\n"); + if(v1 != NULL) print_v1(v1); + + printf("\n==== ID3v2 ====\n"); + if(v2 != NULL) print_v2(v2); + + printf("\n==== ID3v2 Raw frames ====\n"); + if(v2 != NULL) print_raw_v2(v2); + } + else printf("Nothing found for %s.\n", argv[i]); + + mpg123_close(m); + } + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/doc/examples/mpg123_to_out123.c b/doc/examples/mpg123_to_out123.c new file mode 100644 index 0000000..2031ab9 --- /dev/null +++ b/doc/examples/mpg123_to_out123.c @@ -0,0 +1,164 @@ +/* + mpg123_to_wav.c + + copyright 2007-2016 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Nicholas Humfrey + + The most complicated part is about the choices to make about output format, + and prepare for the unlikely case a bastard mp3 might file change it. +*/ + +#include +#include +#include +#include + +void usage(const char *cmd) +{ + printf("Usage: %s [ [ [encoding [buffersize]]]]\n" + , cmd); + printf( "\nPlay MPEG audio from intput file to output file/device using\n" + "specified out123 driver, sample encoding and buffer size optional.\n\n" ); + exit(99); +} + +void cleanup(mpg123_handle *mh, out123_handle *ao) +{ + out123_del(ao); + /* It's really to late for error checks here;-) */ + mpg123_close(mh); + mpg123_delete(mh); + mpg123_exit(); +} + +int main(int argc, char *argv[]) +{ + mpg123_handle *mh = NULL; + out123_handle *ao = NULL; + char *infile = NULL; + char *driver = NULL; + char *outfile = NULL; + unsigned char* buffer = NULL; + const char *encname; + size_t buffer_size = 0; + size_t done = 0; + int channels = 0; + int encoding = 0; + int framesize = 1; + long rate = 0; + int err = MPG123_OK; + off_t samples = 0; + + if(argc<2) + usage(argv[0]); + + infile = argv[1]; + if(argc >= 3) + driver = argv[2]; + if(argc >= 4) + outfile = argv[3]; + printf("Input file: %s\n", infile); + printf("Output driver: %s\n", driver ? driver : " (default)"); + printf("Output file: %s\n", outfile ? outfile : " (default)"); + + err = mpg123_init(); + if(err != MPG123_OK || (mh = mpg123_new(NULL, &err)) == NULL) + { + fprintf(stderr, "Basic setup goes wrong: %s", mpg123_plain_strerror(err)); + cleanup(mh, ao); + return -1; + } + + ao = out123_new(); + if(!ao) + { + fprintf(stderr, "Cannot create output handle.\n"); + cleanup(mh, ao); + return -1; + } + + if(argc >= 5) + { /* Make mpg123 support the desired encoding only for all rates. */ + const long *rates; + size_t rate_count; + size_t i; + int enc; + /* If that is zero, you'll get the error soon enough from mpg123. */ + enc = out123_enc_byname(argv[4]); + mpg123_format_none(mh); + mpg123_rates(&rates, &rate_count); + for(i=0; i (default)"); + printf("Effective output file: %s\n", outfile ? outfile : " (default)"); + + /* Ensure that this output format will not change + (it might, when we allow it). */ + mpg123_format_none(mh); + mpg123_format(mh, rate, channels, encoding); + + encname = out123_enc_name(encoding); + printf( "Playing with %i channels and %li Hz, encoding %s.\n" + , channels, rate, encname ? encname : "???" ); + if( out123_start(ao, rate, channels, encoding) + || out123_getformat(ao, NULL, NULL, NULL, &framesize) ) + { + fprintf(stderr, "Cannot start output / get framesize: %s\n" + , out123_strerror(ao)); + cleanup(mh, ao); + return -1; + } + + /* Buffer could be almost any size here, mpg123_outblock() is just some + recommendation. The size should be a multiple of the PCM frame size. */ + buffer_size = argc >= 6 ? atol(argv[5]) : mpg123_outblock(mh); + buffer = malloc( buffer_size ); + + do + { + size_t played; + err = mpg123_read( mh, buffer, buffer_size, &done ); + played = out123_play(ao, buffer, done); + if(played != done) + { + fprintf(stderr + , "Warning: written less than gotten from libmpg123: %li != %li\n" + , (long)played, (long)done); + } + samples += played/framesize; + /* We are not in feeder mode, so MPG123_OK, MPG123_ERR and + MPG123_NEW_FORMAT are the only possibilities. + We do not handle a new format, MPG123_DONE is the end... so + abort on anything not MPG123_OK. */ + } while (done && err==MPG123_OK); + + free(buffer); + + if(err != MPG123_DONE) + fprintf( stderr, "Warning: Decoding ended prematurely because: %s\n", + err == MPG123_ERR ? mpg123_strerror(mh) : mpg123_plain_strerror(err) ); + + printf("%li samples written.\n", (long)samples); + cleanup(mh, ao); + return 0; +} diff --git a/doc/examples/mpglib.c b/doc/examples/mpglib.c new file mode 100644 index 0000000..4ee1a1d --- /dev/null +++ b/doc/examples/mpglib.c @@ -0,0 +1,92 @@ +/* + mpglib: test program for libmpg123, in the style of the legacy mpglib test program + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include + +/* unistd.h is not available under MSVC, + io.h defines the read and write functions */ +#ifndef _MSC_VER +#include +#else +#include +#endif + +#ifdef _WIN32 +#include +#endif + +#include + +#define INBUFF 16384 +#define OUTBUFF 32768 + +int main(int argc, char **argv) +{ + size_t size; + unsigned char buf[INBUFF]; /* input buffer */ + unsigned char out[OUTBUFF]; /* output buffer */ + ssize_t len; + int ret; + size_t in = 0, outc = 0; + mpg123_handle *m; + +#ifdef _WIN32 +_setmode(_fileno(stdin),_O_BINARY); +_setmode(_fileno(stdout),_O_BINARY); +#endif + + mpg123_init(); + m = mpg123_new(argc > 1 ? argv[1] : NULL, &ret); + if(m == NULL) + { + fprintf(stderr,"Unable to create mpg123 handle: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + mpg123_param(m, MPG123_VERBOSE, 2, 0); /* Brabble a bit about the parsing/decoding. */ + + /* Now mpg123 is being prepared for feeding. The main loop will read chunks from stdin and feed them to mpg123; + then take decoded data as available to write to stdout. */ + mpg123_open_feed(m); + if(m == NULL) return -1; + + fprintf(stderr, "Feed me some MPEG audio to stdin, I will decode to stdout.\n"); + while(1) /* Read and write until everything is through. */ + { + len = read(0,buf,INBUFF); + if(len <= 0) + { + fprintf(stderr, "input data end\n"); + break; + } + in += len; + /* Feed input chunk and get first chunk of decoded audio. */ + ret = mpg123_decode(m,buf,len,out,OUTBUFF,&size); + if(ret == MPG123_NEW_FORMAT) + { + long rate; + int channels, enc; + mpg123_getformat(m, &rate, &channels, &enc); + fprintf(stderr, "New format: %li Hz, %i channels, encoding value %i\n", rate, channels, enc); + } + write(1,out,size); + outc += size; + while(ret != MPG123_ERR && ret != MPG123_NEED_MORE) + { /* Get all decoded audio that is available now before feeding more input. */ + ret = mpg123_decode(m,NULL,0,out,OUTBUFF,&size); + write(1,out,size); + outc += size; + } + if(ret == MPG123_ERR){ fprintf(stderr, "some error: %s", mpg123_strerror(m)); break; } + } + fprintf(stderr, "%lu bytes in, %lu bytes out\n", (unsigned long)in, (unsigned long)outc); + + /* Done decoding, now just clean up and leave. */ + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/doc/examples/scan.c b/doc/examples/scan.c new file mode 100644 index 0000000..df9b999 --- /dev/null +++ b/doc/examples/scan.c @@ -0,0 +1,47 @@ +/* + scan: Estimate length (sample count) of a mpeg file and compare to length from exact scan. + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +/* Note the lack of error checking here. + While it would be nicer to inform the user about troubles, libmpg123 is designed _not_ to bite you on operations with invalid handles , etc. + You just jet invalid results on invalid operations... */ + +#include +#include + +int main(int argc, char **argv) +{ + mpg123_handle *m; + int i; + if(argc < 2) + { + fprintf(stderr, "\nI will give you the estimated and exact sample lengths of MPEG audio files.\n"); + fprintf(stderr, "\nUsage: %s \n\n", argv[0]); + return -1; + } + mpg123_init(); + m = mpg123_new(NULL, NULL); + mpg123_param(m, MPG123_RESYNC_LIMIT, -1, 0); /* New in library version 0.0.1 . */ + for(i = 1; i < argc; ++i) + { + off_t a, b; + + mpg123_open(m, argv[i]); + + a = mpg123_length(m); + mpg123_scan(m); + b = mpg123_length(m); + + mpg123_close(m); + + printf("File %i: estimated %li vs. scanned %li\n", i, (long)a, (long)b); + } + + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/doc/libmpg123_speed.txt b/doc/libmpg123_speed.txt new file mode 100644 index 0000000..1d48648 --- /dev/null +++ b/doc/libmpg123_speed.txt @@ -0,0 +1,84 @@ +This is historic... one should make a new investigation. +What I can say that a quick test of pre0.59s versus 1.7.3 with generic decoder on my x86-64 GNU/Linux box is not able to call a winner (or looser, for that matter). +Though, 1.8.0 will make the new libmpg123 a winner, because there is new optimization code going on! + +The move to libmpg123 means some more code separation / interfacing and especially the move of any local static variables into the mpg123_handle to make multiple stream handling possible. +That may very well have an impact on performance of the mpg123 decoder. +I made some tests, even using gcc's -pg option and gprof, with mixed result: SSE and MMX on my Thinkpad X31 are slower, especially the asm synth funtion, while the generic code is fine. +On the other hand, on a K6-3+ using the same gcc version 4.1.2, the library based mpg123 is _faster_ for MMX and 3DNowExt. +Epecially the mmx synth is faster... while the 3DNowExt synth is slower, too (it's the same code as SSE synth, just calling different dct64) - but speedups in other regions still make 3DNowExt of the library mpg123 more efficient. + +What I can clearly say is that dropping the multi-cpu support via ./configure --with-cpu does help in for both monolithic and library mpg123, but that is no wonder as it removes indirection. +The main point stays, though: On my Thinkpad the library is slow, on the K6-3+ it's fast. + +What's the point to get here? I am not sure. We're depending on the compiler optimization (btw: Intel Compiler doesn't change the relation for the Thinkpad; not tested on the K6). +I guess that for my Thinkpad another gcc version could invert the picture again... +Also, I am not sure how far I should trust the gprof analysis... but it can be right; even when there is no apparent cause for the speed difference in the code itself, it could be some effect of cache and memory access. +Some reordering of instructions and data... for sure that happened. + +I'll need further numbers to conclude anything about the (positive/negative) impact my code changes have. + +OK, ran the test of trunk against branches/mpg123lib on my media box with AMD Geode (AthlonXP, actually): + +thomas@kiste:~$ for i in mpg123-lib mpg123-trunk; do for cpu in mmx 3dnowext sse; do echo $i $cpu; time $i/src/mpg123 --cpu $cpu -q -t /thorma/var/music/metallica/ride_the_lightning/*.mp3; done; done +mpg123-lib mmx + +real 0m25.949s +user 0m25.395s +sys 0m0.534s +mpg123-lib 3dnowext + +real 0m25.442s +user 0m24.863s +sys 0m0.558s +mpg123-lib sse + +real 0m25.794s +user 0m25.214s +sys 0m0.562s +mpg123-trunk mmx + +real 0m26.650s +user 0m26.004s +sys 0m0.626s +mpg123-trunk 3dnowext + +real 0m25.886s +user 0m25.262s +sys 0m0.600s +mpg123-trunk sse + +real 0m25.695s +user 0m25.136s +sys 0m0.539s +thomas@kiste:~$ for i in mpg123-lib mpg123-trunk; do for cpu in 3dnow; do echo $i $cpu; time $i/src/mpg123 --cpu $cpu -q -t /thorma/var/music/metallica/ride_the_lightning/*.mp3; done; done +mpg123-lib 3dnow + +real 0m33.011s +user 0m32.365s +sys 0m0.621s +mpg123-trunk 3dnow + +real 0m32.830s +user 0m32.192s +sys 0m0.619s + + +You can't really make a decision there. It's tight. +What worries me a bit is the total loose of 3DNow against MMX - should it be that drastic? +Well, it's higher quality, at least. + + +Addendum: The game on an K6-3+ + +On mpg123 < 1.8.0, he 3DNowExt decoder used to be slower than the 3DNow decoder. Only recently it has been observed, that the simplification of the runtime decoder choice code sped up that one significantly, towards the same performance level as the single-decoder build of mpg123 1.6.4 (-with-cpu=3dnowext_alone having broken build in later versions:-/). +We are talking about a difference of 20% here... there is something special about the K6-3+ that makes is that sensitive to how the function pointers get thrown around. + +Example numbers: Dynamic x86 build of 1.6.4, 3DNowExt needs 5.9 s, 3DNow 5.6 s. +3DNowExt-only build: 4.9 s +3DNow-only build: 5.6 s +Now... dynamic build of mpg123 trunk of 2010-05-24: 3DNowExt 4.9 s, 3DNow 5.6 s. That's how it should be. One might investigate how exactly the old ways before mpg123 1.8 worked against the K6-3+ ... possibly helping performance issues seen with the mpg123 coded for MPlayer on that CPU. + +-- +Thomas. + diff --git a/equalize.dat b/equalize.dat new file mode 100644 index 0000000..8cefb34 --- /dev/null +++ b/equalize.dat @@ -0,0 +1,37 @@ +# in every line, there are two values. One for the left +# and one for the right cahnnel. +# the first line is the multiplicator for the lowest frequency band +# the 32th line for the highest freq. band +# +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 diff --git a/libmpg123.pc.in b/libmpg123.pc.in new file mode 100644 index 0000000..198ff70 --- /dev/null +++ b/libmpg123.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmpg123 +Description: An optimised MPEG Audio decoder +Requires: +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lmpg123 +Cflags: -I${includedir} diff --git a/libout123.pc.in b/libout123.pc.in new file mode 100644 index 0000000..2892a27 --- /dev/null +++ b/libout123.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libout123 +Description: A streaming audio output API derived from mpg123 +Requires: +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lout123 +Cflags: -I${includedir} diff --git a/m4/addrconfig.m4 b/m4/addrconfig.m4 new file mode 100644 index 0000000..5494509 --- /dev/null +++ b/m4/addrconfig.m4 @@ -0,0 +1,34 @@ +dnl Check whether the AI_ADDRCONFIG flag can be used with getaddrinfo +dnl Taken from APR ... +AC_DEFUN([APR_CHECK_GETADDRINFO_ADDRCONFIG], [ + AC_CACHE_CHECK(for working AI_ADDRCONFIG, apr_cv_gai_addrconfig, [ + AC_TRY_RUN([ +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +int main(int argc, char **argv) { + struct addrinfo hints, *ai; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_ADDRCONFIG; + return getaddrinfo("localhost", NULL, &hints, &ai) != 0; +}], [apr_cv_gai_addrconfig=yes], + [apr_cv_gai_addrconfig=no], + [apr_cv_gai_addrconfig=no])]) + +if test $apr_cv_gai_addrconfig = yes; then + AC_DEFINE(HAVE_GAI_ADDRCONFIG, 1, [Define if getaddrinfo accepts the AI_ADDRCONFIG flag]) +fi +]) diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 0000000..a3bc337 --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,8369 @@ +# 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 . +]) + +# 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: +# +# ='`$ECHO "$" | $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 ." + +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 +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* 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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + 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 + + # 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="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +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 &1 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 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 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 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 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 index 0000000..94b0829 --- /dev/null +++ b/m4/ltoptions.m4 @@ -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 index 0000000..48bc934 --- /dev/null +++ b/m4/ltsugar.m4 @@ -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 index 0000000..fa04b52 --- /dev/null +++ b/m4/ltversion.m4 @@ -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 index 0000000..c6b26f8 --- /dev/null +++ b/m4/lt~obsolete.m4 @@ -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])]) diff --git a/makedll.sh b/makedll.sh new file mode 100644 index 0000000..2fe9ef6 --- /dev/null +++ b/makedll.sh @@ -0,0 +1,19 @@ +#!/bin/sh +if test -e Makefile; then + make clean +fi +options="$@" +echo "using options: $options" +CFLAGS="-march=i686" ./configure --disable-modules --with-cpu=x86_dither $options && +cd src/libmpg123 && +make && +cp .libs/libmpg123-0.dll ../../ && +cp .libs/libmpg123-0.dll.def ../../libmpg123-0.def +cd ../../ && +echo "Now run that lib tool... perhaps you want to strip, too. +Hints: + strip --strip-unneeded libmpg123-0.dll + lib /machine:i386 /def:libmpg123-0.def" || +echo You got some trouble. + + diff --git a/man1/mpg123.1 b/man1/mpg123.1 new file mode 100644 index 0000000..3e2b396 --- /dev/null +++ b/man1/mpg123.1 @@ -0,0 +1,574 @@ +.TH mpg123 1 "29 Feb 2016" +.SH NAME +mpg123 \- play audio MPEG 1.0/2.0/2.5 stream (layers 1, 2 and 3) +.SH SYNOPSIS +.B mpg123 +[ +.B options +] +.IR file-or-URL ... +.SH DESCRIPTION +.B mpg123 +reads one or more +.IR file\^ s +(or standard input if ``\-'' is specified) or +.IR URL\^ s +and plays them on the audio device (default) or +outputs them to stdout. +.IR file\^ / URL +is assumed to be an MPEG audio bit stream. +.SH OPERANDS +The following operands are supported: +.TP 8 +.IR file (s) +The path name(s) of one or more input files. They must be +valid MPEG-1.0/2.0/2.5 audio layer 1, 2 or 3 bit streams. +If a dash ``\-'' is specified, MPEG data will +be read from the standard input. Furthermore, any name +starting with ``http://'' is recognized as +.I URL +(see next section). +.SH OPTIONS +.B mpg123 +options may be either the traditional POSIX one letter options, +or the GNU style long options. POSIX style options start with a +single ``\-'', while GNU long options start with ``\-\^\-''. +Option arguments (if needed) follow separated by whitespace (not ``=''). +Note that some options can be absent from your installation when disabled in the build process. +.SH INPUT OPTIONS +.TP +\fB\-k \fInum\fR, \fB\-\^\-skip \fInum +Skip first +.I num +frames. By default the decoding starts at the first frame. +.TP +\fB\-n \fInum\fR, \fB\-\^\-frames \fInum +Decode only +.I num +frames. By default the complete stream is decoded. +.TP +.BR \-\-fuzzy +Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC). +Without that, seeks need a first scan through the file before they can jump at positions. +You can decide here: sample-accurate operation with gapless features or faster (fuzzy) seeking. +.TP +.BR \-y ", " \-\^\-no\-resync +Do NOT try to resync and continue decoding if an error occurs in +the input file. Normally, +.B mpg123 +tries to keep the playback alive at all costs, including skipping invalid material and searching new header when something goes wrong. +With this switch you can make it bail out on data errors +(and perhaps spare your ears a bad time). Note that this switch has been renamed from \-\-resync. +The old name still works, but is not advertised or recommened to use (subject to removal in future). +.TP +\fB\-\^-resync\-limit \fIbytes\fR +Set number of bytes to search for valid MPEG data once lost in stream; <0 means search whole stream. +If you know there are huge chunks of invalid data in your files... here is your hammer. +Note: Only since version 1.14 this also increases the amount of junk skipped on beginning. +.TP +\fB\-p \fIURL \fR| \fBnone\fR, \fB\-\^\-proxy \fIURL \fR| \fBnone +The specified +.I proxy +will be used for HTTP requests. It +should be specified as full URL (``http://host.domain:port/''), +but the ``http://'' prefix, the port number and the trailing +slash are optional (the default port is 80). Specifying +.B none +means not to use any proxy, and to retrieve files directly +from the respective servers. See also the +``HTTP SUPPORT'' section. +.TP +\fB\-u \fIauth\fR, \fB\-\^\-auth \fIauth +HTTP authentication to use when recieving files via HTTP. +The format used is user:password. +.TP +\fB\-\^\-ignore\-mime +Ignore MIME types given by HTTP server. If you know better and want mpg123 +to decode something the server thinks is image/png, then just do it. +.TP +\fB\-\^\-no\-seekbuffer +Disable the default micro-buffering of non-seekable streams that gives the +parser a safer footing. +.TP +\fB\-@ \fIfile\fR, \fB\-\^\-list \fIfile +Read filenames and/or URLs of MPEG audio streams from the specified +.I file +in addition to the ones specified on the command line (if any). +Note that +.I file +can be either an ordinary file, a dash ``\-'' to indicate that +a list of filenames/URLs is to be read from the standard input, +or an URL pointing to a an appropriate list file. Note: only +one +.B \-@ +option can be used (if more than one is specified, only the +last one will be recognized). +.TP +\fB\-l \fIn\fR, \fB\-\^\-listentry \fIn +Of the playlist, play specified entry only. +.I n +is the number of entry starting at 1. A value of 0 is the default and means playling the whole list, a negative value means showing of the list of titles with their numbers... +.TP +\fB\-\^\-continue +Enable playlist continuation mode. This changes frame skipping to apply only to the first track and also continues to play following tracks in playlist after the selected one. Also, the option to play a number of frames only applies to the whole playlist. Basically, this tries to treat the playlist more like one big stream (like, an audio book). +The current track number in list (1-based) and frame number (0-based) are printed at exit (useful if you interrupted playback and want to continue later). +Note that the continuation info is printed to standard output unless the switch for piping audio data to standard out is used. Also, it really makes sense to work with actual playlist files instead of lists of file names as arguments, to keep track positions consistent. +.TP +\fB\-\-loop \fItimes\fR +for looping track(s) a certain number of times, < 0 means infinite loop (not with \-\-random!). +.TP +.BR \-\-keep\-open +For remote control mode: Keep loaded file open after reaching end. +.TP +\fB\-\-timeout \fIseconds\fR +Timeout in (integer) seconds before declaring a stream dead (if <= 0, wait forever). +.TP +.BR \-z ", " \-\^\-shuffle +Shuffle play. Randomly shuffles the order of files specified on the command +line, or in the list file. +.TP +.BR \-Z ", " \-\-random +Continuous random play. Keeps picking a random file from the command line +or the play list. Unlike shuffle play above, random play never ends, and +plays individual songs more than once. +.TP +\fB\-\^\-no\-icy\-meta +Do not accept ICY meta data. +.TP +\fB\-i, \-\^-index +Index / scan through the track before playback. +This fills the index table for seeking (if enabled in libmpg123) and may make the operating system cache the file contents for smoother operating on playback. +.TP +\fB\-\-index\-size \fIsize\fR +Set the number of entries in the seek frame index table. +.TP +\fB\-\-preframes \fInum\fR +Set the number of frames to be read as lead-in before a seeked-to position. +This serves to fill the layer 3 bit reservoir, which is needed to faithfully reproduce a certain sample at a certain position. +Note that for layer 3, a minimum of 1 is enforced (because of frame overlap), and for layer 1 and 2, this is limited to 2 (no bit reservoir in that case, but engine spin-up anyway). + +.SH OUTPUT and PROCESSING OPTIONS +.TP +\fB\-o \fImodule\fR, \-\^\-output \fImodule\fR +Select audio output module. You can provide a comma-separated list to use the first one that works. +.TP +\fB\-\^\-list\-modules +List the available modules. +.TP +\fB\-a \fIdev\fR, \fB\-\^\-audiodevice \fIdev +Specify the audio device to use. The default is +system-dependent (usually /dev/audio or /dev/dsp). +Use this option if you have multiple audio devices and +the default is not what you want. +.TP +.BR \-s ", " \-\^\-stdout +The decoded audio samples are written to standard output, +instead of playing them through the audio device. This +option must be used if your audio hardware is not supported +by +.BR mpg123 . +The output format per default is raw (headerless) linear PCM audio data, +16 bit, stereo, host byte order (you can force mono or 8bit). +.TP +\fB\-O \fIfile\fR, \fB\-\^\-outfile +Write raw output into a file (instead of simply redirecting standard output to a file with the shell). +.TP +\fB\-w \fIfile\fR, \fB\-\^\-wav +Write output as WAV file. This will cause the MPEG stream to be decoded +and saved as file +.I file +, or standard output if +.I - +is used as file name. You can also use +.I --au +and +.I --cdr +for AU and CDR format, respectively. Note that WAV/AU writing to non-seekable files, or redirected stdout, needs some thought. Since 1.16.0, the logic changed to writing the header with the first actual data. This avoids spurious WAV headers in a pipe, for example. The result of decoding nothing to WAV/AU is a file consisting just of the header when it is seekable and really nothing when not (not even a header). Correctly writing data with prophetic headers to stdout is no easy business. +.TP +\fB\-\^\-au \fIfile +Does not play the MPEG file but writes it to +.I file +in SUN audio format. If \- is used as the filename, the AU file is +written to stdout. See paragraph about WAV writing for header fun with non-seekable streams. +.TP +\fB\-\^\-cdr \fIfile +Does not play the MPEG file but writes it to +.I file +as a CDR file. If \- is used as the filename, the CDR file is written +to stdout. +.TP +.BR \-\-reopen +Forces reopen of the audiodevice after ever song +.TP +.BR \-\-cpu\ \fIdecoder\-type +Selects a certain decoder (optimized for specific CPU), for example i586 or MMX. +The list of available decoders can vary; depending on the build and what your CPU supports. +This options is only availabe when the build actually includes several optimized decoders. +.TP +.BR \-\-test\-cpu +Tests your CPU and prints a list of possible choices for \-\-cpu. +.TP +.BR \-\-list\-cpu +Lists all available decoder choices, regardless of support by your CPU. +.TP +\fB\-g \fIgain\fR, \fB\-\^\-gain \fIgain +[DEPRECATED] Set audio hardware output gain (default: don't change). The unit of the gain value is hardware and output module dependent. +(This parameter is only provided for backwards compatibility and may be removed in the future without prior notice. Use the audio player for playing and a mixer app for mixing, UNIX style!) +.TP +\fB\-f \fIfactor\fR, \fB\-\^\-scale \fIfactor +Change scale factor (default: 32768). +.TP +.BR \-\-rva-mix,\ \-\-rva-radio +Enable RVA (relative volume adjustment) using the values stored for ReplayGain radio mode / mix mode with all tracks roughly equal loudness. +The first valid information found in ID3V2 Tags (Comment named RVA or the RVA2 frame) or ReplayGain header in Lame/Info Tag is used. +.TP +.BR \-\-rva-album,\ \-\-rva-audiophile +Enable RVA (relative volume adjustment) using the values stored for ReplayGain audiophile mode / album mode with usually the effect of adjusting album loudness but keeping relative loudness inside album. +The first valid information found in ID3V2 Tags (Comment named RVA_ALBUM or the RVA2 frame) or ReplayGain header in Lame/Info Tag is used. +.TP +.BR \-0 ", " \-\^\-single0 "; " \-1 ", " \-\^\-single1 +Decode only channel 0 (left) or channel 1 (right), +respectively. These options are available for +stereo MPEG streams only. +.TP +.BR \-m ", " \-\^\-mono ", " \-\^\-mix ", " \-\^\-singlemix +Mix both channels / decode mono. It takes less +CPU time than full stereo decoding. +.TP +.BR \-\-stereo +Force stereo output +.TP +\fB\-r \fIrate\fR, \fB\-\^\-rate \fIrate +Set sample rate (default: automatic). You may want to +change this if you need a constant bitrate independent of +the mpeg stream rate. mpg123 automagically converts the +rate. You should then combine this with \-\-stereo or \-\-mono. +.TP +.BR \-2 ", " \-\^\-2to1 "; " \-4 ", " \-\^\-4to1 +Performs a downsampling of ratio 2:1 (22 kHz) or 4:1 (11 kHz) +on the output stream, respectively. Saves some CPU cycles, but +at least the 4:1 ratio sounds ugly. +.TP +.BR \-\-pitch\ \fIvalue +Set hardware pitch (speedup/down, 0 is neutral; 0.05 is 5%). This changes the output sampling rate, so it only works in the range your audio system/hardware supports. +.TP +.BR \-\-8bit +Forces 8bit output +.TP +\fB\-\^\-float +Forces f32 encoding +.TP +\fB\-e \fIenc\fR, \fB\-\^\-encoding \fIenc +Choose output sample encoding. Possible values look like f32 (32-bit floating point), s32 (32-bit signed integer), u32 (32-bit unsigned integer) and the variants with different numbers of bits (s24, u24, s16, u16, s8, u8) and also special variants like ulaw and alaw 8-bit. +See the output of mpg123's longhelp for actually available encodings. +.TP +\fB\-d \fIn\fR, \fB\-\^\-doublespeed \fIn +Only play every +.IR n 'th +frame. This will cause the MPEG stream +to be played +.I n +times faster, which can be used for special +effects. Can also be combined with the +.B \-\^\-halfspeed +option to play 3 out of 4 frames etc. Don't expect great +sound quality when using this option. +.TP +\fB\-h \fIn\fR, \fB\-\^\-halfspeed \fIn +Play each frame +.I n +times. This will cause the MPEG stream +to be played at +.IR 1 / n 'th +speed (n times slower), which can be +used for special effects. Can also be combined with the +.B \-\^\-doublespeed +option to double every third frame or things like that. +Don't expect great sound quality when using this option. +.TP +\fB\-E \fIfile\fR, \fB\-\^\-equalizer +Enables equalization, taken from +.IR file . +The file needs to contain 32 lines of data, additional comment lines may +be prefixed with +.IR # . +Each data line consists of two floating-point entries, separated by +whitespace. They specify the multipliers for left and right channel of +a certain frequency band, respectively. The first line corresponds to the +lowest, the 32nd to the highest frequency band. +Note that you can control the equalizer interactively with the generic control interface. +.TP +\fB\-\^\-gapless +Enable code that cuts (junk) samples at beginning and end of tracks, enabling gapless transitions between MPEG files when encoder padding and codec delays would prevent it. +This is enabled per default beginning with mpg123 version 1.0.0 . +.TP +\fB\-\^\-no\-gapless +Disable the gapless code. That gives you MP3 decodings that include encoder delay and padding plus mpg123's decoder delay. +.TP +\fB\-\^\-no\-infoframe +Do not parse the Xing/Lame/VBR/Info frame, decode it instead just like a stupid old MP3 hardware player. +This implies disabling of gapless playback as the necessary information is in said metadata frame. +.TP +\fB\-D \fIn\fR, \fB\-\-delay \fIn +Insert a delay of \fIn\fR seconds before each track. +.TP +.BR "\-o h" ", " \-\^\-headphones +Direct audio output to the headphone connector (some hardware only; AIX, HP, SUN). +.TP +.BR "\-o s" ", " \-\^\-speaker +Direct audio output to the speaker (some hardware only; AIX, HP, SUN). +.TP +.BR "\-o l" ", " \-\^\-lineout +Direct audio output to the line-out connector (some hardware only; AIX, HP, SUN). +.TP +\fB\-b \fIsize\fR, \fB\-\^\-buffer \fIsize +Use an audio output buffer of +.I size +Kbytes. This is useful to bypass short periods of heavy +system activity, which would normally cause the audio output +to be interrupted. +You should specify a buffer size of at least 1024 +(i.e. 1 Mb, which equals about 6 seconds of audio data) or more; +less than about 300 does not make much sense. The default is 0, +which turns buffering off. +.TP +\fB\-\^\-preload \fIfraction +Wait for the buffer to be filled to +.I fraction +before starting playback (fraction between 0 and 1). You can tune this prebuffering to either get faster sound to your ears or safer uninterrupted web radio. +Default is 0.2 (wait for 20 % of buffer to be full, changed from 1 in version 1.23). +.TP +\fB\-\^\-devbuffer \fIseconds +Set device buffer in seconds; <= 0 means default value. This is the small buffer between the +application and the audio backend, possibly directly related to hardware buffers. +.TP +\fB\-\^\-smooth +Keep buffer over track boundaries -- meaning, do not empty the buffer between tracks for possibly some added smoothness. + +.SH MISC OPTIONS + +.TP +.BR \-t ", " \-\^\-test +Test mode. The audio stream is decoded, but no output occurs. +.TP +.BR \-c ", " \-\^\-check +Check for filter range violations (clipping), and report them for each frame +if any occur. +.TP +.BR \-v ", " \-\^\-verbose +Increase the verbosity level. For example, displays the frame +numbers during decoding. +.TP +.BR \-q ", " \-\^\-quiet +Quiet. Suppress diagnostic messages. +.TP +.BR \-C ", " \-\^\-control +Enable terminal control keys. This is enabled automatically if a terminal is detected. +By default use 's' or the space bar to stop/restart (pause, unpause) playback, 'f' to jump forward to the next song, 'b' to jump back to the +beginning of the song, ',' to rewind, '.' to fast forward, and 'q' to quit. +Type 'h' for a full list of available controls. +.TP +\fB\-\^\-no\-control +Disable terminal control even if terminal is detected. +.TP +\fB\-\^\-title +In an xterm, rxvt, screen, iris-ansi (compatible, TERM environment variable is examined), change the window's title to the name of song currently +playing. +.TP +\fB\-\^\-name \fIname +Set the name of this instance, possibly used in various places. This sets the client name for JACK output. +.TP +\fB\-\^\-long\-tag +Display ID3 tag info always in long format with one line per item (artist, title, ...) +.TP +.BR \-\-utf8 +Regardless of environment, print metadata in UTF-8 (otherwise, when not using UTF-8 locale, you'll get ASCII stripdown). +.TP +.BR \-R ", " \-\^\-remote +Activate generic control interface. +.B mpg123 +will then read and execute commands from stdin. Basic usage is ``load '' to play some file and the obvious ``pause'', ``command. +``jump '' will jump/seek to a given point (MPEG frame number). +Issue ``help'' to get a full list of commands and syntax. +.TP +.BR \-\^\-remote\-err +Print responses for generic control mode to standard error, not standard out. +This is automatically triggered when using +.B -s +N. +.TP +\fB\-\-fifo \fIpath +Create a fifo / named pipe on the given path and use that for reading commands instead of standard input. +.TP +\fB\-\^\-aggressive +Tries to get higher priority +.TP +.BR \-T ", " \-\-realtime +Tries to gain realtime priority. This option usually requires root +privileges to have any effect. +.TP +.BR \-? ", " \-\^\-help +Shows short usage instructions. +.TP +.BR \-\^\-longhelp +Shows long usage instructions. +.TP +.BR \-\^\-version +Print the version string. +.SH HTTP SUPPORT +In addition to reading MPEG audio streams from ordinary +files and from the standard input, +.B mpg123 +supports retrieval of MPEG audio files or playlists via the HTTP protocol, +which is used in the World Wide Web (WWW). Such files are +specified using a so-called URL, which starts with ``http://''. When a file with +that prefix is encountered, +.B mpg123 +attempts to open an HTTP connection to the server in order to +retrieve that file to decode and play it. +.P +It is often useful to retrieve files through a WWW cache or +so-called proxy. To accomplish this, +.B mpg123 +examines the environment for variables named +.BR MP3_HTTP_PROXY ", " http_proxy " and " HTTP_PROXY , +in this order. The value of the first one that is set will +be used as proxy specification. To override this, you can +use the +.B \-p +command line option (see the ``OPTIONS'' section). Specifying +.B "\-p none" +will enforce contacting the server directly without using +any proxy, even if one of the above environment variables +is set. +.P +Note that, in order to play MPEG audio files from a WWW +server, it is necessary that the connection to that server +is fast enough. For example, a 128 kbit/s MPEG file +requires the network connection to be at least 128 kbit/s +(16 kbyte/s) plus protocol overhead. If you suffer from +short network outages, you should try the +.B \-b +option (buffer) to bypass such outages. If your network +connection is generally not fast enough to retrieve MPEG +audio files in realtime, you can first download the files +to your local harddisk (e.g. using +.BR wget (1)) +and then play them from there. +.P +If authentication is needed to access the file it can be +specified with the +.BR "\-u user:pass". +.SH INTERRUPT +When in terminal control mode, you can quit via pressing the q key, +while any time you can abort +.B mpg123 +by pressing Ctrl-C. If not in terminal control mode, this will +skip to the next file (if any). If you want to abort playing immediately +in that case, press Ctrl-C twice in short succession (within about one second). +.P +Note that the result of quitting +.B mpg123 +pressing Ctrl-C might not be audible +immediately, due to audio data buffering in the audio device. +This delay is system dependent, but it is usually not more +than one or two seconds. + +.SH PLAYBACK STATUS LINE +In verbose mode, mpg123 updates a line with various information centering around +the current playback position. On any decent terminal, the line also works +as a progress bar in the current file by reversing video for a fraction of the +line according to the current position. An example for a full line is this: + + > 0291+0955 00:01.68+00:28.22 [00:05.30] mix 100=085 192 kb/s 576 B acc 18 clip p+0.014 + +The information consists of, in order: +.TP +.BR > +single-character playback state (``>'' for playing, ``='' for pausing/looping, ``_'' for stopped) +.TP +.BR 0291+0955 +current frame offset and number of remaining frames after the plus sign +.TP +.BR 00:01.68+00:28.22 +current position from and remaining time in human terms +(hours, minutes, seconds) +.TP +.BR [00:05.30] +fill of the output buffer in terms of playback time, if the buffer is enabled +.TP +.BR mix +selected RVA mode (possible values: mix, alb (album), and \-\^\-\^\- (neutral, off)) +.TP +.BR 100=085 +set volume and the RVA-modified effective volume after the equal sign +.TP +.BR 192\ kb/s +current bitrate +.TP +.BR 576\ B +size of current frame in bytes +.TP +.BR acc +if positions are accurate, possible values are ``acc'' for accurate positions or ``fuz'' for fuzzy +(with guessed byte offsets using mean frame size) +.TP +.BR 18\ clip +amount of clipped samples, non-zero only if decoder reports that +(generic does, some optimized ones not) +.TP +.BR p+0.014 +pitch change (increased/decreased playback sampling rate on user request) + +.SH NOTES +MPEG audio decoding requires a good deal of CPU performance, +especially layer-3. To decode it in realtime, you should +have at least an i486DX4, Pentium, Alpha, SuperSparc or equivalent +processor. You can also use the +.B -m +option to decode mono only, which reduces the CPU load +somewhat for layer-3 streams. See also the +.BR \-2 " and " \-4 +options. +.P +If everything else fails, have mpg123 decode to a file +and then use an appropriate utility to play that file with less CPU load. +Most probably you can configure mpg123 to produce a format suitable +for your audio device (see above about encodings and sampling rates). +.P +If your system is generally fast enough to decode in +realtime, but there are sometimes periods of heavy +system load (such as cronjobs, users logging in remotely, +starting of ``big'' programs etc.) causing the +audio output to be interrupted, then you should use +the +.B \-b +option to use a buffer of reasonable size (at least 1000 Kbytes). +.SH BUGS +.P +Mostly MPEG-1 layer 2 and 3 are tested in real life. +Please report any issues and provide test files to help fixing them. +.P +No CRC error checking is performed. +.P +Some platforms lack audio hardware support; you may be able to use the +.B -s +switch to feed the decoded data to a program that can play it on your audio device. +.SH AUTHORS +.TP +Maintainer: +.br +Thomas Orgis , +.TP +Original Creator: +.br +Michael Hipp +.PP +Uses code or ideas from various people, see the AUTHORS file accompanying the source code. +.SH LICENSE +.B mpg123 +is licensed under the GNU Lesser/Library General Public License, LGPL, version 2.1 . +.SH WEBSITE +http://www.mpg123.org +.br +http://sourceforge.net/projects/mpg123 diff --git a/man1/out123.1 b/man1/out123.1 new file mode 100644 index 0000000..ad979a7 --- /dev/null +++ b/man1/out123.1 @@ -0,0 +1,210 @@ +.TH out123 1 "26 May 2016" +.SH NAME +out123 \- send raw PCM audio or a waveform pattern to an output device +.SH SYNOPSIS +.B cat audio.raw | out123 +[ +.B options +] + +.B out123 --wave-freq +freq1[,freq2,...] +[ +.B options +] +.SH DESCRIPTION +.B out123 +reads raw PCM data (in host byte order) from standard input +and plays it on the audio device specified by given options. +Alternatively, it can generate periodic signals for playback +itself. +.SH OPTIONS +.B out123 +options may be either the traditional POSIX one letter options, +or the GNU style long options. POSIX style options start with a +single ``\-'', while GNU long options start with ``\-\^\-''. +Option arguments (if needed) follow separated by whitespace (not ``=''). +Note that some options can be absent from your installation when disabled in the build process. +.TP +\fB\-\^\-name \fIname +Set the name of this instance, possibly used in various places. This sets the client name for JACK output. +.TP +\fB\-o \fImodule\fR, \-\^\-output \fImodule\fR +Select audio output module. You can provide a comma-separated list to use the first one that works. +.TP +\fB\-\^\-list\-modules +List the available modules. +.TP +\fB\-a \fIdev\fR, \fB\-\^\-audiodevice \fIdev +Specify the audio device to use. The default is +system-dependent (usually /dev/audio or /dev/dsp). +Use this option if you have multiple audio devices and +the default is not what you want. +.TP +.BR \-s ", " \-\^\-stdout +The audio samples are written to standard output, +instead of playing them through the audio device. +The output format is the same as the input ... so in this mode, +.B out123 +acts like the standard tool \fB cat. +This shortcut is equivalent to ``-o raw -a -''. +.TP +\fB\-O \fIfile\fR, \fB\-\^\-outfile +Write raw output into a file (instead of simply redirecting standard output to a file with the shell). +This shortcut is equivalent to ``-o raw -a \fIfile\fR''. +.TP +\fB\-w \fIfile\fR, \fB\-\^\-wav +Write output as WAV file +.I file +, or standard output if +.I - +is or the empty string used as file name. You can also use +.I --au +and +.I --cdr +for AU and CDR format, respectively. Note that WAV/AU writing to non-seekable files or redirected stdout needs some thought. The header is written with the first actual data. The result of decoding nothing to WAV/AU is a file consisting just of the header when it is seekable and really nothing when not (not even a header). Correctly writing data with prophetic headers to stdout is no easy business. +This shortcut is equivalent to ``-o wav -a \fIfile\fR''. +.TP +\fB\-\^\-au \fIfile +Write to +.I file +in SUN audio format. If \- or the empty string is used as the filename, the AU file is +written to stdout. See paragraph about WAV writing for header fun with non-seekable streams. +This shortcut is equivalent to ``-o au -a \fIfile\fR''. +.TP +\fB\-\^\-cdr \fIfile +Write to +.I file +as a CDR (CD-ROM audio, more correctly CDDA for Compact Disc Digital Audio). +If \- is or the empty string used as the filename, the CDR file is written +to stdout. +This shortcut is equivalent to ``-o cdr -a \fIfile\fR''. +.TP +\fB\-r \fIrate\fR, \fB\-\^\-rate \fIrate +Set sample rate in Hz (default: 44100). If this does not match the actual input +sampling rate, you get changed pitch. Might be intentional;-) +.TP +\fB\-c \fIcount\fR, \fB\-\^\-channels \fIcount +Set channel count to given value. +.TP +\fp\-e \fIenc\fR, \fB\-\^\-encoding \fIenc +Choose output sample encoding. Possible values look like f32 (32-bit floating point), s32 (32-bit signed integer), u32 (32-bit unsigned integer) and the variants with different numbers of bits (s24, u24, s16, u16, s8, u8) and also special variants like ulaw and alaw 8-bit. +See the output of \fBout123\fR's longhelp for actually available encodings. +Default is s16. +.TP +.BR \-m ", " \-\^\-mono " +Set for single-channel audio (default is two channels, stereo). +.TP +.BR \-\-stereo +Select stereo output (2 channels, default). +.TP +.BR \-\^\-list\-encodings +List known encoding short and long names to standard output. +.TP +.BR \-\^\-test\-format +Check if given format is supported by given driver and device (in command line before +encountering this), silently returning 0 as exit value if it is the case. +.TP +.BR \-\^\-test\-encodings +Print out the short names of encodings supported with the current setup. +.TP +.BR \-\^\-query\-format +If the selected driver and device communicate some default accepted format, print +out a command line fragment for \fBout123\fR setting that format, always in that order: +\-\^\-rate -\^\-channels -\^\-encoding +.TP +.BR "\-o h" ", " \-\^\-headphones +Direct audio output to the headphone connector (some hardware only; AIX, HP, SUN). +.TP +.BR "\-o s" ", " \-\^\-speaker +Direct audio output to the speaker (some hardware only; AIX, HP, SUN). +.TP +.BR "\-o l" ", " \-\^\-lineout +Direct audio output to the line-out connector (some hardware only; AIX, HP, SUN). +.TP +\fB\-b \fIsize\fR, \fB\-\^\-buffer \fIsize +Use an audio output buffer of +.I size +Kbytes. This is useful to bypass short periods of heavy +system activity, which would normally cause the audio output +to be interrupted. +You should specify a buffer size of at least 1024 +(i.e. 1 Mb, which equals about 6 seconds of usual audio data) or more; +less than about 300 does not make much sense. The default is 0, +which turns buffering off. +.TP +\fB\-\^\-preload \fIfraction +Wait for the buffer to be filled to +.I fraction +before starting playback (fraction between 0 and 1). You can tune this prebuffering to either get sound faster to your ears or safer uninterrupted web radio. +Default is 0.2 (changed from 1 since version 1.23). +.TP +\fB\-\^\-devbuffer \fIseconds +Set device buffer in seconds; <= 0 means default value. This is the small buffer between the +application and the audio backend, possibly directly related to hardware buffers. +.TP +\fB\-\^\-timelimit \fIsamples +Set playback time limit in PCM samples if set to a value greater than zero. +\fBout123\fR will stop reading from stdin or playing from the generated wave +table after reaching that number of samples. +.TP +\fB\-\^\-wave\-freq \fIfrequencies +Set wave generator frequency or list of those with comma separation for enabling +a generated test signal instead of standard input. Empty values repeat the +previous one. +.TP +\fB\-\^\-wave\-pat \fIpatterns +Set the waveform patterns of the generated waves as comma-separated list. +Choices include sine, square, triangle, sawtooth, gauss, pulse, and shot. +Empty values repeat the previous one. +.TP +\fB\-\^\-wave\-phase \fIphases +Set waveform phase shift(s) as comma-separated list, negative values +inverting the pattern in time and empty value repeating the previous. +.TP +\fB\-\^\-wave\-limit \fIsamples +Set a custom soft limit on the wave table size. Small values cause larger changes +in actual frequencies to make whole periods fit. +.TP +.BR \-t ", " \-\^\-test +Test mode. The audio stream is read, but no output occurs. +.TP +.BR \-v ", " \-\^\-verbose +Increase the verbosity level. +.TP +.BR \-q ", " \-\^\-quiet +Quiet. Suppress diagnostic messages. +.TP +\fB\-\^\-aggressive +Tries to get higher priority +.TP +.BR \-T ", " \-\-realtime +Tries to gain realtime priority. This option usually requires root +privileges to have any effect. +.TP +.BR \-? ", " \-\^\-help +Shows short usage instructions. +.TP +.BR \-\^\-longhelp +Shows long usage instructions. +.TP +.BR \-\^\-version +Print the version string. +.SH AUTHORS +.TP +Maintainer: +.br +Thomas Orgis , +.TP +Creator (ancestry of code inside mpg123): +.br +Michael Hipp +.TP +Uses code or ideas from various people, see the AUTHORS file accompanying the source code. +.SH LICENSE +.B out123 +is licensed under the GNU Lesser/Library General Public License, LGPL, version 2.1 . +.SH WEBSITE +http://www.mpg123.org +.br +http://sourceforge.net/projects/mpg123 diff --git a/mpg123.spec b/mpg123.spec new file mode 100644 index 0000000..4a33dac --- /dev/null +++ b/mpg123.spec @@ -0,0 +1,76 @@ +# This is a generic spec file that should "just work" with rpmbuild on any distro. +# Make sure you have appropriate -devel packes installed: +# - devel packages for alsa, sdl, etc... to build the respective output modules. +Summary: The fast console mpeg audio decoder/player. +Name: mpg123 +Version: 1.25.10 +Release: 1 +URL: http://www.mpg123.org/ +License: GPL +Group: Applications/Multimedia +Packager: Michael Ryzhykh +Source: http://www.mpg123.org/download/mpg123-%{version}.tar.bz2 +BuildRoot: %_tmppath/%name-%version +Prefix: /usr + +%description +This is a console based decoder/player for mono/stereo mpeg audio files, +probably more familiar as MP3 or MP2 files. It's focus is speed. +It can play MPEG1.0/2.0/2.5 layer I, II, II (1, 2, 3;-) files +(VBR files are fine, too) and produce output on a number of different ways: +raw data to stdout and different sound systems depending on your platform. + +%package devel +Summary: Files needed for development with libmpg123 or libout123 +Group: Development/Libraries + +%description devel +Libraries and header files for development with mpg123. + +%prep +%setup -q -n %name-%version + +%build +%configure --enable-shared --enable-static +make + +%install +%{__rm} -rf %{buildroot} +%makeinstall + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(755,root,root) +%{_bindir}/* +%defattr(644,root,root) +%doc %{_mandir}/*/mpg123.1.gz +%doc %{_mandir}/*/out123.1.gz +%{_libdir}/libmpg123.so.* +%{_libdir}/libout123.so.* +%{_libdir}/mpg123/output_*.so + +%files devel +%defattr(644,root,root) +%{_libdir}/pkgconfig/libmpg123.pc +%{_libdir}/pkgconfig/libout123.pc +%{_includedir}/*.h +%{_libdir}/libmpg123.a +%{_libdir}/libmpg123.la +%{_libdir}/libmpg123.so +%{_libdir}/libout123.a +%{_libdir}/libout123.la +%{_libdir}/libout123.so +%exclude %{_libdir}/mpg123/output_*.a + +%changelog +* 2017-02-27 Thomas Orgis +- libltdl and module .la files gone +* Sat Sep 3 2016 Srikanth Rao +- remove junk added in last edit, add out123 manpage +* Much later Thomas Orgis +- some blind update +* Tue Jan 1 2008 Michael Ryzhykh +- Initial Version. + diff --git a/mpg123.spec.in b/mpg123.spec.in new file mode 100644 index 0000000..f8fd94a --- /dev/null +++ b/mpg123.spec.in @@ -0,0 +1,76 @@ +# This is a generic spec file that should "just work" with rpmbuild on any distro. +# Make sure you have appropriate -devel packes installed: +# - devel packages for alsa, sdl, etc... to build the respective output modules. +Summary: The fast console mpeg audio decoder/player. +Name: @PACKAGE_NAME@ +Version: @PACKAGE_VERSION@ +Release: 1 +URL: http://www.mpg123.org/ +License: GPL +Group: Applications/Multimedia +Packager: Michael Ryzhykh +Source: http://www.mpg123.org/download/mpg123-%{version}.tar.bz2 +BuildRoot: %_tmppath/%name-%version +Prefix: /usr + +%description +This is a console based decoder/player for mono/stereo mpeg audio files, +probably more familiar as MP3 or MP2 files. It's focus is speed. +It can play MPEG1.0/2.0/2.5 layer I, II, II (1, 2, 3;-) files +(VBR files are fine, too) and produce output on a number of different ways: +raw data to stdout and different sound systems depending on your platform. + +%package devel +Summary: Files needed for development with libmpg123 or libout123 +Group: Development/Libraries + +%description devel +Libraries and header files for development with mpg123. + +%prep +%setup -q -n %name-%version + +%build +%configure --enable-shared --enable-static +make + +%install +%{__rm} -rf %{buildroot} +%makeinstall + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(755,root,root) +%{_bindir}/* +%defattr(644,root,root) +%doc %{_mandir}/*/mpg123.1.gz +%doc %{_mandir}/*/out123.1.gz +%{_libdir}/libmpg123.so.* +%{_libdir}/libout123.so.* +%{_libdir}/mpg123/output_*.so + +%files devel +%defattr(644,root,root) +%{_libdir}/pkgconfig/libmpg123.pc +%{_libdir}/pkgconfig/libout123.pc +%{_includedir}/*.h +%{_libdir}/libmpg123.a +%{_libdir}/libmpg123.la +%{_libdir}/libmpg123.so +%{_libdir}/libout123.a +%{_libdir}/libout123.la +%{_libdir}/libout123.so +%exclude %{_libdir}/mpg123/output_*.a + +%changelog +* 2017-02-27 Thomas Orgis +- libltdl and module .la files gone +* Sat Sep 3 2016 Srikanth Rao +- remove junk added in last edit, add out123 manpage +* Much later Thomas Orgis +- some blind update +* Tue Jan 1 2008 Michael Ryzhykh +- Initial Version. + diff --git a/ports/MSVC++/2008clr/2008clr.sln b/ports/MSVC++/2008clr/2008clr.sln new file mode 100644 index 0000000..c5562a5 --- /dev/null +++ b/ports/MSVC++/2008clr/2008clr.sln @@ -0,0 +1,81 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpg123clr", "mpg123clr\mpg123clr.vcproj", "{99E8B20E-9C29-46BC-B766-A50F237D88BF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "scanclr", "examples\scanclr\scanclr.csproj", "{53664927-0A21-4056-A5D5-C6A1B4B1F839}" + ProjectSection(ProjectDependencies) = postProject + {99E8B20E-9C29-46BC-B766-A50F237D88BF} = {99E8B20E-9C29-46BC-B766-A50F237D88BF} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "feedseekclr", "examples\feedseekclr\feedseekclr.csproj", "{626B52AB-1E46-46FB-A259-03DCE3994BE6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReplaceReaderclr", "examples\ReplaceReaderclr\ReplaceReaderclr.csproj", "{6415FBC0-44EC-4158-8A24-127D9BAC5CEA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpg123", "..\2008\libmpg123\libmpg123.vcproj", "{67CAA87B-7CF1-4F93-BB67-21C513F40803}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Win32.ActiveCfg = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Win32.Build.0 = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Any CPU.ActiveCfg = Release|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Mixed Platforms.Build.0 = Release|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Win32.ActiveCfg = Release|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Win32.Build.0 = Release|Win32 + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Win32.ActiveCfg = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Any CPU.Build.0 = Release|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Win32.ActiveCfg = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Win32.ActiveCfg = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Any CPU.Build.0 = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Win32.ActiveCfg = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Any CPU.Build.0 = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Win32.ActiveCfg = Release|Any CPU + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Any CPU.ActiveCfg = Debug_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Mixed Platforms.ActiveCfg = Debug_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Mixed Platforms.Build.0 = Debug_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.ActiveCfg = Debug_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.Build.0 = Debug_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Any CPU.ActiveCfg = Release_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Mixed Platforms.ActiveCfg = Release_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Mixed Platforms.Build.0 = Release_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.ActiveCfg = Release_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.Build.0 = Release_x86_Dll_Minimal|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs b/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs new file mode 100644 index 0000000..1059a9a --- /dev/null +++ b/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs @@ -0,0 +1,435 @@ +/* + replacereaderclr: test program for mpg123clr, showing how to use ReplaceReader in a CLR enviro. + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + initially written by Malcolm Boczek + + not to be used as an example of good coding practices, note the total absence of error handling!!! +*/ + +/* + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.12.0.0 14-Apr-10 Added ReplaceReaderHandle sample code (mb) +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.IO; // for ReplaceReaderHandle example +using System.Runtime.InteropServices; // for ReplaceReaderHandle example + +using mpg123clr; + +namespace ReplaceReaderclr +{ + class Program + { + private unsafe static int MyReadFunc(int a, void* b, uint c) + { + // need to call posix read function here... + + // PosixRead is an example, substitute your replacement function here. + int ret = mpg123.PosixRead(a, b, c); + + return ret; + } + + private static int MySeekFunc(int a, int b, int c) + { + // NOTE: Largefile conflict with use of "int" position values. + // Convert to long if off_t is defined as long long + + // need to call posix lseek function here... + + // PosixSeek is an example, substitute your replacement function here. + int ret = mpg123.PosixSeek(a, b, c); + + return ret; + } + + private unsafe static int MyHandleReadFunc(void* a, void* b, uint c) + { + GCHandle gch = GCHandle.FromIntPtr((IntPtr)a); + BinaryReader br = (BinaryReader)gch.Target; + + byte[] buf = br.ReadBytes((int)c); + + // NOTE: no discernible performance difference between Marshal.Copy and ptr++ loop + Marshal.Copy(buf, 0, (IntPtr)b, buf.Length); + +// byte* ptr = (byte*)b; +// for (int i = 0, l = buf.Length; i < l; i++) +// *(ptr++) = buf[i]; + + return buf.Length; + } + + private unsafe static int MyHandleSeekFunc(void* a, int b, int c) + { + // NOTE: Largefile conflict with use of "int" position values. + // Convert to long if off_t is defined as long long + + GCHandle gch = GCHandle.FromIntPtr((IntPtr)a); + BinaryReader br = (BinaryReader)gch.Target; + + return (int)br.BaseStream.Seek(b, (SeekOrigin)c); + } + + private unsafe static void MyHandleCleanFunc(void* a) + { + GCHandle gch = GCHandle.FromIntPtr((IntPtr)a); + BinaryReader br = (BinaryReader)gch.Target; + + br.Close(); + } + + static unsafe void Main(string[] args) + { + if (args.Length == 0) + { + Console.WriteLine("I need a file to work on:\n\nPress any key to exit."); + while (Console.Read() == 0) ; + return; + } + mpg123clr.mpg.ErrorCode err; + + string filename = args[0]; + + err = mpg123.mpg123_init(); + Console.WriteLine("Init:"); + + RunReplaceReaderTest(filename); + RunReplaceReaderHandleTest(filename); + RunFrameByFrameTest(filename); + + Console.WriteLine("\nPress any key to exit:"); + while (Console.Read() == 0) ; + + mpg123.mpg123_exit(); + } + + static unsafe void RunReplaceReaderTest(string filename) + { + mpg123clr.mpg.ErrorCode err; + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + // ReplaceReader example + mpg123clr.mpg123.ReadDelegate rdel = MyReadFunc; + mpg123clr.mpg123.SeekDelegate sdel = MySeekFunc; + err = mp.mpg123_replace_reader(rdel, sdel); + + //err = mp.mpg123_open(args[0]); + err = mp.mpg123_open(filename); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Error: " + mp.mpg123_strerror()); + } + else + { + Console.WriteLine("Open:"); + + // Show available decoders + string[] Decoders = mp.mpg123_decoders(); + + if (Decoders.Length > 0) + { + Console.WriteLine("\nDecoders:"); + foreach (string str in Decoders) Console.WriteLine(str); + } + + // Show supported decoders + string[] supDecoders = mp.mpg123_supported_decoders(); + + if (supDecoders.Length > 0) + { + Console.WriteLine("\nSupported Decoders:"); + foreach (string str in supDecoders) Console.WriteLine(str); + } + + // Show actual decoder + Console.WriteLine("\nDecoder: " + mp.mpg123_current_decoder()); + + // Show estimated file length + Console.WriteLine("\nLength Estimate: " + mp.mpg123_length().ToString()); + + // Scan - gets actual details including ID3v2 and Frame offsets + err = mp.mpg123_scan(); + + // Show actual file length + if (err == mpg123clr.mpg.ErrorCode.ok) Console.WriteLine("Length Actual : " + mp.mpg123_length().ToString()); + + // Get ID3 data + mpg123clr.id3.mpg123id3v1 iv1; + mpg123clr.id3.mpg123id3v2 iv2; + err = mp.mpg123_id3(out iv1, out iv2); + + // Show ID3v2 data + Console.WriteLine("\nTitle : " + iv2.title); + Console.WriteLine("Artist : " + iv2.artist); + Console.WriteLine("Album : " + iv2.album); + Console.WriteLine("Comment: " + iv2.comment); + Console.WriteLine("Year : " + iv2.year); + + // Demo seek (back to start of file - note: scan should already have done this) + long pos = mp.mpg123_seek(0, System.IO.SeekOrigin.Begin); + + long[] frameindex; + long step; + err = mp.mpg123_index(out frameindex, out step); + + if (err == mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("\nFrameIndex:"); + foreach (long idx in frameindex) + { + // Console.WriteLine(idx.ToString()); + } + } + + int num; + uint cnt; + IntPtr audio; + + // Walk the file - effectively decode the data without using it... + Console.WriteLine("\nWalking : " + iv2.title); + DateTime dte, dts = DateTime.Now; + + while (err == mpg123clr.mpg.ErrorCode.ok || err == mpg123clr.mpg.ErrorCode.new_format) + { + err = mp.mpg123_decode_frame(out num, out audio, out cnt); + + // do something with "audio" here.... + } + + dte = DateTime.Now; + + TimeSpan ts = dte - dts; + Console.WriteLine("Duration: " + ts.ToString()); + + mp.mpg123_close(); + } + + mp.Dispose(); + } + + static unsafe void RunReplaceReaderHandleTest(string filename) + { + mpg123clr.mpg.ErrorCode err; + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + // ReplaceReader example + mpg123clr.mpg123.ReadHandleDelegate rdel = MyHandleReadFunc; + mpg123clr.mpg123.SeekHandleDelegate sdel = MyHandleSeekFunc; + mpg123clr.mpg123.CleanupHandleDelegate cdel = MyHandleCleanFunc; + err = mp.mpg123_replace_reader_handle(rdel, sdel, cdel); + + //err = mp.mpg123_open(args[0]); + BinaryReader br = new BinaryReader(File.OpenRead(filename)); + + err = mp.mpg123_open_handle(br); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Error: " + mp.mpg123_strerror()); + } + else + { + Console.WriteLine("Open:"); + + // Show available decoders + string[] Decoders = mp.mpg123_decoders(); + + if (Decoders.Length > 0) + { + Console.WriteLine("\nDecoders:"); + foreach (string str in Decoders) Console.WriteLine(str); + } + + // Show supported decoders + string[] supDecoders = mp.mpg123_supported_decoders(); + + if (supDecoders.Length > 0) + { + Console.WriteLine("\nSupported Decoders:"); + foreach (string str in supDecoders) Console.WriteLine(str); + } + + // Show actual decoder + Console.WriteLine("\nDecoder: " + mp.mpg123_current_decoder()); + + // Show estimated file length + Console.WriteLine("\nLength Estimate: " + mp.mpg123_length().ToString()); + + // Scan - gets actual details including ID3v2 and Frame offsets + err = mp.mpg123_scan(); + + // Show actual file length + if (err == mpg123clr.mpg.ErrorCode.ok) Console.WriteLine("Length Actual : " + mp.mpg123_length().ToString()); + + // Get ID3 data + mpg123clr.id3.mpg123id3v1 iv1; + mpg123clr.id3.mpg123id3v2 iv2; + err = mp.mpg123_id3(out iv1, out iv2); + + // Show ID3v2 data + Console.WriteLine("\nTitle : " + iv2.title); + Console.WriteLine("Artist : " + iv2.artist); + Console.WriteLine("Album : " + iv2.album); + Console.WriteLine("Comment: " + iv2.comment); + Console.WriteLine("Year : " + iv2.year); + + // Demo seek (back to start of file - note: scan should already have done this) + long pos = mp.mpg123_seek(0, System.IO.SeekOrigin.Begin); + + long[] frameindex; + long step; + err = mp.mpg123_index(out frameindex, out step); + + if (err == mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("\nFrameIndex:"); + foreach (long idx in frameindex) + { + // Console.WriteLine(idx.ToString()); + } + } + + int num; + uint cnt; + IntPtr audio; + + // Walk the file - effectively decode the data without using it... + Console.WriteLine("\nWalking : " + iv2.title); + DateTime dte, dts = DateTime.Now; + + while (err == mpg123clr.mpg.ErrorCode.ok || err == mpg123clr.mpg.ErrorCode.new_format) + { + err = mp.mpg123_decode_frame(out num, out audio, out cnt); + + // do something with "audio" here.... + } + + dte = DateTime.Now; + + TimeSpan ts = dte - dts; + Console.WriteLine("Duration: " + ts.ToString()); + + mp.mpg123_close(); + } + + mp.Dispose(); + + } + + static unsafe void RunFrameByFrameTest(string filename) + { + mpg123clr.mpg.ErrorCode err; + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + err = mp.mpg123_open(filename); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Error: " + mp.mpg123_strerror()); + } + else + { + Console.WriteLine("Open:"); + + // Show available decoders + string[] Decoders = mp.mpg123_decoders(); + + if (Decoders.Length > 0) + { + Console.WriteLine("\nDecoders:"); + foreach (string str in Decoders) Console.WriteLine(str); + } + + // Show supported decoders + string[] supDecoders = mp.mpg123_supported_decoders(); + + if (supDecoders.Length > 0) + { + Console.WriteLine("\nSupported Decoders:"); + foreach (string str in supDecoders) Console.WriteLine(str); + } + + // Show actual decoder + Console.WriteLine("\nDecoder: " + mp.mpg123_current_decoder()); + + // Show estimated file length + Console.WriteLine("\nLength Estimate: " + mp.mpg123_length().ToString()); + + // Scan - gets actual details including ID3v2 and Frame offsets + err = mp.mpg123_scan(); + + // Show actual file length + if (err == mpg123clr.mpg.ErrorCode.ok) Console.WriteLine("Length Actual : " + mp.mpg123_length().ToString()); + + // Get ID3 data + mpg123clr.id3.mpg123id3v1 iv1; + mpg123clr.id3.mpg123id3v2 iv2; + err = mp.mpg123_id3(out iv1, out iv2); + + // Show ID3v2 data + Console.WriteLine("\nTitle : " + iv2.title); + Console.WriteLine("Artist : " + iv2.artist); + Console.WriteLine("Album : " + iv2.album); + Console.WriteLine("Comment: " + iv2.comment); + Console.WriteLine("Year : " + iv2.year); + + // Demo seek (back to start of file - note: scan should already have done this) + long pos = mp.mpg123_seek(0, System.IO.SeekOrigin.Begin); + + long[] frameindex; + long step; + err = mp.mpg123_index(out frameindex, out step); + + if (err == mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("\nFrameIndex:"); + foreach (long idx in frameindex) + { + // Console.WriteLine(idx.ToString()); + } + } + + int num; + uint cnt; + IntPtr audio; + + // Walk the file - effectively decode the data without using it... + Console.WriteLine("\nFrame Walking : " + iv2.title); + DateTime dte, dts = DateTime.Now; + + while (err == mpg123clr.mpg.ErrorCode.ok || err == mpg123clr.mpg.ErrorCode.new_format) + { + err = mp.mpg123_framebyframe_decode(out num, out audio, out cnt); + err = mp.mpg123_framebyframe_next(); + + // do something with "audio" here.... + } + + dte = DateTime.Now; + + TimeSpan ts = dte - dts; + Console.WriteLine("Duration: " + ts.ToString()); + + mp.mpg123_close(); + } + + mp.Dispose(); + + } + } +} diff --git a/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs b/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3f7d5ef --- /dev/null +++ b/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ReplaceReaderclr")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ReplaceReaderclr")] +[assembly: AssemblyCopyright("© mpg123 project 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c65bdebb-51d7-41ba-875d-b2c938f187fc")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj b/ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj new file mode 100644 index 0000000..0b858f7 --- /dev/null +++ b/ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj @@ -0,0 +1,72 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA} + Exe + Properties + ReplaceReaderclr + ReplaceReaderclr + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + x86 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {99E8B20E-9C29-46BC-B766-A50F237D88BF} + mpg123clr + + + + + + if exist "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" copy /y "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" "$(TargetDir)" + + \ No newline at end of file diff --git a/ports/MSVC++/2008clr/examples/feedseekclr/Program.cs b/ports/MSVC++/2008clr/examples/feedseekclr/Program.cs new file mode 100644 index 0000000..93e0bf8 --- /dev/null +++ b/ports/MSVC++/2008clr/examples/feedseekclr/Program.cs @@ -0,0 +1,331 @@ +/* + feedseekclr: test program for mpg123clr, showing how to use fuzzy seeking in feeder mode + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + based on feedseek.c example for libmpg123. + + Comment (Malcolm Boczek) + this CLR example has been written to allow easy comparison to the original feedseek.c example + and uses some constructs that would not normally be used in a C# environment, + eg: byte[]/ASCII text, Marshal.Copy, static fields, lots of casts etc. +*/ + +/* + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.IO; +using System.Runtime.InteropServices; + +using mpg123clr; + +namespace feedseekclr +{ + class Program + { + const int WAVE_FORMAT_PCM = 0x0001; + const int WAVE_FORMAT_IEEE_FLOAT = 0x0003; + + static BinaryWriter _out; + static long totaloffset, dataoffset; + static int rate; + static mpg123clr.mpg.channelcount channels; + static mpg123clr.mpg.enc enc; + static short bitspersample, wavformat; + + // write wav header + static void initwav() + { + uint tmp32 = 0; + ushort tmp16 = 0; + byte[] rifftxt = new byte[] { (byte)'R', (byte)'I', (byte)'F', (byte)'F' }; + byte[] wavetxt = new byte[] { (byte)'W', (byte)'A', (byte)'V', (byte)'E' }; + byte[] fmttxt = new byte[] { (byte)'f', (byte)'m', (byte)'t', (byte)' ' }; + byte[] datatxt = new byte[] { (byte)'d', (byte)'a', (byte)'t', (byte)'a' }; + + _out.Write(rifftxt); + totaloffset = _out.BaseStream.Position; + + _out.Write(tmp32); // total size + _out.Write(wavetxt); + _out.Write(fmttxt); + + tmp32 = 16; + _out.Write(tmp32); // format length + + tmp16 = (ushort)wavformat; + _out.Write(tmp16); // format + + tmp16 = (ushort)channels; + _out.Write(tmp16); // channels + + tmp32 = (uint)rate; + _out.Write(tmp32); // sample rate + + tmp32 = (uint) (rate * bitspersample / 8 * (int)channels); + _out.Write(tmp32); // bytes / second + + tmp16 = (ushort)(bitspersample / 8 * (int)channels); // float 16 or signed int 16 + _out.Write(tmp16); // block align + + tmp16 = (ushort)bitspersample; + _out.Write(tmp16); // bits per sample + + _out.Write(datatxt); + + tmp32 = 0; + dataoffset = _out.BaseStream.Position; + + _out.Write(tmp32); // data length + + } + + // rewrite wav header with final length infos + static void closewav() + { + uint tmp32 = 0; + // ushort tmp16 = 0; + + int total = (int)_out.BaseStream.Position; + + _out.Seek((int)totaloffset, SeekOrigin.Begin); + tmp32 = (uint)(total - (totaloffset + 4)); + + _out.Write(tmp32); + + _out.Seek((int)dataoffset, SeekOrigin.Begin); + + tmp32 = (uint)(total - (dataoffset + 4)); + + _out.Write(tmp32); + } + + // determine correct wav format and bits per sample + // from mpg123 enc value + static void initwavformat() + { + if ((enc & mpg123clr.mpg.enc.enc_float_64) != 0) + { + bitspersample = 64; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if ((enc & mpg123clr.mpg.enc.enc_float_32) != 0) + { + bitspersample = 32; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if ((enc & mpg123clr.mpg.enc.enc_16) != 0) + { + bitspersample = 16; + wavformat = WAVE_FORMAT_PCM; + } + else + { + bitspersample = 8; + wavformat = WAVE_FORMAT_PCM; + } + } + + static void Main(string[] args) + { + const long INBUFF = 16384 * 2 * 2; + + int ret; + mpg123clr.mpg.ErrorCode state; + long inoffset,inc = 0; + long outc = 0; + byte[] buf = new byte[INBUFF]; + + if (args.Length < 2) + { + Console.WriteLine("Please supply in and out filenames\n"); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + mpg123clr.mpg.ErrorCode err; + + err = mpg123.mpg123_init(); + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to create mpg123 handle: " + mpg123error.mpg123_plain_strerror(err)); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + mp.mpg123_param(mpg123clr.mpg.parms.verbose, 4, 0); + + err = mp.mpg123_param(mpg123clr.mpg.parms.flags, + (int) (mpg123clr.mpg.param_flags.fuzzy | + mpg123clr.mpg.param_flags.seekbuffer | + mpg123clr.mpg.param_flags.gapless), 0); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to set library options: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + // Let the seek index auto-grow and contain an entry for every frame + err = mp.mpg123_param(mpg123clr.mpg.parms.index_size, -1, 0); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to set index size: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + // Use float output formats only + err = mp.mpg123_format_none(); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to disable all output formats: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + int[] rates = mp.mpg123_rates(); + foreach (int rate in rates) + { + err = mp.mpg123_format(rate, mpg123clr.mpg.channelcount.both, mpg123clr.mpg.enc.enc_float_32); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to set float output formats: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + } + + err = mp.mpg123_open_feed(); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to open feed: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + string filename = args[0]; + BinaryReader _in = new BinaryReader(File.Open(filename, FileMode.Open)); + + _out = new BinaryWriter(File.Open(args[1], FileMode.Create)); + + while ((ret = (int)(mp.mpg123_feedseek(95000, SeekOrigin.Begin, out inoffset))) == (int)mpg123clr.mpg.ErrorCode.need_more) // equiv to mpg123_feedseek + { + buf = _in.ReadBytes((int)INBUFF); + + if (buf.Length <= 0) break; + + inc += buf.Length; + + state = mp.mpg123_feed(buf, (uint)buf.Length); + + if (state == mpg123clr.mpg.ErrorCode.err) + { + Console.WriteLine("Feed error: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + } + + _in.BaseStream.Seek(inoffset, SeekOrigin.Begin); + + while (true) + { + buf = _in.ReadBytes((int)INBUFF); + if (buf.Length <= 0) break; + + inc += buf.Length; + + err = mp.mpg123_feed(buf, (uint)buf.Length); + + int num; + uint bytes; + IntPtr audio; + + while (err != mpg123clr.mpg.ErrorCode.err && err != mpg123clr.mpg.ErrorCode.need_more) + { + err = mp.mpg123_decode_frame(out num, out audio, out bytes); + + if (err == mpg123clr.mpg.ErrorCode.new_format) + { + mp.mpg123_getformat(out rate, out channels, out enc); + + initwavformat(); + initwav(); + } + + // (Surprisingly?) even though it does a Marshal.Copy it's as efficient as the pointer example below!!! + if (bytes > 0) + { + byte[] outbuf = new byte[bytes]; + Marshal.Copy(audio, outbuf, 0, (int)bytes); + + _out.Write(outbuf, 0, (int)bytes); + } + + // Alternative example of direct usage of audio data via pointers - note it needs "unsafe" + // and I'm fairly sure pointers should be "fixed" first + // if (bytes > 0) + // unsafe{ + // byte* p = (byte*)audio; + // for (int ii = 0; ii < bytes; ii++) + // _out.Write(*p++); + // } + + outc += bytes; + } + + if (err == mpg123clr.mpg.ErrorCode.err) + { + Console.WriteLine("Error: " + mp.mpg123_strerror()); + break; + } + + } + + Console.WriteLine("Finished"); + + closewav(); + + _out.Close(); + _in.Close(); + + mp.mpg123_delete(); + mp.Dispose(); + + mpg123.mpg123_exit(); + + } + } +} diff --git a/ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs b/ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3a54cdd --- /dev/null +++ b/ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("feedseekclr")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("feedseekclr")] +[assembly: AssemblyCopyright("© mpg123 project 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1fdb46e2-eb93-4e8f-8266-0d386215cc75")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj b/ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj new file mode 100644 index 0000000..603c572 --- /dev/null +++ b/ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj @@ -0,0 +1,71 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {626B52AB-1E46-46FB-A259-03DCE3994BE6} + Exe + Properties + feedseekclr + feedseekclr + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x86 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {99E8B20E-9C29-46BC-B766-A50F237D88BF} + mpg123clr + + + + + + if exist "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" copy /y "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" "$(TargetDir)" + + \ No newline at end of file diff --git a/ports/MSVC++/2008clr/examples/scanclr/Program.cs b/ports/MSVC++/2008clr/examples/scanclr/Program.cs new file mode 100644 index 0000000..52ad856 --- /dev/null +++ b/ports/MSVC++/2008clr/examples/scanclr/Program.cs @@ -0,0 +1,79 @@ +/* + scanclr: Estimate length (sample count) of a mpeg file and compare to length from exact scan. + + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + CLR example initially written by Malcolm Boczek + Based on scan.c example initially written by Thomas Orgis +*/ + +/* Note the lack of error checking here. + While it would be nicer to inform the user about troubles, libmpg123 is designed _not_ to bite you on operations with invalid handles , etc. + You just jet invalid results on invalid operations... */ +/* Ditto for mpg123clr (MB) */ + +/* + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using mpg123clr; + +namespace scanclr +{ + class Program + { + static void Main(string[] args) + { + if (args.Length < 1) + { + Console.WriteLine("\nI will give you the estimated and exact sample lengths of MPEG audio files.\n"); + Console.WriteLine("\nUsage: scanclr \n\n"); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + + mpg123clr.mpg.ErrorCode err; + + err = mpg123.mpg123_init(); + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + mp.mpg123_param(mpg123clr.mpg.parms.resync_limit, -1, 0); + + foreach (string name in args) + { + + err = mp.mpg123_open(name); + + long a, b; + + a = mp.mpg123_length(); + + mp.mpg123_scan(); + + b = mp.mpg123_length(); + + mp.mpg123_close(); + + Console.WriteLine(string.Format("File {0}: estimated {1} vs. scanned {2}", name, a, b)); + } + + Console.WriteLine("\nPress any key to exit:"); + while (Console.Read() == 0) ; + + mp.Dispose(); + + mpg123.mpg123_exit(); + } + } +} diff --git a/ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs b/ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d915e84 --- /dev/null +++ b/ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("scanclr")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("scanclr")] +[assembly: AssemblyCopyright("© mpg123 project 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a22ea83e-2dba-4835-b0d8-cca3f0bc73a8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj b/ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj new file mode 100644 index 0000000..ed2d537 --- /dev/null +++ b/ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj @@ -0,0 +1,70 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {53664927-0A21-4056-A5D5-C6A1B4B1F839} + Exe + Properties + scanclr + scanclr + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x86 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {99E8B20E-9C29-46BC-B766-A50F237D88BF} + mpg123clr + + + + + + if exist "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" copy /y "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" "$(TargetDir)" + + \ No newline at end of file diff --git a/ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp b/ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp new file mode 100644 index 0000000..e8547b6 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp @@ -0,0 +1,76 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#include "stdafx.h" + +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly:AssemblyTitleAttribute("mpg123clr.dll")]; +[assembly:AssemblyDescriptionAttribute("mpg123clr Dynamic Link Library")]; +[assembly:AssemblyConfigurationAttribute("")]; +[assembly:AssemblyCompanyAttribute("mpg123 Project")]; +[assembly:AssemblyProductAttribute("mpg123clr.dll")]; +[assembly:AssemblyCopyrightAttribute("� 2009-2011 by the mpg123 project")]; +[assembly:AssemblyTrademarkAttribute("")]; +[assembly:AssemblyCultureAttribute("")]; + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the value or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly:AssemblyVersionAttribute("1.13.0.0")]; + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project directory. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly:AssemblyDelaySignAttribute(false)]; +[assembly:AssemblyKeyFileAttribute("")]; +[assembly:AssemblyKeyNameAttribute("")]; diff --git a/ports/MSVC++/2008clr/mpg123clr/ReadMe.txt b/ports/MSVC++/2008clr/mpg123clr/ReadMe.txt new file mode 100644 index 0000000..f6010d4 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/ReadMe.txt @@ -0,0 +1,165 @@ +======================================================================== + DYNAMIC LINK LIBRARY : mpg123clr Project Overview +======================================================================== + +Project Installation: + +The project is part of a Visual Studio 2008 Solution. + +The Visual Studio solution file is 2008clr.sln located in a folder/directory named 2008clr. + +This folder/directory should be located in the mpg123/ports/MSVC++ folder to maintain file relationships +with required mpg123 library files. i.e. at mpg123/ports/MSVC++/2008clr. + +The solution includes the following projects: + + mpg123clr The mpg123 CLR project. This creates the CLR compatible DLL file. + scanclr Demonstration project for comparison with scan.c example. + feedseekclr Demonstration project for comparison with feedseek.c example + replacereaderclr Demonstration project, how to implement ReplaceReader in CLR (proof of concept) + libmpg123 For convenience, ensures that libmpg123.lib is available for linking + +========================================================================= +Compiling: +Configuration Manager: + +mpg123clr requires linking to a libmpg123 static library, this library must be compiled prior to +compiling the clr projects. mpg123clr uses relative folder position during linking; therefore either:- + + ensure that the 2008clr solution is correctly located within the ports\msvc++ folder, or + change the "linker->input->additional dependencies" to suit your installation configuration + +NOTE: x64 Active Solution Platform configurations are not supplied with this solution but have been tested. +(Effectively all that is required is to change all "include" references to account for the "x64" output locations) + +NOTE: The "unsafe" context of the ReplaceReaderClr project is only required to allow the use of callbacks. +mpg123clr is written to avoid the use of "unsafe" for the majority of normal operations. + + +========================================================================== +Using mpg123clr: + +Mpg123clr is a CLR ready dll. Simply add a reference to the mpg123clr.dll file in your application project. + +You may also add a "using" directive in your program files. C# e.g. using mpg123clr; + +The mpg123clr project is configured to create an additional Intellisense documentation file (mpg123clr.xml) +to assist usage. If you manually relocate the .dll please also copy the .xml file to ensure correct Intellisense +operation. + +=========================================================================== +Common Errors: + +1) Problem: "Unhandled Exception - file not found" error when the application is executed. + Cause: Incorrect libmpg123 library build / missing libmpg123.dll. + Solution: Copy libmpg123.dll to the application output folder - possibly in a Post-Build Event (see scanclr for + an example). + Explanation: mpg123clr requires static library libmpg123.lib and NOT dynamic library libmpg123.dll. + If the libmpg123 library is built using an incorrect Project Context (such as Debug_Generic_Dll), mpg123clr + will attempt to load the libmpg123.dll at runtime even though this file is not required. + Alternatively: Use Configuration Manager and select a non-dll build context for the libmpg123 project. + (i.e. Debug_Generic not Debug_Generic_Dll) + +=========================================================================== +Developer Notes: + + 1) Documentation do not appear in CLR Intellisense environment (at time of writing). + So deferred in favour of within . + 2) During development "off_t" parameters conflicted with intellisense (although size_t worked just fine) + Since many CLR functions that refer to off_t features (e.g. positioners) actually expect 64bit long + (or long long in C++) parameters, I've implemented off_t as a long long - with one notable exception. + This fixed intellisense and accommodates the CLR 64bit long implementation positioners: And then intellisense + started working correctly and made this a moot point - at least as far as intellisense is concerned. + 3) off_t notable exception - SeekDelegate, SeekHandleDelegate + Usually 2008clr functions are called by the callee, long long (clr 64bit long) can be marshaled and passed + to libmpg123. The seek delegate is called directly by the libmpg123 seek functions - there isn't an opportunity + to marshal the offending parameters. A library compiled in 32 bit will expect the SeekDelegate to have a 32bit + position parameter but in 64bit compilation the same parameter will be 64bit. Therefore the need to be correct + overrides the need for consistency with CLR 64bit positioners. + SIDE NOTE: In early tests the SeekDelegate was defined with a long long parameter - libmpg123 called it oblivious + to the fact that the type was incorrect. The only impact was that the 32bit position and 32bit origin (whence) + were compacted to a single 64bit parameter. This is fixed, no longer an issue!!! +4) PosixSeek and PosixRead ARE ONLY INCLUDED AS PROOF OF CONCEPT - to prove that the callbacks into CLR would + function correctly with libmpg123 cdecl calls. It saved making a separate dll for the posix elements. + REPEAT AFTER ME: Not for normal consumption.... +5) The __clrcall decoration of mpg123clr functions is not strictly necessary for Visual Studio 2005 and later, + but has been left in for compatibility with earlier versions. See MS documentation of "double thunking" +6) Many functions use pin_ptr to pin the return variables prior to calling the libmpg123 function, this was + considered as an alternative to avoid the use of local variables with attendant overhead of + allocate/use/copy/destroy etc. In practice pin_ptr has significant overhead, empirical tests showed very + little performance difference between either method. +7) Set pin_ptr to NULL after use, to force early GC (recommended). Carried out performance trials and found + insignificant impact. Since most functions are likely to be used repeatedly decided to follow recommended usage. + If code analysis proves this to be redundant - can be removed... + (1.9.0.1 update) "insignificant" in Debug mode, quite significant if the debug overhead is removed, + i.e. Release mode. So try/finally blocks removed in favour of allocating temporary local return variable. +8) (1.12.0.0 update) Support for mpg123_open_handle warrants further description... here it is. + a) Pinning of delegates is not required. See Microsoft: C++, How to: Marshal Callbacks and Delegates Using C++ Interop + b) Pinning of objects is an entirely different matter, so why is the open_handle object not pinned? + Answer: Because it's an object. I allowed passing of any object not just handles. + i) a pin_ptr cannot be a field member for instance scope. + ii) cannot pin the object itself because there's no object.field to pin + iii) cannot pin the object target because the referenced object may be unblittable. + iv) GCHandle.Alloc(obj, GCHandleType.Pinned) doesn't work on unblittable objects (eg managed references like BinaryReader) + Since I don't restrict which objects may be passed I'm forced to exclude pinning. + c) The generated handle doesn't need to be pinned. GCHandle.Alloc(obj) creates a potentially GC relocatable object + containing a Handle to the object. The GCHandle.ToIntPtr(userObjectHandle) creates an integer representation of the + handle that is valid irrespective of any GC relocation of either the object or the GCHandle and can therefore be + passed through unmanaged code to CLR native methods that can re-reference the original object via GCHandle.FromIntPtr + and gch.Target. + All this seems relatively efficient, certainly there is little performance difference between the ReplaceReader + and ReplaceReaderHandle sample code. + +============================================================================= +Tested/Untested + +I haven't used mpg123clr in a production project yet, although one is about to start. Therefore EVERYTHING should +be treated as though unproven. UPDATE: the scanclr, feedseekclr and replacereaderclr examples have provided a basic +functional test. + +Largefile support totally untested... would appreciate a volunteer. + +The majority of functions have been tried in test projects with the following exceptions. + +64bit compilation. mpg123clr compiles correctly in 64bit x64 platform mode, but hasn't been tested. + +ICY(icy_meta); Never had genuine ICY data to test with. +Icy2Utf8(icy_text); Never tried. Please provide sample material. +enc_from_id3(encbyte); Works on libmpg123 enums, never had real world text samples. +store_utf8(...); Works with CLR generated text, not tried with real world text samples. +mpg123str.strlen(...) Not tested with utf8 text strings. Please provide sample material. + +============================================================================== +Documentation + +mpg123clr is 90% documentation, use intellisense as your reference. If in doubt refer back to the libmpg123 +documents. NOTE: You need to build the mpg123clr library to create the intellisense file. + +=============================================================================== +Error Trapping + +libmpg123 is an error agnostic library - it shouldn't generate errors, but neither does it trap them. + +mpg123clr is built on the same concept although some CLR generated errors have been trapped. My personal +preference is that exceptions should be avoided not relied on... + +THE CALLING APPLICATION IS RESPONSIBLE FOR ERROR DETECTION, TRAPPING AND CORRECTION. + +All projects are "as is" with no express or implied warranty. Demonstration projects are to demonstrate the +use of the library and are NOT considered examples of good coding practice. Use at own risk. + +=============================================================================== +Revision History + + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.9.0.0 30-Sep-09 Project config - if exists, copy libmpg123.dll to app output folder (mb) + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) + 1.9.0.1 24-Nov-09 Performance update - removed try/finally (mb) + 1.12.0.0 14-Apr-10 Release match - added open_handle and framebyframe support (mb) + 1.13.0.0 13-Jan-11 Release match - added encsize and strlen support (mb) + +Constructive feedback preferred. + +Malcolm Boczek +mpg123clr original author. diff --git a/ports/MSVC++/2008clr/mpg123clr/advanced.cpp b/ports/MSVC++/2008clr/mpg123clr/advanced.cpp new file mode 100644 index 0000000..ef9ebdf --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/advanced.cpp @@ -0,0 +1,91 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.9.0.0 13-Oct-09 pin_ptr = nullptr on return (mb) + 1.9.0.1 24-Nov-09 performance update - removed try/finally (mb) +*/ + +#include "StdAfx.h" +#include "advanced.h" + +mpg123clr::advpars::advpars(int% error) +{ + pin_ptr err = &error; + mp = ::mpg123_new_pars(err); + + err = nullptr; +} + +mpg123clr::advpars::~advpars(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!advpars(); +} + +mpg123clr::advpars::!advpars(void) +{ + if (mp != NULL) + { + ::mpg123_delete_pars(mp); + mp = NULL; + } +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_fmt_none(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_fmt_none(mp); +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_fmt_all(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_fmt_all(mp); +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_fmt(int rate, mpg123clr::mpg::channelcount channels, int encodings) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_fmt(mp, rate, (int)channels, encodings); +} + +mpg123clr::mpg::channelcount mpg123clr::advpars::mpg123_fmt_support(int rate, int encodings) +{ + return (mpg123clr::mpg::channelcount) ::mpg123_fmt_support(mp, rate, encodings); +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_par(mpg123clr::mpg::parms type, int val, double fval) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_par(mp, (mpg123_parms) type, val, fval); +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_getpar(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval) +{ + // Avoid need for local intermediary variables + pin_ptr _val = &val; + pin_ptr _fval = &fval; + + int ret = ::mpg123_getpar(mp, (mpg123_parms) type, (long*)_val, _fval); + + _fval = nullptr; + _val = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + + diff --git a/ports/MSVC++/2008clr/mpg123clr/advanced.h b/ports/MSVC++/2008clr/mpg123clr/advanced.h new file mode 100644 index 0000000..0bbd4a8 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/advanced.h @@ -0,0 +1,130 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "enum.h" +#include "error.h" + +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see (Microsoft) Destructors and Finalizers in Visual C++] + // + // C++/CLI + // A myA; + // // use myA here + // + // Equivalent user code: + // + // A ^ myA = gcnew A; + // try { /* use myA here */ } finally { delete myA; } + // + // + // C# (from wikipedia) + // using(A myA = new A()) { /* Use myA here */ } + // Compiler calls myA.Dispose(), in a "finally" of a "try/finally" block + // + // Equivalent user code: + // + // A myA = new myA(); + // try { /* Use myA here */ } finally { myA.Dispose(); } + // + // Otherwise Finalizer will be nondeterministically called by GC + + + /// CLR wrapper for mpg123_pars object. + public ref class advpars + { + protected public: + mpg123_pars* mp; + + protected: + !advpars(void); + + public: + ///Constructor. + ///Returns MPG123_OK or mpg123 error code. + advpars([Out] int% error); + + ///Destructor. + ~advpars(void); + + ///Configure mpg123 parameters to accept no output formats. + ///Use to clear default parameters prior to applying specific settings. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_fmt_none(void); + + ///Configure mpg123 parameters to accept all formats including custom rate you may set - this is the default. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_fmt_all(void); + + ///Configure detailed output formats. + ///Returns MPG123 error codes. + /// + ///Sample rate (Hertz) + ///Combination of channelcount.stereo and channelcount.mono + ///Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///MPG123 error codes. + /// VERSION CHECK: long as int for Intellisense + mpg123clr::mpg::ErrorCode __clrcall mpg123_fmt(int rate, mpg123clr::mpg::channelcount channels, int encodings); + + ///Get available support for supplied rate and encoding. + ///Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono. + /// + ///Sample rate (Hertz) + ///Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono. + /// VERSION CHECK: long as int for Intellisense + mpg123clr::mpg::channelcount __clrcall mpg123_fmt_support(int rate, int encoding); + + ///Set a specific advpars value. + ///Returns MPG123 error codes. + /// + ///Specifies the advpars parameter to be set. + ///The integer value to be applied. + ///The real value to be applied. + ///MPG123 error codes. + /// VERSION CHECK: long as int for Intellisense + mpg123clr::mpg::ErrorCode __clrcall mpg123_par(mpg123clr::mpg::parms type, int val, double fval); + + ///Get a specific advpars value. + ///Returns MPG123 error codes. + /// + ///Specifies the advpars parameter to be returned. + ///Returns the applicable integer value. + ///Returns the applicable real value. + ///MPG123 error codes. + /// VERSION CHECK: long as int for Intellisense + mpg123clr::mpg::ErrorCode __clrcall mpg123_getpar(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval); + }; + +} \ No newline at end of file diff --git a/ports/MSVC++/2008clr/mpg123clr/dllmain.cpp b/ports/MSVC++/2008clr/mpg123clr/dllmain.cpp new file mode 100644 index 0000000..8a4edd3 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/ports/MSVC++/2008clr/mpg123clr/enum.h b/ports/MSVC++/2008clr/mpg123clr/enum.h new file mode 100644 index 0000000..a3c251a --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/enum.h @@ -0,0 +1,218 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.10.0.0 30-Nov-09 release match - added mpg123_feature (mb) + 1.13.0.0 13-Jan-11 release match (mb) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + + +namespace mpg123clr +{ + ///Mpg123 enumerations. + namespace mpg + { + + ///Enumeration of the parameters types that it is possible to set/get. + public enum class parms + { + verbose = MPG123_VERBOSE, /// set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) + flags = MPG123_FLAGS, /// set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) + add_flags = MPG123_ADD_FLAGS, /// add some flags (integer) + force_rate = MPG123_FORCE_RATE, /// when value > 0, force output rate to that value (integer) + down_sample = MPG123_DOWN_SAMPLE, /// 0=native rate, 1=half rate, 2=quarter rate (integer) + rva = MPG123_RVA, /// one of the RVA choices above (integer) + downspeed = MPG123_DOWNSPEED, /// play a frame N times (integer) + upspeed = MPG123_UPSPEED, /// play every Nth frame (integer) + start_frame = MPG123_START_FRAME, /// start with this frame (skip frames before that, integer) + decode_frames = MPG123_DECODE_FRAMES, /// decode only this number of frames (integer) + icy_interval = MPG123_ICY_INTERVAL, /// stream contains ICY metadata with this interval (integer) + outscale = MPG123_OUTSCALE, /// the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) + timeout = MPG123_TIMEOUT, /// timeout for reading from a stream (not supported on win32, integer) + remove_flags = MPG123_REMOVE_FLAGS, /// remove some flags (inverse of MPG123_ADD_FLAGS, integer) + resync_limit = MPG123_RESYNC_LIMIT, /// Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). + index_size = MPG123_INDEX_SIZE, /// Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. + preframes = MPG123_PREFRAMES /// Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please. + + }; + + + ///Parameter flag bits. + ///Equivalent to MPG123_FLAGS, use the usual binary or ( | ) to combine. + public enum class param_flags + { + force_mono = MPG123_FORCE_MONO, /// 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. + mono_left = MPG123_MONO_LEFT, /// 0001 Force playback of left channel only. + mono_right = MPG123_MONO_RIGHT, /// 0010 Force playback of right channel only. + mono_mix = MPG123_MONO_MIX, /// 0100 Force playback of mixed mono. + force_stereo = MPG123_FORCE_STEREO, /// 1000 Force stereo output. + force_8bit = MPG123_FORCE_8BIT, /// 00010000 Force 8bit formats. + quiet = MPG123_QUIET, /// 00100000 Suppress any printouts (overrules verbose). + gapless = MPG123_GAPLESS, /// 01000000 Enable gapless decoding (default on if libmpg123 has support). + no_resync = MPG123_NO_RESYNC, /// 10000000 Disable resync stream after error. + seekbuffer = MPG123_SEEKBUFFER, /// 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). + fuzzy = MPG123_FUZZY, /// 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) + force_float = MPG123_FORCE_FLOAT, /// 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). + + ///Prevent ID3 text translation to UTF-8. + ///NOTE: Do not set if you intend to use CLR id3v2 objects. + /// + plain_id3text = MPG123_PLAIN_ID3TEXT, /// 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. + + ignore_streamlength = MPG123_IGNORE_STREAMLENGTH, /// 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag. + + // 1.13.0.0 + skip_id3v2 = MPG123_SKIP_ID3V2, /// 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. + }; + + ///RVA enumeration. + ///Equivalent to MPG123_RVA. + public enum class rva + { + rva_off = MPG123_RVA_OFF, /// RVA disabled (default). + rva_mix = MPG123_RVA_MIX, /// Use mix/track/radio gain. + rva_album = MPG123_RVA_ALBUM, /// Use album/audiophile gain + rva_max = MPG123_RVA_ALBUM, /// The maximum RVA code, may increase in future. + }; + + ///Feature set available for query with mpg123_feature. + ///Equivalent to MPG123_FEATURE_SET. + public enum class feature_set + { + feature_abi_utf8open = MPG123_FEATURE_ABI_UTF8OPEN, /// mpg123 expects path names to be given in UTF-8 encoding instead of plain native. + feature_output_8bit = MPG123_FEATURE_OUTPUT_8BIT, /// 8bit output + feature_output_16bit = MPG123_FEATURE_OUTPUT_16BIT, /// 16bit output + feature_output_32bit = MPG123_FEATURE_OUTPUT_32BIT, /// 32bit output + feature_index = MPG123_FEATURE_INDEX, /// support for building a frame index for accurate seeking + feature_parse_id3v2 = MPG123_FEATURE_PARSE_ID3V2, /// id3v2 parsing + feature_decode_layer1 = MPG123_FEATURE_DECODE_LAYER1, /// mpeg layer-1 decoder enabled + feature_decode_layer2 = MPG123_FEATURE_DECODE_LAYER2, /// mpeg layer-2 decoder enabled + feature_decode_layer3 = MPG123_FEATURE_DECODE_LAYER3, /// mpeg layer-3 decoder enabled + feature_decode_accurate = MPG123_FEATURE_DECODE_ACCURATE, /// accurate decoder rounding + feature_decode_downsample = MPG123_FEATURE_DECODE_DOWNSAMPLE, /// downsample (sample omit) + feature_decode_ntom = MPG123_FEATURE_DECODE_NTOM, /// flexible rate decoding + feature_parse_icy = MPG123_FEATURE_PARSE_ICY, /// ICY support + feature_timeout_read = MPG123_FEATURE_TIMEOUT_READ, /// Reader with timeout (network) + }; + + + + ///An enum over all sample types possibly known to mpg123. + ///The values are designed as bit flags to allow bitmasking for encoding families. + /// + ///Note that (your build of) libmpg123 does not necessarily support all these. + /// Usually, you can expect the 8bit encodings and signed 16 bit. + /// Also 32bit float will be usual beginning with mpg123-1.7.0 . + /// + ///What you should bear in mind is that (SSE, etc) optimized routines may be absent + /// for some formats. We do have SSE for 16, 32 bit and float, though. + /// 24 bit integer is done via postprocessing of 32 bit output -- just cutting + /// the last byte, no rounding, even. If you want better, do it yourself. + /// + ///All formats are in native byte order. On a little endian machine this should mean + /// that you can just feed the MPG123_ENC_SIGNED_32 data to common 24bit hardware that + /// ignores the lowest byte (or you could choose to do rounding with these lower bits). + /// + public enum class enc + { + enc_8 = MPG123_ENC_8, /// 0000 0000 1111 Some 8 bit integer encoding. + enc_16 = MPG123_ENC_16, /// 0000 0100 0000 Some 16 bit integer encoding. + enc_24 = MPG123_ENC_24, /// 0100 0000 0000 0000 Some 24 bit integer encoding. (r1.13) + enc_32 = MPG123_ENC_32, /// 0001 0000 0000 Some 32 bit integer encoding. + enc_signed = MPG123_ENC_SIGNED, /// 0000 1000 0000 Some signed integer encoding. + enc_float = MPG123_ENC_FLOAT, /// 1110 0000 0000 Some float encoding. + enc_signed_16 = MPG123_ENC_SIGNED_16, /// 1101 0000 signed 16 bit + enc_unsigned_16 = MPG123_ENC_UNSIGNED_16, /// 0110 0000 unsigned 16 bit + enc_unsigned_8 = MPG123_ENC_UNSIGNED_8, /// 0000 0001 unsigned 8 bit + enc_signed_8 = MPG123_ENC_SIGNED_8, /// 1000 0010 signed 8 bit + enc_ulaw_8 = MPG123_ENC_ULAW_8, /// 0000 0100 ulaw 8 bit + enc_alaw_8 = MPG123_ENC_ALAW_8, /// 0000 1000 alaw 8 bit + enc_signed_32 = MPG123_ENC_SIGNED_32, /// 0001 0001 1000 0000 signed 32 bit + enc_unsigned_32 = MPG123_ENC_UNSIGNED_32, /// 0010 0001 0000 0000 unsigned 32 bit + enc_signed_24 = MPG123_ENC_SIGNED_24, /// 0101 0000 1000 0000 signed 24 bit (r1.13) + enc_unsigned_24 = MPG123_ENC_UNSIGNED_24, /// 0110 0000 0000 0000 unsigned 24 bit (r1.13) + enc_float_32 = MPG123_ENC_FLOAT_32, /// 0010 0000 0000 32bit float + enc_float_64 = MPG123_ENC_FLOAT_64, /// 0100 0000 0000 64bit float + enc_any = MPG123_ENC_ANY, /// any encoding + }; + + + ///Channel count enumeration + ///clr added both + public enum class channelcount + { + mono = MPG123_MONO, + stereo = MPG123_STEREO, + both = MPG123_MONO | MPG123_STEREO, + }; + + ///Channel enumeration. + public enum class channels + { + left = MPG123_LEFT, /// The Left Channel. + right = MPG123_RIGHT, /// The Right Channel. + both = MPG123_LR, /// Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT + }; + + ///VBR enumeration. + public enum class mpeg_vbr + { + cbr = MPG123_CBR, /// Constant Bitrate Mode (default) + vbr = MPG123_VBR, /// Variable Bitrate Mode + abr = MPG123_ABR, /// Average Bitrate Mode + }; + + ///MPEG Version enumeration. + public enum class mpeg_version + { + mpeg_1_0 = MPG123_1_0, /// MPEG Version 1.0 + mpeg_2_0 = MPG123_2_0, /// MPEG Version 2.0 + mpeg_2_5 = MPG123_2_5, /// MPEG Version 2.5 + }; + + ///MPEG Mode enumeration. + public enum class mpeg_mode + { + m_stereo = MPG123_M_STEREO, /// Standard Stereo. + m_joint = MPG123_M_JOINT, /// Joint Stereo. + m_dual = MPG123_M_DUAL, /// Dual Channel. + m_mono = MPG123_M_MONO, /// Single Channel. + }; + + ///MPEG Flags enumeration. + public enum class mpeg_flags + { + CRC = MPG123_CRC, /// The bitstream is error protected using 16-bit CRC. + COPYRIGHT = MPG123_COPYRIGHT, /// The bitstream is copyrighted. + PRIVATE = MPG123_PRIVATE, /// The private bit has been set. + ORIGINAL = MPG123_ORIGINAL, /// The bitstream is an original, not a copy. + }; + + ///Positional state. + public enum class state + { + accurate = MPG123_ACCURATE /// Query if positons are currently accurate (integer value, 0 if false, 1 if true) + }; + + + } +} \ No newline at end of file diff --git a/ports/MSVC++/2008clr/mpg123clr/error.cpp b/ports/MSVC++/2008clr/mpg123clr/error.cpp new file mode 100644 index 0000000..aeb964e --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/error.cpp @@ -0,0 +1,48 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) +*/ + +#include "StdAfx.h" +#include "error.h" + +mpg123clr::mpg123error::mpg123error(void) +{ +} + +// Destructor cleans up all resources +mpg123clr::mpg123error::~mpg123error(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123error(); +} + +// Finalizer cleans up unmanaged resources +mpg123clr::mpg123error::!mpg123error(void) +{ + // none! +} + +String^ mpg123clr::mpg123error::mpg123_plain_strerror(mpg123clr::mpg::ErrorCode errcode) +{ + return gcnew String(::mpg123_plain_strerror((int)errcode)); +} + diff --git a/ports/MSVC++/2008clr/mpg123clr/error.h b/ports/MSVC++/2008clr/mpg123clr/error.h new file mode 100644 index 0000000..c20976f --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/error.h @@ -0,0 +1,134 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.12.0.0 14-Apr-10 Revision harmonization (catch-up) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "enum.h" + +using namespace System; + +namespace mpg123clr +{ + // defgroup mpg123_error mpg123 error handling + // + // Functions to get text version of the error numbers and an enumeration + // of the error codes returned by libmpg123. + // + // Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + // Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + // The positive range of return values is used for "useful" values when appropriate. + // + // + // + + + namespace mpg + { + ///Enumeration of the message and error codes as returned by libmpg123 functions. + public enum class ErrorCode + { + done = MPG123_DONE, /// Message: Track ended. + new_format = MPG123_NEW_FORMAT, /// Message: Output format will be different on next call. + need_more = MPG123_NEED_MORE, /// Message: For feed reader: "Feed me more!" + err = MPG123_ERR, /// Generic Error + ok = MPG123_OK, /// Success + bad_outformat = MPG123_BAD_OUTFORMAT, /// Unable to set up output format! + bad_channel = MPG123_BAD_CHANNEL, /// Invalid channel number specified. + bad_rate = MPG123_BAD_RATE, /// Invalid sample rate specified. + err_16to8table = MPG123_ERR_16TO8TABLE, /// Unable to allocate memory for 16 to 8 converter table! + bad_param = MPG123_BAD_PARAM, /// Bad parameter id! + bad_buffer = MPG123_BAD_BUFFER, /// Bad buffer given -- invalid pointer or too small size. + out_of_mem = MPG123_OUT_OF_MEM, /// Out of memory -- some malloc() failed. + not_initialized = MPG123_NOT_INITIALIZED, /// You didn't initialize the library! + bad_decoder = MPG123_BAD_DECODER, /// Invalid decoder choice. + bad_handle = MPG123_BAD_HANDLE, /// Invalid mpg123 handle. + no_buffers = MPG123_NO_BUFFERS, /// Unable to initialize frame buffers (out of memory?). + bad_rva = MPG123_BAD_RVA, /// Invalid RVA mode. + no_gapless = MPG123_NO_GAPLESS, /// This build doesn't support gapless decoding. + no_space = MPG123_NO_SPACE, /// Not enough buffer space. + bad_types = MPG123_BAD_TYPES, /// Incompatible numeric data types. + bad_band = MPG123_BAD_BAND, /// Bad equalizer band. + err_null = MPG123_ERR_NULL, /// Null pointer given where valid storage address needed. + err_reader = MPG123_ERR_READER, /// Error reading the stream. + no_seek_from_end = MPG123_NO_SEEK_FROM_END, /// Cannot seek from end (end is not known). + bad_whence = MPG123_BAD_WHENCE, /// Invalid 'whence' for seek function. + no_timeout = MPG123_NO_TIMEOUT, /// Build does not support stream timeouts. + bad_file = MPG123_BAD_FILE, /// File access error. + no_seek = MPG123_NO_SEEK, /// Seek not supported by stream. + no_reader = MPG123_NO_READER, /// No stream opened. + bad_pars = MPG123_BAD_PARS, /// Bad parameter handle. + bad_index_par = MPG123_BAD_INDEX_PAR, /// Bad parameters to mpg123_index() + out_of_sync = MPG123_OUT_OF_SYNC, /// Lost track in bytestream and did not try to resync. + resync_fail = MPG123_RESYNC_FAIL, /// Resync failed to find valid MPEG data. + no_8bit = MPG123_NO_8BIT, /// No 8bit encoding possible. + bad_align = MPG123_BAD_ALIGN, /// Stack aligmnent error + null_buffer = MPG123_NULL_BUFFER, /// NULL input buffer with non-zero size... + no_relseek = MPG123_NO_RELSEEK, /// Relative seek not possible (screwed up file offset) + null_pointer = MPG123_NULL_POINTER, /// You gave a null pointer somewhere where you shouldn't have. + bad_key = MPG123_BAD_KEY, /// Bad key value given. + no_index = MPG123_NO_INDEX, /// No frame index in this build. + index_fail = MPG123_INDEX_FAIL, /// Something with frame index went wrong. + bad_decoder_setup = MPG123_BAD_DECODER_SETUP, /// Something prevents a proper decoder setup + missing_feature = MPG123_MISSING_FEATURE, /// This feature has not been built into libmpg123. + /* 1.8.1 */ + bad_value = MPG123_BAD_VALUE, /// A bad value has been given, somewhere. + lseek_failed = MPG123_LSEEK_FAILED, /// Low-level seek failed. + /* 1.12.0 */ + bad_custom_io = MPG123_BAD_CUSTOM_IO, /// Custom I/O not prepared. + lfs_overflow = MPG123_LFS_OVERFLOW, /// Offset value overflow during translation of large file API calls, + /// - your client program cannot handle that large file. + + }; + } + + ///Wrapper for mpg123_errors + public ref class mpg123error + { + protected: + ///Finalizer. + ///Cleanly handles mpg123_delete of internal (unmanaged) handles. + /// Implementation of CLR Finalize(). + !mpg123error(void); + + public: + ///Constructor. + mpg123error(void); + + ///Destructor. Used for final object deletion. + ///Calls finalizer for clean disposal of internal (unmanaged) library handles. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123error(void); + + ///Obtain a string description of the errcode meaning. + ///Returns a String description representing the error code. + /// + ///The error code to be described. + ///Returns a String description representing the error code. + static String^ __clrcall mpg123_plain_strerror(mpg123clr::mpg::ErrorCode errcode); + }; +} \ No newline at end of file diff --git a/ports/MSVC++/2008clr/mpg123clr/id3v1.cpp b/ports/MSVC++/2008clr/mpg123clr/id3v1.cpp new file mode 100644 index 0000000..2b8bd87 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/id3v1.cpp @@ -0,0 +1,92 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) +*/ + +#include "StdAfx.h" +#include "id3v1.h" + +mpg123clr::id3::mpg123id3v1::mpg123id3v1(void) +{ +} + +mpg123clr::id3::mpg123id3v1::mpg123id3v1(mpg123_id3v1* sb) +{ + this->sb = sb; +} + + +// Destructor +mpg123clr::id3::mpg123id3v1::~mpg123id3v1(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123id3v1(); +} + +// Finalizer +mpg123clr::id3::mpg123id3v1::!mpg123id3v1(void) +{ + // we do not create the underlying structure, so shouldn't dispose it either... +} + +String^ mpg123clr::id3::mpg123id3v1::tag::get() +{ + if (sb == nullptr || sb->tag == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->tag, (int)strnlen(sb->tag, 3)); +} + +String^ mpg123clr::id3::mpg123id3v1::title::get() +{ + if (sb == nullptr || sb->title == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->title, (int)strnlen(sb->title, 30)); +} + +String^ mpg123clr::id3::mpg123id3v1::artist::get() +{ + if (sb == nullptr || sb->artist == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->artist, (int)strnlen(sb->artist, 30)); +} + +String^ mpg123clr::id3::mpg123id3v1::album::get() +{ + if (sb == nullptr || sb->album == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->album, (int)strnlen(sb->album, 30)); +} + +String^ mpg123clr::id3::mpg123id3v1::comment::get() +{ + if (sb == nullptr || sb->comment == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->comment, (int)strnlen(sb->comment, 30)); +} + +int mpg123clr::id3::mpg123id3v1::genre::get() +{ + if (sb == nullptr) return 0; + + return sb->genre; +} + + diff --git a/ports/MSVC++/2008clr/mpg123clr/id3v1.h b/ports/MSVC++/2008clr/mpg123clr/id3v1.h new file mode 100644 index 0000000..b1ce75e --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/id3v1.h @@ -0,0 +1,132 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + namespace id3 + { + ///id3check enumeration. + public enum class id3check + { + none = 0, + id3 = 2, /**< 0010 There is some ID3 info. */ + upd_id3 = MPG123_ID3, /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ + new_id3 = MPG123_NEW_ID3, /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ + icy = 8, /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ + upd_icy = MPG123_ICY, /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ + new_icy = MPG123_NEW_ICY, /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + }; + + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see Destructors and Finalizers in Visual C++] + // + // A ^ myA = gcnew A; + // try + // { + // use myA + // } + // finally + // { + // delete myA; + // } + + ///Wrapper for mpg123_id3v1. + [StructLayout(LayoutKind::Sequential)] + public ref struct mpg123id3v1 + { + private: + mpg123_id3v1* sb; + protected: + ///Finalizer. + ///Cleanly handles mpg123_delete of internal (unmanaged) mpg123 handle. + /// Implementation of CLR Finalize(). + !mpg123id3v1(void); + internal: + ///Working Constructor. + ///Maps to mpg123_id3v1 memory. + /// + mpg123id3v1(mpg123_id3v1* sb); + public: + ///Constructor. + ///Only creates object for use as "out" target in ID3 constructor. + /// + mpg123id3v1(void); + + ///Destructor. Used for final object deletion. + ///Calls finalizer for clean disposal of internal (unmanaged) library handles. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123id3v1(void); + + ///Get the ID3v1 tag descriptor. + ///Property returns the ID3v1 tag (should always be "TAG"). + /// + ///The ID3v1 tag (should always be "TAG"). + property String^ tag{String^ __clrcall get();} + + ///Get the ID3v1 title text. + ///Property returns the ID3v1 title text. + /// + ///The ID3v1 title text. + property String^ title{String^ __clrcall get();} + + ///Get the ID3v1 artist text. + ///Property returns the ID3v1 artist text. + /// + ///The ID3v1 artist text. + property String^ artist{String^ __clrcall get();} + + ///Get the ID3v1 album text. + ///Property returns the ID3v1 album text. + /// + ///The ID3v1 album text. + property String^ album{String^ __clrcall get();} + + ///Get the ID3v1 comment text. + ///Property returns the ID3v1 comment text. + /// + ///The ID3v1 comment text. + property String^ comment{String^ __clrcall get();} + + ///Get the ID3v1 genre index. + ///Property returns the ID3v1 genre index. + /// + ///The ID3v1 genre index. + property int genre{int __clrcall get();} + + + }; + } +} \ No newline at end of file diff --git a/ports/MSVC++/2008clr/mpg123clr/id3v2.cpp b/ports/MSVC++/2008clr/mpg123clr/id3v2.cpp new file mode 100644 index 0000000..a5ec9e3 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/id3v2.cpp @@ -0,0 +1,138 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) + 1.10.0.0 30-Nov-09 Add test for null base (sb) - in addition to null string test (mb) + (required if v2 referenced prior to file scan) +*/ + +#include "StdAfx.h" +#include "id3v2.h" + +mpg123clr::id3::mpg123id3v2::mpg123id3v2(void) +{ +} + +mpg123clr::id3::mpg123id3v2::mpg123id3v2(mpg123_id3v2* sb) +{ + this->sb = sb; +} + + +// Destructor +mpg123clr::id3::mpg123id3v2::~mpg123id3v2(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123id3v2(); +} + +// Finalizer +mpg123clr::id3::mpg123id3v2::!mpg123id3v2(void) +{ + // we do not create the underlying structure, so shouldn't dispose it either... +} + +String^ mpg123clr::id3::mpg123id3v2::title::get() +{ + // updated: more efficient "union style" mpg123str + mpg123str^ str = (sb == nullptr || sb->title == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->title); + + // Deprecated remnant - uses "overlayed style" mpg123str - note inefficient PtrToStrucure... + // mpg123str^% str = gcnew mpg123str; + // Marshal::PtrToStructure((IntPtr)sb->title, str); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::artist::get() +{ + mpg123str^ str = (sb == nullptr || sb->artist == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->artist); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::album::get() +{ + mpg123str^ str = (sb == nullptr || sb->album == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->album); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::comment::get() +{ + mpg123str^ str = (sb == nullptr || sb->comment == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->comment); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::year::get() +{ + mpg123str^ str = (sb == nullptr || sb->year == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->year); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::genre::get() +{ + mpg123str^ str = (sb == nullptr || sb->genre == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->genre); + + return str->Text; +} + +int mpg123clr::id3::mpg123id3v2::version::get() +{ + return sb->version; +} + +array^ mpg123clr::id3::mpg123id3v2::MakeTextList(mpg123_text* ptr, size_t count) +{ + // WARN 4267 - clr limited to 32bit-length-size arrays!! + array^ ary = gcnew array((int)count); + + for (int ii = 0; ii < ary->Length; ii++) + { + // Remnant - for explicit layout + // mpg123text^% txt = gcnew mpg123text; + // Marshal::PtrToStructure((IntPtr)ptr++, txt); + + // New code - for "handle style" structure + mpg123text^% txt = gcnew mpg123text(ptr++); + + ary[ii] = txt; + } + + return ary; +} + +array^ mpg123clr::id3::mpg123id3v2::Comments::get() +{ + return MakeTextList(sb->comment_list, sb->comments); +} + +array^ mpg123clr::id3::mpg123id3v2::Texts::get() +{ + return MakeTextList(sb->text, sb->texts); +} + +array^ mpg123clr::id3::mpg123id3v2::Extras::get() +{ + return MakeTextList(sb->extra, sb->extras); +} + diff --git a/ports/MSVC++/2008clr/mpg123clr/id3v2.h b/ports/MSVC++/2008clr/mpg123clr/id3v2.h new file mode 100644 index 0000000..8e4b046 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/id3v2.h @@ -0,0 +1,152 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "string.h" +#include "text.h" + +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + namespace id3 + { + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see Destructors and Finalizers in Visual C++] + // + // A ^ myA = gcnew A; + // try + // { + // use myA + // } + // finally + // { + // delete myA; + // } + + ///Wrapper for mpg123_id3v2. + [StructLayout(LayoutKind::Sequential)] + public ref struct mpg123id3v2 + { + private: + mpg123_id3v2* sb; + + array^ __clrcall MakeTextList(mpg123_text* ptr, size_t count); + + protected: + ///Finalizer. + ///Does nothing - wrapper points to underlying memory, this class doesn't allocate memory. + /// Implementation of CLR Finalize(). + !mpg123id3v2(void); + + internal: + ///Working Constructor. + ///Maps to mpg123_id3v2 memory. + /// + mpg123id3v2(mpg123_id3v2* sb); + + public: + ///Constructor. + ///Only creates object for use as "out" target in ID3 constructor. + /// + mpg123id3v2(void); + + ///Destructor. Used for final object deletion. + ///Calls finalizer for clean disposal of internal (unmanaged) library handles. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123id3v2(void); + + ///Get the ID3v2 title text. + ///Property returns the last encountered ID3v2 title text. + /// + ///The last encountered ID3v2 title text. + property String^ title{String^ __clrcall get();} + + ///Get the ID3v2 artist text. + ///Property returns the last encountered ID3v2 artist text. + /// + ///The last encountered ID3v2 artist text. + property String^ artist{String^ __clrcall get();} + + ///Get the ID3v2 album text. + ///Property returns the last encountered ID3v2 album text. + /// + ///The last encountered ID3v2 album text. + property String^ album{String^ __clrcall get();} + + ///Get the ID3v2 comment text. + ///Property returns the last encountered ID3v2 comment text. + /// + ///The last encountered ID3v2 comment text. + property String^ comment{String^ __clrcall get();} + + ///Get the ID3v2 year text. + ///Property returns the last encountered ID3v2 year text. + /// + ///The last encountered ID3v2 year text. + property String^ year{String^ __clrcall get();} + + ///Get the ID3v2 genre text. + ///Property returns the last encountered ID3v2 genre text. + /// + ///The last encountered ID3v2 genre text. + property String^ genre{String^ __clrcall get();} + + ///Get the ID3v2 version. + ///Property returns the ID3v2 version. + /// + ///The ID3v2 version. + property int version{int __clrcall get();} + + + ///Get an array of Comments. + ///Property returns an array of Comments. + /// + ///An array of Comments. + property array^ Comments{array^ __clrcall get();}; + + ///Get an array of ID3v2 text fields (including USLT). + ///Property returns an array of ID3v2 text fields (including USLT). + /// + ///An array of ID3v2 text fields (including USLT). + property array^ Texts{array^ __clrcall get();}; + + ///Get an array of extra (TXXX) fields. + ///Property returns an array of extra (TXXX) fields. + /// + ///An array of extra (TXXX) fields. + property array^ Extras{array^ __clrcall get();}; + + }; + } +} diff --git a/ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp b/ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp new file mode 100644 index 0000000..5ed0099 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp @@ -0,0 +1,896 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) + 1.9.0.0 13-Oct-09 pin_ptr = nullptr on return (mb) + 1.9.0.1 24-Nov-09 performance update - removed try/finally (mb) + 1.10.0.0 30-Nov-09 release match - added mpg123_feature (mb) + 1.12.0.0 14-Apr-10 release match - added framebyframe and "handle" ReplaceReaders (mb) + 1.13.0.0 13-Jan-11 release match - added encsize (mb) +*/ + +// mpg123clr.cpp : Defines the exported functions for the DLL application. +// + +#include "stdafx.h" +#include "mpg123clr.h" + + +mpg123clr::mpg123::mpg123(void) +{ + mh = nullptr; + useHandleReplacement = false; + lastReplacementWasHandle = false; +} + +mpg123clr::mpg123::mpg123(mpg123_handle* mh) +{ + this->mh = mh; + useHandleReplacement = false; + lastReplacementWasHandle = false; +} + +// Destructor +mpg123clr::mpg123::~mpg123(void) +{ + // clean up code to release managed resources + + // call Finalizer to clean up unmanaged resources + this->!mpg123(); + + // CLI implements SuppressFinalize - therefore not required here... + //GC::SuppressFinalize(this); +} + +// Finalizer +mpg123clr::mpg123::!mpg123(void) +{ + // clean up unmanaged resources + if (mh != nullptr) + { + ::mpg123_delete(mh); + mh = nullptr; + } +} + +void mpg123clr::mpg123::mpg123_delete(void) +{ + if (mh != nullptr) + { + ::mpg123_delete(mh); + mh = nullptr; + } +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_init(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_init(); +} + +void mpg123clr::mpg123::mpg123_exit(void) +{ + ::mpg123_exit(); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_new(String ^ decoder) +{ + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(decoder)).ToPointer(); + + int err; + mh = ::mpg123_new(chars, &err); + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) err; +} +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_new(void) +{ + int err; + mh = ::mpg123_new(NULL, &err); + + return (mpg123clr::mpg::ErrorCode) err; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_parnew(mpg123clr::advpars^ par, String ^ decoder) +{ + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(decoder)).ToPointer(); + + int err; + mh = ::mpg123_parnew(par->mp, chars, &err); + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) err; +} +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_parnew(mpg123clr::advpars^ par) +{ + int err; + mh = ::mpg123_parnew(par->mp, NULL, &err); + + return (mpg123clr::mpg::ErrorCode) err; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_param(mpg123clr::mpg::parms type, int val, double fval) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_param(mh, (mpg123_parms)type, val, fval); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_getparam(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval) +{ + // Avoid need for local intermediary variables + pin_ptr _val = &val; + pin_ptr _fval = &fval; + + int ret = ::mpg123_getparam(mh, (mpg123_parms)type, (long*) _val, _fval); + + _fval = nullptr; + _val = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +int mpg123clr::mpg123::mpg123_feature(mpg123clr::mpg::feature_set key) +{ + return ::mpg123_feature((mpg123_feature_set) key); +} + +String^ mpg123clr::mpg123::mpg123_strerror(void) +{ + return gcnew String(::mpg123_strerror(mh)); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_errcode(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_errcode(mh); +} + +array^ mpg123clr::mpg123::StringArrayFromPtr(const char** ptr) +{ + int count = 0; + + // count how many strings in array by walking up the array until NULL found + while (*(ptr++) != NULL){ ++count; } + + // create an array of the correct size + array ^ str = gcnew array(count); + + --ptr; // loop leaves ptr +2 beyond end of array - put ptr back to just after last index + + // walk back down the array, extracting the strings + while (count-- > 0){ str[count] = gcnew String(*(--ptr)); } + + return str; +} + +array^ mpg123clr::mpg123::mpg123_decoders(void) +{ + return StringArrayFromPtr(::mpg123_decoders()); +} + +array^ mpg123clr::mpg123::mpg123_supported_decoders(void) +{ + return StringArrayFromPtr(::mpg123_supported_decoders()); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_decoder(String^ name) +{ + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(name)).ToPointer(); + + int ret; + + // one of the few mpg123 places that fault with an exception... + try { ret = ::mpg123_decoder(mh, chars); } + catch(Exception^){ ret = MPG123_ERR; } + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +String^ mpg123clr::mpg123::mpg123_current_decoder(void) +{ + return gcnew String(::mpg123_current_decoder(mh)); +} + +array^ mpg123clr::mpg123::mpg123_rates(void) +{ + size_t number; + const long* list; + + ::mpg123_rates(&list, &number); + + array^ rList = gcnew array((int)number); + + int index = 0; + + // walk the array, extracting the rates + while (index < (int)number){ rList[index++] = *(list++); } + + return rList; +} + +array^ mpg123clr::mpg123::mpg123_encodings(void) +{ + size_t number; + const int* list; + + ::mpg123_encodings(&list, &number); + + // WARN 4267 - assuming that the number of encodings will never exceed 32bits + array^ rList = gcnew array((int)number); + + int index = 0; + + // walk the array, extracting the rates + while (index < (int)number){ rList[index++] = (mpg123clr::mpg::enc) *(list++); } + + return rList; +} + +int mpg123clr::mpg123::mpg123_encsize(mpg123clr::mpg::enc encoding) +{ + return ::mpg123_encsize((int) encoding); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_format_none(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_format_none(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_format_all(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_format_all(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_format(int rate, mpg123clr::mpg::channelcount channels, mpg123clr::mpg::enc encodings) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_format(mh, rate, (int) channels, (int) encodings); +} + +mpg123clr::mpg::channelcount mpg123clr::mpg123::mpg123_format_support(int rate, mpg123clr::mpg::enc encodings) +{ + return (mpg123clr::mpg::channelcount) ::mpg123_format_support(mh, rate, (int) encodings); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_getformat([Out] int% rate, [Out] mpg123clr::mpg::channelcount% channels, [Out] mpg123clr::mpg::enc% encodings) +{ + // either:- + // + // long _rate; + // int _chan, _enc; + // int ret = mpg123_getformat(mh, &_rate, &_chan, &_enc); + // rate = _rate; + // channels = _chan; + // encodings = _enc; + // return (mpg123clr::mpg::ErrorCode) ret; + // + // or:- + // use pinned pointers instead + pin_ptr _rate = &rate; + pin_ptr _chan = &channels; + pin_ptr _enc = &encodings; + + int ret = ::mpg123_getformat(mh, (long*)_rate, (int*)_chan, (int*)_enc); + + _enc = nullptr; + _chan = nullptr; + _rate = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_open(String^ path) +{ + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(path)).ToPointer(); + + _ReplaceReader(); + + int ret = ::mpg123_open(mh, chars); + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_open_fd(int filedescriptor) +{ + _ReplaceReader(); + + return (mpg123clr::mpg::ErrorCode) ::mpg123_open_fd(mh, filedescriptor); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_open_handle(System::Object^ obj) +{ + // NOTE: You must have configured callbacks using mpg123_replace_reader_handle + // before calling mpg123_open_handle! + + _ReplaceReader(); // activate callbacks + + // Make sure we free this in Close functions + userObjectHandle = GCHandle::Alloc(obj); + + // NOTE: This sends a HANDLE not an ADDRESS, no pinning required + return (mpg123clr::mpg::ErrorCode) ::mpg123_open_handle(mh, (void*)GCHandle::ToIntPtr(userObjectHandle).ToPointer()); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_open_feed(void) +{ + _ReplaceReader(); + + return (mpg123clr::mpg::ErrorCode) ::mpg123_open_feed(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_close(void) +{ + // Closes 'mh' and calls Cleanup delegate if provided + int ret = ::mpg123_close(mh); + + // See GCHandle.Free - caller must ensure Free called only once for a given handle. + if (userObjectHandle.IsAllocated) userObjectHandle.Free(); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_read(array^ buffer, [Out] size_t% count) +{ + pin_ptr _count = &count; + pin_ptr _ptr = &buffer[0]; + + int ret = ::mpg123_read(mh, _ptr, buffer->Length, _count); + + _ptr = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_read(array^ buffer, size_t offset, size_t size, [Out] size_t% count) +{ + pin_ptr _count = &count; + // WARN 4267 - clr limited to 32bit-length-size arrays!! + pin_ptr _ptr = &buffer[(int)offset]; + + int ret = ::mpg123_read(mh, _ptr, size, _count); + + _ptr = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_feed(array^ inbuffer, size_t size) +{ + pin_ptr _ptr = &inbuffer[0]; + + int ret = ::mpg123_feed(mh, _ptr, size); + + _ptr = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_decode(array^ inbuffer, size_t insize, array^ outbuffer, size_t outsize, [Out] size_t% count) +{ + pin_ptr _count = &count; + pin_ptr _inptr = &inbuffer[0]; + pin_ptr _outptr = &outbuffer[0]; + + int ret = ::mpg123_decode(mh, _inptr, insize, _outptr, outsize, _count); + + _outptr = nullptr; + _inptr = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_decode_frame([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% count) +{ + pin_ptr _count = &count; + pin_ptr _num = # + pin_ptr _x = &audio; + + int ret = ::mpg123_decode_frame(mh, _num, (unsigned char**)_x, _count); + + _x = nullptr; + _num = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_framebyframe_decode([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% count) +{ + // NOTE: must use framebyframe_next to obtain successive frames + + pin_ptr _count = &count; + pin_ptr _num = # + pin_ptr _x = &audio; + + int ret = ::mpg123_framebyframe_decode(mh, _num, (unsigned char**)_x, _count); + + _x = nullptr; + _num = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_framebyframe_next() +{ + // mpg123lib has warning, Experimental API. Watch for updates!!! + // framebyframe_decode doesn't automatically move on to next frame, + // use framebyframe_next to move on to "Find, read and parse the next mp3 frame" + int ret = ::mpg123_framebyframe_next(mh); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +long long mpg123clr::mpg123::mpg123_tell(void) +{ + return ::mpg123_tell(mh); +} + +long long mpg123clr::mpg123::mpg123_tellframe(void) +{ + return ::mpg123_tellframe(mh); +} + +long long mpg123clr::mpg123::mpg123_tell_stream(void) +{ + return ::mpg123_tell_stream(mh); +} + +long long mpg123clr::mpg123::mpg123_seek(long long offset, SeekOrigin origin) +{ + return ::mpg123_seek(mh, (off_t)offset, (int)origin); +} + +long long mpg123clr::mpg123::mpg123_feedseek(long long offset, SeekOrigin origin, [Out] long long% input_offset) +{ + // NOTE: off_t fiddles... + // pin_ptr _input_offset = &input_offset; // type mismatch between 32 and 64 bit offsets. + + off_t _input_offset; // type accomodation + + off_t ret = ::mpg123_feedseek(mh, (off_t)offset, (int)origin, &_input_offset); // ok types + + input_offset = _input_offset; // type conversion + + return ret; +} + +long long mpg123clr::mpg123::mpg123_seek_frame(long long frameoffset, SeekOrigin origin) +{ + return ::mpg123_seek_frame(mh, (off_t)frameoffset, (int)origin); +} + +long long mpg123clr::mpg123::mpg123_timeframe(double seconds) +{ + return ::mpg123_timeframe(mh, seconds); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_index([Out] array^% index, [Out] long long% step) +{ + // remnant: only works if off_t, index and step are 32 bit - possible redo for 64 bit library + // pin_ptr _step = &step; + // int ret = mpg123_index(mh, &_list, (off_t*)_step, &_count); + // index = gcnew array((int)_count); + // Marshal::Copy((IntPtr)_list, index, 0, (int)_count); + + // alternate: works for 32 and 64 bit libraries - returns long long values + off_t* _list; + size_t _count; + off_t _step; // type accomodation + + int ret = ::mpg123_index(mh, &_list, &_step, &_count); + + step = _step; // type conversion + + // WARN 4267 - clr limited to 32bit-length-size arrays!! + index = gcnew array((int)_count); + + // walk the array, extracting the rates + int idx = 0; // array length limited to 32bit + while (idx < index->Length){ index[idx++] = *(_list++); } + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_index([Out] IntPtr% indexarr, [Out] long long% step, [Out] size_t% fill) +{ + pin_ptr _fill = &fill; + pin_ptr _x = &indexarr; // NOTE: untyped index pointer. + off_t _step; // type accomodation + + int ret = ::mpg123_index(mh, (off_t**)_x, &_step, _fill); + + step = _step; // type conversion + + _x = nullptr; + _fill = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_position( + long long frameoffset, long long bufferedbytes, [Out] long long% currentframe, [Out] long long% framesleft, + [Out] double% currentseconds, [Out] double% secondsleft) +{ + // NOTE: off_t fiddles + // pin_ptr _currentframe = ¤tframe; + // pin_ptr _framesleft = &framesleft; + pin_ptr _currentseconds = ¤tseconds; + pin_ptr _secondsleft = &secondsleft; + off_t _currentframe; // type accomodation + off_t _framesleft; // type accomodation + + int ret = ::mpg123_position(mh, (off_t)frameoffset, (off_t)bufferedbytes, &_currentframe, &_framesleft, _currentseconds, _secondsleft); + + currentframe = _currentframe; // type conversion + framesleft = _framesleft; // type conversion + + _secondsleft = nullptr; + _currentseconds = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +#pragma region Volume and Equalizer + + /// \defgroup mpg123_voleq mpg123 volume and equalizer + /// + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_eq(mpg123clr::mpg::channels channel, int band, double fval) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_eq(mh, (mpg123_channels)channel, band, fval); +} + +double mpg123clr::mpg123::mpg123_geteq(mpg123clr::mpg::channels channel, int band) +{ + return ::mpg123_geteq(mh, (mpg123_channels)channel, band); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_reset_eq(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_reset_eq(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_volume(double volume) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_volume(mh, volume); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_volume_change(double change) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_volume_change(mh, change); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_getvolume([Out] double% basevol, [Out] double% really, [Out] double% rva_db) +{ + pin_ptr _basevol = &basevol; + pin_ptr _really = &really; + pin_ptr _rva_db = &rva_db; + + int ret = ::mpg123_getvolume(mh, _basevol, _really, _rva_db); + + _rva_db = nullptr; + _really = nullptr; + _basevol = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +#pragma endregion -Volume and Equalizer +#pragma region Status and Information + + // \defgroup mpg123_status mpg123 status and information + // + // + // + +// The "proper" way to manage structs... +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_safeinfo([Out]mpeg_frameinfo^% finfo) +{ + // "out" our return reference and grab some memory + finfo = gcnew mpeg_frameinfo; + IntPtr pp = Marshal::AllocHGlobal(Marshal::SizeOf(finfo)); + + // get the info + + // could cast away... + // int ret = mpg123_info(mh, reinterpret_cast((int)pp)); + // int ret = mpg123_info(mh, static_cast((void*)pp)); + + // or let the compiler decide... + int ret = ::mpg123_info(mh, (mpg123_frameinfo*)(void*)pp); + + // marshal data into return object and free temporary memory + Marshal::PtrToStructure(pp, finfo); + Marshal::FreeHGlobal(pp); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +// The "efficient" way to manage structs... +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_info([Out]mpeg_frameinfo^% finfo) +{ + finfo = gcnew mpeg_frameinfo; + + pin_ptr _ptr = &finfo->version; + + // According to SizeOf... + // The unmanaged and managed sizes of an object can differ, this would imply + // that the memory layout for each would also be different, which would indicate + // that using a ptr, derived from a ptr-to-a-managed type, in unmanaged code could + // have unforseen results. + // + // In non-homogenous structs (like mpg123text) it can lead to corrupted CLR stack. + // In homogenous structs (like finfo) it appears to be "managable". + // + // However, until it fails it'll do... and it's much faster (see mpg123_safeinfo(...)). + + // WARNING: + // The epitome of "unsafe" as defined by CLR (using unmanaged pointers). + // If we start to get CLR stack corruptions - check here first! (see SafeInfo for "safe" managed version) + int ret = ::mpg123_info(mh, (mpg123_frameinfo*)_ptr); + + _ptr = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +size_t mpg123clr::mpg123::mpg123_safe_buffer(void) +{ + return ::mpg123_safe_buffer(); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_scan(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_scan(mh); +} + +long long mpg123clr::mpg123::mpg123_length(void) +{ + return ::mpg123_length(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_set_filesize(long long size) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_set_filesize(mh, (off_t)size); +} + +double mpg123clr::mpg123::mpg123_tpf(void) +{ + return ::mpg123_tpf(mh); +} + +long mpg123clr::mpg123::mpg123_clip(void) +{ + return ::mpg123_clip(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_getstate(mpg123clr::mpg::state key, [Out] int% val, [Out] double% fval) +{ + pin_ptr _val = &val; + pin_ptr _fval = &fval; + + int ret = ::mpg123_getstate(mh, (mpg123_state)key, (long*) _val, _fval); + + _fval = nullptr; + _val = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +#pragma endregion -Status and Information + +#pragma region Metadata Handling + + // \defgroup mpg123_metadata mpg123 metadata handling + // + // Functions to retrieve the metadata from MPEG Audio files and streams. + // Also includes string handling functions. + // + +mpg123clr::id3::id3check mpg123clr::mpg123::mpg123_meta_check(void) +{ + return (mpg123clr::id3::id3check ) ::mpg123_meta_check(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_id3([Out]id3::mpg123id3v1^% v1, [Out]id3::mpg123id3v2^% v2) +{ + mpg123_id3v1* pv1; + mpg123_id3v2* pv2; + + // doc says "pv1 and pv2 may be set to NULL when there is no corresponding data." + // they may also be set to point to empty structure... + int ret = ::mpg123_id3(mh, &pv1, &pv2); + + v1 = gcnew mpg123clr::id3::mpg123id3v1(pv1); + v2 = gcnew mpg123clr::id3::mpg123id3v2(pv2); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_icy([Out]IntPtr% icy_meta) +{ + char* _icy_meta; + + int ret = ::mpg123_icy(mh, &_icy_meta); + + icy_meta = (IntPtr) _icy_meta; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +array^ mpg123clr::mpg123::mpg123_icy2utf8(IntPtr icy_text) +{ + // TODO: Do we really need this? + // char* putf8 = mpg123_icy2utf8(const_cast(reinterpret_cast(icy_text.ToPointer()))); + + // Or is this adequate? + char* putf8 = ::mpg123_icy2utf8((const char*)(void*) icy_text); + + // WARN 4267 - clr limited to 32bit-length-size arrays!! + array^ ary = gcnew array((int)strlen(putf8)); + + Marshal::Copy((IntPtr)putf8, ary, 0, ary->Length); + free(putf8); + + return ary; +} + +#pragma endregion -Metadata Handling + +#pragma region Low Level I/O + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_replace_buffer(IntPtr data, size_t size) +{ + // "data" buffer should be fixed BEFORE calling this function. + + // TODO: to cast or not to cast?? + // return (mpg123clr::mpg::ErrorCode) mpg123_replace_buffer(mh, reinterpret_cast(data.ToPointer()), size); + + return (mpg123clr::mpg::ErrorCode) ::mpg123_replace_buffer(mh, (unsigned char*)(void*) data, size); +} + +size_t mpg123clr::mpg123::mpg123_outblock(void) +{ + return ::mpg123_outblock(mh); +} + +void mpg123clr::mpg123::_ReplaceReader(void) +{ + if ((readDel == r_readDel) && (seekDel == r_seekDel) + && (readHDel == r_readHDel) && (seekDel == r_seekHDel) && (cleanHDel == r_cleanHDel)) return; + + // readDel and seekDel are "keep alive" fields that prevent GC of the delegates. + // the underlying function pointers no not require "pinning". + + // Note: most examples use GCHandle::Alloc to "pin" the delegate but this is usually to prevent GC + // outside of function scope and is not strictly necessary here since readDel and seekDel never go + // out of scope. + + // See MS: c++, How to: Marshal Callbacks and Delegates Using C++ Interop + // for more details. + + readDel = r_readDel; + seekDel = r_seekDel; + readHDel = r_readHDel; + seekHDel = r_seekHDel; + cleanHDel = r_cleanHDel; + + // just for clarity + typedef off_t (_cdecl* SEEKCB)(int, off_t, int); + typedef ssize_t (_cdecl* READCB)(int, void*, size_t); + typedef off_t (_cdecl* HSEEKCB)(void*, off_t, int); + typedef ssize_t (_cdecl* HREADCB)(void*, void*, size_t); + typedef void (_cdecl* HCLEANCB)(void*); + + // NOTE: GetFunctionPointerForDelegate doesn't like nullptr + // NOTE: I'm not suggesting that replace_reader and replace_reader_handle should be + // intermingled, just trying to maintain a clean stack + + if (!useHandleReplacement) + { + if (lastReplacementWasHandle) + ::mpg123_replace_reader_handle(mh, nullptr, nullptr, nullptr); + + ::mpg123_replace_reader( + mh, + (readDel != nullptr) ? (READCB)(Marshal::GetFunctionPointerForDelegate(readDel)).ToPointer() : nullptr, + (seekDel != nullptr) ? (SEEKCB)(Marshal::GetFunctionPointerForDelegate(seekDel)).ToPointer() : nullptr + ); + } + else + { + if (!lastReplacementWasHandle) // can give redundant call on first use - microscopically inefficient - not catastrophic + ::mpg123_replace_reader(mh, nullptr, nullptr); + + ::mpg123_replace_reader_handle( + mh, + (readHDel != nullptr) ? (HREADCB)(Marshal::GetFunctionPointerForDelegate(readHDel)).ToPointer() : nullptr, + (seekHDel != nullptr) ? (HSEEKCB)(Marshal::GetFunctionPointerForDelegate(seekHDel)).ToPointer() : nullptr, + (cleanHDel != nullptr) ? (HCLEANCB)(Marshal::GetFunctionPointerForDelegate(cleanHDel)).ToPointer() : nullptr + ); + } + lastReplacementWasHandle = useHandleReplacement; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_replace_reader(ReadDelegate^ r_read, SeekDelegate^ r_lseek) +{ + // save temporary delegates to be implemented at next 'Open' + r_readDel = r_read; + r_seekDel = r_lseek; + r_readHDel = nullptr; + r_seekHDel = nullptr; + r_cleanHDel = nullptr; + useHandleReplacement = false; + + return mpg123clr::mpg::ErrorCode::ok; + +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_replace_reader_handle(ReadHandleDelegate^ rh_read, SeekHandleDelegate^ rh_lseek, CleanupHandleDelegate^ rh_clean) +{ + // save temporary delegates to be implemented at next 'Open' + r_readHDel = rh_read; + r_seekHDel = rh_lseek; + r_cleanHDel = rh_clean; + r_readDel = nullptr; + r_seekDel = nullptr; + useHandleReplacement = true; + + return mpg123clr::mpg::ErrorCode::ok; + +} + +#pragma endregion -Low Level I/O + +#pragma region MS Unicode Extension + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_topen(String^ path) +{ + _ReplaceReader(); // mpg123_tOpen will replace its own reader, this is just for consistency + + const _TCHAR* chars = (const _TCHAR*)(Marshal::StringToHGlobalUni(path)).ToPointer(); + + int ret = ::mpg123_topen(mh, chars); + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_tclose(void) +{ + // Not sure if t_close calls Cleanup (it shouldn't since t_open substitutes its own readers) + int ret = ::mpg123_tclose(mh); + + // Fairly sure replace_reader_handle, topen and tclose are incompatible, just for consistency + // See GCHandle.Free - caller must ensure Free called only once for a given handle. + if (userObjectHandle.IsAllocated) userObjectHandle.Free(); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +#pragma endregion -MS Unicode Extension + + diff --git a/ports/MSVC++/2008clr/mpg123clr/mpg123clr.h b/ports/MSVC++/2008clr/mpg123clr/mpg123clr.h new file mode 100644 index 0000000..e4bc94a --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/mpg123clr.h @@ -0,0 +1,953 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.10.0.0 30-Nov-09 release match - added mpg123_feature (mb) + 1.12.0.0 14-Apr-10 release match - added framebyframe and "handle" ReplaceReaders (mb) + 1.13.0.0 13-Jan-11 release match - added encsize (mb) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "enum.h" +#include "error.h" +#include "id3v1.h" +#include "id3v2.h" +#include "advanced.h" + +#include // for posix proof of concept only + +#include +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::IO; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + + + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see (Microsoft) Destructors and Finalizers in Visual C++] + // + // C++/CLI + // A myA; + // // use myA here + // + // Equivalent user code: + // + // A ^ myA = gcnew A; + // try { /* use myA here */ } finally { delete myA; } + // + // + // C# (from wikipedia) + // using(A myA = new A()) { /* Use myA here */ } + // Compiler calls myA.Dispose(), in a "finally" of a "try/finally" block + // + // Equivalent user code: + // + // A myA = new myA(); + // try { /* Use myA here */ } finally { myA.Dispose(); } + // + // Otherwise Finalizer will be nondeterministically called by GC + + + ///Wrapper for libmpg123. + public ref class mpg123 + { + +#pragma region Callback and Delegate + + // Functional callbacks for low-level I/O ReplaceReader + + public: + ///Seek Delegate. + ///Callback seek function to provide low-level stream access to posix-like seek operations. + /// Requires user supplied static callback fuction of form off_t fn(int fd, off_t offset, int origin). + ///Returns callee supplied resulting offset from start of file or -1 for error. + /// + ///Contains file descriptor. + ///Contains required offset value. + ///Contains relative origin value (whence) applied to offset. + ///Callee supplied resulting offset from start of file or -1 for error. + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate off_t SeekDelegate(int fd, off_t offset, int origin); + + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate off_t SeekHandleDelegate(void* handle, off_t offset, int origin); + + ///Read Delegate. + ///Callback read function to provide low-level stream access to posix-like read operations. + /// Requires user supplied static callback fuction of form ssize_t fn(int fd, void* buffer, size_t size). + ///Returns callee supplied resulting actual number of bytes read or -1 for error. + /// + ///Contains file descriptor. + ///Contains address of buffer. + ///Contains size of buffer. + ///Callee supplied resulting actual number of bytes read or -1 for error. + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate ssize_t ReadDelegate(int fd, void* buffer, size_t size); + + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate ssize_t ReadHandleDelegate(void* handle, void* buffer, size_t size); + + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate void CleanupHandleDelegate(void* handle); + + private: + // Delegate "keep alive" fields to prevent GC of delegate. + SeekDelegate^ seekDel; + ReadDelegate^ readDel; + + SeekHandleDelegate^ seekHDel; + ReadHandleDelegate^ readHDel; + CleanupHandleDelegate^ cleanHDel; + + GCHandle userObjectHandle; + + // Temporary delegate store, replacereader action is defered until next stream 'open' action + SeekDelegate^ r_seekDel; + ReadDelegate^ r_readDel; + + SeekHandleDelegate^ r_seekHDel; + ReadHandleDelegate^ r_readHDel; + CleanupHandleDelegate^ r_cleanHDel; + + bool useHandleReplacement; + bool lastReplacementWasHandle; + +#pragma endregion -Callback and Delegate + + +#pragma region Library and Handle Setup + + // \defgroup mpg123_init mpg123 library and handle setup + // + // Functions to initialise and shutdown the mpg123 library and handles. + // The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + // Tip: Use a RVA setting... + // + + private: + mpg123_handle* mh; + + internal: + mpg123(mpg123_handle* mh); + + protected: + ///Finalizer. + ///Cleanly handles mpg123_delete of internal (unmanaged) mpg123 handle. + /// Implementation of CLR Finalize(). + !mpg123(void); + + public: + ///Constructor. + ///Only creates mpg123 object, you must call one of the New() methods to obtain a decoder library handle. + ///Recommended usage: using(mpg123 obj = new mpg123()){ use obj here } + mpg123(void); + + ///Destructor. Used for final object deletion. + ///Calls finalizer for clean disposal of internal (unmanaged) library handles. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123(void); + + ///(mpg123_init) Function to initialise the mpg123 library. + ///This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + ///Returns MPG123_OK if successful, otherwise an error number. + ///Returns MPG123_OK if successful, otherwise an error number. + static mpg123clr::mpg::ErrorCode __clrcall mpg123_init(void); + + ///(mpg123_exit) Function to close down the mpg123 library. + ///This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + static void __clrcall mpg123_exit(void); + + ///(mpg123_new) Obtain am mpg123 handle with designated decoder. + ///Returns MPG123_OK or applicable error code. + /// + ///Name of the decoder to attach. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_new(String ^ decoder); + + ///Obtain an mpg123 handle with default decoder. + ///Returns MPG123_OK or applicable error code. + /// + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_new(void); + + ///Obtain am mpg123 handle with default decoder. + ///Allows use of common parms object for multiple connections. + ///Returns MPG123_OK or applicable error code. + /// + ///Supplied Advanced parameter object. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_parnew(mpg123clr::advpars^ par); + + ///Obtain am mpg123 handle with designated decoder. + ///Allows use of common parms object for multiple connections. + ///Returns MPG123_OK or applicable error code. + /// + ///Supplied Advanced parameter object. + ///Name of the decoder to attach. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_parnew(mpg123clr::advpars^ par, String^ decoder); + + ///(mpg123_delete) Delete internal mpg123 handle. + ///The framework will dispose of the object when it goes out of scope - you do not need to explicitly call Delete(). + /// However it is available to allow reuse of this object with successive handles - using New()/Delete() pairs. + /// + void __clrcall mpg123_delete(void); + + public: + + ///Set a specific parameter value. + ///Returns MPG123_OK or applicable error code. + /// + ///Define the parameter to be set. (parms enumeration) + ///Integer value to apply. + ///Real value to apply. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_param(mpg123clr::mpg::parms type, int val, double fval); + + ///Get a specific parameter value. + ///Returns MPG123_OK or applicable error code. + /// + ///Define the parameter to get. (parms enumeration) + ///Returned integer value. + ///Returned real value. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_getparam(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval); + + ///Query libmpg123 feature. + ///Returns 1 for success, 0 for unimplemented feature. + /// + ///Define the feature to query. (feature_set enumeration) + ///1 for success, 0 for unimplemented feature. + static int __clrcall mpg123_feature(mpg123clr::mpg::feature_set key); + +#pragma endregion -Library and Handle Setup + +#pragma region Internal Helpers + + internal: + array^ StringArrayFromPtr(const char ** ptr); + +#pragma endregion -Internal Helpers + +#pragma region Error Handling + + // \defgroup mpg123_error mpg123 error handling + // + // Functions to get text version of the error numbers and an enumeration + // of the error codes returned by libmpg123. + // + // Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + // Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + // The positive range of return values is used for "useful" values when appropriate. + // + + public: + + ///Get string describing what error has occured in the context of this object. + ///When a function operating on an mpg123 handle returns MPG123_ERR, you should use this function to check the actual reason. + ///This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. + ///Returns text representation of last error (incl. None) encountered by this object. + /// + ///Text representation of last error (incl. None) encountered by this object. + String^ __clrcall mpg123_strerror(void); + + ///Get last error encountered in the context of this object. + ///When a function operating on an mpg123 handle returns MPG123_ERR, you should use this function to check the actual reason. + ///This function will catch internal handle == NULL and return MPG123_BAD_HANDLE. + ///Returns ErrorCode for last encountered error. + /// + ///The plain errcode intead of a string of last error (incl. None) encountered by this object. + mpg123clr::mpg::ErrorCode __clrcall mpg123_errcode(void); + +#pragma endregion -Error Handling + +#pragma region Decoder Selection + + // \defgroup mpg123_decoder mpg123 decoder selection + // + // Functions to list and select the available decoders. + // Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + // + + public: + + ///Obtain list of generally available decoder names (plain 8bit ASCII). + ///Retuns a string array of generally available decoder names (plain 8bit ASCII). + /// + ///A string array of generally available decoder names (plain 8bit ASCII). + array^ __clrcall mpg123_decoders(void); + + ///Obtain list of the decoders supported by the CPU (plain 8bit ASCII). + ///Returns a string array of the decoders supported by the CPU (plain 8bit ASCII). + /// + ///A string array of the decoders supported by the CPU (plain 8bit ASCII). + array^ __clrcall mpg123_supported_decoders(void); + + ///Select the decoder to use. + ///Returns MPG123_OK or applicable error code. + /// + ///Name of the required decoder. (should be in SupportedDecoders list) + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_decoder(String^ name); + + ///Get the currently active decoder engine name. + ///The active decoder engine can vary depening on output constraints, mostly non-resampling, integer output is accelerated via 3DNow and Co. + /// but for other modes a fallback engine kicks in. + ///Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + ///Returns the decoder name or String.Empty on error. + /// + ///The decoder name or String.Empty on error. + String^ __clrcall mpg123_current_decoder(void); + +#pragma endregion -Decoder Selection + +#pragma region Output Audio Format + + // \defgroup mpg123_output mpg123 output audio format + // + // Functions to get and select the format of the decoded audio. + // + + public: + + ///Get an array of supported standard sample rates. + ///These are possible native sample rates of MPEG audio files. + /// You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + ///Returns array of sample rates. + /// + ///An array of sample rates. + array^ __clrcall mpg123_rates(void); + + ///An array of supported audio encodings. + ///An audio encoding is one of the fully qualified members of mpg.enc + ///Returns array of supported Encodings. + /// + ///An array of supported Encodings. + array^ __clrcall mpg123_encodings(void); + + ///Get the size (in bytes) of one mono sample of the named encoding. + ///Returns the positive size of encoding in bytes, 0 on invalid encoding. + /// + ///The encoding value to analyze. + ///The positive size of encoding in bytes, 0 on invalid encoding. + static int __clrcall mpg123_encsize(mpg123clr::mpg::enc encoding); + + ///Configure mpg123 to accept no output format at all. + ///Use to clear default parameters prior to applying specific settings. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_format_none(void); + + ///Configure mpg123 to accept all formats including any custom formats - this is the default. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_format_all(void); + + ///Configure detailed output formats. + ///Returns MPG123 error codes. + /// + ///Sample rate (Hertz) + ///Combination of channelcount.stereo and channelcount.mono + ///Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_format(int rate, mpg123clr::mpg::channelcount channels, mpg123clr::mpg::enc encodings); + + ///Get available support for supplied rate and encoding. + ///Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono. + /// + ///Sample rate (Hertz) + ///Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono. + mpg123clr::mpg::channelcount __clrcall mpg123_format_support(int rate, mpg123clr::mpg::enc encoding); + + ///Get current output format. + ///Returns MPG123 error codes. + /// + ///Returns current sample rate (Hertz) + ///Returns combination of channelcount.stereo and channelcount.mono + ///Returns combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_getformat([Out] int% rate, [Out] mpg123clr::mpg::channelcount% channels, [Out] mpg123clr::mpg::enc% encoding); + +#pragma endregion -Output Audio Format + +#pragma region File Input and Decoding + + // \defgroup mpg123_input mpg123 file input and decoding + // + // Functions for input bitstream and decoding operations. + // Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + // + + public: + + ///Open and prepare to decode the file specified by ANSI filename. + ///This does not open HTTP urls; the mpg library contains no networking code. + /// If you want to decode internet streams, use Open(fd) or Open(). + /// + ///Returns MPG123 error codes + /// + ///ANSI file path. Accepts ANSI path characters. For Unicode paths use tOpen. + /// NOTE: can be used in Unicode environment as long as wide-char codepages are avoided. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_open(String^ path); + + ///Use a previously obtained file descriptor as the bitstream input. + ///NOTE: Close() will NOT close a file opened with this method. + ///Returns MPG123 error codes. + /// + ///File Descriptor of pre required file. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_open_fd(int fd); + + ///Use an opaque handle as bitstream input. + ///This works only with the replaced I/O from mpg123_replace_reader_handle()! + ///mpg123_close() will call the cleanup callback for your handle (if you gave one). + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_open_handle(System::Object^ obj); + + ///Open a new bitstream and prepare for direct feeding. + ///This works together with Decode(); you are responsible for reading and feeding the input bitstream. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_open_feed(void); + + ///Closes the source, if the library opened it. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_close(void); + + ///Open and prepare to decode the file specified by UNICODE (wide-character) filename. + ///This does not open HTTP urls; the mpg library contains no networking code. + /// If you want to decode internet streams, use Open(fd) or Open(). + /// + ///Returns MPG123 error codes + /// + ///UNICODE wide-character file path. See also ANSI Open(path). + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_topen(String^ path); + + ///Closes the file opened with tOpen. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_tclose(void); + + ///Read from stream and decode. + ///Equivalent to mpg123_read(,,,) + ///Returns MPG123 error codes. (watch out for MPG123_DONE and friends!) + /// + ///Supplied buffer in which to return audio output data. + ///Returns number of actual audio output bytes returned. + ///MPG123 error codes. (watch out for MPG123_DONE and friends!) + mpg123clr::mpg::ErrorCode __clrcall mpg123_read(array^ buffer, [Out] size_t% count); + + ///Read from stream and decode. + ///Equivalent to mpg123_read(,,,) but modified to better support CLR Stream.Read + ///Returns MPG123 error codes. (watch out for MPG123_DONE and friends!) + /// + ///Supplied buffer in which to return audio output data. + ///Offset in buffer at which to begin storing data. + ///Maximum number of bytes to return. + ///Returns number of actual audio output bytes returned. + ///MPG123 error codes. (watch out for MPG123_DONE and friends!) + mpg123clr::mpg::ErrorCode __clrcall mpg123_read(array^ buffer, size_t offset, size_t size, [Out] size_t% count); + + ///Feed data for a stream that has been opened with Open() - (mpg123_open_feed). + ///Equivalent to mpg123_feed(...), it's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + ///Returns MPG123 error codes. + /// + ///Input buffer. + ///Number of input bytes. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_feed(array^ inbuffer, size_t size); + + ///Decode MPEG Audio from inmemory to outmemory. + ///This is very close to a drop-in replacement for old mpglib. + ///When you give zero-sized output buffer the input will be parsed until + /// decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + /// without taking decoded data. + ///Think of this function being the union of Read() and Feed() (which it actually is, sort of;-). + /// You can actually always decide if you want those specialized functions in separate steps or one call this one here. + ///Returns MPG123 error codes. (watch out especially for MPG123_NEED_MORE) + /// + ///Input buffer. + ///Number of input bytes. + ///Supplied buffer in which to return audio output data. + ///Size in bytes of buffer. + ///Returns number of actual audio output bytes returned. + ///MPG123 error codes. (watch out especially for MPG123_NEED_MORE) + mpg123clr::mpg::ErrorCode __clrcall mpg123_decode(array^ inbuffer, size_t insize, array^ outbuffer, size_t outsize, [Out] size_t% count); + + ///Decode next MPEG frame to internal buffer or read a frame and return after setting a new format. + ///Returns MPG123 error codes. (watch out for MPG123_NEW_FORMAT) + /// + ///Returns current frame offset. + ///Returns pointer to internal buffer to read the decoded audio from. (Can be NULL for NEW_FORMAT) + ///Returns number of actual audio output bytes ready in the buffer. + ///MPG123 error codes. (watch out for MPG123_NEW_FORMAT) + mpg123clr::mpg::ErrorCode __clrcall mpg123_decode_frame([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% count); + + ///Decode current MPEG frame to internal buffer. + ///Use with mpg123_framebyframe_next to progress through data. + ///Warning: This is experimental API that might change in future releases! + /// Please watch mpg123 development closely when using it. + ///Returns MPG123 error codes. + /// + ///Returns current frame offset. + ///Returns pointer to internal buffer to read the decoded audio from. (Can be NULL for NEW_FORMAT) + ///Returns number of actual audio output bytes ready in the buffer. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_framebyframe_decode([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% bytes); + + ///Find, read and parse the next mp3 frame. + ///Use with mpg123_framebyframe_decode to obtain frame data. + ///Warning: This is experimental API that might change in future releases! + /// Please watch mpg123 development closely when using it. + ///Returns MPG123 error codes. (watch out for MPG123_NEW_FORMAT) + /// + ///MPG123 error codes. (watch out for MPG123_NEW_FORMAT) + mpg123clr::mpg::ErrorCode __clrcall mpg123_framebyframe_next(void); + +#pragma endregion -File Input and Decoding + +#pragma region Position and Seeking + + // \defgroup mpg123_seek mpg123 position and seeking + // + // Functions querying and manipulating position in the decoded audio bitstream. + // The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + // If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + // The general usage is modelled after stdlib's ftell() and fseek(). + // Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + // - SEEK_SET: set position to (or near to) specified offset + // - SEEK_CUR: change position by offset from now + // - SEEK_END: set position to offset from end + // + // Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + // Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + // Short: When you care about the sample position, don't mess with those parameters;-) + // Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + // + + public: + + ///Get the current position in samples. On the next read, you'd get that sample. + ///Returns the current sample position. + /// + ///The current sample position. + long long __clrcall mpg123_tell(); + + ///Get the frame number that the next read will give you data from. + ///Returns the current frame number position. + /// + ///The current frame number position. + long long __clrcall mpg123_tellframe(); + + ///Get the current byte offset in the input stream. + ///Returns the current byte offset. + /// + ///The current byte offset. + long long __clrcall mpg123_tell_stream(); + + ///Seek to a desired sample offset. + ///Returns the resulting offset >= 0 or error/message code. + /// + ///The distance to move. + ///(whence) The relative location to move from.(SeekOrigin.Begin, SeekOrigin.Current, SeekOrigin.End) + ///Returns the resulting offset >= 0 or error/message code. + long long __clrcall mpg123_seek(long long offset, SeekOrigin origin); + + ///Seek to a desired sample offset in data feeding mode. + ///This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + ///Returns the resulting offset >= 0 or error/message code. + /// + ///The distance to move. + ///(whence) The relative location to move from.(SeekOrigin.Begin, SeekOrigin.Current, SeekOrigin.End) + ///Returns the position it expects to be at the next time data is fed to Decode(). + ///Returns the resulting offset >= 0 or error/message code. + long long __clrcall mpg123_feedseek(long long offset, SeekOrigin origin, [Out] long long% input_offset); + + ///Seek to a desired MPEG frame index. + ///Returns the resulting offset >= 0 or error/message code. + /// + ///The numberof frames to move. + ///(whence) The relative location to move from.(SEEK_SET, SEEK_CUR or SEEK_END) + ///Returns the resulting offset >= 0 or error/message code. + long long __clrcall mpg123_seek_frame(long long frameoffset, SeekOrigin origin); + + ///Seek to an absolute MPEG frame offset corresponding to an offset in seconds. + ///This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + ///Returns the resulting offset >= 0 or error/message code. + /// + ///The absolute time offset required. + ///Returns the resulting offset >= 0 or error/message code. + long long __clrcall mpg123_timeframe(double seconds); + + ///Get a copy of the frame index table. Somewhat equivalent to mpg123_index(,,). + ///The library requests not to modify table values. Since this is a copy, modification is meaningless - it has no effect on library routines. + ///NOTE: The returned index table value types are Int64 independant of library build. + ///Returns MPG123 error codes. + /// + ///Returns array of source file position offsets (not output samples). Length of array is equivalent to mpg123_index "fill" parameter. + ///Returns number of MPEG frames per index entry. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_index([Out] array^% index, [Out] long long% step); + + ///Get a pointer to the frame index table. Equivalent to mpg123_index(,,). + ///Do not modify table values unless you really know what you are doing! + ///NOTE: The returned index table value types may be Int32 or Int64 depending on library build. + ///Returns MPG123 error codes. + /// + ///Returns pointer to source file position offset index array (not output samples). + ///Returns number of MPEG frames per index entry. + ///Returns number of recorded index offsets; size of the array. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_index([Out] IntPtr% indexarr, [Out] long long% step, [Out] size_t% fill); + + ///Get information about current and remaining frames/seconds. Equivalent to mpg123_position(,,,,,,). + ///WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + ///You provide an offset (in frames) from now and a number of output bytes + /// served by libmpg123 but not yet played. You get the projected current frame + /// and seconds, as well as the remaining frames/seconds. This does _not_ care + /// about skipped samples due to gapless playback. + ///Returns MPG123 error codes. + /// + ///Offset (in frames) from now. + ///Number of output bytes served by library but not yet played. + ///Returns projected current frame. + ///Returns projected frames remaining. + ///Returns projected current seconds. + ///Returns projected seconds remaining. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_position(long long frameoffset, long long bufferedbytes, + [Out] long long% currentframe, [Out] long long% framesleft, + [Out] double% currentseconds, [Out] double% secondsleft); + +#pragma endregion -Position and Seeking + +#pragma region Volume and Equalizer + + // \defgroup mpg123_voleq mpg123 volume and equalizer + // + + public: + + ///Set the 32 Band Audio Equalizer settings. + ///Returns MPG123 error codes. + /// + ///Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. (enum mpg.channels) + ///The equaliser band to change (from 0 to 31) + ///The (linear) adjustment factor to be applied. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_eq(mpg123clr::mpg::channels channel, int band, double fval); + + ///Get the 32 Band Audio Equalizer settings. + ///Rreturns the (linear) adjustment factor. + /// + ///Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. (enum mpg.channels) + ///The equaliser band to get (from 0 to 31) + ///The (linear) adjustment factor. + double __clrcall mpg123_geteq(mpg123clr::mpg::channels channel, int band); + + ///Reset the 32 Band Audio Equalizer settings to flat. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_reset_eq(); + + ///Set the absolute output volume including the RVA setting. + ///Returns MPG123 error codes. + /// + ///The (linear) adjustment factor to be applied, volume < 0 just applies (a possibly changed) RVA setting. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_volume(double volume); + + ///Adjust output volume including the RVA setting. + ///Returns MPG123 error codes. + /// + ///The (linear) adjustment factor to be applied. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_volume_change(double change); + + ///Get the current volume setting, the actual value due to RVA, and the RVA adjustment itself. + ///Returns MPG123 error codes. + /// + ///Returns the current linear volume factor. (not percent) + ///Returns the actual linear volume factor due to RVA. (not percent) + ///Returns the RVA adjustment in decibels. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_getvolume([Out] double% basevol, [Out] double% really, [Out] double% rva_db); + +#pragma endregion -Volume and Equalizer + +#pragma region Status and Information + + // \defgroup mpg123_status mpg123 status and information + // + // + // + + [StructLayout(LayoutKind::Sequential, CharSet=CharSet::Ansi, Pack=1)] + ref struct mpeg_frameinfo + { + mpg123clr::mpg::mpeg_version version; // The MPEG version (1.0/2.0/2.5). + int layer; // The MPEG Audio Layer (MP1/MP2/MP3). + long rate; // The sampling rate in Hz. + mpg123clr::mpg::mpeg_mode mode; // The audio mode (Mono, Stereo, Joint-stero, Dual Channel). + int mode_ext; // The mode extension bit flag. + int framesize; // The size of the frame (in bytes). + mpg123clr::mpg::mpeg_flags flags; // MPEG Audio flag bits. + int emphasis; // The emphasis type. + int bitrate; // Bitrate of the frame (kbps). + int abr_rate; // The target average bitrate. + mpg123clr::mpg::mpeg_vbr vbr; // The VBR mode. + }; + + ///Get the frame information about the MPEG audio bitstream. + ///Returns MPG123 error codes. + /// + ///Returns the frame information. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_info([Out]mpeg_frameinfo^% finfo); + + ///Get the frame information about the MPEG audio bitstream. + ///SafeInfo uses "safe" managed structures but is somewhat slower than Info(). + /// Recommend using Info() unless it gives specific problems. + ///Returns MPG123 error codes. + /// + ///Returns the frame information. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_safeinfo([Out]mpeg_frameinfo^% finfo); + + ///Get the safe output buffer size for all cases (when you want to replace the internal buffer). + ///Returns safe buffer size. + /// + ///Safe buffer size. + static size_t __clrcall mpg123_safe_buffer(void); + + ///Make a full parsing scan of each frame in the file. + ///ID3 tags are found. An accurate length value is stored. Seek index will be filled. + /// A seek back to current position is performed. + ///This function refuses work when stream is not seekable. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_scan(void); + + ///Return, if possible, the full (expected) length of current track in samples. + ///Returns length (>= 0) or MPG123_ERR if there is no length guess possible. (Multiply by BlockAlign for byte-count) + /// + ///Length (>= 0) or MPG123_ERR if there is no length guess possible. (Multiply by BlockAlign for byte-count) + long long __clrcall mpg123_length(void); + + ///Override the value for file size in bytes. + ///Useful for getting sensible track length values in feed mode or for HTTP streams. + ///Returns MPG123 error codes. + /// + ///Size to set. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_set_filesize(long long size); + + ///Time Per Frame (seconds). + ///Returns time per frame in seconds ( < 0 is error ). + /// + ///Time per frame in seconds ( < 0 is error ). + double __clrcall mpg123_tpf(void); + + ///Get and reset the clip count. + ///Returns the number of previously encountered clips. + /// + ///The number of previously encountered clips. + long __clrcall mpg123_clip(); + + ///Get various current decoder/stream state information. + ///Returns MPG123 error codes. + /// + ///The key to identify the information to get (enum mpg.state). + ///Returns integer values. + ///Returns real values. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_getstate(mpg123clr::mpg::state key, [Out] int% val, [Out] double% fval); + +#pragma endregion -Status and Information + +#pragma region Metadata Handling + + // \defgroup mpg123_metadata mpg123 metadata handling + // + // Functions to retrieve the metadata from MPEG Audio files and streams. + // Also includes string handling functions. + // + + // clr - much of the metadata has been relocated to class files for maintainability + // see string.h, text.h, id3v1.h and id3v2.h + // + + ///Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + ///Returns a combination of flags. (enum id3.id3check) + /// + ///Returns a combination of flags. (enum id3.id3check) + mpg123clr::id3::id3check __clrcall mpg123_meta_check(void); /* On error (no valid handle) just 0 is returned. */ + + ///Get ID3 data. Data structures may change on any (next) read/decode function call. + ///v1 and/or v2 may be Empty if no corresponding data exists. + ///Returns MPG123_OK or MPG123_ERR. + /// + ///Returns mpg123id3v1 data structure containing ID3v1 data (usually from end of file). + ///Returns mpg123id3v2 data structure containing ID3v2 data (usually - but not restricted to - from beginning of file). + ///Returns MPG123_OK or MPG123_ERR. + mpg123clr::mpg::ErrorCode __clrcall mpg123_id3([Out]id3::mpg123id3v1^% v1, [Out]id3::mpg123id3v2^% v2); + + ///Get ICY meta data. Data structure may change on any (next) read/decode function call. + ///Icy_meta may be null if no corresponding data exists. + ///Returns MPG123_OK or MPG123_ERR. + /// + ///Returns ICY meta data (windows-1252 encoded). + ///Returns MPG123_OK or MPG123_ERR. + mpg123clr::mpg::ErrorCode __clrcall mpg123_icy([Out]IntPtr% icy_meta); /* same for ICY meta string */ + + ///Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + ///Returns byte array of utf8 encoded data. + /// + ///ICY meta data in ICY encoding. + ///Returns byte array of utf8 encoded data. + static array^ __clrcall mpg123_icy2utf8(IntPtr icy_text); + +#pragma endregion -Metadata Handling + +#pragma region Advanced Parameter API + + // \defgroup mpg123_advpar mpg123 advanced parameter API + // + // Direct access to a parameter set without full handle around it. + // Possible uses: + // - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + // - Use one set of parameters for multiple handles. + // + // The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + // family) directly return a fully qualified mpg123 error code, the ones + // operating on full handles normally MPG123_OK or MPG123_ERR, storing the + // specific error code itself inside the handle. + // + + // see advanced.h + +#pragma endregion -Advanced Parameter API + +#pragma region Low Level I/O + + // \defgroup mpg123_lowio mpg123 low level I/O + // You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + // + + ///Replace default internal buffer with user-supplied buffer. + ///Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. + ///The data buffer should be pinned before calling this function. + ///Returns MPG123_OK or MPG123 error code. + /// + ///Pointer to supplied buffer. + ///Size of supplied buffer. + ///MPG123_OK or MPG123_ERR code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_buffer(IntPtr data, size_t size); + + ///The max size of one frame's decoded output with current settings. + ///Use that to determine an appropriate minimum buffer size for decoding one frame. + ///Returns size of required buffer. + /// + ///Size of required buffer. + size_t __clrcall mpg123_outblock(void); + + ///Replace low-level stream access functions; read and lseek as known in POSIX. + ///You can use this to make any fancy file opening/closing yourself, + /// using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a 'real' file descriptor...). + ///Setting a function to NULL means that the default internal function is used (active from next Open call onward). + ///////////////////////// + ///Always returns MPG123_OK. + /// + ///Delegate for read function, null for default. + ///Delegate for lseek function, null for default. + ///Always MPG123_OK. + mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_reader(ReadDelegate^ r_read, SeekDelegate^ r_lseek); + + /////////////////////////////////////// + mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_reader_handle(ReadHandleDelegate^ rh_read, SeekHandleDelegate^ rh_lseek, CleanupHandleDelegate^ rh_clean); + + private: + + // Defered internal implementation of ReplaceReader - action is defered until next 'Open' operation. + void __clrcall _ReplaceReader(void); + + public: + + // These functions are not part of the mpg123clr wrapper but are included as proof of concept + // of how to implement callback functions. + + ///Proof of concept posix-like lseek function. + ///This routine should not normally be called from your callback routine, it is a sample function + /// showing how such a callback could be implemented. + /// + ///File descriptor. + ///Required position. + ///Whence. + ///Resultant position. + static long PosixSeek(int fd, long offset, int origin) + { + long ret = _lseek(fd, offset, origin); + return ret; + } + + ///Proof of concept posix-like read function. + ///This routine should not normally be called from your callback routine, it is a sample function + /// showing how such a callback could be implemented. + /// + ///File descriptor. + ///Buffer address. + ///Size of buffer. + ///Actual bytes read. + static int PosixRead(int fd, void*buf, unsigned int count) + { + int ret = _read(fd, buf, count); + return ret; + } + +#pragma endregion -Low Level I/O + + }; + +} \ No newline at end of file diff --git a/ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc b/ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc new file mode 100644 index 0000000..be9f220 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc @@ -0,0 +1,102 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,13,0,0 + PRODUCTVERSION 1,13,0,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "mpg123 Project" + VALUE "FileDescription", "mpg123clr Dynamic Link Library" + VALUE "FileVersion", "1, 13, 0, 0" + VALUE "InternalName", "mpg123clr" + VALUE "LegalCopyright", "2009-2011 - the mpg123 project" + VALUE "OriginalFilename", "mpg123clr.dll" + VALUE "ProductName", "mpg123 Common Language Runtime Dynamic Link Library" + VALUE "ProductVersion", "1, 13, 0, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj b/ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj new file mode 100644 index 0000000..8c1f2bf --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/MSVC++/2008clr/mpg123clr/resource.h b/ports/MSVC++/2008clr/mpg123clr/resource.h new file mode 100644 index 0000000..250c6a2 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by mpg123clr.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/ports/MSVC++/2008clr/mpg123clr/stdafx.cpp b/ports/MSVC++/2008clr/mpg123clr/stdafx.cpp new file mode 100644 index 0000000..42146a7 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// mpg123clr.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/ports/MSVC++/2008clr/mpg123clr/stdafx.h b/ports/MSVC++/2008clr/mpg123clr/stdafx.h new file mode 100644 index 0000000..8a4c94f --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/stdafx.h @@ -0,0 +1,38 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here + +struct mpg123_pars_struct{}; +struct mpg123_handle_struct{}; \ No newline at end of file diff --git a/ports/MSVC++/2008clr/mpg123clr/string.cpp b/ports/MSVC++/2008clr/mpg123clr/string.cpp new file mode 100644 index 0000000..cc27096 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/string.cpp @@ -0,0 +1,166 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) + 1.13.0.0 13-Jan-11 release match - added strlen (mb) +*/ + +#include "StdAfx.h" +#include "string.h" + +// Constructor for overlaid instance (instanced) +mpg123clr::mpg123str::mpg123str(void) +{ + instanced = true; + sb = new ::mpg123_string; + mpg123_init_string(); + +} + +// Constructor for mpg123_string handle instance (referenced) +mpg123clr::mpg123str::mpg123str(mpg123_string* sb) +{ + instanced = false; + this->sb = sb; +} + +mpg123clr::mpg123str::mpg123str(const char* str) +{ + instanced = true; + sb = new ::mpg123_string; + mpg123_init_string(); + + ::mpg123_set_string(sb, str); +} + +// Destructor cleans up all resources +mpg123clr::mpg123str::~mpg123str(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123str(); +} + +// Finalizer cleans up unmanaged resources +mpg123clr::mpg123str::!mpg123str(void) +{ + if (instanced && (sb != nullptr)) mpg123_free_string(); +} + +int mpg123clr::mpg123str::mpg123_add_string(String ^ s) +{ + return mpg123_add_substring(s, 0, s->Length); +} + +int mpg123clr::mpg123str::mpg123_add_substring(String ^ s, int from, int count) +{ + // convert CLR string to CLI string + using namespace Runtime::InteropServices; + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(s->Substring(from, count))).ToPointer(); + + // add mpg123_string info + int ret = ::mpg123_add_string(sb, chars); + + // free temporary memory + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return ret; +} + +int mpg123clr::mpg123str::mpg123_copy_string(mpg123str^ to) +{ + return ::mpg123_copy_string(sb, to->sb); +} + +void mpg123clr::mpg123str::mpg123_free_string() +{ + ::mpg123_free_string(sb); +} + +int mpg123clr::mpg123str::mpg123_grow_string(int newSize) +{ + return ::mpg123_grow_string(sb, newSize); +} + +int mpg123clr::mpg123str::mpg123_resize_string(int newSize) +{ + return ::mpg123_resize_string(sb, newSize); +} + +void mpg123clr::mpg123str::mpg123_init_string() +{ + ::mpg123_init_string(sb); +} + +int mpg123clr::mpg123str::mpg123_set_string(String ^ s) +{ + return mpg123_set_substring(s, 0, s->Length); +} + +int mpg123clr::mpg123str::mpg123_set_substring(String ^ s, int from, int count) +{ + // convert CLR string to CLI string + using namespace Runtime::InteropServices; + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(s->Substring(from, count))).ToPointer(); + + // set mpg123_string info + int ret = ::mpg123_set_string(sb, chars); + + // free temporary memory + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return ret; +} + +long long mpg123clr::mpg123str::mpg123_strlen(bool utf8) +{ + // TODO: determine use for utf8 vs ansi + return ::mpg123_strlen(sb, utf8); +} + +int mpg123clr::mpg123str::Fill::get() +{ + // WARN 4267 - clr limited to 32bit-length-size strings by PtrToStringAnsi + return (int)sb->fill; +} + +int mpg123clr::mpg123str::Size::get() +{ + // WARN 4267 - clr limited to 32bit-length-size strings by PtrToStringAnsi + return (int)sb->size; +} + +String^ mpg123clr::mpg123str::Text::get() +{ + if (sb->fill == 0) return gcnew String(""); + + // WARN 4267 - clr limited to 32bit-length-size strings by PtrToStringAnsi + return Marshal::PtrToStringAnsi((IntPtr)sb->p, (int)strnlen(sb->p, sb->fill)); +} + +mpg123clr::mpg123str::text_encoding mpg123clr::mpg123str::mpg123_enc_from_id3(unsigned char id3_enc_byte) +{ + return (mpg123clr::mpg123str::text_encoding) ::mpg123_enc_from_id3(id3_enc_byte); +} + +int mpg123clr::mpg123str::mpg123_store_utf8(text_encoding enc, const unsigned char *source, size_t source_size) +{ + return ::mpg123_store_utf8(sb, (mpg123_text_encoding)enc, source, source_size); +} diff --git a/ports/MSVC++/2008clr/mpg123clr/string.h b/ports/MSVC++/2008clr/mpg123clr/string.h new file mode 100644 index 0000000..19bb862 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/string.h @@ -0,0 +1,265 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 16-Sep-09 1.9.0 Update - add enc_from_id3, store_utf8 + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.13.0.0 13-Jan-11 release match - added strlen (mb) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see Destructors and Finalizers in Visual C++] + // + // A ^ myA = gcnew A; + // try + // { + // use myA + // } + // finally + // { + // delete myA; + // } + + + ///Wrapper for mpg123_string. + ///mpg123str can be used as both (publicly) an instance object and (privately) a reference object. + /// Construction and Finalizer operations perform differently depending on the instance type... + /// + ///Instanced: i.e. new mpg123str(); + /// Normal operation of any object. Construction initializes memory and Destruction frees memory. + /// + ///Referenced: i.e. new mpg123str(sb); + /// Construction and Destruction have no effect on the referenced object, mpg123str objects may be freely + /// made and deleted without affecting the referenced object. + /// + ///However! + /// + ///All methods operate on the referenced object (and NOT a copy of the object), the underlying mpg123_string + /// is directly modified in situ. Therefore the referenced object can be initialized and disposed by + /// explicitly calling Init() and Free(). + ///The length of strings is limited to a 32bit value due to limitations of the CLI marshaler. + /// + /// + [StructLayout(LayoutKind::Sequential, CharSet=CharSet::Ansi)] + public ref struct mpg123str + { + + public: + + ///text_encoding enumeration. + enum class text_encoding + { + text_unknown = mpg123_text_unknown, /// Unkown encoding... mpg123_id3_encoding can return that on invalid codes. + text_utf8 = mpg123_text_utf8, /// UTF-8 + text_latin1 = mpg123_text_latin1, /// ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. + text_icy = mpg123_text_icy, /// ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. + text_cp1252 = mpg123_text_cp1252, /// Really CP-1252 without any guessing. + text_utf16 = mpg123_text_utf16, /// Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + /// When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + /// you don't mess with the reserved code points. If you want to decode little endian data + /// without BOM you need to prepend 0xff 0xfe yourself. + text_utf16bom = mpg123_text_utf16bom, /// Just an alias for UTF-16, ID3v2 has this as distinct code. + text_utf16be = mpg123_text_utf16be, /// Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + /// BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + /// One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + /// types (we expect a BOM before real data there), not so for utf16be! + text_max = mpg123_text_max /// Placeholder for the maximum encoding value. + }; + + ///id3_enc enumeration. + enum class id3_enc + { + id3_latin1 = mpg123_id3_latin1, /// Note: This sometimes can mean anything in practice... + id3_utf16bom = mpg123_id3_utf16bom, /// UTF16, UCS-2 ... it's all the same for practical purposes. + id3_utf16be = mpg123_id3_utf16be, /// Big-endian UTF-16, BOM see note for mpg123_text_utf16be. + id3_utf8 = mpg123_id3_utf8, /// Our lovely overly ASCII-compatible 8 byte encoding for the world. + id3_enc_max = mpg123_id3_enc_max /// Placeholder to check valid range of encoding byte. + }; + + + private: + mpg123_string* sb; + bool instanced; + + internal: + ///Reference Constructor. Does nothing to referenced mpg123_string structure. + ///Reference objects may be freely created and deleted without affecting the underlying mpg123_string object. + /// However, operations on the referenced object do modify the object in-situ (i.e. 'this' is not a 'copy'), and + /// the referenced object may be explicitly initialized and disposed by calling the appropriate methods. (Init() and Free()) + ///Recommended usage: using(mpg123str obj = new mpg123str(sb)){ use obj here } + /// + mpg123str(mpg123_string* sb); + + ///Internal Constructor. + ///Only used on empty fields. + /// + mpg123str(const char* str); + + protected: + ///Finalizer. + ///Cleanly handles mpg123_free_string of instanced mpg123_string object. + ///Does not dispose referenced mpg123_string object. Referenced objects may be explicitly disposed by using Free(). + /// + /// Implementation of CLR Finalize(). + !mpg123str(void); + + public: + ///Constructor, also initializes underlying mpg123_string structure. + ///Instanced objects automatically dispose of underlying mpg123_string object. + ///Recommended usage: using(mpg123str obj = new mpg123str(sb)){ use obj here } + /// + mpg123str(void); + + ///Destructor. Used for final object deletion. + ///Instance objects call the finalizer for clean disposal of internal mpg123_string object. + ///Reference objects may be freely deleted without affecting the underlying mpg123_string object. + /// However, the referenced object may be explicitly disposed by calling Free() + /// + // Implementation of CLR Dispose(). + // ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + // See Destructors and Finalizers in Visual C++ + ~mpg123str(void); + + ///Append a C# string to this mpg123str. + ///Returns 0 on error, 1 on success. + /// + ///String to be appended. + ///0 on error, 1 on success. + int __clrcall mpg123_add_string(String ^ s); + + ///Append a C# substring to this mpg123str. + ///Returns 0 on error, 1 on success. + /// + ///String to be appended. + ///String offset to copy from. + ///Number of characters to copy. (a null byte is always appended) + ///0 on error, 1 on success. + int __clrcall mpg123_add_substring(String ^ s, int from, int count); + + ///Copy the contents of this string to another. + ///Returns 0 on error, 1 on success. + /// + ///Where to copy this string to. + ///0 on error, 1 on success. + int __clrcall mpg123_copy_string(mpg123str^ to); + + ///Free-up mempory for an existing mpg123_string. + /// + void __clrcall mpg123_free_string(void); + + ///Increase size of a mpg123_string if necessary (it may stay larger). + ///Returns 0 on error, 1 on success. + /// + ///Required size. + ///0 on error, 1 on success. + int __clrcall mpg123_grow_string(int newSize); + + ///Change the size of a mpg123_string. + ///Returns 0 on error, 1 on success. + /// + ///Required size. + ///0 on error, 1 on success. + int __clrcall mpg123_resize_string(int newSize); + + ///Create and allocate memory for a new mpg123_string. + /// + void __clrcall mpg123_init_string(void); + + ///Set the contents to a C# string. + ///Returns 0 on error, 1 on success. + /// + ///String to be applied. + ///0 on error, 1 on success. + int __clrcall mpg123_set_string(String ^ s); + + ///Set the contents to a C# substring. + ///Returns 0 on error, 1 on success. + /// + ///String to be applied. + ///String offset to copy from. + ///Number of characters to copy. (a null byte is always appended) + ///0 on error, 1 on success. + int __clrcall mpg123_set_substring(String ^ s, int from, int count); + + ///Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + ///Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. + ///Returns the character count. + /// + ///Flag to tell if the string is in utf8 encoding. + ///Character count. + long long __clrcall mpg123_strlen(bool utf8); + + ///Get the number of used bytes. (including closing zero byte). + ///Property returns the number of used bytes. + /// + ///The number of used bytes. + property int Fill{int __clrcall get();} // property + + ///Get the number of bytes allocated. + ///Property returns the number of bytes allocated. + /// + ///The number of bytes allocated. + property int Size{int __clrcall get();} // property + + ///Get a C# string representation of the mpg123str. + ///Property returns C# string text. + /// + ///C# string text. + property String^ Text{String^ __clrcall get();} + +// 1.9.0.0 +add + + ///Convert ID3 encoding byte to mpg123 encoding index. + ///Returns the text_encoding enum of the converted value. + /// + ///The ID3 encoding byte to be converted. + ///The text_encoding enum of the converted value. + static text_encoding __clrcall mpg123_enc_from_id3(unsigned char id3_enc_byte); + + ///Store text data in string, after converting to UTF-8 from indicated encoding. + ///A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + /// Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + ///CLR - e.g. UnicodeEncoding(true, true) works with utf16be. + ///Returns 0 on error, 1 on success (on error, mpg123_free_string is called on sb). + /// + ///Mpg123 text encoding value. + ///Source buffer with plain unsigned bytes. + ///Number of bytes in the source buffer. + ///0 on error, 1 on success (on error, mpg123_free_string is called on sb). + int __clrcall mpg123_store_utf8(text_encoding enc, const unsigned char *source, size_t source_size); + +// 1.9.0.0 -add + + }; + +} diff --git a/ports/MSVC++/2008clr/mpg123clr/targetver.h b/ports/MSVC++/2008clr/mpg123clr/targetver.h new file mode 100644 index 0000000..f583181 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/targetver.h @@ -0,0 +1,24 @@ +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. +#endif diff --git a/ports/MSVC++/2008clr/mpg123clr/text.cpp b/ports/MSVC++/2008clr/mpg123clr/text.cpp new file mode 100644 index 0000000..e07ffd8 --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/text.cpp @@ -0,0 +1,67 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#include "StdAfx.h" +#include "text.h" + +mpg123clr::mpg123text::mpg123text(void) +{ +} + +mpg123clr::mpg123text::mpg123text(mpg123_text* sb) +{ + this->sb = sb; +} + +// Destructor +mpg123clr::mpg123text::~mpg123text(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123text(); +} + +// Finalizer +mpg123clr::mpg123text::!mpg123text(void) +{ +} + +String^ mpg123clr::mpg123text::lang::get() +{ + return Marshal::PtrToStringAnsi((IntPtr)sb->lang, (int)strnlen(sb->lang, 3)); +} + +String^ mpg123clr::mpg123text::id::get() +{ + return Marshal::PtrToStringAnsi((IntPtr)sb->id, (int)strnlen(sb->id, 4)); +} + +String^ mpg123clr::mpg123text::description::get() +{ + mpg123str^ str = gcnew mpg123str(&sb->description); + return str->Text; +} + +String^ mpg123clr::mpg123text::text::get() +{ + mpg123str^ str = gcnew mpg123str(&sb->text); + return str->Text; +} diff --git a/ports/MSVC++/2008clr/mpg123clr/text.h b/ports/MSVC++/2008clr/mpg123clr/text.h new file mode 100644 index 0000000..32160cd --- /dev/null +++ b/ports/MSVC++/2008clr/mpg123clr/text.h @@ -0,0 +1,111 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "string.h" + +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see Destructors and Finalizers in Visual C++] + // + // A ^ myA = gcnew A; + // try + // { + // use myA + // } + // finally + // { + // delete myA; + // } + + + ///Wrapper for mpg123_text. + [StructLayout(LayoutKind::Sequential, CharSet=CharSet::Ansi)] + public ref struct mpg123text + { + private: + mpg123_text* sb; + + internal: + ///Constructor. + ///Recommended usage: only as tracking marker to existing mpg123_text objects. + mpg123text(void); + + ///Reference Constructor. + ///Recommended usage: only as tracking marker to existing mpg123_text objects. + mpg123text(mpg123_text* sb); + + protected: + ///Finalizer. + ///Does nothing. mpg123text can only be instanced as a reference to an existing mpg123_text object (which is responsible for its own disposal. + /// Implementation of CLR Finalize(). + !mpg123text(void); + + public: + ///Destructor. Used for final object deletion. + ///Calls finalizer. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123text(void); + + ///Get a string representation of the 3-letter language code. + ///Only COMM and USLT have a language element. + ///Property returns string representation of the 3-letter language code. + /// + ///String representation of the 3-letter language code. + property String^ lang{String^ __clrcall get();} + + ///Get a string representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.) + ///Property returns string representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.) + /// + ///String representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.) + property String^ id{String^ __clrcall get();} + + ///Get a string representation of the description field. + ///Only COMM and TXXX have a description element. + ///Property returns string representation of the description field. + /// + ///String representation of the description field. + property String^ description{String^ __clrcall get();} + + ///Get a string representation of the ID3 tag text. + ///This is for COMM, TXXX and all the other text fields. + ///Property returns string representation of the ID3 tag text. + /// + ///String representation of the ID3 tag text. + property String^ text{String^ __clrcall get();} + + }; +} diff --git a/ports/MSVC++/2015/uwp/libmpg123.sln b/ports/MSVC++/2015/uwp/libmpg123.sln new file mode 100644 index 0000000..ac604da --- /dev/null +++ b/ports/MSVC++/2015/uwp/libmpg123.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpg123", "libmpg123\libmpg123.vcxproj", "{2411FC2F-79ED-4787-A143-DE3644B0FBF5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|ARM.ActiveCfg = Debug|ARM + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|ARM.Build.0 = Debug|ARM + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|x64.ActiveCfg = Debug|x64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|x64.Build.0 = Debug|x64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|x86.ActiveCfg = Debug|Win32 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Debug|x86.Build.0 = Debug|Win32 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|ARM.ActiveCfg = Release|ARM + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|ARM.Build.0 = Release|ARM + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|x64.ActiveCfg = Release|x64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|x64.Build.0 = Release|x64 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|x86.ActiveCfg = Release|Win32 + {2411FC2F-79ED-4787-A143-DE3644B0FBF5}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj b/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj new file mode 100644 index 0000000..3f9abef --- /dev/null +++ b/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj @@ -0,0 +1,616 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + Win32 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {2411fc2f-79ed-4787-a143-de3644b0fbf5} + DynamicLibrary + libmpg123 + libmpg123 + en-US + 14.0 + true + Windows Store + 10.0.10240.0 + 10.0.10240.0 + 10.0 + + + + DynamicLibrary + true + v140 + + + DynamicLibrary + true + v140 + + + DynamicLibrary + true + v140 + + + DynamicLibrary + false + v140 + + + DynamicLibrary + false + v140 + + + DynamicLibrary + false + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + false + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\ + + + false + false + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\ + false + + + false + false + + + false + false + false + + + false + false + + + false + false + false + + + + NotUsing + false + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions) + CompileAsC + 4996;%(DisableSpecificWarnings) + + + Console + false + false + $(IntDir) + dct36_3dnow.o;dct36_3dnowext.o;dct36_sse.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + Default + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(IntDir)dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnow.o" "$(IntDir)dct36_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(IntDir)dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnowext.o" "$(IntDir)dct36_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_sse.S" /nologo > "$(IntDir)dct36_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_sse.o" "$(IntDir)dct36_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(IntDir)dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnow.o" "$(IntDir)dct64_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(IntDir)dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnowext.o" "$(IntDir)dct64_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(IntDir)dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_mmx.o" "$(IntDir)dct64_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(IntDir)dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse.o" "$(IntDir)dct64_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(IntDir)dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse_float.o" "$(IntDir)dct64_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(IntDir)equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)equalizer_3dnow.o" "$(IntDir)equalizer_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(IntDir)getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)getcpuflags.o" "$(IntDir)getcpuflags.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(IntDir)synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnow.o" "$(IntDir)synth_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(IntDir)synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnowext.o" "$(IntDir)synth_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(IntDir)synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_i586.o" "$(IntDir)synth_i586.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(IntDir)synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_mmx.o" "$(IntDir)synth_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(IntDir)synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse.o" "$(IntDir)synth_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(IntDir)synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_float.o" "$(IntDir)synth_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(IntDir)synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_float.o" "$(IntDir)synth_stereo_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(IntDir)tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)tabinit_mmx.o" "$(IntDir)tabinit_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(IntDir)synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_accurate.o" "$(IntDir)synth_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(IntDir)synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_s32.o" "$(IntDir)synth_sse_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(IntDir)synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_accurate.o" "$(IntDir)synth_stereo_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(IntDir)synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_s32.o" "$(IntDir)synth_stereo_sse_s32.asm" + + + + + + NotUsing + false + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + CompileAsC + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions) + 4996;%(DisableSpecificWarnings) + ProgramDatabase + MultiThreadedDLL + + + Console + false + false + $(IntDir) + dct36_3dnow.o;dct36_3dnowext.o;dct36_sse.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(IntDir)dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnow.o" "$(IntDir)dct36_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(IntDir)dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnowext.o" "$(IntDir)dct36_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_sse.S" /nologo > "$(IntDir)dct36_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_sse.o" "$(IntDir)dct36_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(IntDir)dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnow.o" "$(IntDir)dct64_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(IntDir)dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnowext.o" "$(IntDir)dct64_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(IntDir)dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_mmx.o" "$(IntDir)dct64_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(IntDir)dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse.o" "$(IntDir)dct64_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(IntDir)dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse_float.o" "$(IntDir)dct64_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(IntDir)equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)equalizer_3dnow.o" "$(IntDir)equalizer_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(IntDir)getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)getcpuflags.o" "$(IntDir)getcpuflags.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(IntDir)synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnow.o" "$(IntDir)synth_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(IntDir)synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnowext.o" "$(IntDir)synth_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(IntDir)synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_i586.o" "$(IntDir)synth_i586.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(IntDir)synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_mmx.o" "$(IntDir)synth_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(IntDir)synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse.o" "$(IntDir)synth_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(IntDir)synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_float.o" "$(IntDir)synth_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(IntDir)synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_float.o" "$(IntDir)synth_stereo_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(IntDir)tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)tabinit_mmx.o" "$(IntDir)tabinit_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(IntDir)synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_accurate.o" "$(IntDir)synth_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(IntDir)synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_s32.o" "$(IntDir)synth_sse_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(IntDir)synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_accurate.o" "$(IntDir)synth_stereo_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(IntDir)synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_s32.o" "$(IntDir)synth_stereo_sse_s32.asm" + + + + + + NotUsing + false + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;%(PreprocessorDefinitions) + CompileAsC + 4996;%(DisableSpecificWarnings) + + + Console + false + false + $(OutDir) + Default + + + + + + + + + NotUsing + false + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;%(PreprocessorDefinitions) + CompileAsC + 4996;%(DisableSpecificWarnings) + MultiThreadedDLL + + + Console + false + false + $(OutDir) + + + + + + + + + NotUsing + false + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_X86_64;%(PreprocessorDefinitions) + CompileAsC + 4996;%(DisableSpecificWarnings) + + + Console + false + false + $(IntDir) + Default + getcpuflags_x86_64.o;dct36_x86_64.o;synth_x86_64_float.o;synth_x86_64_s32.o;synth_stereo_x86_64_float.o;synth_stereo_x86_64_s32.o;synth_x86_64.o;dct64_x86_64.o;dct64_x86_64_float.o;synth_stereo_x86_64.o;synth_x86_64_accurate.o;synth_stereo_x86_64_accurate.o;%(AdditionalDependencies) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags_x86_64.S" /nologo > "$(IntDir)getcpuflags_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)getcpuflags_x86_64.o" "$(IntDir)getcpuflags_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_x86_64.S" /nologo > "$(IntDir)dct36_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct36_x86_64.o" "$(IntDir)dct36_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_float.S" /nologo > "$(IntDir)synth_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_float.o" "$(IntDir)synth_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_s32.S" /nologo > "$(IntDir)synth_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_s32.o" "$(IntDir)synth_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_float.S" /nologo > "$(IntDir)synth_stereo_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_float.o" "$(IntDir)synth_stereo_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_s32.S" /nologo > "$(IntDir)synth_stereo_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_s32.o" "$(IntDir)synth_stereo_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64.S" /nologo > "$(IntDir)synth_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64.o" "$(IntDir)synth_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64.S" /nologo > "$(IntDir)dct64_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64.o" "$(IntDir)dct64_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64_float.S" /nologo > "$(IntDir)dct64_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64_float.o" "$(IntDir)dct64_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64.S" /nologo > "$(IntDir)synth_stereo_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64.o" "$(IntDir)synth_stereo_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_accurate.S" /nologo > "$(IntDir)synth_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_accurate.o" "$(IntDir)synth_x86_64_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_accurate.S" /nologo > "$(IntDir)synth_stereo_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_accurate.o" "$(IntDir)synth_stereo_x86_64_accurate.asm" + + + + + + NotUsing + false + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_X86_64;%(PreprocessorDefinitions) + CompileAsC + 4996;%(DisableSpecificWarnings) + ProgramDatabase + MultiThreadedDLL + + + Console + false + false + $(IntDir) + getcpuflags_x86_64.o;dct36_x86_64.o;synth_x86_64_float.o;synth_x86_64_s32.o;synth_stereo_x86_64_float.o;synth_stereo_x86_64_s32.o;synth_x86_64.o;dct64_x86_64.o;dct64_x86_64_float.o;synth_stereo_x86_64.o;synth_x86_64_accurate.o;synth_stereo_x86_64_accurate.o;%(AdditionalDependencies) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags_x86_64.S" /nologo > "$(IntDir)getcpuflags_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)getcpuflags_x86_64.o" "$(IntDir)getcpuflags_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_x86_64.S" /nologo > "$(IntDir)dct36_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct36_x86_64.o" "$(IntDir)dct36_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_float.S" /nologo > "$(IntDir)synth_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_float.o" "$(IntDir)synth_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_s32.S" /nologo > "$(IntDir)synth_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_s32.o" "$(IntDir)synth_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_float.S" /nologo > "$(IntDir)synth_stereo_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_float.o" "$(IntDir)synth_stereo_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_s32.S" /nologo > "$(IntDir)synth_stereo_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_s32.o" "$(IntDir)synth_stereo_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64.S" /nologo > "$(IntDir)synth_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64.o" "$(IntDir)synth_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64.S" /nologo > "$(IntDir)dct64_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64.o" "$(IntDir)dct64_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64_float.S" /nologo > "$(IntDir)dct64_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64_float.o" "$(IntDir)dct64_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64.S" /nologo > "$(IntDir)synth_stereo_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64.o" "$(IntDir)synth_stereo_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_accurate.S" /nologo > "$(IntDir)synth_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_accurate.o" "$(IntDir)synth_x86_64_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_accurate.S" /nologo > "$(IntDir)synth_stereo_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_accurate.o" "$(IntDir)synth_stereo_x86_64_accurate.asm" + + + + + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj.filters b/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj.filters new file mode 100644 index 0000000..72de4e6 --- /dev/null +++ b/ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj.filters @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + asm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + + + {9464c065-7e0c-42f6-ae7c-de9964e273f9} + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj b/ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj new file mode 100644 index 0000000..fdbf000 --- /dev/null +++ b/ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj @@ -0,0 +1,173 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {3C75D302-5DA2-49DD-A27A-5EB199D6933B} + Win32Proj + dump_seekindex + 8.1 + + + + Application + true + Unicode + v140 + + + Application + true + Unicode + v140 + + + Application + false + true + Unicode + v140 + + + Application + false + true + Unicode + v140 + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + $(Platform)\$(Configuration)\ + + + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + true + + + $(ProjectDir)$(Configuration)\ + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;LINK_MPG123_DLL;%(PreprocessorDefinitions) + ProgramDatabase + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + + + + + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;LINK_MPG123_DLL;%(PreprocessorDefinitions) + ProgramDatabase + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + + + + + + + + + Level3 + + + MaxSpeed + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + true + + + + + + + + + Level3 + + + MaxSpeed + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + true + + + + + + + + + + + + {67caa87b-7cf1-4f93-bb67-21c513f40803} + + + + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj.filters b/ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj.filters new file mode 100644 index 0000000..2269324 --- /dev/null +++ b/ports/MSVC++/2015/win32/dump_seekindex/dump_seekindex.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj b/ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj new file mode 100644 index 0000000..1157bd2 --- /dev/null +++ b/ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj @@ -0,0 +1,179 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + {67caa87b-7cf1-4f93-bb67-21c513f40803} + + + + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15} + Win32Proj + feedseek + 8.1 + + + + Application + Unicode + v140 + + + Application + Unicode + v140 + + + Application + true + Unicode + v140 + + + Application + true + Unicode + v140 + + + + + + + + + + + + + + + + + + + true + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + true + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + + + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + + + + + + Level3 + ProgramDatabase + Disabled + EnableFastChecks + MultiThreadedDebugDLL + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;LINK_MPG123_DLL;%(PreprocessorDefinitions) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + + + + + + + + + + + Level3 + ProgramDatabase + Disabled + EnableFastChecks + MultiThreadedDebugDLL + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;LINK_MPG123_DLL;%(PreprocessorDefinitions) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + + + + + + + + + Level3 + + + MaxSpeed + MultiThreadedDLL + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + true + + + + + + + + + Level3 + + + MaxSpeed + MultiThreadedDLL + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + true + + + + + + + + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj.filters b/ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj.filters new file mode 100644 index 0000000..922b00a --- /dev/null +++ b/ports/MSVC++/2015/win32/feedseek/feedseek.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj b/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj new file mode 100644 index 0000000..1edf77d --- /dev/null +++ b/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj @@ -0,0 +1,1243 @@ + + + + + Debug_Generic_Dll + Win32 + + + Debug_Generic_Dll + x64 + + + Debug_Generic + Win32 + + + Debug_Generic + x64 + + + Debug_x86_Dll + Win32 + + + Debug_x86_Dll + x64 + + + Debug_x86 + Win32 + + + Debug_x86 + x64 + + + Release_Generic_Dll + Win32 + + + Release_Generic_Dll + x64 + + + Release_Generic + Win32 + + + Release_Generic + x64 + + + Release_x86_Dll + Win32 + + + Release_x86_Dll + x64 + + + Release_x86 + Win32 + + + Release_x86 + x64 + + + + {67CAA87B-7CF1-4F93-BB67-21C513F40803} + libmpg123 + 8.1 + + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + v140 + + + DynamicLibrary + Unicode + v140 + + + StaticLibrary + Unicode + true + v140 + + + StaticLibrary + Unicode + true + v140 + + + StaticLibrary + Unicode + v140 + + + StaticLibrary + Unicode + v140 + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + v140 + + + DynamicLibrary + Unicode + v140 + + + StaticLibrary + Unicode + true + v140 + + + StaticLibrary + Unicode + true + v140 + + + StaticLibrary + Unicode + v140 + + + StaticLibrary + Unicode + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(SolutionDir)$(Platform)\Debug\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\Release\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\Debug\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\Release\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\Debug\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\Release\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\Debug\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\Release\ + $(Platform)\$(Configuration)\ + false + false + + + $(SolutionDir)$(Platform)\Release\ + + + $(SolutionDir)$(Platform)\Release\ + + + $(SolutionDir)$(Platform)\Release\ + + + $(SolutionDir)$(Platform)\Release\ + + + $(SolutionDir)$(Platform)\Debug\ + + + $(SolutionDir)$(Platform)\Debug\ + + + $(SolutionDir)$(Platform)\Debug\ + + + $(SolutionDir)$(Platform)\Debug\ + + + + Disabled + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + + Shlwapi.lib + + + + + Disabled + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + + + + + + Shlwapi.lib;%(AdditionalDependencies) + + + + + MaxSpeed + AnySuitable + true + Speed + true + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + + Shlwapi.lib + + + + + MaxSpeed + AnySuitable + true + Speed + true + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + + + + + + Shlwapi.lib;%(AdditionalDependencies) + + + + + Disabled + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;BUILD_MPG123_DLL;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + DebugFastLink + true + 0x63000000 + false + true + Shlwapi.lib;%(AdditionalDependencies) + + + + + Disabled + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;BUILD_MPG123_DLL;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + $(IntDir);%(AdditionalLibraryDirectories) + DebugFastLink + true + 0x63000000 + false + true + Shlwapi.lib;%(AdditionalDependencies) + + + + + + + + + MaxSpeed + AnySuitable + true + Speed + true + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;BUILD_MPG123_DLL;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + 0x63000000 + false + true + Shlwapi.lib;%(AdditionalDependencies) + + + + + MaxSpeed + AnySuitable + true + Speed + true + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;BUILD_MPG123_DLL;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + 0x63000000 + false + true + Shlwapi.lib;%(AdditionalDependencies) + + + + + + + + + Disabled + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(IntDir)dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnow.o" "$(IntDir)dct36_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(IntDir)dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnowext.o" "$(IntDir)dct36_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_sse.S" /nologo > "$(IntDir)dct36_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_sse.o" "$(IntDir)dct36_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(IntDir)dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnow.o" "$(IntDir)dct64_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(IntDir)dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnowext.o" "$(IntDir)dct64_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(IntDir)dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_mmx.o" "$(IntDir)dct64_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(IntDir)dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse.o" "$(IntDir)dct64_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(IntDir)dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse_float.o" "$(IntDir)dct64_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(IntDir)equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)equalizer_3dnow.o" "$(IntDir)equalizer_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(IntDir)getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)getcpuflags.o" "$(IntDir)getcpuflags.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(IntDir)synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnow.o" "$(IntDir)synth_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(IntDir)synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnowext.o" "$(IntDir)synth_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(IntDir)synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_i586.o" "$(IntDir)synth_i586.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(IntDir)synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_mmx.o" "$(IntDir)synth_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(IntDir)synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse.o" "$(IntDir)synth_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(IntDir)synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_float.o" "$(IntDir)synth_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(IntDir)synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_float.o" "$(IntDir)synth_stereo_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(IntDir)tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)tabinit_mmx.o" "$(IntDir)tabinit_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(IntDir)synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_accurate.o" "$(IntDir)synth_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(IntDir)synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_s32.o" "$(IntDir)synth_sse_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(IntDir)synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_accurate.o" "$(IntDir)synth_stereo_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(IntDir)synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_s32.o" "$(IntDir)synth_stereo_sse_s32.asm" + + + + Shlwapi.lib;dct36_3dnow.o;dct36_3dnowext.o;dct36_sse.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(IntDir);%(AdditionalLibraryDirectories) + + + + + Disabled + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_X86_64;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags_x86_64.S" /nologo > "$(IntDir)getcpuflags_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)getcpuflags_x86_64.o" "$(IntDir)getcpuflags_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_x86_64.S" /nologo > "$(IntDir)dct36_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct36_x86_64.o" "$(IntDir)dct36_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_float.S" /nologo > "$(IntDir)synth_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_float.o" "$(IntDir)synth_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_s32.S" /nologo > "$(IntDir)synth_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_s32.o" "$(IntDir)synth_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_float.S" /nologo > "$(IntDir)synth_stereo_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_float.o" "$(IntDir)synth_stereo_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_s32.S" /nologo > "$(IntDir)synth_stereo_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_s32.o" "$(IntDir)synth_stereo_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64.S" /nologo > "$(IntDir)synth_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64.o" "$(IntDir)synth_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64.S" /nologo > "$(IntDir)dct64_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64.o" "$(IntDir)dct64_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64_float.S" /nologo > "$(IntDir)dct64_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64_float.o" "$(IntDir)dct64_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64.S" /nologo > "$(IntDir)synth_stereo_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64.o" "$(IntDir)synth_stereo_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_accurate.S" /nologo > "$(IntDir)synth_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_accurate.o" "$(IntDir)synth_x86_64_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_accurate.S" /nologo > "$(IntDir)synth_stereo_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_accurate.o" "$(IntDir)synth_stereo_x86_64_accurate.asm" + + + + Shlwapi.lib;getcpuflags_x86_64.o;dct36_x86_64.o;synth_x86_64_float.o;synth_x86_64_s32.o;synth_stereo_x86_64_float.o;synth_stereo_x86_64_s32.o;synth_x86_64.o;dct64_x86_64.o;dct64_x86_64_float.o;synth_stereo_x86_64.o;synth_x86_64_accurate.o;synth_stereo_x86_64_accurate.o;%(AdditionalDependencies) + $(IntDir);%(AdditionalLibraryDirectories) + + + + + MaxSpeed + AnySuitable + true + Speed + true + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(IntDir)dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnow.o" "$(IntDir)dct36_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(IntDir)dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnowext.o" "$(IntDir)dct36_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_sse.S" /nologo > "$(IntDir)dct36_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_sse.o" "$(IntDir)dct36_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(IntDir)dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnow.o" "$(IntDir)dct64_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(IntDir)dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnowext.o" "$(IntDir)dct64_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(IntDir)dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_mmx.o" "$(IntDir)dct64_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(IntDir)dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse.o" "$(IntDir)dct64_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(IntDir)dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse_float.o" "$(IntDir)dct64_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(IntDir)equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)equalizer_3dnow.o" "$(IntDir)equalizer_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(IntDir)getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)getcpuflags.o" "$(IntDir)getcpuflags.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(IntDir)synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnow.o" "$(IntDir)synth_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(IntDir)synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnowext.o" "$(IntDir)synth_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(IntDir)synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_i586.o" "$(IntDir)synth_i586.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(IntDir)synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_mmx.o" "$(IntDir)synth_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(IntDir)synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse.o" "$(IntDir)synth_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(IntDir)synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_float.o" "$(IntDir)synth_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(IntDir)synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_float.o" "$(IntDir)synth_stereo_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(IntDir)tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)tabinit_mmx.o" "$(IntDir)tabinit_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(IntDir)synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_accurate.o" "$(IntDir)synth_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(IntDir)synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_s32.o" "$(IntDir)synth_sse_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(IntDir)synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_accurate.o" "$(IntDir)synth_stereo_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(IntDir)synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_s32.o" "$(IntDir)synth_stereo_sse_s32.asm" + + + + Shlwapi.lib;dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(IntDir);%(AdditionalLibraryDirectories) + true + + + + + MaxSpeed + AnySuitable + true + Speed + true + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_X86_64;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags_x86_64.S" /nologo > "$(IntDir)getcpuflags_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)getcpuflags_x86_64.o" "$(IntDir)getcpuflags_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_x86_64.S" /nologo > "$(IntDir)dct36_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct36_x86_64.o" "$(IntDir)dct36_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_float.S" /nologo > "$(IntDir)synth_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_float.o" "$(IntDir)synth_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_s32.S" /nologo > "$(IntDir)synth_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_s32.o" "$(IntDir)synth_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_float.S" /nologo > "$(IntDir)synth_stereo_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_float.o" "$(IntDir)synth_stereo_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_s32.S" /nologo > "$(IntDir)synth_stereo_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_s32.o" "$(IntDir)synth_stereo_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64.S" /nologo > "$(IntDir)synth_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64.o" "$(IntDir)synth_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64.S" /nologo > "$(IntDir)dct64_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64.o" "$(IntDir)dct64_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64_float.S" /nologo > "$(IntDir)dct64_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64_float.o" "$(IntDir)dct64_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64.S" /nologo > "$(IntDir)synth_stereo_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64.o" "$(IntDir)synth_stereo_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_accurate.S" /nologo > "$(IntDir)synth_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_accurate.o" "$(IntDir)synth_x86_64_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_accurate.S" /nologo > "$(IntDir)synth_stereo_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_accurate.o" "$(IntDir)synth_stereo_x86_64_accurate.asm" + + + + Shlwapi.lib;getcpuflags_x86_64.o;dct36_x86_64.o;synth_x86_64_float.o;synth_x86_64_s32.o;synth_stereo_x86_64_float.o;synth_stereo_x86_64_s32.o;synth_x86_64.o;dct64_x86_64.o;dct64_x86_64_float.o;synth_stereo_x86_64.o;synth_x86_64_accurate.o;synth_stereo_x86_64_accurate.o;%(AdditionalDependencies) + $(IntDir);%(AdditionalLibraryDirectories) + true + + + + + Disabled + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(IntDir)dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnow.o" "$(IntDir)dct36_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(IntDir)dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnowext.o" "$(IntDir)dct36_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_sse.S" /nologo > "$(IntDir)dct36_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_sse.o" "$(IntDir)dct36_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(IntDir)dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnow.o" "$(IntDir)dct64_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(IntDir)dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnowext.o" "$(IntDir)dct64_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(IntDir)dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_mmx.o" "$(IntDir)dct64_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(IntDir)dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse.o" "$(IntDir)dct64_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(IntDir)dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse_float.o" "$(IntDir)dct64_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(IntDir)equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)equalizer_3dnow.o" "$(IntDir)equalizer_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(IntDir)getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)getcpuflags.o" "$(IntDir)getcpuflags.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(IntDir)synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnow.o" "$(IntDir)synth_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(IntDir)synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnowext.o" "$(IntDir)synth_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(IntDir)synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_i586.o" "$(IntDir)synth_i586.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(IntDir)synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_mmx.o" "$(IntDir)synth_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(IntDir)synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse.o" "$(IntDir)synth_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(IntDir)synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_float.o" "$(IntDir)synth_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(IntDir)synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_float.o" "$(IntDir)synth_stereo_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(IntDir)tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)tabinit_mmx.o" "$(IntDir)tabinit_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(IntDir)synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_accurate.o" "$(IntDir)synth_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(IntDir)synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_s32.o" "$(IntDir)synth_sse_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(IntDir)synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_accurate.o" "$(IntDir)synth_stereo_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(IntDir)synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_s32.o" "$(IntDir)synth_stereo_sse_s32.asm" + + + + Shlwapi.lib;dct36_3dnow.o;dct36_3dnowext.o;dct36_sse.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(IntDir);%(AdditionalLibraryDirectories) + DebugFastLink + true + 0x63000000 + true + false + + + + + Disabled + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_X86_64;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags_x86_64.S" /nologo > "$(IntDir)getcpuflags_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)getcpuflags_x86_64.o" "$(IntDir)getcpuflags_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_x86_64.S" /nologo > "$(IntDir)dct36_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct36_x86_64.o" "$(IntDir)dct36_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_float.S" /nologo > "$(IntDir)synth_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_float.o" "$(IntDir)synth_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_s32.S" /nologo > "$(IntDir)synth_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_s32.o" "$(IntDir)synth_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_float.S" /nologo > "$(IntDir)synth_stereo_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_float.o" "$(IntDir)synth_stereo_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_s32.S" /nologo > "$(IntDir)synth_stereo_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_s32.o" "$(IntDir)synth_stereo_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64.S" /nologo > "$(IntDir)synth_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64.o" "$(IntDir)synth_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64.S" /nologo > "$(IntDir)dct64_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64.o" "$(IntDir)dct64_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64_float.S" /nologo > "$(IntDir)dct64_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64_float.o" "$(IntDir)dct64_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64.S" /nologo > "$(IntDir)synth_stereo_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64.o" "$(IntDir)synth_stereo_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_accurate.S" /nologo > "$(IntDir)synth_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_accurate.o" "$(IntDir)synth_x86_64_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_accurate.S" /nologo > "$(IntDir)synth_stereo_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_accurate.o" "$(IntDir)synth_stereo_x86_64_accurate.asm" + + + + Shlwapi.lib;getcpuflags_x86_64.o;dct36_x86_64.o;synth_x86_64_float.o;synth_x86_64_s32.o;synth_stereo_x86_64_float.o;synth_stereo_x86_64_s32.o;synth_x86_64.o;dct64_x86_64.o;dct64_x86_64_float.o;synth_stereo_x86_64.o;synth_x86_64_accurate.o;synth_stereo_x86_64_accurate.o;%(AdditionalDependencies) + $(IntDir);%(AdditionalLibraryDirectories) + DebugFastLink + true + 0x63000000 + true + false + + + + + + + + + MaxSpeed + AnySuitable + true + Speed + true + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(IntDir)dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnow.o" "$(IntDir)dct36_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(IntDir)dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_3dnowext.o" "$(IntDir)dct36_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_sse.S" /nologo > "$(IntDir)dct36_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct36_sse.o" "$(IntDir)dct36_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(IntDir)dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnow.o" "$(IntDir)dct64_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(IntDir)dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_3dnowext.o" "$(IntDir)dct64_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(IntDir)dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_mmx.o" "$(IntDir)dct64_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(IntDir)dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse.o" "$(IntDir)dct64_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(IntDir)dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)dct64_sse_float.o" "$(IntDir)dct64_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(IntDir)equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)equalizer_3dnow.o" "$(IntDir)equalizer_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(IntDir)getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)getcpuflags.o" "$(IntDir)getcpuflags.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(IntDir)synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnow.o" "$(IntDir)synth_3dnow.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(IntDir)synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_3dnowext.o" "$(IntDir)synth_3dnowext.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(IntDir)synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_i586.o" "$(IntDir)synth_i586.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(IntDir)synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_mmx.o" "$(IntDir)synth_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(IntDir)synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse.o" "$(IntDir)synth_sse.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(IntDir)synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_float.o" "$(IntDir)synth_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(IntDir)synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_float.o" "$(IntDir)synth_stereo_sse_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(IntDir)tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)tabinit_mmx.o" "$(IntDir)tabinit_mmx.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(IntDir)synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_accurate.o" "$(IntDir)synth_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(IntDir)synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_sse_s32.o" "$(IntDir)synth_sse_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(IntDir)synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_accurate.o" "$(IntDir)synth_stereo_sse_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(IntDir)synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_s32.o" "$(IntDir)synth_stereo_sse_s32.asm" + + + + Shlwapi.lib;dct36_3dnow.o;dct36_3dnowext.o;dct36_sse.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(IntDir);%(AdditionalLibraryDirectories) + 0x63000000 + false + true + + + + + + + + + + + + + MaxSpeed + AnySuitable + true + Speed + true + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src;$(ProjectDir)..\..\..\..\..\src\libmpg123;$(ProjectDir)..\..\..\..\..\src\compat;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_X86_64;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + Level3 + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\getcpuflags_x86_64.S" /nologo > "$(IntDir)getcpuflags_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)getcpuflags_x86_64.o" "$(IntDir)getcpuflags_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct36_x86_64.S" /nologo > "$(IntDir)dct36_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct36_x86_64.o" "$(IntDir)dct36_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_float.S" /nologo > "$(IntDir)synth_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_float.o" "$(IntDir)synth_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_s32.S" /nologo > "$(IntDir)synth_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_s32.o" "$(IntDir)synth_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_float.S" /nologo > "$(IntDir)synth_stereo_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_float.o" "$(IntDir)synth_stereo_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_s32.S" /nologo > "$(IntDir)synth_stereo_x86_64_s32.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_s32.o" "$(IntDir)synth_stereo_x86_64_s32.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64.S" /nologo > "$(IntDir)synth_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64.o" "$(IntDir)synth_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64.S" /nologo > "$(IntDir)dct64_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64.o" "$(IntDir)dct64_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\dct64_x86_64_float.S" /nologo > "$(IntDir)dct64_x86_64_float.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)dct64_x86_64_float.o" "$(IntDir)dct64_x86_64_float.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64.S" /nologo > "$(IntDir)synth_stereo_x86_64.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64.o" "$(IntDir)synth_stereo_x86_64.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_x86_64_accurate.S" /nologo > "$(IntDir)synth_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_x86_64_accurate.o" "$(IntDir)synth_x86_64_accurate.asm" + +cl /I "..\..\.." /I "$(ProjectDir)..\..\..\..\..\src" /EP /TC "$(ProjectDir)..\..\..\..\..\src\libmpg123\synth_stereo_x86_64_accurate.S" /nologo > "$(IntDir)synth_stereo_x86_64_accurate.asm" +yasm -a x86 -m amd64 -f win64 -p gas -r raw -g null -o "$(IntDir)synth_stereo_x86_64_accurate.o" "$(IntDir)synth_stereo_x86_64_accurate.asm" + + + + Shlwapi.lib;getcpuflags_x86_64.o;dct36_x86_64.o;synth_x86_64_float.o;synth_x86_64_s32.o;synth_stereo_x86_64_float.o;synth_stereo_x86_64_s32.o;synth_x86_64.o;dct64_x86_64.o;dct64_x86_64_float.o;synth_stereo_x86_64.o;synth_x86_64_accurate.o;synth_stereo_x86_64_accurate.o;%(AdditionalDependencies) + $(IntDir);%(AdditionalLibraryDirectories) + 0x63000000 + false + true + + + + + + + + + + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj.filters b/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj.filters new file mode 100644 index 0000000..41b81b2 --- /dev/null +++ b/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj.filters @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + asm + + + + + {ec5e359b-ad6d-459c-a37e-18370a602ac0} + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/win32/mpg123.sln b/ports/MSVC++/2015/win32/mpg123.sln new file mode 100644 index 0000000..4d57ff1 --- /dev/null +++ b/ports/MSVC++/2015/win32/mpg123.sln @@ -0,0 +1,58 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "feedseek", "feedseek\feedseek.vcxproj", "{AE56D9D0-ECBA-44CD-943A-E530F6C46E15}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpg123", "libmpg123\libmpg123.vcxproj", "{67CAA87B-7CF1-4F93-BB67-21C513F40803}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scan", "scan\scan.vcxproj", "{1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_seekindex", "dump_seekindex\dump_seekindex.vcxproj", "{3C75D302-5DA2-49DD-A27A-5EB199D6933B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Debug|Win32.Build.0 = Debug|Win32 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Debug|x64.ActiveCfg = Debug|x64 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Debug|x64.Build.0 = Debug|x64 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Release|Win32.ActiveCfg = Release|Win32 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Release|Win32.Build.0 = Release|Win32 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Release|x64.ActiveCfg = Release|x64 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Release|x64.Build.0 = Release|x64 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.ActiveCfg = Debug_x86_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.Build.0 = Debug_x86_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|x64.ActiveCfg = Debug_x86_Dll|x64 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|x64.Build.0 = Debug_x86_Dll|x64 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.ActiveCfg = Release_x86_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.Build.0 = Release_x86_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|x64.ActiveCfg = Release_x86_Dll|x64 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|x64.Build.0 = Release_x86_Dll|x64 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Debug|Win32.ActiveCfg = Debug|Win32 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Debug|Win32.Build.0 = Debug|Win32 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Debug|x64.ActiveCfg = Debug|x64 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Debug|x64.Build.0 = Debug|x64 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Release|Win32.ActiveCfg = Release|Win32 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Release|Win32.Build.0 = Release|Win32 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Release|x64.ActiveCfg = Release|x64 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Release|x64.Build.0 = Release|x64 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Debug|Win32.Build.0 = Debug|Win32 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Debug|x64.ActiveCfg = Debug|x64 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Debug|x64.Build.0 = Debug|x64 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Release|Win32.ActiveCfg = Release|Win32 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Release|Win32.Build.0 = Release|Win32 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Release|x64.ActiveCfg = Release|x64 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ports/MSVC++/2015/win32/scan/scan.vcxproj b/ports/MSVC++/2015/win32/scan/scan.vcxproj new file mode 100644 index 0000000..4bf9987 --- /dev/null +++ b/ports/MSVC++/2015/win32/scan/scan.vcxproj @@ -0,0 +1,173 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + {67caa87b-7cf1-4f93-bb67-21c513f40803} + + + + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508} + Win32Proj + scan + 8.1 + + + + Application + Unicode + v140 + + + Application + Unicode + v140 + + + Application + true + Unicode + v140 + + + Application + true + Unicode + v140 + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + $(Platform)\$(Configuration)\ + + + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + true + + + $(ProjectDir)$(Configuration)\ + + + + + NotUsing + Level3 + ProgramDatabase + Disabled + EnableFastChecks + MultiThreadedDebugDLL + WIN32;_DEBUG;_CONSOLE;LINK_MPG123_DLL;%(PreprocessorDefinitions) + $(IntDir) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + + + + + + + + + NotUsing + Level3 + ProgramDatabase + Disabled + EnableFastChecks + MultiThreadedDebugDLL + WIN32;_DEBUG;_CONSOLE;LINK_MPG123_DLL;%(PreprocessorDefinitions) + $(IntDir) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + + + + + + + + + Level3 + NotUsing + MaxSpeed + MultiThreadedDLL + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + true + + + + + + + + + Level3 + NotUsing + MaxSpeed + MultiThreadedDLL + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + $(ProjectDir)..\..\..;$(ProjectDir)..\..\..\..\..\src\libmpg123 + + + Console + true + true + + + + + + + + + + \ No newline at end of file diff --git a/ports/MSVC++/2015/win32/scan/scan.vcxproj.filters b/ports/MSVC++/2015/win32/scan/scan.vcxproj.filters new file mode 100644 index 0000000..884481c --- /dev/null +++ b/ports/MSVC++/2015/win32/scan/scan.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H b/ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H new file mode 100644 index 0000000..9a569bb --- /dev/null +++ b/ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H @@ -0,0 +1,15 @@ +// ------------------------------------------------------------------------------------------------ + +#pragma once + +// ------------------------------------------------------------------------------------------------ + +protected: + +::FILE *m_pFile; + +PBYTE m_pucMemData; +DWORD m_dwLength; +DWORD m_dwReadPos; + +// ------------------------------------------------------------------------------------------------ diff --git a/ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H b/ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H new file mode 100644 index 0000000..c9471a8 --- /dev/null +++ b/ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H @@ -0,0 +1,139 @@ +// ------------------------------------------------------------------------------------------------ + +#pragma once + +// ------------------------------------------------------------------------------------------------ + +#ifdef _DEBUG +#pragma comment(lib, "libMPG123_d.lib") +#else +#pragma comment(lib, "libMPG123.lib") +#endif + +// ------------------------------------------------------------------------------------------------ + +#include "../DShowBase/streams.h" + +#include +#include + +#include "../../libMPG123/MPG123.H" + +#include + +// ------------------------------------------------------------------------------------------------ + +#define WAVE_HEADER_LENGTH 44 + +// ------------------------------------------------------------------------------------------------ + +#define MP3_DECODE_LEN 0x4000 + +#define MP3_DECODE_BUF_LEN 0x8000 + +// ------------------------------------------------------------------------------------------------ + +namespace IIEP +{ + class CMP3Stream : public CAsyncStream + { + public: + + CMP3Stream(void); + ~CMP3Stream(void); + + void SetSeekFlag(void); + + bool Open(const WORD *pcwsFileName, CMediaType &coMT, DWORD dwKBPerSec = INFINITE); + void Close(void); + + HRESULT SetPointer(LONGLONG llPos); + HRESULT Read(PBYTE pucBuffer, + DWORD dwBytesToRead, + BOOL bAlign, + LPDWORD pdwBytesRead); + + LONGLONG Size(LONGLONG *pSizeAvailable); + + DWORD Alignment(void); + + void Lock (void); + void Unlock(void); + + bool DecodeFrame(void); + + // + + bool OpenFile(const WORD *pcwsFileName); + + DWORD ReadFile(PVOID pBuf , DWORD dwLen ); + long SeekFile(long nOffset, int iOrigin); + + // + + private: + + CCritSec m_csLock; + + DWORD m_dwKBPerSec; + DWORD m_dwTimeStart; + + mpg123_handle *m_pcoMH; + + DWORD m_dwTotalBlocks; + DWORD m_dwAlignment; + + DWORD m_dwLength; + DWORD m_dwPosition; + + BYTE m_ucHeader[WAVE_HEADER_LENGTH]; + + // + + DWORD m_dwDataBufPos; + DWORD m_dwDataBufLen; + BYTE m_ucDataBuffer[MP3_DECODE_BUF_LEN]; + + // + + bool m_bSeekFlag; + + // + + IIEP::CFileIn m_coFileIn; + long m_nDataBegin; + long m_nDataTotal; + }; + + // ---------------------------------------------------------------------------------------------- + + class CMP3Reader : public CAsyncReader + { + public: + + // We're not going to be CoCreate'd so we don't need registration stuff etc + + STDMETHODIMP Register(void) + { + return S_OK; + } + + STDMETHODIMP Unregister(void) + { + return S_OK; + } + + CMP3Reader(CMP3Stream *pcoStream, + CMediaType *pcoMT, + HRESULT *phr) : + CAsyncReader(NAME("MP3 Reader\0"), + NULL, + pcoStream, + phr) + { + m_coMT = *pcoMT; + } + }; +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H b/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H new file mode 100644 index 0000000..07a853d --- /dev/null +++ b/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H @@ -0,0 +1,206 @@ +// +// __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ +// /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ +// \_/_//_/\\_\/ \_/_//_/\\_\//_/\\_\\_\\_\//_/\\_\\_/_/\/ +// /_//_/\/ /_//_/\/ /_/\/ __ /_/\/ __ /_/\/ +// /_//_/\/ /_//_/\/ /_//_//_/\ /_//_//_//_/\/ +// /_//_/\/ /_//_/\/ /_/\\_\\_\/ /_/\\_\\_\\_\/ +// __ /_//_/\/ __ /_//_/\/ /_/\/ __ __ /_/\/ +// /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ /_/\/ +// \_\\_\\_\\_\/ \_\\_\\_\\_\/ \_\\_\\_\\_\/ \_\/ +// +// +// ..:: Interactive Internet Entertainment Platform ::.. +// +// (C) 2000-2006, FAN YI PENG. ALL RIGHTS RESERVED +// +// ________________________________________________________________________________________________ +// +/// @file IIEP_Def.H +/// @brief �������� +// ________________________________________________________________________________________________ +// +// +// _____________________________________ +// | | +// | DATA | +// _____________________________|_____________________________________|____________________________ +// +// __________ +// __________________________________________| CONFIG |__________________________________________ + +#pragma once + +#ifdef _DEBUG + #pragma comment(lib, "IIEP_DBG.LIB") +#else + #pragma comment(lib, "IIEP.LIB") +#endif + +// ____________________________________________ CONFIG ____________________________________________ +// +// __________ +// __________________________________________| DEFINE |__________________________________________ +// +// _____________ +// ____/ Data Type \_____________________________________________________________________________ + +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef unsigned long DWORD; +typedef __int64 QWORD; + +typedef BYTE *PBYTE; +typedef WORD *PWORD; +typedef DWORD *PDWORD; +typedef QWORD *PQWORD; + +typedef void *PVOID; + +// ______ Data Type _______________________________________________________________________________ +// +// ___________ +// ____/ Release \_______________________________________________________________________________ + +#define SAFE_DELETE(p) if (p) { delete (p); (p) = 0; } +#define SAFE_DELETE_ARRAY(p) if (p) { delete[] (p); (p) = 0; } +#define SAFE_RELEASE(p) if (p) { (p) -> Release(); (p) = 0; } + +// ______ Release _________________________________________________________________________________ +// +// __________ +// ____/ Assert \________________________________________________________________________________ + +#ifndef ASSERT + #ifdef _DEBUG + namespace IIEP { bool AssertFunction(bool, long, const char *, const char *); } + #define ASSERT(expression) \ + if (IIEP::AssertFunction((bool) (expression), __LINE__, __FILE__, __FUNCTION__)) {_asm {int 3}} + #else + #define ASSERT(expression) + #endif +#endif + +// ______ Assert __________________________________________________________________________________ +// +// _______ +// ____/ LOG \___________________________________________________________________________________ + +namespace IIEP +{ + void DebugLog(const char *pcszFormat, ...); + void DebugLog(const WORD *pcwsFormat, ...); + + void WriteLog(const char *pcszFormat, ...); + void WriteLog(const WORD *pcwsFormat, ...); +} + +// ______ LOG _____________________________________________________________________________________ +// +// ________ +// ____/ TODO \__________________________________________________________________________________ + +#ifdef _DEBUG + #define TODO \ + IIEP::DebugLog("\n[TODO] %d: \"%s\"- %s()\n~~~~~~\n", __LINE__, __FILE__, __FUNCTION__); + #define ToDo(x) \ + IIEP::DebugLog("\n[TODO] %d: \"%s\"- %s(): %s\n~~~~~~\n", __LINE__, __FILE__, __FUNCTION__, (x)); +#else + #define TODO + #define ToDo(x) +#endif + +// ______ TODO ____________________________________________________________________________________ +// +// ________ +// ____/ Path \__________________________________________________________________________________ + +namespace IIEP +{ + void ResetToExePath(void); +} + +// ______ Path ____________________________________________________________________________________ +// +// __________ +// ____/ CMutex \________________________________________________________________________________ + +namespace IIEP +{ + class CMutex + { + public: + + CMutex(void) { m_bLocked = false; } + ~CMutex(void) {} + + void Lock(void); + void Unlock(void) { m_bLocked = false; } + void Set(void) { m_bLocked = true; } + void Wait(void); + + bool IsLock(void) const { return m_bLocked; } + + private: + + volatile bool m_bLocked; + }; +} + +// ______ CMutex __________________________________________________________________________________ +// +// _________ +// ____/ SRect \_________________________________________________________________________________ + +namespace IIEP +{ + /// @brief ���νṹ + + struct SRect + { + SRect(void) {} + + SRect(long nX, long nY, long nWidth, long nHeight) + { + m_nX = nX; + m_nY = nY; + m_nWidth = nWidth; + m_nHeight = nHeight; + } + + // ------------------------------------------------------------------------------------------- + + void Set(long nX, long nY, long nWidth, long nHeight) + { + m_nX = nX; + m_nY = nY; + m_nWidth = nWidth; + m_nHeight = nHeight; + } + + // ------------------------------------------------------------------------------------------- + + long m_nX; ///< �������Ͻ� X ������ + long m_nY; ///< �������Ͻ� Y ������ + long m_nWidth; ///< ����� + long m_nHeight; ///< ���θ߶� + }; +} + +// ______ SRect ___________________________________________________________________________________ +// +// ___________________________ +// ____/ Sample Grabber CallBack \_______________________________________________________________ + +namespace IIEP +{ + typedef void (*CALLBACK_SampleGrabberBuffer) (PVOID, DWORD); +} + +// ______ Sample Grabber CallBack _________________________________________________________________ +// +// ____________________________________________ DEFINE ____________________________________________ +// +// ____________________________________________________________________________________ DATA ______ +// +// ___________________________________________ FILE END ___________________________________________ \ No newline at end of file diff --git a/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H b/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H new file mode 100644 index 0000000..73fb5b4 --- /dev/null +++ b/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H @@ -0,0 +1,167 @@ +// +// __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ +// /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ +// \_/_//_/\\_\/ \_/_//_/\\_\//_/\\_\\_\\_\//_/\\_\\_/_/\/ +// /_//_/\/ /_//_/\/ /_/\/ __ /_/\/ __ /_/\/ +// /_//_/\/ /_//_/\/ /_//_//_/\ /_//_//_//_/\/ +// /_//_/\/ /_//_/\/ /_/\\_\\_\/ /_/\\_\\_\\_\/ +// __ /_//_/\/ __ /_//_/\/ /_/\/ __ __ /_/\/ +// /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ /_/\/ +// \_\\_\\_\\_\/ \_\\_\\_\\_\/ \_\\_\\_\\_\/ \_\/ +// +// +// ..:: Interactive Internet Entertainment Platform ::.. +// +// (C) 2000-2005, FAN YI PENG. ALL RIGHTS RESERVED +// +// ________________________________________________________________________________________________ +// +/// @file IIEP_FileIn.H +/// @brief �ļ�����ӿ��� +// ________________________________________________________________________________________________ +// +// +// _____________________________________ +// | | +// | DATA | +// _____________________________|_____________________________________|____________________________ +// +// __________ +// __________________________________________| CONFIG |__________________________________________ + +#pragma once + +// ____________________________________________ CONFIG ____________________________________________ +// +// __________ +// __________________________________________| HEADER |__________________________________________ + +#include +#include + +#include + +// ____________________________________________ HEADER ____________________________________________ +// +// __________ +// __________________________________________| DEFINE |__________________________________________ +// +// ___________ +// ____/ CFileIn \_______________________________________________________________________________ + +namespace IIEP +{ + /// @brief �ļ�����ӿ��� + + class CFileIn + { + public: + + CFileIn(void); + ~CFileIn(void); + + bool Open(const char *pcszFileName); + bool Open(const WORD *pcwsFileName); + + void Close(void); + + DWORD GetFileSize(void) const; + DWORD GetReadPosition(void) const; + + bool Seek(long nOffset, long nOrigin = 0); // SEEK_SET = 0 SEEK_CUR = 1 SEEK_END = 2 + + bool Skip(long nOffset) { return Seek(nOffset, 1); } + + DWORD Read(PVOID pDataBuffer, DWORD dwReadSize); + + bool ReadB(BYTE &ucData) + { + return (1 == Read(&ucData, 1)); + } + + bool ReadW(WORD &wData) + { + return (2 == Read(&wData, 2)); + } + + bool ReadDW(DWORD &dwData) + { + return (4 == Read(&dwData, 4)); + } + + bool ReadInverseW(WORD &wData) + { + if (2 == Read(&wData, 2)) + { + _asm + { + MOV ECX, wData + MOV AX, [ECX] + XCHG AH, AL + MOV [ECX], AX + } + + return true; + } + + return false; + } + + bool ReadInverseDW(DWORD &dwData) + { + if (4 == Read(&dwData, 4)) + { + _asm + { + MOV ECX, dwData + MOV EAX, [ECX] + BSWAP EAX + MOV [ECX], EAX + } + + return true; + } + + return false; + } + + // -------------------------------------------------------------------------------------------- + + bool ReadAnsiLine(std::string &strLine); + bool ReadUnicodeLine(std::wstring &wstrLine, bool bBigEndian); + + bool ReadAnsiString (char *pszBuffer, DWORD dwBufferLength); + bool ReadUnicodeString(WORD *pwzBuffer, DWORD dwBufferLength); + + // -------------------------------------------------------------------------------------------- + + private: + + CFileIn(const CFileIn &); // forbidden + CFileIn & operator = (const CFileIn &); // forbidden + + #include + }; +} + +// ______ CFileIn _________________________________________________________________________________ +// +// _______________ +// ____/ Memory File \___________________________________________________________________________ + +namespace IIEP +{ + bool CreateMemoryFile(PVOID pMemory, DWORD dwLength, const char *pcszFileName); + bool CreateMemoryFile(PVOID pMemory, DWORD dwLength, const WORD *pcwsFileName); + bool RemoveMemoryFile(const char *pcszFileName); + bool RemoveMemoryFile(const WORD *pcwsFileName); + void RemoveMemoryFile(void); +} + +// ______ Memory File _____________________________________________________________________________ +// +// ____________________________________________ DEFINE ____________________________________________ +// +// ____________________________________________________________________________________ DATA ______ +// +// ___________________________________________ FILE END ___________________________________________ \ No newline at end of file diff --git a/ports/MSVC++/CMP3Stream/README b/ports/MSVC++/CMP3Stream/README new file mode 100644 index 0000000..df7a9aa --- /dev/null +++ b/ports/MSVC++/CMP3Stream/README @@ -0,0 +1,4 @@ +This is a MS Visual C++ project plus wrapper class for libmpg123, contributed by "Gates Fan" . +You need to copy the stuff from mgp123-x.y.z/src/libmpg123 to the libMPG123 directory and also ensure that you produce a valid mpg123.h from the mpg123.h.in (replace the @BLABLA@ with the appropriate #includes). + +Thomas. diff --git a/ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP b/ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP new file mode 100644 index 0000000..4fb1a02 --- /dev/null +++ b/ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP @@ -0,0 +1,462 @@ +// ------------------------------------------------------------------------------------------------ + +#include + +#include +#include + +#include +#include +#include + +// ------------------------------------------------------------------------------------------------ + +struct MEM_FILE_IDX +{ + MEM_FILE_IDX(void) + { + m_dwID = 0; + m_dwLength = 0; + m_pucData = 0; + } + + DWORD m_dwID; // hash ID of filename + DWORD m_dwLength; // file length + PBYTE m_pucData; // memory pointer +}; + +static std::vector s_vecMemFile; + +// ------------------------------------------------------------------------------------------------ +// name: SearchMemFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +static std::vector :: iterator SearchMemFile(PCWSTR pcwsFileName) +{ + DWORD dwID = IIEP::HashFNV_1a(pcwsFileName); + + std::vector ::iterator it; + + for (it = s_vecMemFile.begin(); it < s_vecMemFile.end(); it ++) + { + if (it -> m_dwID == dwID) return it; + } + + return s_vecMemFile.end(); +} + +// ------------------------------------------------------------------------------------------------ + +static std::vector :: iterator SearchMemFile(const char *pcszFileName) +{ + WORD wzNameBuffer[0x1000]; + + wzNameBuffer[0] = 0; + + IIEP::StringFromANSI(pcszFileName, wzNameBuffer, 0x1000); + + return SearchMemFile(wzNameBuffer); +} + +// ------------------------------------------------------------------------------------------------ +// name: CreateMemoryFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CreateMemoryFile(PVOID pMemory, DWORD dwLength, PCWSTR pcwsFileName) +{ + if (0 == pcwsFileName || 0 == *pcwsFileName) return false; + + RemoveMemoryFile(pcwsFileName); + + DWORD dwID = IIEP::HashFNV_1a(pcwsFileName); + + MEM_FILE_IDX soIDX; + + soIDX.m_dwID = dwID; + soIDX.m_dwLength = dwLength; + soIDX.m_pucData = (PBYTE) pMemory; + + s_vecMemFile.push_back(soIDX); + + return true; +} + +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CreateMemoryFile(PVOID pMemory, DWORD dwLength, const char *pcszFileName) +{ + WORD wzNameBuffer[0x1000]; + + wzNameBuffer[0] = 0; + + StringFromANSI(pcszFileName, wzNameBuffer, 0x1000); + + return CreateMemoryFile(pMemory, dwLength, wzNameBuffer); +} + +// ------------------------------------------------------------------------------------------------ +// name: RemoveMemoryFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::RemoveMemoryFile(PCWSTR pcwsFileName) +{ + if (0 == pcwsFileName || 0 == *pcwsFileName) return false; + + std::vector ::iterator it = SearchMemFile(pcwsFileName); + + if (it == s_vecMemFile.end()) return false; + + s_vecMemFile.erase(it); + + return true; +} + +// ------------------------------------------------------------------------------------------------ + +bool IIEP::RemoveMemoryFile(const char *pcszFileName) +{ + WORD wzNameBuffer[0x1000]; + + wzNameBuffer[0] = 0; + + StringFromANSI(pcszFileName, wzNameBuffer, 0x1000); + + return RemoveMemoryFile(wzNameBuffer); +} + +// ------------------------------------------------------------------------------------------------ + +void IIEP::RemoveMemoryFile(void) +{ + s_vecMemFile.clear(); +} + +// ------------------------------------------------------------------------------------------------ +// name: CFileIn() +// desc: +// ------------------------------------------------------------------------------------------------ + +IIEP::CFileIn::CFileIn(void) +{ + m_pFile = 0; + m_pucMemData = 0; + m_dwLength = 0; + m_dwReadPos = 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: ~CFileIn() +// desc: +// ------------------------------------------------------------------------------------------------ + +IIEP::CFileIn::~CFileIn(void) +{ + Close(); +} + +// ------------------------------------------------------------------------------------------------ +// name: Open() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::Open(const char *pcszFileName) +{ + WORD wzNameBuffer[0x1000]; + + wzNameBuffer[0] = 0; + + StringFromANSI(pcszFileName, wzNameBuffer, 0x1000); + + return Open(wzNameBuffer); +} + +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::Open(const WORD *pcwsFileName) +{ + Close(); + + if (0 == pcwsFileName || 0 == *pcwsFileName) return false; + + std::vector ::iterator it = SearchMemFile(pcwsFileName); + + if (it == s_vecMemFile.end()) // not found in memory + { + m_pFile = _wfopen(pcwsFileName, L"rb"); + + if (m_pFile) + { + return true; // found DOS file + } + + return false; + } + + if (s_vecMemFile.empty()) return false; + + m_pucMemData = it -> m_pucData; + m_dwLength = it -> m_dwLength; + + return true; +} + +// ------------------------------------------------------------------------------------------------ +// name: Close() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CFileIn::Close(void) +{ + if (m_pFile) + { + fclose(m_pFile); + + m_pFile = 0; + } + + m_pucMemData = 0; + m_dwLength = 0; + m_dwReadPos = 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: GetFileSize() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CFileIn::GetFileSize(void) const +{ + if (m_pFile) + { + DWORD dwPostion = ftell(m_pFile); + + fseek(m_pFile, 0, SEEK_END); + + DWORD dwFileSize = ftell(m_pFile); + + fseek(m_pFile, dwPostion, SEEK_SET); + + return dwFileSize; + } + + return m_dwLength; +} + +// ------------------------------------------------------------------------------------------------ +// name: GetReadPosition() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CFileIn::GetReadPosition(void) const +{ + if (m_pFile) + { + return ftell(m_pFile); + } + + return m_dwReadPos; +} + +// ------------------------------------------------------------------------------------------------ +// name: Seek() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::Seek(long nOffset, long nOrigin) +{ + if (m_pFile) + { + return (0 == fseek(m_pFile, nOffset, nOrigin)); + } + + if (m_pucMemData) + { + switch (nOrigin) + { + case SEEK_SET: + if (nOffset < 0 || nOffset >= (long) m_dwLength) return false; + m_dwReadPos = nOffset; + return true; + + case SEEK_CUR: + nOffset += m_dwReadPos; + if (nOffset < 0 || nOffset >= (long) m_dwLength) return false; + m_dwReadPos = nOffset; + return true; + + case SEEK_END: + ASSERT(nOffset <= 0); // ��������Ǹ��� + nOffset = m_dwLength - 1 + nOffset; + if (nOffset < 0 || nOffset >= (long) m_dwLength) return false; + m_dwReadPos = nOffset; + return true; + } + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ +// name: Read() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CFileIn::Read(PVOID pDataBuffer, DWORD dwReadSize) +{ + if (m_pFile) + { + return (DWORD) fread(pDataBuffer, 1, dwReadSize, m_pFile); + } + + if (m_pucMemData) + { + if (m_dwReadPos + dwReadSize > m_dwLength) dwReadSize = m_dwLength - m_dwReadPos; + + memcpy(pDataBuffer, m_pucMemData + m_dwReadPos, dwReadSize); + + m_dwReadPos += dwReadSize; + + return dwReadSize; + } + + return 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadAnsiLine() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::ReadAnsiLine(std::string &strLine) +{ + BYTE ucChar = 0; + + strLine.clear(); + + while (ReadB(ucChar)) + { + if (0x0D == ucChar) + { + } + else + if (0x0A == ucChar) + { + return true; + } + else + { + strLine.push_back(ucChar); + } + } + + if (strLine.empty()) return false; + + return true; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadUnicodeLine() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::ReadUnicodeLine(std::wstring &wstrLine, bool bBigEndian) +{ + WORD wChar = 0; + + wstrLine.clear(); + + while (bBigEndian ? ReadInverseW(wChar) : ReadW(wChar)) + { + if (0x000D == wChar) + { + } + else + if (0x000A == wChar) + { + return true; + } + else + { + wstrLine.push_back(wChar); + } + } + + if (wstrLine.empty()) return false; + + return true; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadAnsiString() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::ReadAnsiString(char *pszBuffer, DWORD dwBufferLength) +{ + DWORD dwIndex = 0; + BYTE ucChar; + + while (ReadB(ucChar)) + { + if (dwIndex >= dwBufferLength) return true; + + pszBuffer[dwIndex ++] = ucChar; + + if (0 == ucChar) + { + return true; + } + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadUnicodeString() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::ReadUnicodeString(WORD *pwzBuffer, DWORD dwBufferLength) +{ + DWORD dwIndex = 0; + WORD wChar; + + ReadInverseW(wChar); + + if (wChar == 0xFFFE) // Unicode + { + while (ReadW(wChar)) + { + if (dwIndex >= dwBufferLength) return true; + + pwzBuffer[dwIndex ++] = wChar; + + if (0 == wChar) + { + return true; + } + } + } + else + if (wChar == 0xFEFF) // Unicode big endian + { + while (ReadInverseW(wChar)) + { + if (dwIndex >= dwBufferLength) return true; + + pwzBuffer[dwIndex ++] = wChar; + + if (0 == wChar) + { + return true; + } + } + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP b/ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP new file mode 100644 index 0000000..ab67713 --- /dev/null +++ b/ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP @@ -0,0 +1,122 @@ +// ------------------------------------------------------------------------------------------------ + +#include +#include + +#include + +#include + +// ------------------------------------------------------------------------------------------------ + +static bool s_bLogFileOpened = false; + +// ------------------------------------------------------------------------------------------------ +// name: DebugLog() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::DebugLog(const char *pcszFormat, ...) +{ +#ifdef _DEBUG + char cBuffer[0x8000]; + + va_list pcArg; + + va_start(pcArg, pcszFormat); + _vsnprintf(cBuffer, 0x8000, pcszFormat, pcArg); + va_end(pcArg); + + ::OutputDebugStringA(cBuffer); +#endif +} + +// ------------------------------------------------------------------------------------------------ + +void IIEP::DebugLog(const WORD *pcwsFormat, ...) +{ +#ifdef _DEBUG + WCHAR wcBuffer[0x8000]; + + va_list pcArg; + + va_start(pcArg, pcwsFormat); + _vsnwprintf(wcBuffer, 0x8000, pcwsFormat, pcArg); + va_end(pcArg); + + ::OutputDebugStringW(wcBuffer); +#endif +} + +// ------------------------------------------------------------------------------------------------ +// name: WriteLog() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::WriteLog(const char *pcszFormat, ...) +{ + char cBuffer[0x8000]; + + va_list pcArg; + + va_start(pcArg, pcszFormat); + _vsnprintf(cBuffer, 0x8000, pcszFormat, pcArg); + va_end(pcArg); + + FILE *phFile; + + #define LOG_FILE "C:\\IIEP.LOG" + + if (s_bLogFileOpened) + { + phFile = fopen(LOG_FILE, "a+"); + } + else + { + phFile = fopen(LOG_FILE, "w"); + + s_bLogFileOpened = true; + } + + if (phFile) + { + fprintf(phFile, cBuffer); + fclose(phFile); + } +} + +// ------------------------------------------------------------------------------------------------ + +void IIEP::WriteLog(const WORD *pcwsFormat, ...) +{ + WCHAR wcBuffer[0x8000]; + + va_list pcArg; + + va_start(pcArg, pcwsFormat); + _vsnwprintf(wcBuffer, 0x8000, pcwsFormat, pcArg); + va_end(pcArg); + + FILE *phFile; + + #define LOG_FILE "C:\\IIEP.LOG" + + if (s_bLogFileOpened) + { + phFile = fopen(LOG_FILE, "a"); + } + else + { + phFile = fopen(LOG_FILE, "w"); + + s_bLogFileOpened = true; + } + + if (phFile) + { + fwprintf(phFile, wcBuffer); + fclose(phFile); + } +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP b/ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP new file mode 100644 index 0000000..5566f35 --- /dev/null +++ b/ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP @@ -0,0 +1,35 @@ +// ------------------------------------------------------------------------------------------------ + +#include + +#include + +// ------------------------------------------------------------------------------------------------ +// name: Lock() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMutex::Lock(void) +{ + while (m_bLocked) + { + ::Sleep(1); + } + + m_bLocked = true; +} + +// ------------------------------------------------------------------------------------------------ +// name: Wait() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMutex::Wait(void) +{ + while (m_bLocked) + { + ::Sleep(1); + } +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP b/ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP new file mode 100644 index 0000000..658b000 --- /dev/null +++ b/ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP @@ -0,0 +1,586 @@ +// ------------------------------------------------------------------------------------------------ + +#include + +#include + +// ------------------------------------------------------------------------------------------------ + +extern BYTE g_ucWaveHeader[WAVE_HEADER_LENGTH]; + +// ------------------------------------------------------------------------------------------------ +// name: CMP3Stream() +// desc: +// ------------------------------------------------------------------------------------------------ + +static size_t read_sub(int fd, void *pBuf, size_t nSize) +{ + if (fd) + { + IIEP::CMP3Stream *pcoStream = (IIEP::CMP3Stream *) fd; + + return pcoStream -> ReadFile(pBuf, nSize); + } + + return 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: CMP3Stream() +// desc: +// ------------------------------------------------------------------------------------------------ + +static off_t seek_sub(int fd, off_t nOffset, int iOrigin) +{ + if (fd) + { + IIEP::CMP3Stream *pcoStream = (IIEP::CMP3Stream *) fd; + + return pcoStream -> SeekFile(nOffset, iOrigin); + } + + return 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: CMP3Stream() +// desc: +// ------------------------------------------------------------------------------------------------ + +IIEP::CMP3Stream::CMP3Stream(void) +{ + m_dwKBPerSec = INFINITE; + m_dwTimeStart = 0; + + m_pcoMH = 0; + + m_dwTotalBlocks = 0; + m_dwAlignment = 4; + + m_dwLength = 0; + m_dwPosition = 0; + + memcpy(m_ucHeader, g_ucWaveHeader, WAVE_HEADER_LENGTH); + + m_dwDataBufPos = 0; + m_dwDataBufLen = 0; + + m_bSeekFlag = false; +} + +// ------------------------------------------------------------------------------------------------ +// name: ~CMP3Stream() +// desc: +// ------------------------------------------------------------------------------------------------ + +IIEP::CMP3Stream::~CMP3Stream(void) +{ + Close(); +} + +// ------------------------------------------------------------------------------------------------ +// name: SetSeekFlag() +// desc: called by IIEP::CPlayer::SetMediaPosition(QWORD qwPosition) +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMP3Stream::SetSeekFlag(void) +{ + m_bSeekFlag = true; +} + +// ------------------------------------------------------------------------------------------------ +// name: Open() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CMP3Stream::Open(const WORD *pcwsFileName, CMediaType &coMT, DWORD dwKBPerSec) +{ + Close(); + + // + + if (MPG123_OK != mpg123_init()) + { + goto OPEN_FAIL; + } + + m_pcoMH = mpg123_new(NULL, NULL); + + if (0 == m_pcoMH) + { + goto OPEN_FAIL; + } + + if (false == OpenFile(pcwsFileName)) + { + goto OPEN_FAIL; + } + + if (MPG123_OK != mpg123_replace_reader(m_pcoMH, read_sub, seek_sub)) + { + goto OPEN_FAIL; + } + + if (MPG123_OK != mpg123_open_fd(m_pcoMH, (int) this)) + { + goto OPEN_FAIL; + } + + long nRate; + int iChannels; + int iEncoding; + + if (MPG123_OK != mpg123_getformat(m_pcoMH, &nRate, &iChannels, &iEncoding)) + { + goto OPEN_FAIL; + } + + // Ensure that this output format will not change (it could, when we allow it) + + mpg123_format_none(m_pcoMH); + mpg123_format(m_pcoMH, nRate, iChannels, iEncoding); + + // scan & get total samples + + mpg123_scan(m_pcoMH); + + off_t nOff = mpg123_length(m_pcoMH); + + if (nOff < 0) + { + goto OPEN_FAIL; + } + + m_dwTotalBlocks = (DWORD) nOff; + + // set other format + + m_dwAlignment = iChannels * 2; + + if (0 == m_dwAlignment) + { + m_dwAlignment = 4; + } + + m_dwLength = m_dwTotalBlocks * m_dwAlignment + WAVE_HEADER_LENGTH; + + WORD wChannels = (WORD ) iChannels; + DWORD dwSamplesPerSec = (DWORD) nRate; + DWORD dwAvgBytesPerSec = m_dwAlignment * dwSamplesPerSec; + WORD wBlockAlign = (WORD ) m_dwAlignment; + WORD wBitsPerSample = 16; + + PWORD pwData; + PDWORD pdwData; + + pdwData = (PDWORD) &m_ucHeader[0x04]; + *pdwData = m_dwTotalBlocks * m_dwAlignment + WAVE_HEADER_LENGTH - 8; + + pwData = (PWORD) &m_ucHeader[0x16]; + *pwData = wChannels; + + pdwData = (PDWORD) &m_ucHeader[0x18]; + *pdwData = dwSamplesPerSec; + + pdwData = (PDWORD) &m_ucHeader[0x1C]; + *pdwData = dwAvgBytesPerSec; + + pwData = (PWORD) &m_ucHeader[0x20]; + *pwData = wBlockAlign; + + pwData = (PWORD) &m_ucHeader[0x22]; + *pwData = wBitsPerSample; + + pdwData = (PDWORD) &m_ucHeader[0x28]; + *pdwData = m_dwTotalBlocks * m_dwAlignment; + + coMT.majortype = MEDIATYPE_Stream; + coMT.subtype = MEDIASUBTYPE_WAVE; + + SetPointer(0); + + m_dwTimeStart = ::timeGetTime(); + + return true; + +OPEN_FAIL: + + Close(); + + return false; +} + +// ------------------------------------------------------------------------------------------------ +// name: Close() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMP3Stream::Close(void) +{ + m_coFileIn.Close(); + + if (m_pcoMH) + { + mpg123_close (m_pcoMH); + mpg123_delete(m_pcoMH); + + m_pcoMH = 0; + } + + mpg123_exit(); + + m_dwTimeStart = 0; + m_dwTotalBlocks = 0; + + m_dwLength = 0; + m_dwPosition = 0; + + m_bSeekFlag = false; + + m_nDataBegin = 0; + m_nDataTotal = 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: SetPointer() +// desc: +// ------------------------------------------------------------------------------------------------ + +HRESULT IIEP::CMP3Stream::SetPointer(LONGLONG llPos) +{ + if (llPos < 0 || llPos > (LONGLONG) m_dwLength) + { + return S_FALSE; + } + + m_dwPosition = (DWORD) llPos; + + if (llPos < WAVE_HEADER_LENGTH) + { + mpg123_seek(m_pcoMH, 0, SEEK_SET); + + m_dwDataBufLen = 0; + } + else + { + if (m_bSeekFlag && m_dwAlignment > 0) + { + m_bSeekFlag = false; + + mpg123_seek(m_pcoMH, (long) (m_dwPosition - WAVE_HEADER_LENGTH) / m_dwAlignment, SEEK_SET); + + m_dwDataBufLen = 0; + } + } + + return S_OK; +} + +// ------------------------------------------------------------------------------------------------ +// name: Read() +// desc: +// ------------------------------------------------------------------------------------------------ + +HRESULT IIEP::CMP3Stream::Read(PBYTE pucBuffer, + DWORD dwBytesToRead, + BOOL bAlign, + LPDWORD pdwBytesRead) +{ + if (0 == m_pcoMH) return S_FALSE; + + CAutoLock lck(&m_csLock); + + DWORD dwReadLength; + + // wait until the bytes are here + + DWORD dwTime = ::timeGetTime(); + + if (m_dwPosition + dwBytesToRead > m_dwLength) + { + dwReadLength = m_dwLength - m_dwPosition; + } + else + { + dwReadLength = dwBytesToRead; + } + + DWORD dwTimeToArrive = (m_dwPosition + dwReadLength) / m_dwKBPerSec; + + if (dwTime - m_dwTimeStart < dwTimeToArrive) + { + ::Sleep(dwTimeToArrive - dwTime + m_dwTimeStart); + } + + // read data + + DWORD dwRead = 0; + + if (m_dwPosition < WAVE_HEADER_LENGTH) + { + DWORD dwPatchLen = WAVE_HEADER_LENGTH - m_dwPosition; + + if (dwReadLength < dwPatchLen) + { + dwPatchLen = dwReadLength; + } + + memcpy(pucBuffer, m_ucHeader + m_dwPosition, dwPatchLen); + + m_dwPosition += dwPatchLen; + dwReadLength -= dwPatchLen; + + pucBuffer += dwPatchLen; + dwRead += dwPatchLen; + } + + if (dwReadLength > 0) + { + while (m_dwDataBufLen < dwReadLength) + { + if (m_dwDataBufLen > 0) + { + memcpy(pucBuffer, m_ucDataBuffer + m_dwDataBufPos, m_dwDataBufLen); + + dwRead += m_dwDataBufLen; + + dwReadLength -= m_dwDataBufLen; + + pucBuffer += m_dwDataBufLen; + m_dwDataBufPos += m_dwDataBufLen; + m_dwDataBufLen = 0; + } + + if (DecodeFrame() == false) break; + } + + if (dwReadLength > 0) + { + if (m_dwDataBufLen >= dwReadLength) + { + memcpy(pucBuffer, m_ucDataBuffer + m_dwDataBufPos, dwReadLength); + + dwRead += dwReadLength; + + m_dwDataBufPos += dwReadLength; + m_dwDataBufLen -= dwReadLength; + } + } + } + + m_dwPosition += dwRead; + *pdwBytesRead = dwRead; + + return S_OK; +} + +// ------------------------------------------------------------------------------------------------ +// name: Size() +// desc: +// ------------------------------------------------------------------------------------------------ + +LONGLONG IIEP::CMP3Stream::Size(LONGLONG *pSizeAvailable) +{ +// LONGLONG llCurrentAvailable = Int32x32To64((::timeGetTime() - m_dwTimeStart), m_dwKBPerSec); + LONGLONG llLength = (LONGLONG) m_dwTotalBlocks * m_dwAlignment + WAVE_HEADER_LENGTH; + + if (pSizeAvailable) + { +// *pSizeAvailable = min(llLength, llCurrentAvailable); + *pSizeAvailable = llLength; + } + + return llLength; +} + +// ------------------------------------------------------------------------------------------------ +// name: Alignment() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CMP3Stream::Alignment(void) +{ + return m_dwAlignment; +} + +// ------------------------------------------------------------------------------------------------ +// name: Lock() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMP3Stream::Lock(void) +{ + m_csLock.Lock(); +} + +// ------------------------------------------------------------------------------------------------ +// name: Unlock() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMP3Stream::Unlock(void) +{ + m_csLock.Unlock(); +} + +// ------------------------------------------------------------------------------------------------ +// name: DecodeFrame() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CMP3Stream::DecodeFrame(void) +{ + if (0 == m_dwDataBufLen) + { + m_dwDataBufPos = 0; + } + + if (m_dwDataBufPos + m_dwDataBufLen + MP3_DECODE_LEN > MP3_DECODE_BUF_LEN) + { + return true; + } + + size_t nBytesRead = 0; + + mpg123_read(m_pcoMH, m_ucDataBuffer + m_dwDataBufPos + m_dwDataBufLen, MP3_DECODE_LEN, &nBytesRead); + + m_dwDataBufLen += (DWORD) nBytesRead; + + return (m_dwDataBufLen > 0); +} + +// ------------------------------------------------------------------------------------------------ +// name: OpenFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CMP3Stream::OpenFile(const WORD *pcwsFileName) +{ + if (m_coFileIn.Open(pcwsFileName)) + { + m_nDataBegin = 0; + m_nDataTotal = m_coFileIn.GetFileSize(); + + // check ID3 Tag V2.x + + BYTE ucBuffer[8]; + bool bFound; + +TRY_ID3_AGAIN: + + bFound = false; + + if (6 == m_coFileIn.Read(ucBuffer, 6)) + { + if (ucBuffer[0] == 'I' && + ucBuffer[1] == 'D' && + ucBuffer[2] == '3') + { + bFound = true; + + DWORD dwHeaderSize; + + if (m_coFileIn.ReadInverseDW(dwHeaderSize)) + { + dwHeaderSize = ((dwHeaderSize & 0x7F000000) >> 3) + + ((dwHeaderSize & 0x007F0000) >> 2) + + ((dwHeaderSize & 0x00007F00) >> 1) + + ((dwHeaderSize & 0x0000007F) ); + + dwHeaderSize += 10; + + m_nDataBegin += dwHeaderSize; + m_nDataTotal -= dwHeaderSize; + + if (ucBuffer[3] >= 0x03) // ID3 Tag version >= 2.3 + { + if (ucBuffer[5] & 0x40) // has extended header + { + if (m_coFileIn.ReadInverseDW(dwHeaderSize)) + { + dwHeaderSize = ((dwHeaderSize & 0x7F000000) >> 3) + + ((dwHeaderSize & 0x007F0000) >> 2) + + ((dwHeaderSize & 0x00007F00) >> 1) + + ((dwHeaderSize & 0x0000007F) ); + + dwHeaderSize += 4; + + m_nDataBegin += dwHeaderSize; + m_nDataTotal -= dwHeaderSize; + } + } + } + } + } + } + + SeekFile(0, SEEK_SET); + + if (bFound) + { + goto TRY_ID3_AGAIN; + } +/* + m_coFileIn.Read(ucBuffer, 2); + + if (ucBuffer[0] != 0xFF || ucBuffer[1] < 0xF0) + { + m_nDataBegin ++; + m_nDataTotal --; + + SeekFile(0, SEEK_SET); + + goto TRY_ID3_AGAIN; + } + + SeekFile(0, SEEK_SET); +*/ + return true; + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CMP3Stream::ReadFile(PVOID pBuf, DWORD dwLen) +{ + return m_coFileIn.Read(pBuf, dwLen); +} + +// ------------------------------------------------------------------------------------------------ +// name: SeekFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +long IIEP::CMP3Stream::SeekFile(long nOffset, int iOrigin) +{ + switch (iOrigin) + { + case SEEK_SET: + if (nOffset < 0 || nOffset >= m_nDataTotal) return -1; + break; + + case SEEK_CUR: + nOffset += (m_coFileIn.GetReadPosition() - m_nDataBegin); + if (nOffset < 0 || nOffset >= m_nDataTotal) return -1; + break; + + case SEEK_END: + nOffset = m_nDataTotal - 1 + nOffset; + if (nOffset < 0 || nOffset >= m_nDataTotal) return -1; + break; + } + + if (m_coFileIn.Seek(nOffset + m_nDataBegin, SEEK_SET)) + { + return nOffset; + } + + return -1; +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE b/ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE diff --git a/ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj b/ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj new file mode 100644 index 0000000..6c68b6e --- /dev/null +++ b/ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/MSVC++/config.h b/ports/MSVC++/config.h new file mode 100644 index 0000000..ca8733d --- /dev/null +++ b/ports/MSVC++/config.h @@ -0,0 +1,42 @@ +#define strcasecmp _strcmpi +#define strncasecmp _strnicmp + +#define HAVE_STRERROR 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_LIMITS_H 1 + +#define HAVE_STRDUP +#define HAVE_STDLIB_H +#define HAVE_STDINT_H +#define HAVE_INTTYPES_H +#define HAVE_STRING_H + +#ifdef _M_ARM +#define ASMALIGN_ARMASM 1 +#else +#define ASMALIGN_BALIGN 1 +#endif + + +/* We want some frame index, eh? */ +#define FRAME_INDEX 1 +#define INDEX_SIZE 1000 + +/* also gapless playback! */ +#define GAPLESS 1 +/* #ifdef GAPLESS +#undef GAPLESS +#endif */ + +/* #define DEBUG +#define EXTRA_DEBUG */ + +#define REAL_IS_FLOAT + +#define inline __inline + +/* we are on win32 */ +#define HAVE_WINDOWS_H + +/* use the unicode support within libmpg123 */ +#define WANT_WIN32_UNICODE diff --git a/ports/MSVC++/examples/feedseek.c b/ports/MSVC++/examples/feedseek.c new file mode 100644 index 0000000..80cc3fd --- /dev/null +++ b/ports/MSVC++/examples/feedseek.c @@ -0,0 +1,240 @@ +/* + feedseek: test program for libmpg123, showing how to use fuzzy seeking in feeder mode + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#include +#include +#include +#include + +#define INBUFF 16384 * 2 * 2 +#define WAVE_FORMAT_PCM 0x0001 +#define WAVE_FORMAT_IEEE_FLOAT 0x0003 + +FILE *out; +size_t totaloffset, dataoffset; +long rate; +int channels, enc; +unsigned short bitspersample, wavformat; + +// write wav header +void initwav() +{ + unsigned int tmp32 = 0; + unsigned short tmp16 = 0; + + fwrite("RIFF", 1, 4, out); + totaloffset = ftell(out); + + fwrite(&tmp32, 1, 4, out); // total size + fwrite("WAVE", 1, 4, out); + fwrite("fmt ", 1, 4, out); + tmp32 = 16; + fwrite(&tmp32, 1, 4, out); // format length + tmp16 = wavformat; + fwrite(&tmp16, 1, 2, out); // format + tmp16 = channels; + fwrite(&tmp16, 1, 2, out); // channels + tmp32 = rate; + fwrite(&tmp32, 1, 4, out); // sample rate + tmp32 = rate * bitspersample/8 * channels; + fwrite(&tmp32, 1, 4, out); // bytes / second + tmp16 = bitspersample/8 * channels; // float 16 or signed int 16 + fwrite(&tmp16, 1, 2, out); // block align + tmp16 = bitspersample; + fwrite(&tmp16, 1, 2, out); // bits per sample + fwrite("data ", 1, 4, out); + tmp32 = 0; + dataoffset = ftell(out); + fwrite(&tmp32, 1, 4, out); // data length +} + +// rewrite wav header with final length infos +void closewav() +{ + unsigned int tmp32 = 0; + unsigned short tmp16 = 0; + + long total = ftell(out); + fseek(out, totaloffset, SEEK_SET); + tmp32 = total - (totaloffset + 4); + fwrite(&tmp32, 1, 4, out); + fseek(out, dataoffset, SEEK_SET); + tmp32 = total - (dataoffset + 4); + + fwrite(&tmp32, 1, 4, out); +} + +// determine correct wav format and bits per sample +// from mpg123 enc value +void initwavformat() +{ + if(enc & MPG123_ENC_FLOAT_64) + { + bitspersample = 64; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if(enc & MPG123_ENC_FLOAT_32) + { + bitspersample = 32; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if(enc & MPG123_ENC_16) + { + bitspersample = 16; + wavformat = WAVE_FORMAT_PCM; + } + else + { + bitspersample = 8; + wavformat = WAVE_FORMAT_PCM; + } +} + +int _tmain(int argc, TCHAR **argv) +{ + unsigned char buf[INBUFF]; + unsigned char *audio; + FILE *in; + mpg123_handle *m; + int ret, state; + size_t inc, outc; + off_t len, num; + size_t bytes; + off_t inoffset; + size_t nrates; + const long *rates; + size_t i; + inc = outc = 0; + nrates = 0; + rates = NULL; + + if(argc < 3) + { + fprintf(stderr,"Please supply in and out filenames\n"); + return -1; + } + + mpg123_init(); + + m = mpg123_new(NULL, &ret); + if(m == NULL) + { + fprintf(stderr,"Unable to create mpg123 handle: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + mpg123_param(m, MPG123_VERBOSE, 4, 0); + + ret = mpg123_param(m, MPG123_FLAGS, MPG123_FUZZY | MPG123_SEEKBUFFER | MPG123_GAPLESS, 0); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set library options: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + // Let the seek index auto-grow and contain an entry for every frame + ret = mpg123_param(m, MPG123_INDEX_SIZE, -1, 0); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set index size: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + // Use float output formats only + ret = mpg123_format_none(m); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to disable all output formats: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + mpg123_rates(&rates, &nrates); + for(i=0; i +#include + +int _tmain(int argc, _TCHAR* argv[]) +{ + mpg123_handle *m; + int i; + if(argc < 2) + { + fprintf(stderr, "\nI will give you the estimated and exact sample lengths of MPEG audio files.\n"); + fprintf(stderr, "\nUsage: %ls \n\n", argv[0]); + return -1; + } + mpg123_init(); + m = mpg123_new(NULL, NULL); + mpg123_param(m, MPG123_RESYNC_LIMIT, -1, 0); /* New in library version 0.0.1 . */ + for(i = 1; i < argc; ++i) + { + off_t a, b; + + mpg123_topen(m, argv[i]); + + a = mpg123_length(m); + mpg123_scan(m); + b = mpg123_length(m); + + mpg123_tclose(m); + + printf("File %i: estimated %li vs. scanned %li\n", i, (long)a, (long)b); + } + + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/ports/MSVC++/mpg123.h b/ports/MSVC++/mpg123.h new file mode 100644 index 0000000..df3cc14 --- /dev/null +++ b/ports/MSVC++/mpg123.h @@ -0,0 +1,45 @@ +/* + mpg123_msvc: MPEG Audio Decoder library wrapper header for MS VC++ 2005 + + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + initially written by Patrick Dehne and Thomas Orgis. +*/ +#ifndef MPG123_MSVC_H +#define MPG123_MSVC_H + +#include +#include +#include + +// Needed for Visual Studio versions before VS 2010. +#if (_MSC_VER < 1600) +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +#define PRIiMAX "I64i" +typedef __int64 intmax_t; +#else +#include +#include +#endif + +// ftell returns long, _ftelli64 returns __int64 +// off_t is long, not __int64, use ftell +#define ftello ftell + +#define MPG123_NO_CONFIGURE +#include "mpg123.h.in" /* Yes, .h.in; we include the configure template! */ + +#ifdef __cplusplus +extern "C" { +#endif + + // Wrapper around mpg123_open that supports path names with unicode + // characters + MPG123_EXPORT int mpg123_topen(mpg123_handle *fr, const _TCHAR *path); + MPG123_EXPORT int mpg123_tclose(mpg123_handle *fr); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ports/MSVC++/msvc.c b/ports/MSVC++/msvc.c new file mode 100644 index 0000000..63ad8ea --- /dev/null +++ b/ports/MSVC++/msvc.c @@ -0,0 +1,65 @@ +/* + msvc: libmpg123 add-ons for MSVC++ + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + originally written by Patrick Dehne (inspired by libmpg123/readers.c) + +*/ + +#include "mpg123lib_intern.h" + +#include +#include +#include + +#include "debug.h" + +/* mpg123_replace_reader expects size_t as count, _read unsigned int */ +static ssize_t read_helper(int handle, void *dest, size_t count) +{ + return _read(handle, dest, (unsigned int) count); +} + +int mpg123_topen(mpg123_handle *fr, const _TCHAR *path) +{ + int ret; + int filept; /* descriptor of opened file/stream */ + + ret = mpg123_replace_reader(fr, read_helper, _lseek); + if(ret != MPG123_OK) + { + return ret; + } + + if((filept = _topen(path, O_RDONLY|O_BINARY)) < 0) + { + /* Will not work with unicode path name + if(NOQUIET) error2("Cannot open file %s: %s", path, strerror(errno)); */ + + if(NOQUIET) error1("Cannot open file: %s", strerror(errno)); + fr->err = MPG123_BAD_FILE; + return filept; /* error... */ + } + + if(mpg123_open_fd(fr, filept) == MPG123_OK) { + return MPG123_OK; + } + else + { + _close(filept); + return MPG123_ERR; + } +} + +int mpg123_tclose(mpg123_handle *fr) +{ + int ret, filept; + + filept = fr->rdat.filept; + ret = mpg123_close(fr); + _close(filept); + + return ret; +} diff --git a/ports/README b/ports/README new file mode 100644 index 0000000..9fcb369 --- /dev/null +++ b/ports/README @@ -0,0 +1,41 @@ +DISCLAIMER: The contents of the ports directory are included for convenience, +but they usually contain files contributed by various people, not the core +mpg123 team. The stuff is not tested by us. In some cases, it's even +impossible to tell what is really inside. Use at your own risk (well, like +all Free Software, actually;-). + +This directory contains some (contributed) works covering usage and/or building +of mpg123/libmpg123 from different programming environments. Note that those +may be a bit outdated (especially when a file is added/removed in libmpg123 +sources); as the team lacks resource to test everything. But in any case, +the ports can provide a good starting point on the respective platform, to get +it to work with minimal fuzz. + +- Delphi: mpg123_.pas + Unit for linking against libmpg123 (Win32, DLL). + ...by Arthur Pires +- Sony PSP: Sony_PSP/; building libmpg123 for the PSP (used for the MODO player). + ...by Bastian Pflieger +- MSVC++: Microsoft Windows / Visual C++ builds + - MSVC++/CMP3Stream: + project for building libmpg123 with interface class. + ...by "Gates Fan" + - MSVC++/mpg123.h + A wrapper header over mpg123.h.in (yes, the template file in + ../src/libmpg123) to use in MSVC++ projects that link to libmpg123. + - MSVC++/YYYY contain project files for building and using libmpg123 with + the corresponding versions of Microsoft Visual C++. + To use it add the project to your solution. Then add a reference to + libmpg123 from the project that wants to use it. + Also add ports/MSVC++ and src/libmpg123 to the include path. + If you want to use the asm build you will need yasm (http://www.tortall.net/projects/yasm/). + Please put yasm.exe into a directory where MSVC++ can find it. Finally + switch the libmpg123 project to the + Release_MMX_Dll (outdated! There should be Realease_X86_Dll or similar by now) + build using the Visual Studio Configuration Manager. + - Xcode contains the project file for building and using libmpg123 with + Xcode for Mac and iOS (arm and simulator builds). Please add the + ports/Xcode folder to the header search path of your project so that + Xcode can find the right mpg123.h and config.h. Then drag the mpg123 + Xcode project into your own project. Finally in your build target, build + phases, add mpg123-ios or mpg123-mac to the libraries to link. diff --git a/ports/Sony_PSP/Makefile.psp b/ports/Sony_PSP/Makefile.psp new file mode 100644 index 0000000..12d8664 --- /dev/null +++ b/ports/Sony_PSP/Makefile.psp @@ -0,0 +1,38 @@ +PSPSDK = $(shell psp-config --pspsdk-path) +PSPDIR = $(shell psp-config --psp-prefix) + +#DEFINES := PSP OPT_GENERIC REAL_IS_FIXED HAVE_CONFIG_H +DEFINES := PSP OPT_GENERIC REAL_IS_FLOAT HAVE_CONFIG_H +#DEFINES := PSP OPT_GENERIC FLOATOUT REAL_IS_FLOAT HAVE_CONFIG_H +DEFINEFLAGS := $(addprefix -D,$(DEFINES)) +INCDIR := ../. +CFLAGS = -g -O2 -Wall -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $(DEFINEFLAGS) + +MPG123_OBJS = compat.o parse.o frame.o format.o index.o synth.o synth_8bit.o \ + ntom.o icy2utf8.o synth_real.o synth_s32.o\ + equalizer.o icy.o id3.o layer1.o layer2.o layer3.o optimize.o readers.o tabinit.o stringbuf.o libmpg123.o dct64.o + +MPG123_LIB_FILE = ./libmpg123.a + +OBJS = $(MPG123_OBJS) +TARGET_LIB = $(MPG123_LIB_FILE) + +include $(PSPSDK)/lib/build.mak + + + +#################### +## Makefile rules ## +#################### + +install: $(MPG123_LIB_FILE) + @echo "" + @echo "**********************************************************************" + @echo "Installing libstsound into $(PSPDIR)" + @mkdir -p $(PSPDIR)/include $(PSPDIR)/lib + @cp -v mpg123.h $(PSPDIR)/include + @cp -v libmpg123.a $(PSPDIR)/lib + @echo "Done" + @echo "**********************************************************************" + @echo "" + diff --git a/ports/Sony_PSP/README b/ports/Sony_PSP/README new file mode 100644 index 0000000..ce9b45c --- /dev/null +++ b/ports/Sony_PSP/README @@ -0,0 +1,11 @@ +Hi + +* Place Makefile.psp in the directory src/libmpg123. +* Patch readers.c (present in src/libmpg123) using readers.c.patch +* Place Config.h in directory src/ +* cd to src/libmpg123 and do "make -f Makefile.psp install" + +Tested on mpg123 1.4.x and psptoolchain rev. 2398 + +Regards +Bastian diff --git a/ports/Sony_PSP/config.h b/ports/Sony_PSP/config.h new file mode 100644 index 0000000..957c5e9 --- /dev/null +++ b/ports/Sony_PSP/config.h @@ -0,0 +1,368 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It's for 32bit x86... */ +#define ABI_ALIGN_FUN 1 + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +/* #undef ASMALIGN_EXP */ + +/* Define if __attribute__((aligned(16))) shall be used */ +/* #undef CCALIGN */ + +/* Define if checking of stack alignment is wanted. */ +#define CHECK_ALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "alsa,oss,esd,sdl,nas,arts" + +/* Define if building with dynamcally linked libmpg123 */ +#define DYNAMIC_BUILD 1 + +/* Define if FIFO support is enabled. */ +#define FIFO 1 + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_SOUNDCARD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +#define HAVE_LTDL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define if network support is enabled. */ +/* #define NETWORK 1 */ + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit integer output. */ +/* define NO_32BIT 1 */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* define NO_REAL 1 */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.8rc5" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.8rc5" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 4 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +#define USE_MODULES 1 + +/* Version number of package */ +#define VERSION "1.8rc5" + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if does not define. */ +/* #undef int16_t */ + +/* Define to `int' if does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if does not define. */ +/* #undef size_t */ + +/* Define to `long' if does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef uint32_t */ diff --git a/ports/Sony_PSP/readers.c.patch b/ports/Sony_PSP/readers.c.patch new file mode 100644 index 0000000..73bbb26 --- /dev/null +++ b/ports/Sony_PSP/readers.c.patch @@ -0,0 +1,2 @@ +14a15 +> #include diff --git a/ports/Xcode/config.h b/ports/Xcode/config.h new file mode 100644 index 0000000..651b521 --- /dev/null +++ b/ports/Xcode/config.h @@ -0,0 +1,197 @@ +#include "TargetConditionals.h" + +#if TARGET_IPHONE_SIMULATOR + #define DEFAULT_OUTPUT_MODULE "dummy" + /* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + /* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + /* #undef HAVE_CORESERVICES_CORESERVICES_H */ + /* #undef HAVE_OPENAL_ALC_H */ + /* #undef HAVE_OPENAL_AL_H */ + #define ABI_ALIGN_FUN 1 + #define HAVE_GAI_ADDRCONFIG 1 + #define LFS_ALIAS_BITS 32 + /* #undef HAVE_LIBMX */ + #define HAVE_MMAP 1 + #define IEEE_FLOAT 1 + #define SIZEOF_INT32_T 4 + #define SIZEOF_LONG 4 + #define SIZEOF_OFF_T 8 + #define SIZEOF_SIZE_T 4 + #define SIZEOF_SSIZE_T 4 + #define OPT_GENERIC +#elif TARGET_OS_IPHONE + #define DEFAULT_OUTPUT_MODULE "dummy" + /* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + /* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + /* #undef HAVE_CORESERVICES_CORESERVICES_H */ + /* #undef HAVE_OPENAL_ALC_H */ + /* #undef HAVE_OPENAL_AL_H */ + /* #undef ABI_ALIGN_FUN */ + /* #undef HAVE_GAI_ADDRCONFIG */ + #define LFS_ALIAS_BITS 32 + /* #undef HAVE_LIBMX */ + /* #undef HAVE_MMAP */ + /* #undef IEEE_FLOAT */ + #define SIZEOF_INT32_T 4 + #define SIZEOF_LONG 4 + #define SIZEOF_OFF_T 8 + #define SIZEOF_SIZE_T 4 + #define SIZEOF_SSIZE_T 4 + #define OPT_NEON +#elif TARGET_OS_MAC + #define DEFAULT_OUTPUT_MODULE "coreaudio" + #define HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H 1 + #define HAVE_AUDIOUNIT_AUDIOUNIT_H 1 + #define HAVE_CORESERVICES_CORESERVICES_H 1 + #define HAVE_OPENAL_ALC_H 1 + #define HAVE_OPENAL_AL_H 1 + /* #undef ABI_ALIGN_FUN */ + #define HAVE_GAI_ADDRCONFIG 1 + #define LFS_ALIAS_BITS 64 + #define HAVE_LIBMX 1 + #define HAVE_MMAP 1 + #define IEEE_FLOAT 1 + #define SIZEOF_INT32_T 4 + #define SIZEOF_LONG 8 + #define SIZEOF_OFF_T 8 + #define SIZEOF_SIZE_T 8 + #define SIZEOF_SIZE_T 8 + #define SIZEOF_SSIZE_T 8 + #define OPT_GENERIC +#else + #error "Unknown target." +#endif + +/* #undef ACCURATE_ROUNDING */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ +#define ASMALIGN_EXP 1 +#define CCALIGN 1 +/* #undef DEBUG */ +/* #undef DYNAMIC_BUILD */ +#define FIFO 1 +#define FRAME_INDEX 1 +#define GAPLESS 1 +/* #undef HAVE_ALC_H */ +/* #undef HAVE_ALIB_H */ +/* #undef HAVE_AL_ALC_H */ +/* #undef HAVE_AL_AL_H */ +/* #undef HAVE_AL_H */ +#define HAVE_ARPA_INET_H 1 +/* #undef HAVE_ASM_AUDIOIO_H */ +#define HAVE_ATOLL 1 +/* #undef HAVE_AUDIOS_H */ +/* #undef HAVE_CULIB_H */ +#define HAVE_DLFCN_H 1 +#define HAVE_GETADDRINFO 1 +#define HAVE_GETPAGESIZE 1 +#define HAVE_GETUID 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LANGINFO_H 1 +#define HAVE_LIBM 1 +#define HAVE_LIMITS_H 1 +/* #undef HAVE_LINUX_SOUNDCARD_H */ +#define HAVE_LOCALE_H 1 +/* #undef HAVE_LTDL */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ +#define HAVE_MEMORY_H 1 +#define HAVE_MKFIFO 1 +#define HAVE_NETDB_H 1 +#define HAVE_NETINET_IN_H 1 +/* #undef HAVE_NETINET_TCP_H */ +#define HAVE_NL_LANGINFO 1 +/* #undef HAVE_OS2ME_H */ +/* #undef HAVE_OS2_H */ +#define HAVE_RANDOM 1 +#define HAVE_SCHED_H 1 +/* #undef HAVE_SCHED_SETSCHEDULER */ +#define HAVE_SETLOCALE 1 +#define HAVE_SETPRIORITY 1 +#define HAVE_SETUID 1 +#define HAVE_SIGNAL_H 1 +/* #undef HAVE_SNDIO_H */ +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRDUP 1 +#define HAVE_STRERROR 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +/* #undef HAVE_SUN_AUDIOIO_H */ +/* #undef HAVE_SYS_AUDIOIO_H */ +/* #undef HAVE_SYS_AUDIO_H */ +#define HAVE_SYS_IOCTL_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_RESOURCE_H 1 +#define HAVE_SYS_SIGNAL_H 1 +#define HAVE_SYS_SOCKET_H 1 +/* #undef HAVE_SYS_SOUNDCARD_H */ +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_WAIT_H 1 +#define HAVE_TERMIOS 1 +#define HAVE_UNISTD_H 1 +/* #undef HAVE_WINDOWS_H */ +/* #undef HAVE_WS2TCPIP_H */ +#define INDEX_SIZE 1000 +#define IPV6 1 +#define LT_OBJDIR ".libs/" +#define MODULE_FILE_SUFFIX ".la" +#define NETWORK 1 +/* #undef NO_16BIT */ +/* #undef NO_32BIT */ +/* #undef NO_8BIT */ +/* #undef NO_DOWNSAMPLE */ +/* #undef NO_ERETURN */ +/* #undef NO_ERRORMSG */ +/* #undef NO_FEEDER */ +/* #undef NO_ICY */ +/* #undef NO_ID3V2 */ +/* #undef NO_LAYER1 */ +/* #undef NO_LAYER2 */ +/* #undef NO_LAYER3 */ +/* #undef NO_NTOM */ +/* #undef NO_REAL */ +/* #undef NO_STRING */ +/* #undef NO_WARNING */ +#define PACKAGE "mpg123" +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" +#define PACKAGE_NAME "mpg123" +#define PACKAGE_STRING "mpg123 1.14.0" +#define PACKAGE_TARNAME "mpg123" +#define PACKAGE_URL "" +#define PACKAGE_VERSION "1.14.0" +/* #undef PORTAUDIO18 */ +#define STDC_HEADERS 1 +/* #undef USE_MODULES */ +#define VERSION "1.14.0" +/* #undef WANT_WIN32_FIFO */ +/* #undef WANT_WIN32_SOCKETS */ +/* #undef WANT_WIN32_UNICODE */ +/* #undef WINVER */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif +/* #undef _FILE_OFFSET_BITS */ +/* #undef _LARGE_FILES */ +/* #undef _WIN32_WINNT */ +/* #undef const */ +#ifndef __cplusplus +/* #undef inline */ +#endif +/* #undef int16_t */ +/* #undef int32_t */ +/* #undef off_t */ +/* #undef size_t */ +/* #undef ssize_t */ +/* #undef uint16_t */ +/* #undef uint32_t */ +/* #undef uintptr_t */ + +#define REAL_IS_FLOAT diff --git a/ports/Xcode/mpg123.h b/ports/Xcode/mpg123.h new file mode 100644 index 0000000..9771180 --- /dev/null +++ b/ports/Xcode/mpg123.h @@ -0,0 +1,17 @@ +/* + mpg123.h: MPEG Audio Decoder library wrapper header for Xcode + + copyright 2012 by the mpg123 project - free software under the terms of the LGPL 2.1 + initially written by Patrick Dehne. +*/ + +#ifndef MPG123_XCODE_H +#define MPG123_XCODE_H + +#include +#include + +#define MPG123_NO_CONFIGURE +#include "../../src/libmpg123/mpg123.h.in" /* Yes, .h.in; we include the configure template! */ + +#endif diff --git a/ports/Xcode/mpg123.xcodeproj/project.pbxproj b/ports/Xcode/mpg123.xcodeproj/project.pbxproj new file mode 100644 index 0000000..30cb5c2 --- /dev/null +++ b/ports/Xcode/mpg123.xcodeproj/project.pbxproj @@ -0,0 +1,670 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CD132C23152A4B8000B4F5A8 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C21152A4B8000B4F5A8 /* config.h */; }; + CD132C24152A4B8000B4F5A8 /* mpg123.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C22152A4B8000B4F5A8 /* mpg123.h */; }; + CD132C7E152A4D7E00B4F5A8 /* compat.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C62152A4D7E00B4F5A8 /* compat.h */; }; + CD132C7F152A4D7E00B4F5A8 /* decode.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C63152A4D7E00B4F5A8 /* decode.h */; }; + CD132C80152A4D7E00B4F5A8 /* dither.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C64152A4D7E00B4F5A8 /* dither.h */; }; + CD132C81152A4D7E00B4F5A8 /* frame.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C65152A4D7E00B4F5A8 /* frame.h */; }; + CD132C82152A4D7E00B4F5A8 /* getbits.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C66152A4D7E00B4F5A8 /* getbits.h */; }; + CD132C83152A4D7E00B4F5A8 /* getcpuflags.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C67152A4D7E00B4F5A8 /* getcpuflags.h */; }; + CD132C84152A4D7E00B4F5A8 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C68152A4D7E00B4F5A8 /* huffman.h */; }; + CD132C85152A4D7E00B4F5A8 /* icy.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C69152A4D7E00B4F5A8 /* icy.h */; }; + CD132C86152A4D7E00B4F5A8 /* icy2utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6A152A4D7E00B4F5A8 /* icy2utf8.h */; }; + CD132C87152A4D7E00B4F5A8 /* id3.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6B152A4D7E00B4F5A8 /* id3.h */; }; + CD132C88152A4D7E00B4F5A8 /* index.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6C152A4D7E00B4F5A8 /* index.h */; }; + CD132C89152A4D7E00B4F5A8 /* intsym.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6D152A4D7E00B4F5A8 /* intsym.h */; }; + CD132C8A152A4D7E00B4F5A8 /* l2tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6E152A4D7E00B4F5A8 /* l2tables.h */; }; + CD132C8B152A4D7E00B4F5A8 /* l3_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6F152A4D7E00B4F5A8 /* l3_integer_tables.h */; }; + CD132C8C152A4D7E00B4F5A8 /* l12_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C70152A4D7E00B4F5A8 /* l12_integer_tables.h */; }; + CD132C8D152A4D7E00B4F5A8 /* mangle.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C71152A4D7E00B4F5A8 /* mangle.h */; }; + CD132C8E152A4D7E00B4F5A8 /* mpg123lib_intern.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C73152A4D7E00B4F5A8 /* mpg123lib_intern.h */; }; + CD132C8F152A4D7E00B4F5A8 /* optimize.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C74152A4D7E00B4F5A8 /* optimize.h */; }; + CD132C90152A4D7E00B4F5A8 /* parse.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C75152A4D7E00B4F5A8 /* parse.h */; }; + CD132C91152A4D7E00B4F5A8 /* reader.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C76152A4D7E00B4F5A8 /* reader.h */; }; + CD132C92152A4D7E00B4F5A8 /* sample.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C77152A4D7E00B4F5A8 /* sample.h */; }; + CD132C93152A4D7E00B4F5A8 /* synth_8bit.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C78152A4D7E00B4F5A8 /* synth_8bit.h */; }; + CD132C94152A4D7E00B4F5A8 /* synth_mono.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C79152A4D7E00B4F5A8 /* synth_mono.h */; }; + CD132C95152A4D7E00B4F5A8 /* synth_ntom.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7A152A4D7E00B4F5A8 /* synth_ntom.h */; }; + CD132C96152A4D7E00B4F5A8 /* synth.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7B152A4D7E00B4F5A8 /* synth.h */; }; + CD132C97152A4D7E00B4F5A8 /* synths.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7C152A4D7E00B4F5A8 /* synths.h */; }; + CD132C98152A4D7E00B4F5A8 /* true.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7D152A4D7E00B4F5A8 /* true.h */; }; + CD132CB3152A4E7000B4F5A8 /* compat.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C99152A4E7000B4F5A8 /* compat.c */; }; + CD132CB4152A4E7000B4F5A8 /* dct64.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9A152A4E7000B4F5A8 /* dct64.c */; }; + CD132CB5152A4E7000B4F5A8 /* dither.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9B152A4E7000B4F5A8 /* dither.c */; }; + CD132CB6152A4E7000B4F5A8 /* equalizer.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9C152A4E7000B4F5A8 /* equalizer.c */; }; + CD132CB7152A4E7000B4F5A8 /* feature.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9D152A4E7000B4F5A8 /* feature.c */; }; + CD132CB8152A4E7000B4F5A8 /* format.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9E152A4E7000B4F5A8 /* format.c */; }; + CD132CB9152A4E7000B4F5A8 /* frame.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9F152A4E7000B4F5A8 /* frame.c */; }; + CD132CBA152A4E7000B4F5A8 /* icy.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA0152A4E7000B4F5A8 /* icy.c */; }; + CD132CBB152A4E7000B4F5A8 /* icy2utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA1152A4E7000B4F5A8 /* icy2utf8.c */; }; + CD132CBC152A4E7000B4F5A8 /* id3.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA2152A4E7000B4F5A8 /* id3.c */; }; + CD132CBD152A4E7000B4F5A8 /* index.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA3152A4E7000B4F5A8 /* index.c */; }; + CD132CBE152A4E7000B4F5A8 /* layer1.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA4152A4E7000B4F5A8 /* layer1.c */; }; + CD132CBF152A4E7000B4F5A8 /* layer2.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA5152A4E7000B4F5A8 /* layer2.c */; }; + CD132CC0152A4E7000B4F5A8 /* layer3.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA6152A4E7000B4F5A8 /* layer3.c */; }; + CD132CC1152A4E7000B4F5A8 /* lfs_alias.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA7152A4E7000B4F5A8 /* lfs_alias.c */; }; + CD132CC2152A4E7000B4F5A8 /* libmpg123.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA8152A4E7000B4F5A8 /* libmpg123.c */; }; + CD132CC3152A4E7000B4F5A8 /* ntom.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA9152A4E7000B4F5A8 /* ntom.c */; }; + CD132CC4152A4E7000B4F5A8 /* optimize.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAA152A4E7000B4F5A8 /* optimize.c */; }; + CD132CC5152A4E7000B4F5A8 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAB152A4E7000B4F5A8 /* parse.c */; }; + CD132CC6152A4E7000B4F5A8 /* readers.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAC152A4E7000B4F5A8 /* readers.c */; }; + CD132CC7152A4E7000B4F5A8 /* stringbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAD152A4E7000B4F5A8 /* stringbuf.c */; }; + CD132CC8152A4E7000B4F5A8 /* synth_8bit.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAE152A4E7000B4F5A8 /* synth_8bit.c */; }; + CD132CC9152A4E7000B4F5A8 /* synth_real.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAF152A4E7000B4F5A8 /* synth_real.c */; }; + CD132CCA152A4E7000B4F5A8 /* synth_s32.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB0152A4E7000B4F5A8 /* synth_s32.c */; }; + CD132CCB152A4E7000B4F5A8 /* synth.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB1152A4E7000B4F5A8 /* synth.c */; }; + CD132CCC152A4E7000B4F5A8 /* tabinit.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB2152A4E7000B4F5A8 /* tabinit.c */; }; + CD132CD6152A511C00B4F5A8 /* dct64_neon_float.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CCD152A511800B4F5A8 /* dct64_neon_float.S */; }; + CD132CD7152A511C00B4F5A8 /* dct64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CCE152A511900B4F5A8 /* dct64_neon.S */; }; + CD132CD9152A511C00B4F5A8 /* synth_neon_float.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD0152A511A00B4F5A8 /* synth_neon_float.S */; }; + CD132CDA152A511C00B4F5A8 /* synth_neon_s32.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD1152A511A00B4F5A8 /* synth_neon_s32.S */; }; + CD132CDB152A511C00B4F5A8 /* synth_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD2152A511A00B4F5A8 /* synth_neon.S */; }; + CD132CDC152A511C00B4F5A8 /* synth_stereo_neon_float.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD3152A511B00B4F5A8 /* synth_stereo_neon_float.S */; }; + CD132CDD152A511C00B4F5A8 /* synth_stereo_neon_s32.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD4152A511B00B4F5A8 /* synth_stereo_neon_s32.S */; }; + CD132CDE152A511C00B4F5A8 /* synth_stereo_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD5152A511C00B4F5A8 /* synth_stereo_neon.S */; }; + CDB0288C152B760700B01410 /* compat.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C99152A4E7000B4F5A8 /* compat.c */; }; + CDB0288D152B760700B01410 /* compat.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C62152A4D7E00B4F5A8 /* compat.h */; }; + CDB0288E152B760700B01410 /* dct64.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9A152A4E7000B4F5A8 /* dct64.c */; }; + CDB02890152B760D00B01410 /* decode.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C63152A4D7E00B4F5A8 /* decode.h */; }; + CDB02891152B760D00B01410 /* dither.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C64152A4D7E00B4F5A8 /* dither.h */; }; + CDB02892152B760D00B01410 /* dither.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9B152A4E7000B4F5A8 /* dither.c */; }; + CDB02893152B760D00B01410 /* equalizer.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9C152A4E7000B4F5A8 /* equalizer.c */; }; + CDB02894152B760D00B01410 /* feature.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9D152A4E7000B4F5A8 /* feature.c */; }; + CDB02895152B760D00B01410 /* format.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9E152A4E7000B4F5A8 /* format.c */; }; + CDB02896152B761300B01410 /* frame.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C65152A4D7E00B4F5A8 /* frame.h */; }; + CDB02897152B761300B01410 /* frame.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9F152A4E7000B4F5A8 /* frame.c */; }; + CDB02898152B761300B01410 /* getbits.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C66152A4D7E00B4F5A8 /* getbits.h */; }; + CDB02899152B761300B01410 /* getcpuflags.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C67152A4D7E00B4F5A8 /* getcpuflags.h */; }; + CDB0289A152B761300B01410 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C68152A4D7E00B4F5A8 /* huffman.h */; }; + CDB0289B152B761300B01410 /* icy.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C69152A4D7E00B4F5A8 /* icy.h */; }; + CDB0289C152B761300B01410 /* icy.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA0152A4E7000B4F5A8 /* icy.c */; }; + CDB0289D152B761300B01410 /* icy2utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6A152A4D7E00B4F5A8 /* icy2utf8.h */; }; + CDB0289E152B761300B01410 /* icy2utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA1152A4E7000B4F5A8 /* icy2utf8.c */; }; + CDB0289F152B761C00B01410 /* id3.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6B152A4D7E00B4F5A8 /* id3.h */; }; + CDB028A0152B761C00B01410 /* id3.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA2152A4E7000B4F5A8 /* id3.c */; }; + CDB028A1152B761C00B01410 /* index.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6C152A4D7E00B4F5A8 /* index.h */; }; + CDB028A2152B761C00B01410 /* index.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA3152A4E7000B4F5A8 /* index.c */; }; + CDB028A3152B761C00B01410 /* intsym.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6D152A4D7E00B4F5A8 /* intsym.h */; }; + CDB028A4152B761C00B01410 /* l2tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6E152A4D7E00B4F5A8 /* l2tables.h */; }; + CDB028A5152B761C00B01410 /* l3_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6F152A4D7E00B4F5A8 /* l3_integer_tables.h */; }; + CDB028A6152B761C00B01410 /* l12_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C70152A4D7E00B4F5A8 /* l12_integer_tables.h */; }; + CDB028A7152B761C00B01410 /* layer1.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA4152A4E7000B4F5A8 /* layer1.c */; }; + CDB028A8152B762E00B01410 /* layer2.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA5152A4E7000B4F5A8 /* layer2.c */; }; + CDB028A9152B763500B01410 /* layer3.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA6152A4E7000B4F5A8 /* layer3.c */; }; + CDB028AA152B763500B01410 /* lfs_alias.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA7152A4E7000B4F5A8 /* lfs_alias.c */; }; + CDB028AB152B763500B01410 /* libmpg123.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA8152A4E7000B4F5A8 /* libmpg123.c */; }; + CDB028AC152B763500B01410 /* mangle.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C71152A4D7E00B4F5A8 /* mangle.h */; }; + CDB028AD152B764100B01410 /* mpg123lib_intern.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C73152A4D7E00B4F5A8 /* mpg123lib_intern.h */; }; + CDB028AE152B764100B01410 /* ntom.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA9152A4E7000B4F5A8 /* ntom.c */; }; + CDB028AF152B764100B01410 /* optimize.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C74152A4D7E00B4F5A8 /* optimize.h */; }; + CDB028B0152B764100B01410 /* optimize.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAA152A4E7000B4F5A8 /* optimize.c */; }; + CDB028B1152B764100B01410 /* parse.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C75152A4D7E00B4F5A8 /* parse.h */; }; + CDB028B2152B764100B01410 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAB152A4E7000B4F5A8 /* parse.c */; }; + CDB028B3152B764100B01410 /* reader.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C76152A4D7E00B4F5A8 /* reader.h */; }; + CDB028B4152B764100B01410 /* readers.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAC152A4E7000B4F5A8 /* readers.c */; }; + CDB028B5152B764900B01410 /* sample.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C77152A4D7E00B4F5A8 /* sample.h */; }; + CDB028B6152B764900B01410 /* stringbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAD152A4E7000B4F5A8 /* stringbuf.c */; }; + CDB028B7152B764900B01410 /* synth.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB1152A4E7000B4F5A8 /* synth.c */; }; + CDB028B8152B764900B01410 /* synth_8bit.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C78152A4D7E00B4F5A8 /* synth_8bit.h */; }; + CDB028B9152B764900B01410 /* synth_8bit.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAE152A4E7000B4F5A8 /* synth_8bit.c */; }; + CDB028BA152B764900B01410 /* synth_mono.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C79152A4D7E00B4F5A8 /* synth_mono.h */; }; + CDB028BB152B764900B01410 /* synth_ntom.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7A152A4D7E00B4F5A8 /* synth_ntom.h */; }; + CDB028BC152B764900B01410 /* synth_real.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAF152A4E7000B4F5A8 /* synth_real.c */; }; + CDB028BD152B764900B01410 /* synth_s32.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB0152A4E7000B4F5A8 /* synth_s32.c */; }; + CDB028BE152B765000B01410 /* synth.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7B152A4D7E00B4F5A8 /* synth.h */; }; + CDB028BF152B765000B01410 /* synths.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7C152A4D7E00B4F5A8 /* synths.h */; }; + CDB028C0152B765000B01410 /* tabinit.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB2152A4E7000B4F5A8 /* tabinit.c */; }; + CDB028C1152B765000B01410 /* true.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7D152A4D7E00B4F5A8 /* true.h */; }; + CDB028C2152B765900B01410 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C21152A4B8000B4F5A8 /* config.h */; }; + CDB028C3152B765900B01410 /* mpg123.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C22152A4B8000B4F5A8 /* mpg123.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CD132C0E152A48C200B4F5A8 /* libmpg123-ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libmpg123-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + CD132C21152A4B8000B4F5A8 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = SOURCE_ROOT; }; + CD132C22152A4B8000B4F5A8 /* mpg123.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123.h; sourceTree = SOURCE_ROOT; }; + CD132C62152A4D7E00B4F5A8 /* compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compat.h; sourceTree = ""; }; + CD132C63152A4D7E00B4F5A8 /* decode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decode.h; sourceTree = ""; }; + CD132C64152A4D7E00B4F5A8 /* dither.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither.h; sourceTree = ""; }; + CD132C65152A4D7E00B4F5A8 /* frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = ""; }; + CD132C66152A4D7E00B4F5A8 /* getbits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getbits.h; sourceTree = ""; }; + CD132C67152A4D7E00B4F5A8 /* getcpuflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getcpuflags.h; sourceTree = ""; }; + CD132C68152A4D7E00B4F5A8 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = ""; }; + CD132C69152A4D7E00B4F5A8 /* icy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy.h; sourceTree = ""; }; + CD132C6A152A4D7E00B4F5A8 /* icy2utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy2utf8.h; sourceTree = ""; }; + CD132C6B152A4D7E00B4F5A8 /* id3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3.h; sourceTree = ""; }; + CD132C6C152A4D7E00B4F5A8 /* index.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = index.h; sourceTree = ""; }; + CD132C6D152A4D7E00B4F5A8 /* intsym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intsym.h; sourceTree = ""; }; + CD132C6E152A4D7E00B4F5A8 /* l2tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l2tables.h; sourceTree = ""; }; + CD132C6F152A4D7E00B4F5A8 /* l3_integer_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l3_integer_tables.h; sourceTree = ""; }; + CD132C70152A4D7E00B4F5A8 /* l12_integer_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l12_integer_tables.h; sourceTree = ""; }; + CD132C71152A4D7E00B4F5A8 /* mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mangle.h; sourceTree = ""; }; + CD132C72152A4D7E00B4F5A8 /* mpg123.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mpg123.h.in; sourceTree = ""; }; + CD132C73152A4D7E00B4F5A8 /* mpg123lib_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123lib_intern.h; sourceTree = ""; }; + CD132C74152A4D7E00B4F5A8 /* optimize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = optimize.h; sourceTree = ""; }; + CD132C75152A4D7E00B4F5A8 /* parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse.h; sourceTree = ""; }; + CD132C76152A4D7E00B4F5A8 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = ""; }; + CD132C77152A4D7E00B4F5A8 /* sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample.h; sourceTree = ""; }; + CD132C78152A4D7E00B4F5A8 /* synth_8bit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_8bit.h; sourceTree = ""; }; + CD132C79152A4D7E00B4F5A8 /* synth_mono.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_mono.h; sourceTree = ""; }; + CD132C7A152A4D7E00B4F5A8 /* synth_ntom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_ntom.h; sourceTree = ""; }; + CD132C7B152A4D7E00B4F5A8 /* synth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth.h; sourceTree = ""; }; + CD132C7C152A4D7E00B4F5A8 /* synths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synths.h; sourceTree = ""; }; + CD132C7D152A4D7E00B4F5A8 /* true.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = true.h; sourceTree = ""; }; + CD132C99152A4E7000B4F5A8 /* compat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = compat.c; sourceTree = ""; }; + CD132C9A152A4E7000B4F5A8 /* dct64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dct64.c; sourceTree = ""; }; + CD132C9B152A4E7000B4F5A8 /* dither.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dither.c; sourceTree = ""; }; + CD132C9C152A4E7000B4F5A8 /* equalizer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = equalizer.c; sourceTree = ""; }; + CD132C9D152A4E7000B4F5A8 /* feature.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = feature.c; sourceTree = ""; }; + CD132C9E152A4E7000B4F5A8 /* format.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = format.c; sourceTree = ""; }; + CD132C9F152A4E7000B4F5A8 /* frame.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = frame.c; sourceTree = ""; }; + CD132CA0152A4E7000B4F5A8 /* icy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = icy.c; sourceTree = ""; }; + CD132CA1152A4E7000B4F5A8 /* icy2utf8.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = icy2utf8.c; sourceTree = ""; }; + CD132CA2152A4E7000B4F5A8 /* id3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = id3.c; sourceTree = ""; }; + CD132CA3152A4E7000B4F5A8 /* index.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = index.c; sourceTree = ""; }; + CD132CA4152A4E7000B4F5A8 /* layer1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer1.c; sourceTree = ""; }; + CD132CA5152A4E7000B4F5A8 /* layer2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer2.c; sourceTree = ""; }; + CD132CA6152A4E7000B4F5A8 /* layer3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer3.c; sourceTree = ""; }; + CD132CA7152A4E7000B4F5A8 /* lfs_alias.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lfs_alias.c; sourceTree = ""; }; + CD132CA8152A4E7000B4F5A8 /* libmpg123.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libmpg123.c; sourceTree = ""; }; + CD132CA9152A4E7000B4F5A8 /* ntom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ntom.c; sourceTree = ""; }; + CD132CAA152A4E7000B4F5A8 /* optimize.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = optimize.c; sourceTree = ""; }; + CD132CAB152A4E7000B4F5A8 /* parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parse.c; sourceTree = ""; }; + CD132CAC152A4E7000B4F5A8 /* readers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = readers.c; sourceTree = ""; }; + CD132CAD152A4E7000B4F5A8 /* stringbuf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stringbuf.c; sourceTree = ""; }; + CD132CAE152A4E7000B4F5A8 /* synth_8bit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth_8bit.c; sourceTree = ""; }; + CD132CAF152A4E7000B4F5A8 /* synth_real.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth_real.c; sourceTree = ""; }; + CD132CB0152A4E7000B4F5A8 /* synth_s32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth_s32.c; sourceTree = ""; }; + CD132CB1152A4E7000B4F5A8 /* synth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth.c; sourceTree = ""; }; + CD132CB2152A4E7000B4F5A8 /* tabinit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tabinit.c; sourceTree = ""; }; + CD132CCD152A511800B4F5A8 /* dct64_neon_float.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = dct64_neon_float.S; sourceTree = ""; }; + CD132CCE152A511900B4F5A8 /* dct64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = dct64_neon.S; sourceTree = ""; }; + CD132CD0152A511A00B4F5A8 /* synth_neon_float.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_neon_float.S; sourceTree = ""; }; + CD132CD1152A511A00B4F5A8 /* synth_neon_s32.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_neon_s32.S; sourceTree = ""; }; + CD132CD2152A511A00B4F5A8 /* synth_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_neon.S; sourceTree = ""; }; + CD132CD3152A511B00B4F5A8 /* synth_stereo_neon_float.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_stereo_neon_float.S; sourceTree = ""; }; + CD132CD4152A511B00B4F5A8 /* synth_stereo_neon_s32.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_stereo_neon_s32.S; sourceTree = ""; }; + CD132CD5152A511C00B4F5A8 /* synth_stereo_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_stereo_neon.S; sourceTree = ""; }; + CD6D72D1152B748200CF4285 /* libmpg123-mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libmpg123-mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CD132C0B152A48C200B4F5A8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD6D72CE152B748200CF4285 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CD132C03152A48C100B4F5A8 = { + isa = PBXGroup; + children = ( + CD132C60152A4C9A00B4F5A8 /* src */, + CD132C13152A48C200B4F5A8 /* Xcode */, + CD132C0F152A48C200B4F5A8 /* Products */, + ); + sourceTree = ""; + }; + CD132C0F152A48C200B4F5A8 /* Products */ = { + isa = PBXGroup; + children = ( + CD132C0E152A48C200B4F5A8 /* libmpg123-ios.a */, + CD6D72D1152B748200CF4285 /* libmpg123-mac.a */, + ); + name = Products; + sourceTree = ""; + }; + CD132C13152A48C200B4F5A8 /* Xcode */ = { + isa = PBXGroup; + children = ( + CD132C21152A4B8000B4F5A8 /* config.h */, + CD132C22152A4B8000B4F5A8 /* mpg123.h */, + ); + name = Xcode; + sourceTree = ""; + }; + CD132C60152A4C9A00B4F5A8 /* src */ = { + isa = PBXGroup; + children = ( + CD132C61152A4CA400B4F5A8 /* libmpg123 */, + ); + name = src; + path = ../../src; + sourceTree = SOURCE_ROOT; + }; + CD132C61152A4CA400B4F5A8 /* libmpg123 */ = { + isa = PBXGroup; + children = ( + CD132C99152A4E7000B4F5A8 /* compat.c */, + CD132C62152A4D7E00B4F5A8 /* compat.h */, + CD132C9A152A4E7000B4F5A8 /* dct64.c */, + CD132CCD152A511800B4F5A8 /* dct64_neon_float.S */, + CD132CCE152A511900B4F5A8 /* dct64_neon.S */, + CD132C63152A4D7E00B4F5A8 /* decode.h */, + CD132C64152A4D7E00B4F5A8 /* dither.h */, + CD132C9B152A4E7000B4F5A8 /* dither.c */, + CD132C9C152A4E7000B4F5A8 /* equalizer.c */, + CD132C9D152A4E7000B4F5A8 /* feature.c */, + CD132C9E152A4E7000B4F5A8 /* format.c */, + CD132C65152A4D7E00B4F5A8 /* frame.h */, + CD132C9F152A4E7000B4F5A8 /* frame.c */, + CD132C66152A4D7E00B4F5A8 /* getbits.h */, + CD132C67152A4D7E00B4F5A8 /* getcpuflags.h */, + CD132C68152A4D7E00B4F5A8 /* huffman.h */, + CD132C69152A4D7E00B4F5A8 /* icy.h */, + CD132CA0152A4E7000B4F5A8 /* icy.c */, + CD132C6A152A4D7E00B4F5A8 /* icy2utf8.h */, + CD132CA1152A4E7000B4F5A8 /* icy2utf8.c */, + CD132C6B152A4D7E00B4F5A8 /* id3.h */, + CD132CA2152A4E7000B4F5A8 /* id3.c */, + CD132C6C152A4D7E00B4F5A8 /* index.h */, + CD132CA3152A4E7000B4F5A8 /* index.c */, + CD132C6D152A4D7E00B4F5A8 /* intsym.h */, + CD132C6E152A4D7E00B4F5A8 /* l2tables.h */, + CD132C6F152A4D7E00B4F5A8 /* l3_integer_tables.h */, + CD132C70152A4D7E00B4F5A8 /* l12_integer_tables.h */, + CD132CA4152A4E7000B4F5A8 /* layer1.c */, + CD132CA5152A4E7000B4F5A8 /* layer2.c */, + CD132CA6152A4E7000B4F5A8 /* layer3.c */, + CD132CA7152A4E7000B4F5A8 /* lfs_alias.c */, + CD132CA8152A4E7000B4F5A8 /* libmpg123.c */, + CD132C71152A4D7E00B4F5A8 /* mangle.h */, + CD132C72152A4D7E00B4F5A8 /* mpg123.h.in */, + CD132C73152A4D7E00B4F5A8 /* mpg123lib_intern.h */, + CD132CA9152A4E7000B4F5A8 /* ntom.c */, + CD132C74152A4D7E00B4F5A8 /* optimize.h */, + CD132CAA152A4E7000B4F5A8 /* optimize.c */, + CD132C75152A4D7E00B4F5A8 /* parse.h */, + CD132CAB152A4E7000B4F5A8 /* parse.c */, + CD132C76152A4D7E00B4F5A8 /* reader.h */, + CD132CAC152A4E7000B4F5A8 /* readers.c */, + CD132C77152A4D7E00B4F5A8 /* sample.h */, + CD132CAD152A4E7000B4F5A8 /* stringbuf.c */, + CD132CB1152A4E7000B4F5A8 /* synth.c */, + CD132C78152A4D7E00B4F5A8 /* synth_8bit.h */, + CD132CAE152A4E7000B4F5A8 /* synth_8bit.c */, + CD132C79152A4D7E00B4F5A8 /* synth_mono.h */, + CD132C7A152A4D7E00B4F5A8 /* synth_ntom.h */, + CD132CAF152A4E7000B4F5A8 /* synth_real.c */, + CD132CB0152A4E7000B4F5A8 /* synth_s32.c */, + CD132CD0152A511A00B4F5A8 /* synth_neon_float.S */, + CD132CD1152A511A00B4F5A8 /* synth_neon_s32.S */, + CD132CD2152A511A00B4F5A8 /* synth_neon.S */, + CD132CD3152A511B00B4F5A8 /* synth_stereo_neon_float.S */, + CD132CD4152A511B00B4F5A8 /* synth_stereo_neon_s32.S */, + CD132CD5152A511C00B4F5A8 /* synth_stereo_neon.S */, + CD132C7B152A4D7E00B4F5A8 /* synth.h */, + CD132C7C152A4D7E00B4F5A8 /* synths.h */, + CD132CB2152A4E7000B4F5A8 /* tabinit.c */, + CD132C7D152A4D7E00B4F5A8 /* true.h */, + ); + path = libmpg123; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + CD132C0C152A48C200B4F5A8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CD132C23152A4B8000B4F5A8 /* config.h in Headers */, + CD132C24152A4B8000B4F5A8 /* mpg123.h in Headers */, + CD132C7E152A4D7E00B4F5A8 /* compat.h in Headers */, + CD132C7F152A4D7E00B4F5A8 /* decode.h in Headers */, + CD132C80152A4D7E00B4F5A8 /* dither.h in Headers */, + CD132C81152A4D7E00B4F5A8 /* frame.h in Headers */, + CD132C82152A4D7E00B4F5A8 /* getbits.h in Headers */, + CD132C83152A4D7E00B4F5A8 /* getcpuflags.h in Headers */, + CD132C84152A4D7E00B4F5A8 /* huffman.h in Headers */, + CD132C85152A4D7E00B4F5A8 /* icy.h in Headers */, + CD132C86152A4D7E00B4F5A8 /* icy2utf8.h in Headers */, + CD132C87152A4D7E00B4F5A8 /* id3.h in Headers */, + CD132C88152A4D7E00B4F5A8 /* index.h in Headers */, + CD132C89152A4D7E00B4F5A8 /* intsym.h in Headers */, + CD132C8A152A4D7E00B4F5A8 /* l2tables.h in Headers */, + CD132C8B152A4D7E00B4F5A8 /* l3_integer_tables.h in Headers */, + CD132C8C152A4D7E00B4F5A8 /* l12_integer_tables.h in Headers */, + CD132C8D152A4D7E00B4F5A8 /* mangle.h in Headers */, + CD132C8E152A4D7E00B4F5A8 /* mpg123lib_intern.h in Headers */, + CD132C8F152A4D7E00B4F5A8 /* optimize.h in Headers */, + CD132C90152A4D7E00B4F5A8 /* parse.h in Headers */, + CD132C91152A4D7E00B4F5A8 /* reader.h in Headers */, + CD132C92152A4D7E00B4F5A8 /* sample.h in Headers */, + CD132C93152A4D7E00B4F5A8 /* synth_8bit.h in Headers */, + CD132C94152A4D7E00B4F5A8 /* synth_mono.h in Headers */, + CD132C95152A4D7E00B4F5A8 /* synth_ntom.h in Headers */, + CD132C96152A4D7E00B4F5A8 /* synth.h in Headers */, + CD132C97152A4D7E00B4F5A8 /* synths.h in Headers */, + CD132C98152A4D7E00B4F5A8 /* true.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD6D72CF152B748200CF4285 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CDB0288D152B760700B01410 /* compat.h in Headers */, + CDB02890152B760D00B01410 /* decode.h in Headers */, + CDB02891152B760D00B01410 /* dither.h in Headers */, + CDB02896152B761300B01410 /* frame.h in Headers */, + CDB02898152B761300B01410 /* getbits.h in Headers */, + CDB02899152B761300B01410 /* getcpuflags.h in Headers */, + CDB0289A152B761300B01410 /* huffman.h in Headers */, + CDB0289B152B761300B01410 /* icy.h in Headers */, + CDB0289D152B761300B01410 /* icy2utf8.h in Headers */, + CDB0289F152B761C00B01410 /* id3.h in Headers */, + CDB028A1152B761C00B01410 /* index.h in Headers */, + CDB028A3152B761C00B01410 /* intsym.h in Headers */, + CDB028A4152B761C00B01410 /* l2tables.h in Headers */, + CDB028A5152B761C00B01410 /* l3_integer_tables.h in Headers */, + CDB028A6152B761C00B01410 /* l12_integer_tables.h in Headers */, + CDB028AC152B763500B01410 /* mangle.h in Headers */, + CDB028AD152B764100B01410 /* mpg123lib_intern.h in Headers */, + CDB028AF152B764100B01410 /* optimize.h in Headers */, + CDB028B1152B764100B01410 /* parse.h in Headers */, + CDB028B3152B764100B01410 /* reader.h in Headers */, + CDB028B5152B764900B01410 /* sample.h in Headers */, + CDB028B8152B764900B01410 /* synth_8bit.h in Headers */, + CDB028BA152B764900B01410 /* synth_mono.h in Headers */, + CDB028BB152B764900B01410 /* synth_ntom.h in Headers */, + CDB028BE152B765000B01410 /* synth.h in Headers */, + CDB028BF152B765000B01410 /* synths.h in Headers */, + CDB028C1152B765000B01410 /* true.h in Headers */, + CDB028C2152B765900B01410 /* config.h in Headers */, + CDB028C3152B765900B01410 /* mpg123.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + CD132C0D152A48C200B4F5A8 /* mpg123-ios */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD132C1B152A48C200B4F5A8 /* Build configuration list for PBXNativeTarget "mpg123-ios" */; + buildPhases = ( + CD132C0A152A48C200B4F5A8 /* Sources */, + CD132C0B152A48C200B4F5A8 /* Frameworks */, + CD132C0C152A48C200B4F5A8 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "mpg123-ios"; + productName = libmpg123; + productReference = CD132C0E152A48C200B4F5A8 /* libmpg123-ios.a */; + productType = "com.apple.product-type.library.static"; + }; + CD6D72D0152B748200CF4285 /* mpg123-mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD6D72D4152B748200CF4285 /* Build configuration list for PBXNativeTarget "mpg123-mac" */; + buildPhases = ( + CD6D72CD152B748200CF4285 /* Sources */, + CD6D72CE152B748200CF4285 /* Frameworks */, + CD6D72CF152B748200CF4285 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "mpg123-mac"; + productName = "mpg123-mac"; + productReference = CD6D72D1152B748200CF4285 /* libmpg123-mac.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CD132C05152A48C100B4F5A8 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; + buildConfigurationList = CD132C08152A48C100B4F5A8 /* Build configuration list for PBXProject "mpg123" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CD132C03152A48C100B4F5A8; + productRefGroup = CD132C0F152A48C200B4F5A8 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CD132C0D152A48C200B4F5A8 /* mpg123-ios */, + CD6D72D0152B748200CF4285 /* mpg123-mac */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + CD132C0A152A48C200B4F5A8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD132CB3152A4E7000B4F5A8 /* compat.c in Sources */, + CD132CB4152A4E7000B4F5A8 /* dct64.c in Sources */, + CD132CB5152A4E7000B4F5A8 /* dither.c in Sources */, + CD132CB6152A4E7000B4F5A8 /* equalizer.c in Sources */, + CD132CB7152A4E7000B4F5A8 /* feature.c in Sources */, + CD132CB8152A4E7000B4F5A8 /* format.c in Sources */, + CD132CB9152A4E7000B4F5A8 /* frame.c in Sources */, + CD132CBA152A4E7000B4F5A8 /* icy.c in Sources */, + CD132CBB152A4E7000B4F5A8 /* icy2utf8.c in Sources */, + CD132CBC152A4E7000B4F5A8 /* id3.c in Sources */, + CD132CBD152A4E7000B4F5A8 /* index.c in Sources */, + CD132CBE152A4E7000B4F5A8 /* layer1.c in Sources */, + CD132CBF152A4E7000B4F5A8 /* layer2.c in Sources */, + CD132CC0152A4E7000B4F5A8 /* layer3.c in Sources */, + CD132CC1152A4E7000B4F5A8 /* lfs_alias.c in Sources */, + CD132CC2152A4E7000B4F5A8 /* libmpg123.c in Sources */, + CD132CC3152A4E7000B4F5A8 /* ntom.c in Sources */, + CD132CC4152A4E7000B4F5A8 /* optimize.c in Sources */, + CD132CC5152A4E7000B4F5A8 /* parse.c in Sources */, + CD132CC6152A4E7000B4F5A8 /* readers.c in Sources */, + CD132CC7152A4E7000B4F5A8 /* stringbuf.c in Sources */, + CD132CC8152A4E7000B4F5A8 /* synth_8bit.c in Sources */, + CD132CC9152A4E7000B4F5A8 /* synth_real.c in Sources */, + CD132CCA152A4E7000B4F5A8 /* synth_s32.c in Sources */, + CD132CCB152A4E7000B4F5A8 /* synth.c in Sources */, + CD132CCC152A4E7000B4F5A8 /* tabinit.c in Sources */, + CD132CD6152A511C00B4F5A8 /* dct64_neon_float.S in Sources */, + CD132CD7152A511C00B4F5A8 /* dct64_neon.S in Sources */, + CD132CD9152A511C00B4F5A8 /* synth_neon_float.S in Sources */, + CD132CDA152A511C00B4F5A8 /* synth_neon_s32.S in Sources */, + CD132CDB152A511C00B4F5A8 /* synth_neon.S in Sources */, + CD132CDC152A511C00B4F5A8 /* synth_stereo_neon_float.S in Sources */, + CD132CDD152A511C00B4F5A8 /* synth_stereo_neon_s32.S in Sources */, + CD132CDE152A511C00B4F5A8 /* synth_stereo_neon.S in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD6D72CD152B748200CF4285 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDB0288C152B760700B01410 /* compat.c in Sources */, + CDB0288E152B760700B01410 /* dct64.c in Sources */, + CDB02892152B760D00B01410 /* dither.c in Sources */, + CDB02893152B760D00B01410 /* equalizer.c in Sources */, + CDB02894152B760D00B01410 /* feature.c in Sources */, + CDB02895152B760D00B01410 /* format.c in Sources */, + CDB02897152B761300B01410 /* frame.c in Sources */, + CDB0289C152B761300B01410 /* icy.c in Sources */, + CDB0289E152B761300B01410 /* icy2utf8.c in Sources */, + CDB028A0152B761C00B01410 /* id3.c in Sources */, + CDB028A2152B761C00B01410 /* index.c in Sources */, + CDB028A7152B761C00B01410 /* layer1.c in Sources */, + CDB028A8152B762E00B01410 /* layer2.c in Sources */, + CDB028A9152B763500B01410 /* layer3.c in Sources */, + CDB028AA152B763500B01410 /* lfs_alias.c in Sources */, + CDB028AB152B763500B01410 /* libmpg123.c in Sources */, + CDB028AE152B764100B01410 /* ntom.c in Sources */, + CDB028B0152B764100B01410 /* optimize.c in Sources */, + CDB028B2152B764100B01410 /* parse.c in Sources */, + CDB028B4152B764100B01410 /* readers.c in Sources */, + CDB028B6152B764900B01410 /* stringbuf.c in Sources */, + CDB028B7152B764900B01410 /* synth.c in Sources */, + CDB028B9152B764900B01410 /* synth_8bit.c in Sources */, + CDB028BC152B764900B01410 /* synth_real.c in Sources */, + CDB028BD152B764900B01410 /* synth_s32.c in Sources */, + CDB028C0152B765000B01410 /* tabinit.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + CD132C19152A48C200B4F5A8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = NO; + EXCLUDED_SOURCE_FILE_NAMES = ""; + "EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*]" = ( + "synth_neon*", + "synth_stereo_neon*", + "dct64_neon*", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + SDKROOT = iphoneos; + }; + name = Debug; + }; + CD132C1A152A48C200B4F5A8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = YES; + EXCLUDED_SOURCE_FILE_NAMES = ""; + "EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*]" = ( + "synth_neon*", + "synth_stereo_neon*", + "dct64_neon*", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CD132C1C152A48C200B4F5A8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libmpg123.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + CD132C1D152A48C200B4F5A8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libmpg123.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + CD6D72D2152B748200CF4285 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + CD6D72D3152B748200CF4285 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CD132C08152A48C100B4F5A8 /* Build configuration list for PBXProject "mpg123" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD132C19152A48C200B4F5A8 /* Debug */, + CD132C1A152A48C200B4F5A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD132C1B152A48C200B4F5A8 /* Build configuration list for PBXNativeTarget "mpg123-ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD132C1C152A48C200B4F5A8 /* Debug */, + CD132C1D152A48C200B4F5A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD6D72D4152B748200CF4285 /* Build configuration list for PBXNativeTarget "mpg123-mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD6D72D2152B748200CF4285 /* Debug */, + CD6D72D3152B748200CF4285 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CD132C05152A48C100B4F5A8 /* Project object */; +} diff --git a/ports/mpg123_.pas b/ports/mpg123_.pas new file mode 100644 index 0000000..5eea80b --- /dev/null +++ b/ports/mpg123_.pas @@ -0,0 +1,478 @@ +unit mpg123_; +interface + +uses + Windows, + SysUtils; + + // INITIAL CONVERSION BY ARTHUR 17/02/2008 + // USE http://www.mpg123.de/api/ FOR DOCUMENTATION SINCE I STRIPED ALL THE COMMENTS FROM THE UNIT + +type + PDWord = ^DWORD; + PPbyte = ^PByte; + PPchar = ^PChar; + Pdouble = ^double; + PPlongint = ^Plongint; + off_t = Longint; + Poff_t = ^off_t; + PPoff_T = ^Poff_t; + size_t = Cardinal; + Psize_t = ^size_t; + +type + Pmpg123_handle_struct = ^Tmpg123_handle_struct; + Tmpg123_handle_struct = packed record + {undefined structure} + end; + + Tmpg123_handle = Tmpg123_handle_struct; + Pmpg123_handle = ^Tmpg123_handle; + +var + mpg123_init: function: Longint; cdecl; + + mpg123_exit: procedure; cdecl; + + mpg123_new: function(decoder: PChar; Error: Plongint): Pmpg123_handle; cdecl; + + mpg123_delete: procedure(mh: Pmpg123_handle); cdecl; + +type + Tmpg123_parms = Longint; +const + MPG123_VERBOSE = 0; + MPG123_FLAGS = 1; + MPG123_ADD_FLAGS = 2; + MPG123_FORCE_RATE = 3; + MPG123_DOWN_SAMPLE = 4; + MPG123_RVA = 5; + MPG123_DOWNSPEED = 6; + MPG123_UPSPEED = 7; + MPG123_START_FRAME = 8; + MPG123_DECODE_FRAMES = 9; + MPG123_ICY_INTERVAL = 10; + MPG123_OUTSCALE = 11; + MPG123_TIMEOUT = 12; + MPG123_REMOVE_FLAGS = 13; + MPG123_RESYNC_LIMIT = 14; + +type + Tmpg123_param_flags = Longint; +const + MPG123_FORCE_MONO = $7; + MPG123_MONO_LEFT = $1; + MPG123_MONO_RIGHT = $2; + MPG123_MONO_MIX = $4; + MPG123_FORCE_STEREO = $8; + MPG123_FORCE_8BIT = $10; + MPG123_QUIET = $20; + MPG123_GAPLESS = $40; + MPG123_NO_RESYNC = $80; + +type + Tmpg123_param_rva = Longint; +const + MPG123_RVA_OFF = 0; + MPG123_RVA_MIX = 1; + MPG123_RVA_ALBUM = 2; + MPG123_RVA_MAX = MPG123_RVA_ALBUM; + +var + mpg123_param: function(mh: Pmpg123_handle; _type: Tmpg123_parms; value: Longint; fvalue: double): Longint; cdecl; + + mpg123_getparam: function(mh: Pmpg123_handle; _type: Tmpg123_parms; val: Plongint; fval: Pdouble): Longint; cdecl; + +type + Tmpg123_errors = Longint; +const + MPG123_DONE = -(12); + MPG123_NEW_FORMAT = -(11); + MPG123_NEED_MORE = -(10); + MPG123_ERR = -(1); + MPG123_OK = 0; + MPG123_BAD_OUTFORMAT = 1; + MPG123_BAD_CHANNEL = 2; + MPG123_BAD_RATE = 3; + MPG123_ERR_16TO8TABLE = 4; + MPG123_BAD_PARAM = 5; + MPG123_BAD_BUFFER = 6; + MPG123_OUT_OF_MEM = 7; + MPG123_NOT_INITIALIZED = 8; + MPG123_BAD_DECODER = 9; + MPG123_BAD_HANDLE = 10; + MPG123_NO_BUFFERS = 11; + MPG123_BAD_RVA = 12; + MPG123_NO_GAPLESS = 13; + MPG123_NO_SPACE = 14; + MPG123_BAD_TYPES = 15; + MPG123_BAD_BAND = 16; + MPG123_ERR_NULL = 17; + MPG123_ERR_READER = 18; + MPG123_NO_SEEK_FROM_END = 19; + MPG123_BAD_WHENCE = 20; + MPG123_NO_TIMEOUT = 21; + MPG123_BAD_FILE = 22; + MPG123_NO_SEEK = 23; + MPG123_NO_READER = 24; + MPG123_BAD_PARS = 25; + MPG123_BAD_INDEX_PAR = 26; + MPG123_OUT_OF_SYNC = 27; + MPG123_RESYNC_FAIL = 28; + +var + mpg123_plain_strerror: function(errcode: Longint): PChar; cdecl; + + mpg123_strerror: function(mh: Pmpg123_handle): PChar; cdecl; + + mpg123_errcode: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_decoders: function: PPchar; cdecl; + + mpg123_supported_decoders: function: PPchar; cdecl; + + mpg123_decoder: function(mh: Pmpg123_handle; decoder_name: PChar): Longint; cdecl; + +type + Tmpg123_enc_enum = Longint; +const + MPG123_ENC_16 = $40; + MPG123_ENC_SIGNED = $80; + MPG123_ENC_8 = $0F; + MPG123_ENC_SIGNED_16 = (MPG123_ENC_16 or MPG123_ENC_SIGNED) or $10; + MPG123_ENC_UNSIGNED_16 = MPG123_ENC_16 or $20; + MPG123_ENC_UNSIGNED_8 = $01; + MPG123_ENC_SIGNED_8 = MPG123_ENC_SIGNED or $02; + MPG123_ENC_ULAW_8 = $04; + MPG123_ENC_ALAW_8 = $08; + MPG123_ENC_ANY = ((((MPG123_ENC_SIGNED_16 or MPG123_ENC_UNSIGNED_16) or MPG123_ENC_UNSIGNED_8) or MPG123_ENC_SIGNED_8) or MPG123_ENC_ULAW_8) or MPG123_ENC_ALAW_8; + +type + Tmpg123_channelcount = Longint; +const + MPG123_MONO = 1; + MPG123_STEREO = 2; + +var + mpg123_rates: procedure(list: PPlongint; number: Psize_t); cdecl; + + mpg123_encodings: procedure(list: PPlongint; number: Psize_t); cdecl; + + mpg123_format_none: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_format_all: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_format: function(mh: Pmpg123_handle; rate: Longint; channels: Longint; encodings: Longint): Longint; cdecl; + + mpg123_format_support: function(mh: Pmpg123_handle; rate: Longint; encoding: Longint): Longint; cdecl; + + mpg123_getformat: function(mh: Pmpg123_handle; rate: Plongint; channels: Plongint; encoding: Plongint): Longint; cdecl; + + mpg123_open: function(mh: Pmpg123_handle; path: PChar): Longint; cdecl; + + mpg123_open_fd: function(mh: Pmpg123_handle; fd: Longint): Longint; cdecl; + + mpg123_open_feed: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_close: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_read: function(mh: Pmpg123_handle; outmemory: PByte; outmemsize: size_t; done: Psize_t): Longint; cdecl; + + mpg123_decode: function(mh: Pmpg123_handle; inmemory: PByte; inmemsize: size_t; outmemory: PByte; outmemsize: size_t; + done: Psize_t): Longint; cdecl; + + mpg123_decode_frame: function(mh: Pmpg123_handle; num: Poff_t; audio: PPbyte; bytes: Psize_t): Longint; cdecl; + + mpg123_tell: function(mh: Pmpg123_handle): off_t; cdecl; + + mpg123_tellframe: function(mh: Pmpg123_handle): off_t; cdecl; + + mpg123_seek: function(mh: Pmpg123_handle; sampleoff: off_t; whence: Longint): off_t; cdecl; + + mpg123_feedseek: function(mh: Pmpg123_handle; sampleoff: off_t; whence: Longint; input_offset: Poff_t): off_t; cdecl; + + mpg123_seek_frame: function(mh: Pmpg123_handle; frameoff: off_t; whence: Longint): off_t; cdecl; + + mpg123_timeframe: function(mh: Pmpg123_handle; sec: double): off_t; cdecl; + + mpg123_index: function(mh: Pmpg123_handle; offsets: PPoff_t; step: Poff_t; fill: Psize_t): Longint; cdecl; + + mpg123_position: function(mh: Pmpg123_handle; frame_offset: off_t; buffered_bytes: off_t; current_frame: Poff_t; frames_left: Poff_t; + current_seconds: Pdouble; seconds_left: Pdouble): Longint; cdecl; + +type + Tmpg123_channels = Longint; +const + MPG123_LEFT = $1; + MPG123_RIGHT = $2; + +var + mpg123_eq: function(mh: Pmpg123_handle; channel: Tmpg123_channels; band: Longint; val: double): Longint; cdecl; + + mpg123_reset_eq: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_volume: function(mh: Pmpg123_handle; vol: double): Longint; cdecl; + + mpg123_volume_change: function(mh: Pmpg123_handle; change: double): Longint; cdecl; + + mpg123_getvolume: function(mh: Pmpg123_handle; base: Pdouble; really: Pdouble; rva_db: Pdouble): Longint; cdecl; + +type + Tmpg123_vbr = Longint; +const + MPG123_CBR = 0; + MPG123_VBR = 1; + MPG123_ABR = 2; + +type + Tmpg123_version = Longint; +const + MPG123_1_0 = 0; + MPG123_2_0 = 1; + MPG123_2_5 = 2; + +type + Tmpg123_mode = Longint; +const + MPG123_M_STEREO = 0; + MPG123_M_JOINT = 1; + MPG123_M_DUAL = 2; + MPG123_M_MONO = 3; + +type + Tmpg123_flags = Longint; +const + MPG123_CRC = $1; + MPG123_COPYRIGHT = $2; + MPG123_PRIVATE = $4; + MPG123_ORIGINAL = $8; + +type + Pmpg123_frameinfo = ^Tmpg123_frameinfo; + Tmpg123_frameinfo = packed record + version: Tmpg123_version; + layer: Longint; + rate: Longint; + mode: Tmpg123_mode; + mode_ext: Longint; + framesize: Longint; + Flags: Tmpg123_flags; + emphasis: Longint; + bitrate: Longint; + abr_rate: Longint; + vbr: Tmpg123_vbr; + end; + +var + mpg123_info: function(mh: Pmpg123_handle; mi: Pmpg123_frameinfo): Longint; cdecl; + + mpg123_safe_buffer: function: size_t; cdecl; + + mpg123_scan: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_length: function(mh: Pmpg123_handle): off_t; cdecl; + + mpg123_tpf: function(mh: Pmpg123_handle): double; cdecl; + + mpg123_clip: function(mh: Pmpg123_handle): Longint; cdecl; + +type + + Pmpg123_string = ^Tmpg123_string; + Tmpg123_string = packed record + p: PChar; + Size: size_t; + fill: size_t; + end; + +var + mpg123_init_string: procedure(sb: Pmpg123_string); cdecl; + + mpg123_free_string: procedure(sb: Pmpg123_string); cdecl; + + mpg123_resize_string: function(sb: Pmpg123_string; news: size_t): Longint; cdecl; + + mpg123_copy_string: function(from: Pmpg123_string; _to: Pmpg123_string): Longint; cdecl; + + mpg123_add_string: function(sb: Pmpg123_string; stuff: PChar): Longint; cdecl; + + mpg123_set_string: function(sb: Pmpg123_string; stuff: PChar): Longint; cdecl; + +type + + Pmpg123_text = ^Tmpg123_text; + Tmpg123_text = packed record + lang: array[0..2] of Char; + id: array[0..3] of Char; + description: Tmpg123_string; + Text: Tmpg123_string; + end; + + PPmpg123_id3v2 = ^Pmpg123_id3v2; + Pmpg123_id3v2 = ^Tmpg123_id3v2; + Tmpg123_id3v2 = packed record + version: Byte; + title: Pmpg123_string; + artist: Pmpg123_string; + album: Pmpg123_string; + year: Pmpg123_string; + genre: Pmpg123_string; + comment: Pmpg123_string; + comment_list: Pmpg123_text; + comments: size_t; + Text: Pmpg123_text; + texts: size_t; + extra: Pmpg123_text; + extras: size_t; + end; + + PPmpg123_id3v1 = ^Pmpg123_id3v1; + Pmpg123_id3v1 = ^Tmpg123_id3v1; + Tmpg123_id3v1 = packed record + tag: array[0..2] of Char; + title: array[0..29] of Char; + artist: array[0..29] of Char; + album: array[0..29] of Char; + year: array[0..3] of Char; + comment: array[0..29] of Char; + genre: Byte; + end; + +const + MPG123_ID3 = $3; + + MPG123_NEW_ID3 = $1; + + MPG123_ICY = $C; + + MPG123_NEW_ICY = $4; + +var + mpg123_meta_check: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_id3_: function(mh: Pmpg123_handle; var v1: Pmpg123_id3v1; var v2: Pmpg123_id3v2): Longint; cdecl; + + mpg123_icy_: function(mh: Pmpg123_handle; icy_meta: PPchar): Longint; cdecl; + +type + Pmpg123_pars_struct = ^Tmpg123_pars_struct; + Tmpg123_pars_struct = packed record + {undefined structure} + end; + + Tmpg123_pars = Tmpg123_pars_struct; + Pmpg123_pars = ^Tmpg123_pars; + +var + mpg123_parnew: function(mp: Pmpg123_pars; decoder: PChar; Error: Plongint): Pmpg123_handle; cdecl; + + mpg123_new_pars: function(Error: Plongint): Pmpg123_pars; cdecl; + + mpg123_delete_pars: procedure(mp: Pmpg123_pars); cdecl; + + mpg123_fmt_none: function(mp: Pmpg123_pars): Longint; cdecl; + + mpg123_fmt_all: function(mp: Pmpg123_pars): Longint; cdecl; + + mpg123_fmt: function(mh: Pmpg123_pars; rate: Longint; channels: Longint; encodings: Longint): Longint; cdecl; + + mpg123_fmt_support: function(mh: Pmpg123_pars; rate: Longint; encoding: Longint): Longint; cdecl; + + mpg123_par: function(mp: Pmpg123_pars; _type: Tmpg123_parms; value: Longint; fvalue: double): Longint; cdecl; + + mpg123_getpar: function(mp: Pmpg123_pars; _type: Tmpg123_parms; val: Plongint; fval: Pdouble): Longint; cdecl; + + mpg123_replace_buffer: function(mh: Pmpg123_handle; data: PByte; Size: size_t): Longint; cdecl; + + mpg123_outblock: function(mh: Pmpg123_handle): size_t; cdecl; + + //mpg123_replace_reader : function(mh:Pmpg123_handle; r_read:function (_para1:longint; _para2:pointer; _para3:size_t):Tssize_t; r_lseek:function (_para1:longint; _para2:off_t; _para3:longint):off_t):longint; + +implementation + +var + hlib: THandle; + +procedure Freempg123; +begin + FreeLibrary(hlib); +end; + +procedure Loadmpg123(lib: PChar); +begin + hlib := LoadLibrary(lib); + mpg123_init := GetProcAddress(hlib, 'mpg123_init'); + mpg123_exit := GetProcAddress(hlib, 'mpg123_exit'); + mpg123_new := GetProcAddress(hlib, 'mpg123_new'); + mpg123_delete := GetProcAddress(hlib, 'mpg123_delete'); + mpg123_param := GetProcAddress(hlib, 'mpg123_param'); + mpg123_getparam := GetProcAddress(hlib, 'mpg123_getparam'); + mpg123_plain_strerror := GetProcAddress(hlib, 'mpg123_plain_strerror'); + mpg123_strerror := GetProcAddress(hlib, 'mpg123_strerror'); + mpg123_errcode := GetProcAddress(hlib, 'mpg123_errcode'); + mpg123_decoders := GetProcAddress(hlib, 'mpg123_decoders'); + mpg123_supported_decoders := GetProcAddress(hlib, 'mpg123_supported_decoders'); + mpg123_decoder := GetProcAddress(hlib, 'mpg123_decoder'); + mpg123_rates := GetProcAddress(hlib, 'mpg123_rates'); + mpg123_encodings := GetProcAddress(hlib, 'mpg123_encodings'); + mpg123_format_none := GetProcAddress(hlib, 'mpg123_format_none'); + mpg123_format_all := GetProcAddress(hlib, 'mpg123_format_all'); + mpg123_format := GetProcAddress(hlib, 'mpg123_format'); + mpg123_format_support := GetProcAddress(hlib, 'mpg123_format_support'); + mpg123_getformat := GetProcAddress(hlib, 'mpg123_getformat'); + mpg123_open := GetProcAddress(hlib, 'mpg123_open'); + mpg123_open_fd := GetProcAddress(hlib, 'mpg123_open_fd'); + mpg123_open_feed := GetProcAddress(hlib, 'mpg123_open_feed'); + mpg123_close := GetProcAddress(hlib, 'mpg123_close'); + mpg123_read := GetProcAddress(hlib, 'mpg123_read'); + mpg123_decode := GetProcAddress(hlib, 'mpg123_decode'); + mpg123_decode_frame := GetProcAddress(hlib, 'mpg123_decode_frame'); + mpg123_tell := GetProcAddress(hlib, 'mpg123_tell'); + mpg123_tellframe := GetProcAddress(hlib, 'mpg123_tellframe'); + mpg123_seek := GetProcAddress(hlib, 'mpg123_seek'); + mpg123_feedseek := GetProcAddress(hlib, 'mpg123_feedseek'); + mpg123_seek_frame := GetProcAddress(hlib, 'mpg123_seek_frame'); + mpg123_timeframe := GetProcAddress(hlib, 'mpg123_timeframe'); + mpg123_index := GetProcAddress(hlib, 'mpg123_index'); + mpg123_position := GetProcAddress(hlib, 'mpg123_position'); + mpg123_eq := GetProcAddress(hlib, 'mpg123_eq'); + mpg123_reset_eq := GetProcAddress(hlib, 'mpg123_reset_eq'); + mpg123_volume := GetProcAddress(hlib, 'mpg123_volume'); + mpg123_volume_change := GetProcAddress(hlib, 'mpg123_volume_change'); + mpg123_getvolume := GetProcAddress(hlib, 'mpg123_getvolume'); + mpg123_info := GetProcAddress(hlib, 'mpg123_info'); + mpg123_safe_buffer := GetProcAddress(hlib, 'mpg123_safe_buffer'); + mpg123_scan := GetProcAddress(hlib, 'mpg123_scan'); + mpg123_length := GetProcAddress(hlib, 'mpg123_length'); + mpg123_tpf := GetProcAddress(hlib, 'mpg123_tpf'); + mpg123_clip := GetProcAddress(hlib, 'mpg123_clip'); + mpg123_init_string := GetProcAddress(hlib, 'mpg123_init_string'); + mpg123_free_string := GetProcAddress(hlib, 'mpg123_free_string'); + mpg123_resize_string := GetProcAddress(hlib, 'mpg123_resize_string'); + mpg123_copy_string := GetProcAddress(hlib, 'mpg123_copy_string'); + mpg123_add_string := GetProcAddress(hlib, 'mpg123_add_string'); + mpg123_set_string := GetProcAddress(hlib, 'mpg123_set_string'); + mpg123_meta_check := GetProcAddress(hlib, 'mpg123_meta_check'); + mpg123_id3_ := GetProcAddress(hlib, 'mpg123_id3'); + mpg123_icy_ := GetProcAddress(hlib, 'mpg123_icy'); + mpg123_parnew := GetProcAddress(hlib, 'mpg123_parnew'); + mpg123_new_pars := GetProcAddress(hlib, 'mpg123_new_pars'); + mpg123_delete_pars := GetProcAddress(hlib, 'mpg123_delete_pars'); + mpg123_fmt_none := GetProcAddress(hlib, 'mpg123_fmt_none'); + mpg123_fmt_all := GetProcAddress(hlib, 'mpg123_fmt_all'); + mpg123_fmt := GetProcAddress(hlib, 'mpg123_fmt'); + mpg123_fmt_support := GetProcAddress(hlib, 'mpg123_fmt_support'); + mpg123_par := GetProcAddress(hlib, 'mpg123_par'); + mpg123_getpar := GetProcAddress(hlib, 'mpg123_getpar'); + mpg123_replace_buffer := GetProcAddress(hlib, 'mpg123_replace_buffer'); + mpg123_outblock := GetProcAddress(hlib, 'mpg123_outblock'); + //mpg123_replace_reader := GetProcAddress(hlib,'mpg123_replace_reader'); +end; + +initialization + Loadmpg123('libmpg123-0.dll'); +finalization + Freempg123; + +end. + diff --git a/scripts/benchmark-cpu.pl b/scripts/benchmark-cpu.pl new file mode 100755 index 0000000..88559bc --- /dev/null +++ b/scripts/benchmark-cpu.pl @@ -0,0 +1,64 @@ +#!/usr/bin/perl +# +# benchmark-cpu.pl: benchmark CPU optimizations of mpg123 +# +# initially written by Nicholas J Humfrey , placed in the public domain +# + +use strict; +#use Time::HiRes qw/time/; + +my $MPG123_CMD = shift @ARGV; +my @TEST_FILES = @ARGV; + +die "Please specify full path to mpg123 >= 1.7.0 and a test MP3 file to decode" if (scalar(@ARGV) < 1); +die "mpg123 command does not exist" unless (-e $MPG123_CMD); +die "mpg123 command is not executable" unless (-x $MPG123_CMD); +for(@TEST_FILES) +{ + die "test MP3 file does not exist" unless (-e $_); +} + +# Force unbuffed output on STDOUT +#$|=1; # why? + +# Check the CPUs available +my $cpulist = `$MPG123_CMD --test-cpu`; +chomp( $cpulist ); +die "Failed to get list of available CPU optimizations" unless ($cpulist =~ s/^Supported decoders: //); + +my @cpus = split( / /, $cpulist ); +my @encs = qw(s16 f32); + +printf STDERR ("Found %d CPU optimizations to test...\n\n", scalar(@cpus) ); + +print "#mpg123 benchmark (user CPU time in seconds for decoding)\n"; +print "#decoder"; +for(@encs){ print " t_$_/s"; } +print "\n"; + +my $allret = 0; + +foreach my $cpu (@cpus) +{ + print "$cpu"; + foreach my $e (@encs) + { + # using user CPU time + my @start_time = times(); + my $ret = system($MPG123_CMD, '-q', '--cpu', $cpu, '-e', $e, '-t', @TEST_FILES ); + my @end_time = times(); + my $runtime = $end_time[2] - $start_time[2]; + if($ret) + { + print STDERR "Execution of $MPG123_CMD failed with code $ret!\n"; + $runtime = 0; + $allret = 1; + } + # third entry is child user time + printf(" %4.2f", $runtime); + } + print("\n"); +} + +exit($allret); diff --git a/scripts/conplay b/scripts/conplay new file mode 100755 index 0000000..eff2a1d --- /dev/null +++ b/scripts/conplay @@ -0,0 +1,133 @@ +#!/usr/bin/env perl + +# Hacked by Thomas Orgis, use at your leisure. + +use strict; +use locale; + +use File::Basename qw(basename dirname); + +my @mpg123_command = qw(mpg123 --continue -Cv --rva-album); +my $listfile = "conplay.m3u"; +my $glob = '*.mp[123]'; + +my $dir = shift; + +unless(defined $dir) +{ + print STDERR "\nThis little wrapper runs $mpg123_command[0] on a given directory (hand in '.' for the current one), playing all $glob files therein in terminal control mode. The extra trick is that a playlist file ($listfile by default) is read and updated (created) with the position you left playback at (via 'q' key), to return on next invokation.\n"; + print STDERR "\nIf you give an existing file instead of a directory, or some non-existing path, as first and only paramter, it is used as playlist name and the directory part is used as the base directory for playback.\n"; + print STDERR "\nThe name stands for CONtinued PLAYback. What did you think?;-)\n\n"; + exit; +} + +if(-f $dir or (not -e $dir)) +{ + $listfile = basename($dir); + $dir = dirname($dir); +} + + +chdir($dir) or die "Cannot enter $dir ($!)!\n"; + +print STDERR "Playing things in: $dir\n"; + +my @files; +my $entry = 1; +my $frame = 0; + +if(-e $listfile) +{ + open(LIST, '<', $listfile) or die "Cannot read playlist ($!)!\n"; + while() + { + chomp; + unless(/^#/) + { + push(@files, $_); + } + elsif(/^#\s*current entry:\s*(\d+)$/) + { + $entry = $1; + } + elsif(/^#\s*current frame:\s*(\d+)$/) + { + $frame = $1; + } + } + close(LIST); +} +else +{ + @files = get_files($glob); + write_list(); +} + +unless(@files) +{ + print STDERR "There are no files to play.\n"; + exit; +} + +if($entry < 0 or $entry > @files or $frame < 0) +{ + die "You got bad data in your playlist file (mismatch between current entry and total count, bad frame index). Clean that up.\n"; +} + +push(@mpg123_command, '-k', $frame, '--listentry', $entry, '-@', $listfile); +print STDERR "running player:\n\t@mpg123_command\n\n"; + +open(MPG123, '-|', @mpg123_command) or die "Cannot run mpg123!"; +while() +{ + print STDOUT $_; + if(/^\[CONTINUE\]\s+track\s+(\d+)\s+frame\s+(\d+)/) + { + $entry = $1; + $frame = $2; + } + if(/^\[BOOKMARK\]\s+track\s+(\d+)\s+frame\s+(\d+)/) + { + print STDERR "\nGot bookmark at track $1, frame $2; not yet doing anything with that, besides storing.\n"; + $entry = $1; + $frame = $2; + } +} +close(MPG123); + +if($entry > @files) +{ + $entry = 0; + $frame = 0; +} +print STDERR "Continue point is in track $entry, frame $frame.\n"; +write_list(); + +sub write_list +{ + unless(@files) + { + print STDERR "Refusing to write empty playlist.\n"; + return; + } + open(LIST, '>', $listfile) or die "Cannot write Playlist"; + print LIST "#M3U\n"; + print LIST "#current entry: $entry\n"; + print LIST "#current frame: $frame\n"; + for my $f (@files) + { + print LIST "$f\n"; + } + close(LIST); +} + +sub get_files +{ + my $glob = shift; + my @files; + open(FIND, '-|', 'find', '.', '-type', 'f', '-name', $glob) or die "Cannot exec find to find files: ($!)\n"; + @files = ; + close(FIND); + chomp(@files); + return sort @files; +} diff --git a/scripts/mpg123info b/scripts/mpg123info new file mode 100755 index 0000000..7b06986 --- /dev/null +++ b/scripts/mpg123info @@ -0,0 +1,71 @@ +#!/bin/bash + +if test $# -eq 0; then + echo "Give me some MPEG 1.0/2.0/2.5 layer 1/2/3 audio file name(s) and I give you meta info about it in an easily-parseable format: + +name=value + +for simple value association and + +name.=value + +to add another line to existing value (multiline comments)." +fi + +for i in "$@" +do + echo lp "$i" + echo tag + echo scan + echo format + echo sample +done | +mpg123 -t -R | +perl -e ' +while() +{ +if(/\@T \{/) +{ + print "# meta info for: ".(shift @ARGV)."\n"; + $field = undef; + %count = (); + %linecount = (); +} +elsif(/\@T ID3:(.*)$/) +{ + $field = undef; + print "ID3v1.title=".substr($1, 0, 30)."\n"; + print "ID3v1.artist=".substr($1, 30, 30)."\n"; + print "ID3v1.album=".substr($1, 60, 30)."\n"; + print "ID3v1.year=".substr($1, 90, 4)."\n"; + print "ID3v1.comment=".substr($1, 94, 30)."\n"; + print "ID3v1.genre=".substr($1, 124)."\n"; +} +elsif(/\@T ID3\.([^:]+):(.*)$/) +{ + $field = undef; + print "ID3.$1=$2\n"; +} +elsif(/\@T (ID3v2\.\S{4})(|\s+lang\(([^\(\)]*)\)\s+desc\(([^\(\)]*)\)):/) +{ + $class = $1; + $field = ++$count{$class} > 1 ? "$class$count{$class}" : $class; + print "$field.lang=$3\n" if(defined $3); + print "$field.desc=$4\n" if(defined $4); +} +elsif(/\@T =(.*)$/) +{ + next unless defined $field; + print "$field".(++$linecount{$field} > 1 ? ".=" : "=").$1."\n"; +} +elsif(/\@FORMAT\s+(\d+)\s+(\d+)/) +{ + print "format.rate=$1\n"; + print "format.channels=$2\n"; +} +elsif(/\@SAMPLE\s+(\d+)\s+(\d+)/) +{ + print "samples=$2\n"; +} +} +' "$@" diff --git a/scripts/tag_lyrics.py b/scripts/tag_lyrics.py new file mode 100644 index 0000000..1feb081 --- /dev/null +++ b/scripts/tag_lyrics.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# needs mutagen +# grabbed from: http://code.activestate.com/recipes/577138-embed-lyrics-into-mp3-files-using-mutagen-uslt-tag/ +# simplified to only work on one file and get lyrics from stdin +# I suspect this is public domain code. Just a usage example of the mutagen lib. + +import os +import sys +import codecs +from mutagen.mp3 import MP3 +from mutagen.id3 import ID3NoHeaderError +from mutagen.id3 import ID3, USLT + +TEXT_ENCODING = 'utf8' +TEXT_LANG = 'XXX' +TEXT_DESC = '' + +# get workdir from first arg or use current dir +if (len(sys.argv) > 1): + fname = sys.argv[1] + print "fname=" + fname +else: + print 'Give me at least a file name to work on, plus the lyrics from stdin' + print 'Optionally, you can provide the language (3 lowercase letters) of the lyrics and a description' + sys.exit() + +if (len(sys.argv) > 2): + TEXT_LANG = sys.argv[2] + +if (len(sys.argv) > 3): + TEXT_DESC = sys.argv[3] + +print "reading lyrics from standard input ..." + +lyrics = sys.stdin.read().strip() + +# try to find the right encoding +for enc in ('utf8','iso-8859-1','iso-8859-15','cp1252','cp1251','latin1'): + try: + lyrics = lyrics.decode(enc) + TEXT_DESC = TEXT_DESC.decode(enc) + print enc, + break + except: + pass + +print "Adding lyrics to " + fname +print "Language: " + TEXT_LANG +print "Description: " + TEXT_DESC + +# create ID3 tag if not exists +try: + tags = ID3(fname) +except ID3NoHeaderError: + print "Adding ID3 header;", + tags = ID3() + +# remove old unsychronized lyrics +if len(tags.getall(u"USLT::'"+TEXT_LANG+"'")) != 0: + print "Removing Lyrics." + tags.delall(u"USLT::'"+TEXT_LANG+"'") + #tags.save(fname) # hm, why? + +#tags.add(USLT(encoding=3, lang=u'eng', desc=u'desc', text=lyrics)) +# apparently the description is important when more than one +# USLT frames are present +#tags[u"USLT::'eng'"] = (USLT(encoding=3, lang=u'eng', desc=u'desc', text=lyrics)) +tags[u"USLT::'"+TEXT_LANG+"'"] = (USLT(encoding=3, lang=TEXT_LANG, desc=TEXT_DESC, text=lyrics)) +print 'Added USLT frame to', fname + +tags.save(fname) + +print 'Done' + diff --git a/src/Makemodule.am b/src/Makemodule.am new file mode 100644 index 0000000..88ed85d --- /dev/null +++ b/src/Makemodule.am @@ -0,0 +1,141 @@ +# Module for non-recursive mpg123 build system. + +include src/compat/Makemodule.am +include src/libmpg123/Makemodule.am +include src/libout123/Makemodule.am + +bin_PROGRAMS += \ + src/mpg123 \ + src/out123 \ + src/mpg123-id3dump \ + src/mpg123-strip + +src_mpg123_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la \ + src/libout123/libout123.la \ + $(LIBM) + +src_mpg123_LDFLAGS = @EXEC_LT_LDFLAGS@ + +src_out123_LDADD = \ + src/compat/libcompat.la \ + src/libout123/libout123.la + +src_out123_LDFLAGS = @EXEC_LT_LDFLAGS@ + +EXTRA_DIST += \ + src/intsym.h \ + src/mpg123-with-modules \ + src/out123-with-modules + +CLEANFILES += src/*.a + +src_mpg123_id3dump_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + +src_mpg123_strip_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + +EXTRA_PROGRAMS += \ + src/tests/seek_whence \ + src/tests/noise \ + src/tests/text \ + src/tests/plain_id3 + +src_mpg123_SOURCES = \ + src/audio.c \ + src/audio.h \ + src/common.c \ + src/common.h \ + src/sysutil.c \ + src/sysutil.h \ + src/control_generic.c \ + src/equalizer.c \ + src/getlopt.c \ + src/getlopt.h \ + src/httpget.c \ + src/httpget.h \ + src/resolver.c \ + src/resolver.h \ + src/genre.h \ + src/genre.c \ + src/mpg123.c \ + src/mpg123app.h \ + src/metaprint.c \ + src/metaprint.h \ + src/local.h \ + src/local.c \ + src/playlist.c \ + src/playlist.h \ + src/streamdump.h \ + src/streamdump.c \ + src/term.c \ + src/term.h \ + src/win32_support.h + +# Does that finally work to build/link the correct object file? +src_mpg123_SOURCES += + +# Replace common.h by sysutil.h! +src_out123_SOURCES = \ + src/sysutil.c \ + src/sysutil.h \ + src/waves.c \ + src/waves.h \ + src/common.h \ + src/getlopt.c \ + src/getlopt.h \ + src/out123.c \ + src/mpg123app.h \ + src/win32_support.h + +src_mpg123_id3dump_SOURCES = \ + src/mpg123-id3dump.c \ + src/getlopt.c \ + src/getlopt.h + +src_mpg123_strip_SOURCES = \ + src/mpg123-strip.c \ + src/getlopt.c \ + src/getlopt.h + +if WIN32_CODES +src_mpg123_SOURCES += \ + src/win32_support.c \ + src/win32_net.c + +src_out123_SOURCES+= \ + src/win32_support.c + +src_mpg123_id3dump_SOURCES += \ + src/win32_support.c +endif + +src_tests_seek_whence_SOURCES = \ + src/tests/seek_whence.c +src_tests_seek_whence_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + +src_tests_noise_SOURCES = \ + src/tests/noise.c \ + src/libmpg123/dither.h \ + src/libmpg123/dither_impl.h +src_tests_noise_LDADD = \ + src/compat/libcompat.la + +src_tests_text_SOURCES = \ + src/tests/text.c \ + src/tests/testtext.h +src_tests_text_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la + +src_tests_plain_id3_SOURCES = \ + src/tests/plain_id3.c +src_tests_plain_id3_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/libmpg123.la diff --git a/src/audio.c b/src/audio.c new file mode 100644 index 0000000..4042d61 --- /dev/null +++ b/src/audio.c @@ -0,0 +1,241 @@ +/* + audio: audio output interface + + copyright ?-2016 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +#include +#include "mpg123app.h" +#include "audio.h" +#include "out123.h" +#include "common.h" +#include "sysutil.h" + +#ifdef HAVE_SYS_WAIT_H +#include +#endif + +#include "debug.h" + +mpg123_string* audio_enclist(void) +{ + int i; + mpg123_string *list; + size_t enc_count = 0; + const int *enc_codes = NULL; + + /* Only the encodings supported by libmpg123 build + Those returned by out123_enc_list() are a superset. */ + mpg123_encodings(&enc_codes, &enc_count); + if((list = malloc(sizeof(*list)))) + mpg123_init_string(list); + /* Further calls to mpg123 string lib are hardened against NULL. */ + for(i=0;i0) + mpg123_add_string(list, " "); + mpg123_add_string(list, out123_enc_name(enc_codes[i])); + } + return list; +} + +static void capline(mpg123_handle *mh, long rate) +{ + int enci; + const int *encs; + size_t num_encs; + mpg123_encodings(&encs, &num_encs); + fprintf(stderr," %5ld |", pitch_rate(rate)); + for(enci=0; enci 2) + fprintf(stderr, "Note: forcing encoding code 0x%x (%s)\n" + , force_fmt, out123_enc_name(force_fmt)); + } + /* Lots of preparation of rate lists. */ + rlimit = param.force_rate > 0 ? num_rates+1 : num_rates; + outrates = malloc(sizeof(*rates)*rlimit); + unpitch = malloc(sizeof(*unpitch)*rlimit); + if(!outrates || !unpitch) + { + if(!param.quiet) + error("DOOM"); + return; + } + for(ri = 0; ri 0) + { + int fi; + int unpitch_i = 0; + if(param.verbose > 1 && outfmts[0].encoding > 0) + { + const char *encname = out123_enc_name(outfmts[0].encoding); + fprintf(stderr, "Note: default format %li Hz, %i channels, %s\n" + , outfmts[0].rate, outfmts[0].channels + , encname ? encname : "???" ); + } + for(fi=1; fi 2) + fprintf( stderr + , "Note: output support for %li Hz, %i channels: 0x%x\n" + , outfmts[fi].rate, outfmts[fi].channels, outfmts[fi].encoding ); + if(force_fmt) + { /* Filter for forced encoding. */ + if((fmts & force_fmt) == force_fmt) + fmts = force_fmt; + else /* Nothing else! */ + fmts = 0; + } + mpg123_format( mh + , brate(unpitch, outfmts[fi].rate, rlimit, &unpitch_i) + , outfmts[fi].channels, fmts ); + } + } + free(outfmts); + free(unpitch); + + if(param.verbose > 1) print_capabilities(ao, mh); +} + +int set_pitch(mpg123_handle *fr, out123_handle *ao, double new_pitch) +{ + double old_pitch = param.pitch; + long rate; + int channels, format; + int smode = 0; + + /* Be safe, check support. */ + if(mpg123_getformat(fr, &rate, &channels, &format) != MPG123_OK) + { + /* We might just not have a track handy. */ + error("There is no current audio format, cannot apply pitch. This might get fixed in future."); + return 0; + } + + param.pitch = new_pitch; + if(param.pitch < -0.99) param.pitch = -0.99; + + if(channels == 1) smode = MPG123_MONO; + if(channels == 2) smode = MPG123_STEREO; + + out123_stop(ao); + /* Remember: This takes param.pitch into account. */ + audio_capabilities(ao, fr); + if(!(mpg123_format_support(fr, rate, format) & smode)) + { + /* Note: When using --pitch command line parameter, you can go higher + because a lower decoder sample rate is automagically chosen. + Here, we'd need to switch decoder rate during track... good? */ + error("Reached a hardware limit there with pitch!"); + param.pitch = old_pitch; + audio_capabilities(ao, fr); + } + return out123_start(ao, pitch_rate(rate), channels, format); +} diff --git a/src/audio.h b/src/audio.h new file mode 100644 index 0000000..724f00e --- /dev/null +++ b/src/audio.h @@ -0,0 +1,38 @@ +/* + audio: audio output interface + + This is what is left after separating out libout123. + + copyright ?-2015 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +/* + * Audio 'LIB' defines + */ + + +#ifndef _MPG123_AUDIO_H_ +#define _MPG123_AUDIO_H_ + +#include "compat.h" +#include "mpg123.h" +#include "out123.h" + +#define pitch_rate(rate) (param.pitch == 0 ? (rate) : (long) ((param.pitch+1.0)*(rate))) + +mpg123_string* audio_enclist(void); + +void audio_capabilities(out123_handle *ao, mpg123_handle *mh); +void print_capabilities(out123_handle *ao, mpg123_handle *mh); + +/* + Twiddle audio output rate to yield speedup/down (pitch) effect. + The actually achieved pitch value is stored in param.pitch. + Returns 1 if pitch setting succeeded, 0 otherwise. +*/ +int set_pitch(mpg123_handle *fr, out123_handle *ao, double new_pitch); + +#endif + diff --git a/src/common.c b/src/common.c new file mode 100644 index 0000000..cb0c092 --- /dev/null +++ b/src/common.c @@ -0,0 +1,456 @@ +/* + common: misc stuff... audio flush, status display... + + copyright ?-2015 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +/* Need snprintf. */ +#define _DEFAULT_SOURCE +#define _BSD_SOURCE +#include "mpg123app.h" +#include "out123.h" +#include +#include "common.h" + +#ifdef __EMX__ +/* Special ways for OS/2 EMX */ +#include +#else +/* POSIX stuff */ +#ifdef HAVE_TERMIOS +#include +#include +#endif +#endif + +#include "debug.h" + +int stopped = 0; +int paused = 0; +static int term_is_fun = -1; + +int term_have_fun(int fd) +{ + if(term_is_fun > -1) + return term_is_fun; + else + term_is_fun = 0; +#ifdef HAVE_TERMIOS + if(term_width(fd) > 0 && param.term_visual) + { + /* Only play with non-dumb terminals. */ + char *tname = compat_getenv("TERM"); + if(tname) + { + if(strcmp(tname, "") && strcmp(tname, "dumb")) + term_is_fun = 1; + free(tname); + } + } +#endif + return term_is_fun; +} + +/* Also serves as a way to detect if we have an interactive terminal. */ +int term_width(int fd) +{ +#ifdef __EMX__ +/* OS/2 */ + int s[2]; + _scrsize (s); + if (s[0] >= 0) + return s[0]; +#else +#ifdef HAVE_TERMIOS +/* POSIX */ + struct winsize geometry; + geometry.ws_col = 0; + if(ioctl(fd, TIOCGWINSZ, &geometry) >= 0) + return (int)geometry.ws_col; +#endif +#endif + return -1; +} + +const char* rva_name[3] = { "off", "mix", "album" }; +static const char* rva_statname[3] = { "---", "mix", "alb" }; +static const char *modes[5] = {"Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel", "Invalid" }; +static const char *smodes[5] = { "stereo", "j-s", "dual", "mono", "o.O" }; +static const char *layers[4] = { "Unknown" , "I", "II", "III" }; +static const char *versions[4] = {"1.0", "2.0", "2.5", "x.x" }; +static const int samples_per_frame[4][4] = +{ + { -1,384,1152,1152 }, /* MPEG 1 */ + { -1,384,1152,576 }, /* MPEG 2 */ + { -1,384,1152,576 }, /* MPEG 2.5 */ + { -1,-1,-1,-1 }, /* Unknown */ +}; + +/* concurring to print_rheader... here for control_generic */ +const char* remote_header_help = "S "; +void print_remote_header(mpg123_handle *mh) +{ + struct mpg123_frameinfo i; + mpg123_info(mh, &i); + if(i.mode >= 4 || i.mode < 0) i.mode = 4; + if(i.version >= 3 || i.version < 0) i.version = 3; + generic_sendmsg("S %s %d %ld %s %d %d %d %d %d %d %d %d %d", + versions[i.version], + i.layer, + i.rate, + modes[i.mode], + i.mode_ext, + i.framesize, + i.mode == MPG123_M_MONO ? 1 : 2, + i.flags & MPG123_COPYRIGHT ? 1 : 0, + i.flags & MPG123_CRC ? 1 : 0, + i.emphasis, + i.bitrate, + i.flags & MPG123_PRIVATE ? 1 : 0, + i.vbr); +} + +void print_header(mpg123_handle *mh) +{ + struct mpg123_frameinfo i; + mpg123_info(mh, &i); + if(i.mode > 4 || i.mode < 0) i.mode = 4; + if(i.version > 3 || i.version < 0) i.version = 3; + if(i.layer > 3 || i.layer < 0) i.layer = 0; + fprintf(stderr,"MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d\n", + versions[i.version], + layers[i.layer], i.rate, + modes[i.mode],i.mode_ext,i.framesize); + fprintf(stderr,"Channels: %d, copyright: %s, original: %s, CRC: %s, emphasis: %d.\n", + i.mode == MPG123_M_MONO ? 1 : 2,i.flags & MPG123_COPYRIGHT ? "Yes" : "No", + i.flags & MPG123_ORIGINAL ? "Yes" : "No", i.flags & MPG123_CRC ? "Yes" : "No", + i.emphasis); + fprintf(stderr,"Bitrate: "); + switch(i.vbr) + { + case MPG123_CBR: + if(i.bitrate) fprintf(stderr, "%d kbit/s", i.bitrate); + else fprintf(stderr, "%d kbit/s (free format)", (int)((double)(i.framesize+4)*8*i.rate*0.001/samples_per_frame[i.version][i.layer]+0.5)); + break; + case MPG123_VBR: fprintf(stderr, "VBR"); break; + case MPG123_ABR: fprintf(stderr, "%d kbit/s ABR", i.abr_rate); break; + default: fprintf(stderr, "???"); + } + fprintf(stderr, " Extension value: %d\n", i.flags & MPG123_PRIVATE ? 1 : 0); +} + +void print_header_compact(mpg123_handle *mh) +{ + struct mpg123_frameinfo i; + mpg123_info(mh, &i); + if(i.mode > 4 || i.mode < 0) i.mode = 4; + if(i.version > 3 || i.version < 0) i.version = 3; + if(i.layer > 3 || i.layer < 0) i.layer = 0; + + fprintf(stderr,"MPEG %s L %s ", versions[i.version], layers[i.layer]); + switch(i.vbr) + { + case MPG123_CBR: + if(i.bitrate) fprintf(stderr, "cbr%d", i.bitrate); + else fprintf(stderr, "cbr%d", (int)((double)i.framesize*8*i.rate*0.001/samples_per_frame[i.version][i.layer]+0.5)); + break; + case MPG123_VBR: fprintf(stderr, "vbr"); break; + case MPG123_ABR: fprintf(stderr, "abr%d", i.abr_rate); break; + default: fprintf(stderr, "???"); + } + fprintf(stderr," %ld %s\n", i.rate, smodes[i.mode]); +} + +unsigned int roundui(double val) +{ + double base = floor(val); + return (unsigned int) ((val-base) < 0.5 ? base : base + 1 ); +} + +/* Split into mm:ss.xx or hh:mm:ss, depending on value. */ +static void settle_time(double tim, unsigned long *times, char *sep) +{ + if(tim >= 3600.) + { + *sep = ':'; + times[0] = (unsigned long) tim/3600; + tim -= times[0]*3600; + times[1] = (unsigned long) tim/60; + tim -= times[1]*60; + times[2] = (unsigned long) tim; + } + else + { + *sep = '.'; + times[0] = (unsigned long) tim/60; + times[1] = (unsigned long) tim%60; + times[2] = (unsigned long) (tim*100)%100; + } +} + +/* Print output buffer fill. */ +void print_buf(const char* prefix, out123_handle *ao) +{ + long rate; + int framesize; + double tim; + unsigned long times[3]; + char timesep; + size_t buffsize; + + buffsize = out123_buffered(ao); + if(out123_getformat(ao, &rate, NULL, NULL, &framesize)) + return; + tim = (double)(buffsize/framesize)/rate; + settle_time(tim, times, ×ep); + fprintf( stderr, "\r%s[%02lu:%02lu%c%02lu]" + , prefix, times[0], times[1], timesep, times[2] ); +} + + + +/* Note about position info with buffering: + Negative positions mean that the previous track is still playing from the + buffer. It's a countdown. The frame counter always relates to the last + decoded frame, what entered the buffer right now. */ +void print_stat(mpg123_handle *fr, long offset, out123_handle *ao, int draw_bar) +{ + size_t buffered; + off_t decoded; + off_t elapsed; + off_t remain; + off_t length; + off_t frame; + off_t frames; + off_t rframes; + int spf; + double basevol, realvol; + char *icy; + long rate; + int framesize; + struct mpg123_frameinfo mi; + char linebuf[256]; + char *line = NULL; + +#ifndef WIN32 +#ifndef GENERIC +/* Only generate new stat line when stderr is ready... don't overfill... */ + { + struct timeval t; + fd_set serr; + int n,errfd = fileno(stderr); + + t.tv_sec=t.tv_usec=0; + + FD_ZERO(&serr); + FD_SET(errfd,&serr); + n = select(errfd+1,NULL,&serr,NULL,&t); + if(n <= 0) return; + } +#endif +#endif + if(out123_getformat(ao, &rate, NULL, NULL, &framesize)) + return; + buffered = out123_buffered(ao)/framesize; + decoded = mpg123_tell(fr); + length = mpg123_length(fr); + frame = mpg123_tellframe(fr); + frames = mpg123_framelength(fr); + spf = mpg123_spf(fr); + if(decoded < 0 || length < 0 || frame < 0 || frames <= 0 || spf <= 0) + return; + /* Apply offset. */ + frame += offset; + if(frame < 0) + frame = 0; + /* Some sensible logic around offsets and time. + Buffering makes the relationships between the numbers non-trivial. */ + rframes = frames-frame; + elapsed = decoded + offset*spf - buffered; /* May be negative, a countdown. */ + remain = elapsed > 0 ? length - elapsed : length; + if( MPG123_OK == mpg123_info(fr, &mi) + && MPG123_OK == mpg123_getvolume(fr, &basevol, &realvol, NULL) ) + { + char framefmt[10]; + char framestr[2][32]; + int linelen; + int maxlen; + int len; + int ti; + /* Deal with overly long times. */ + double tim[3]; + unsigned long times[3][3]; + char timesep[3]; + char sign[3] = {' ', ' ', ' '}; + + /* 255 is enough for the data I prepare, if there is no terminal width to + fill */ + maxlen = term_width(STDERR_FILENO); + linelen = maxlen > 0 ? maxlen : (sizeof(linebuf)-1); + line = linelen >= sizeof(linebuf) + ? malloc(linelen+1) /* Only malloc if it is a really long line. */ + : linebuf; /* Small buffer on stack is enough. */ + + tim[0] = (double)elapsed/rate; + tim[1] = (double)remain/rate; + tim[2] = (double)buffered/rate; + for(ti=0; ti<3; ++ti) + { + if(tim[ti] < 0.){ sign[ti] = '-'; tim[ti] = -tim[ti]; } + settle_time(tim[ti], times[ti], ×ep[ti]); + } + /* Taking pains to properly size the frame number fields. */ + len = snprintf( framefmt, sizeof(framefmt) + , "%%0%d"OFF_P, (int)log10(frames)+1 ); + if(len < 0 || len >= sizeof(framefmt)) + memcpy(framefmt, "%05"OFF_P, sizeof("%05"OFF_P)); + snprintf( framestr[0], sizeof(framestr[0])-1, framefmt, (off_p)frame); + framestr[0][sizeof(framestr[0])-1] = 0; + snprintf( framestr[1], sizeof(framestr[1])-1, framefmt, (off_p)rframes); + framestr[1][sizeof(framestr[1])-1] = 0; + /* Now start with the state line. */ + memset(line, 0, linelen+1); /* Always one zero more. */ + /* Start with position info. */ + len = snprintf( line, linelen + , "%c %s+%s %c%02lu:%02lu%c%02lu+%02lu:%02lu%c%02lu" + , stopped ? '_' : (paused ? '=' : '>') + , framestr[0], framestr[1] + , sign[0] + , times[0][0], times[0][1], timesep[0], times[0][2] + , times[1][0], times[1][1], timesep[1], times[1][2] + ); + /* Just cut it. */ + if(len >= linelen) + len=linelen; + if(len >= 0 && param.usebuffer && len < linelen ) + { /* Buffer info. */ + int len_add = snprintf( line+len, linelen-len + , " [%02lu:%02lu%c%02lu]" + , times[2][0], times[2][1], timesep[2], times[2][2] ); + if(len_add > 0) + len += len_add; + } + if(len >= 0 && len < linelen) + { /* Volume info. */ + int len_add = snprintf( line+len, linelen-len + , " %s %03u=%03u" + , rva_statname[param.rva], roundui(basevol*100), roundui(realvol*100) + ); + if(len_add > 0) + len += len_add; + } + if(len >= 0 && len < linelen) + { /* Bitrate. */ + int len_add = snprintf( line+len, linelen-len + , " %3d kb/s", mi.bitrate ); + if(len_add > 0) + len += len_add; + } + if(len >= 0 && len < linelen) + { /* Size of frame in bytes. */ + int len_add = snprintf( line+len, linelen-len + , " %4d B", mi.framesize ); + if(len_add > 0) + len += len_add; + } + if(len >= 0 && len < linelen) + { /* Size of frame in bytes. */ + int len_add = 0; + long res = 0; + if(mpg123_getstate(fr, MPG123_ACCURATE, &res, NULL) == MPG123_OK) + len_add = snprintf( line+len, linelen-len + , " %s", res ? "acc" : "fuz" ); + if(len_add > 0) + len += len_add; + } + if(len >= 0 && len < linelen) + { /* Size of frame in bytes. */ + int len_add = 0; + long res = mpg123_clip(fr); + if(res >= 0) + len_add = snprintf( line+len, linelen-len + , " %4ld clip", res ); + if(len_add > 0) + len += len_add; + } + if(len >= 0 && len < linelen) + { /* Size of frame in bytes. */ + int len_add = 0; + len_add = snprintf( line+len, linelen-len + , " p%+.3f", param.pitch ); + if(len_add > 0) + len += len_add; + } + if(len >= 0) + { + if(maxlen > 0 && len > maxlen) + { + /* Emergency cut to avoid terminal scrolling. */ + int i; + /* Blank a word that would have been cut off. */ + for(i=maxlen; i>=0; --i) + { + char old = line[i]; + line[i] = ' '; + if(old == ' ') + break; + } + line[maxlen] = 0; + len = maxlen; + } + /* Ensure that it is filled with spaces if we got some line length. + Shouldn't we always fill to maxlen? */ + if(maxlen > 0) + memset(line+len, ' ', linelen-len); +#ifdef HAVE_TERMIOS + draw_bar = draw_bar && term_have_fun(STDERR_FILENO); + /* Use inverse color to draw a progress bar. */ + if(maxlen > 0 && draw_bar) + { + char old; + int barlen = 0; + if(length > 0 && elapsed > 0) + { + if(elapsed < length) + barlen = (int)((double)elapsed/length * maxlen); + else + barlen = maxlen; + } + old = line[barlen]; + fprintf(stderr, "\x1b[7m"); + line[barlen] = 0; + fprintf(stderr, "\r%s", line); + line[barlen] = old; + fprintf(stderr, "\x1b[0m"); + fprintf(stderr, "%s", line+barlen); + } + else +#endif + fprintf(stderr, "\r%s", line); + } + } + /* Check for changed tags here too? */ + if( mpg123_meta_check(fr) & MPG123_NEW_ICY && MPG123_OK == mpg123_icy(fr, &icy) ) + { + if(line) /* Clear the inverse video. */ + fprintf(stderr, "\r%s", line); + fprintf(stderr, "\nICY-META: %s\n", icy); + } + if(line && line != linebuf) + free(line); +} + +void clear_stat() +{ + int len = term_width(STDERR_FILENO); + if(len > 0) + { + char fmt[20]; + int flen; + if( (flen=snprintf(fmt, sizeof(fmt), "\r%%%ds\r", len)) > 0 + && flen < sizeof(fmt) ) + fprintf(stderr, fmt, " "); + } +} diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..f787eb3 --- /dev/null +++ b/src/common.h @@ -0,0 +1,38 @@ +/* + common: anything can happen here... frame reading, output, messages + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +#ifndef _MPG123_COMMON_H_ +#define _MPG123_COMMON_H_ + +#include "mpg123app.h" +#include "out123.h" + +extern int stopped; +extern int paused; + +/* Return non-zero if full terminal fun is desired/possible. */ +int term_have_fun(int fd); + +/* Return width of terminal associated with given descriptor, + -1 when there is none. */ +int term_width(int fd); + +void print_header(mpg123_handle *); +void print_header_compact(mpg123_handle *); +void print_stat(mpg123_handle *fr, long offset, out123_handle *ao, int draw_bar); +void print_buf(const char* prefix, out123_handle *ao); +void clear_stat(); +/* for control_generic */ +extern const char* remote_header_help; +void print_remote_header(mpg123_handle *mh); +void generic_sendmsg (const char *fmt, ...); + +extern const char* rva_name[3]; + +#endif + diff --git a/src/compat/Makemodule.am b/src/compat/Makemodule.am new file mode 100644 index 0000000..63ec854 --- /dev/null +++ b/src/compat/Makemodule.am @@ -0,0 +1,14 @@ +noinst_LTLIBRARIES += src/compat/libcompat.la +noinst_LTLIBRARIES += src/compat/libcompat_str.la + +src_compat_libcompat_la_SOURCES = \ + src/compat/compat_str.c \ + src/compat/compat.c \ + src/compat/compat.h + +# A smaller one for the output modules. Do not want to grow them +# unnecessarily with unused code. +src_compat_libcompat_str_la_SOURCES = \ + src/compat/compat_str.c \ + src/compat/compat.h + diff --git a/src/compat/compat.c b/src/compat/compat.c new file mode 100644 index 0000000..675a2da --- /dev/null +++ b/src/compat/compat.c @@ -0,0 +1,665 @@ +/* + compat: Some compatibility functions (basic memory & string stuff in separate file) + + The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX. + So anything possibly somewhat advanced should be considered to be put here, with proper #ifdef;-) + + copyright 2007-2016 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis, Windows Unicode stuff by JonY. +*/ + +#include "config.h" +/* This source file does need _POSIX_SOURCE to get some sigaction. */ +#define _POSIX_SOURCE +#include "compat.h" + +#ifdef _MSC_VER +#include + +#if(defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP)) +#define WINDOWS_UWP +#endif + +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_DIRENT_H +# include +#endif + +/* Win32 is only supported with unicode now. These headers also cover + module stuff. The WANT_WIN32_UNICODE macro is synonymous with + "want windows-specific API, and only the unicode variants of which". */ +#ifdef WANT_WIN32_UNICODE +#include +#include +#include +#include +#endif + +#ifdef USE_MODULES +# ifdef HAVE_DLFCN_H +# include +# endif +#endif + +#include "debug.h" + +#ifndef WINDOWS_UWP + +char *compat_getenv(const char* name) +{ + char *ret = NULL; +#ifdef WANT_WIN32_UNICODE + wchar_t *env; + wchar_t *wname = NULL; + if(win32_utf8_wide(name, &wname, NULL) > 0) + { + env = _wgetenv(wname); + free(wname); + if(env) + win32_wide_utf8(env, &ret, NULL); + } +#else + ret = getenv(name); + if(ret) + ret = compat_strdup(ret); +#endif + return ret; +} + +#ifdef WANT_WIN32_UNICODE + +/* Convert unix UTF-8 (or ASCII) paths to Windows wide character paths. */ +static wchar_t* u2wpath(const char *upath) +{ + wchar_t* wpath, *p; + if(!upath || win32_utf8_wide(upath, &wpath, NULL) < 1) + return NULL; + for(p=wpath; *p; ++p) + if(*p == L'/') + *p = L'\\'; + return wpath; +} + +/* Convert Windows wide character paths to unix UTF-8. */ +static char* w2upath(const wchar_t *wpath) +{ + char* upath, *p; + if(!wpath || win32_wide_utf8(wpath, &upath, NULL) < 1) + return NULL; + for(p=upath; *p; ++p) + if(*p == '\\') + *p = '/'; + return upath; +} + +/* An absolute path that is too long and not already marked with + \\?\ can be marked as a long one and still work. */ +static int wpath_need_elongation(wchar_t *wpath) +{ + if( wpath && !PathIsRelativeW(wpath) + && wcslen(wpath) > MAX_PATH-1 + && wcsncmp(L"\\\\?\\", wpath, 4) ) + return 1; + else + return 0; +} + +/* Take any wide windows path and turn it into a path that is allowed + to be longer than MAX_PATH, if it is not already. */ +static wchar_t* wlongpath(wchar_t *wpath) +{ + size_t len, plen; + const wchar_t *prefix = L""; + wchar_t *wlpath = NULL; + if(!wpath) + return NULL; + + /* Absolute paths that do not start with \\?\ get that prepended + to allow them being long. */ + if(!PathIsRelativeW(wpath) && wcsncmp(L"\\\\?\\", wpath, 4)) + { + if(wcslen(wpath) >= 2 && PathIsUNCW(wpath)) + { + /* \\server\path -> \\?\UNC\server\path */ + prefix = L"\\\\?\\UNC"; + ++wpath; /* Skip the first \. */ + } + else /* c:\some/path -> \\?\c:\some\path */ + prefix = L"\\\\?\\"; + } + plen = wcslen(prefix); + len = plen + wcslen(wpath); + wlpath = malloc(len+1*sizeof(wchar_t)); + if(wlpath) + { + /* Brute force memory copying, swprintf is too dandy. */ + memcpy(wlpath, prefix, sizeof(wchar_t)*plen); + memcpy(wlpath+plen, wpath, sizeof(wchar_t)*(len-plen)); + wlpath[len] = 0; + } + return wlpath; +} + +/* Convert unix path to wide windows path, optionally marking + it as long path if necessary. */ +static wchar_t* u2wlongpath(const char *upath) +{ + wchar_t *wpath = NULL; + wchar_t *wlpath = NULL; + wpath = u2wpath(upath); + if(wpath_need_elongation(wpath)) + { + wlpath = wlongpath(wpath); + free(wpath); + wpath = wlpath; + } + return wpath; +} + +#endif + +#else + +static wchar_t* u2wlongpath(const char *upath) +{ + wchar_t* wpath, *p; + if (!upath || win32_utf8_wide(upath, &wpath, NULL) < 1) + return NULL; + for (p = wpath; *p; ++p) + if (*p == L'/') + *p = L'\\'; + return wpath; +} + +#endif + +/* Always add a default permission mask in case of flags|O_CREAT. */ +int compat_open(const char *filename, int flags) +{ + int ret; +#if defined (WANT_WIN32_UNICODE) + wchar_t *frag = NULL; + + frag = u2wlongpath(filename); + /* Fallback to plain open when ucs-2 conversion fails */ + if(!frag) + goto open_fallback; + + /*Try _wopen */ + ret = _wopen(frag, flags|_O_BINARY, _S_IREAD | _S_IWRITE); + if(ret != -1 ) + goto open_ok; /* msdn says -1 means failure */ + +open_fallback: +#endif + +#if (defined(WIN32) && !defined (__CYGWIN__)) + /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */ + /* Try plain old _open(), if it fails, do nothing */ + ret = _open(filename, flags|_O_BINARY, _S_IREAD | _S_IWRITE); +#else + ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); +#endif + +#if defined (WANT_WIN32_UNICODE) +open_ok: + free(frag); +#endif + + return ret; +} + +/* Moved over from wav.c, logic with fallbacks added from the + example of compat_open(). */ +FILE* compat_fopen(const char *filename, const char *mode) +{ + FILE* stream = NULL; +#ifdef WANT_WIN32_UNICODE + int cnt = 0; + wchar_t *wname = NULL; + wchar_t *wmode = NULL; + + wname = u2wlongpath(filename); + if(!wname) + goto fopen_fallback; + cnt = win32_utf8_wide(mode, &wmode, NULL); + if( (wmode == NULL) || (cnt == 0)) + goto fopen_fallback; + + stream = _wfopen(wname, wmode); + if(stream) goto fopen_ok; + +fopen_fallback: +#endif + stream = fopen(filename, mode); +#ifdef WANT_WIN32_UNICODE + +fopen_ok: + free(wmode); + free(wname); +#endif + return stream; +} + +FILE* compat_fdopen(int fd, const char *mode) +{ + return fdopen(fd, mode); +} + +int compat_close(int infd) +{ +#if (defined(WIN32) && !defined (__CYGWIN__)) /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */ + return _close(infd); +#else + return close(infd); +#endif +} + +int compat_fclose(FILE *stream) +{ + return fclose(stream); +} + +/* Windows Unicode stuff */ + +#ifdef WANT_WIN32_UNICODE +int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen) +{ + size_t len; + char *buf; + int ret = 0; + + len = WideCharToMultiByte(CP_UTF8, 0, wptr, -1, NULL, 0, NULL, NULL); /* Get utf-8 string length */ + buf = calloc(len + 1, sizeof (char)); /* Can we assume sizeof char always = 1? */ + + if(!buf) len = 0; + else { + if (len != 0) ret = WideCharToMultiByte(CP_UTF8, 0, wptr, -1, buf, len, NULL, NULL); /*Do actual conversion*/ + buf[len] = '0'; /* Must terminate */ + } + *mbptr = buf; /* Set string pointer to allocated buffer */ + if(buflen != NULL) *buflen = (len) * sizeof (char); /* Give length of allocated memory if needed. */ + return ret; +} + +int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen) +{ + size_t len; + wchar_t *buf; + int ret = 0; + + len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mbptr, -1, NULL, 0); /* Get converted size */ + buf = calloc(len + 1, sizeof (wchar_t)); /* Allocate memory accordingly */ + + if(!buf) len = 0; + else { + if (len != 0) ret = MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS, mbptr, -1, buf, len); /* Do conversion */ + buf[len] = L'0'; /* Must terminate */ + } + *wptr = buf; /* Set string pointer to allocated buffer */ + if (buflen != NULL) *buflen = len * sizeof (wchar_t); /* Give length of allocated memory if needed. */ + return ret; /* Number of characters written */ +} +#endif + +#ifndef WINDOWS_UWP + +/* + The Windows file and path stuff is an extract of jon_y's win32 loader + prototype from the loader_rework branch. It's been divided in to + reusable functons by ThOr in the hope to work out some generic-looking + loader code for both POSIX and Windows. The routines might be + helpful for consistent path work in other parts of mpg123, too. + + This all is about getting some working code on a wide range of + systems while staying somewhat sane. If it does ridiculously inefficient + things with extraneous copies and grabbing of functions that made + it late to some official APIs, that's still fine with us. +*/ + +char* compat_catpath(const char *prefix, const char* path) +{ + char *ret = NULL; +#ifdef WANT_WIN32_UNICODE + wchar_t *wprefix = NULL; /* Wide windows versions of */ + wchar_t *wpath = NULL; /* input arguments. */ + wchar_t *locwret = NULL; /* Tmp return value from LocalAlloc */ + /* + This variation of combinepath can work with long and UNC paths, but + is not officially exposed in any DLLs, It also allocates all its buffers + internally via LocalAlloc, avoiding buffer overflow problems. + ThOr: I presume this hack is for supporting pre-8 Windows, as + from Windows 8 on, this is documented in the API. + */ + HRESULT (__stdcall *mypac)( const wchar_t *in, const wchar_t* more + , unsigned long flags, wchar_t **out ) = NULL; + HMODULE pathcch = NULL; + + if(!prefix && !path) + goto catpath_end; + wprefix = u2wpath(prefix); + wpath = u2wpath(path); + if((prefix && !wprefix) || (path && !wpath)) + goto catpath_end; + + /* Again: I presume this whole fun is to get at PathAllocCombine + even when pathcch.h is not available (like in MinGW32). */ + if( (pathcch = GetModuleHandleA("kernelbase")) ) + mypac = (void *)GetProcAddress(pathcch, "PathAllocCombine"); + if(mypac) /* PATHCCH_ALLOW_LONG_PATH = 1 per API docs */ + { + debug("Actually calling PathAllocCombine!"); + mypac(wprefix, wpath, 1, &locwret); + } + else + { + /* Playing safe, if we'd care much about performance, this would be on + the stack. */ + locwret = LocalAlloc(LPTR, sizeof(wchar_t)*MAX_PATH); + if(locwret) + PathCombineW(locwret, wprefix, wpath); + } + ret = w2upath(locwret); + +catpath_end: + LocalFree(locwret); + free(wprefix); + free(wpath); +#else + size_t len, prelen, patlen; + + if(path && path[0] == '/') + prefix = NULL; /* Absolute path stays as it is. */ + prelen = prefix ? strlen(prefix) : 0; + patlen = path ? strlen(path) : 0; + /* Concatenate the two, put a / in between if both present. */ + len = ((prefix && path) ? 1 : 0) + prelen + patlen; + ret = malloc(len+1); + if(ret) + { + size_t off=0; + memcpy(ret, prefix, prelen); + if(prefix && path) + ret[prelen+(off++)] = '/'; + memcpy(ret+prelen+off, path, patlen); + ret[len] = 0; + } +#endif + return ret; +} + +int compat_isdir(const char *path) +{ + int ret = 0; +#ifdef WANT_WIN32_UNICODE + wchar_t *wpath; + wpath = u2wlongpath(path); + if(wpath) + { + DWORD attr = GetFileAttributesW(wpath); + if(attr != INVALID_FILE_ATTRIBUTES && attr & FILE_ATTRIBUTE_DIRECTORY) + ret=1; + free(wpath); + } +#else + struct stat sb; + if(path && !stat(path, &sb)) + { + if(S_ISDIR(sb.st_mode)) + ret=1; + } +#endif + return ret; +} + +struct compat_dir +{ + char *path; +#ifdef WANT_WIN32_UNICODE + int gotone; /* Got a result stored from FindFirstFileW. */ + WIN32_FIND_DATAW d; + HANDLE ffn; +#else + DIR* dir; +#endif +}; + +struct compat_dir* compat_diropen(char *path) +{ + struct compat_dir *cd; + if(!path) + return NULL; + cd = malloc(sizeof(*cd)); + if(!cd) + return NULL; +#ifdef WANT_WIN32_UNICODE + cd->gotone = 0; + { + char *pattern; + wchar_t *wpattern; + pattern = compat_catpath(path, "*"); + wpattern = u2wlongpath(pattern); + if(wpattern) + { + cd->ffn = FindFirstFileW(wpattern, &(cd->d)); + if(cd->ffn == INVALID_HANDLE_VALUE) + { + /* FindClose() only needed after successful first find, right? */ + free(cd); + cd = NULL; + } + else + cd->gotone = 1; + } + free(wpattern); + free(pattern); + } +#else + cd->dir = opendir(path); + if(!cd->dir) + { + free(cd); + cd = NULL; + } +#endif + if(cd) + { + cd->path = compat_strdup(path); + if(!cd->path) + { + compat_dirclose(cd); + cd = NULL; + } + } + return cd; +} + +void compat_dirclose(struct compat_dir *cd) +{ + if(cd) + { + free(cd->path); +#ifdef WANT_WIN32_UNICODE + FindClose(cd->ffn); +#else + closedir(cd->dir); +#endif + free(cd); + } +} + +char* compat_nextfile(struct compat_dir *cd) +{ + if(!cd) + return NULL; +#ifdef WANT_WIN32_UNICODE + while(cd->gotone || FindNextFileW(cd->ffn, &(cd->d))) + { + cd->gotone = 0; + if(!(cd->d.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + char *ret; + win32_wide_utf8(cd->d.cFileName, &ret, NULL); + return ret; + } + } +#else + { + struct dirent *dp; + while((dp = readdir(cd->dir))) + { + struct stat fst; + char *fullpath = compat_catpath(cd->path, dp->d_name); + if(fullpath && !stat(fullpath, &fst) && S_ISREG(fst.st_mode)) + { + free(fullpath); + return compat_strdup(dp->d_name); + } + free(fullpath); + } + } +#endif + return NULL; +} + +char* compat_nextdir(struct compat_dir *cd) +{ + if(!cd) + return NULL; +#ifdef WANT_WIN32_UNICODE + while(cd->gotone || FindNextFileW(cd->ffn, &(cd->d))) + { + cd->gotone = 0; + if(cd->d.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + char *ret; + win32_wide_utf8(cd->d.cFileName, &ret, NULL); + return ret; + } + } +#else + { + struct dirent *dp; + while((dp = readdir(cd->dir))) + { + struct stat fst; + char *fullpath = compat_catpath(cd->path, dp->d_name); + if(fullpath && !stat(fullpath, &fst) && S_ISDIR(fst.st_mode)) + { + free(fullpath); + return compat_strdup(dp->d_name); + } + free(fullpath); + } + } +#endif + return NULL; +} + +#endif + +#ifdef USE_MODULES +/* + This is what I expected the platform-specific dance for dynamic module + support to be. Little did I know about the peculiarities of (long) + paths and directory/file search on Windows. +*/ + +void *compat_dlopen(const char *path) +{ + void *handle = NULL; +#ifdef WANT_WIN32_UNICODE + wchar_t *wpath; + wpath = u2wlongpath(path); + if(wpath) + handle = LoadLibraryW(wpath); + free(wpath); +#else + handle = dlopen(path, RTLD_NOW); +#endif + return handle; +} + +void *compat_dlsym(void *handle, const char *name) +{ + void *sym = NULL; + if(!handle) + return NULL; +#ifdef WANT_WIN32_UNICODE + sym = GetProcAddress(handle, name); +#else + sym = dlsym(handle, name); +#endif + return sym; +} + +void compat_dlclose(void *handle) +{ + if(!handle) + return; +#ifdef WANT_WIN32_UNICODE + FreeLibrary(handle); +#else + dlclose(handle); +#endif +} + +#endif /* USE_MODULES */ + + +/* This shall survive signals and any return value less than given byte count + is an error */ +size_t unintr_write(int fd, void const *buffer, size_t bytes) +{ + size_t written = 0; + while(bytes) + { + ssize_t part = write(fd, (char*)buffer+written, bytes); + if(part < 0 && errno != EINTR) + break; + bytes -= part; + written += part; + } + return written; +} + +/* Same for reading the data. */ +size_t unintr_read(int fd, void *buffer, size_t bytes) +{ + size_t got = 0; + while(bytes) + { + ssize_t part = read(fd, (char*)buffer+got, bytes); + if(part < 0 && errno != EINTR) + break; + bytes -= part; + got += part; + } + return got; +} + +#ifndef NO_CATCHSIGNAL +#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +void (*catchsignal(int signum, void(*handler)()))() +{ + struct sigaction new_sa; + struct sigaction old_sa; + +#ifdef DONT_CATCH_SIGNALS + fprintf (stderr, "Not catching any signals.\n"); + return ((void (*)()) -1); +#endif + + new_sa.sa_handler = handler; + sigemptyset(&new_sa.sa_mask); + new_sa.sa_flags = 0; + if(sigaction(signum, &new_sa, &old_sa) == -1) + return ((void (*)()) -1); + return (old_sa.sa_handler); +} +#endif +#endif diff --git a/src/compat/compat.h b/src/compat/compat.h new file mode 100644 index 0000000..481fc70 --- /dev/null +++ b/src/compat/compat.h @@ -0,0 +1,289 @@ +/* + compat: Some compatibility functions and header inclusions. + Basic standard C stuff, that may barely be above/around C89. + + The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX. + It is envisioned to include this compat header instead of any of the "standard" headers, to catch compatibility issues. + So, don't include stdlib.h or string.h ... include compat.h. + + copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#ifndef MPG123_COMPAT_H +#define MPG123_COMPAT_H + +#include "config.h" +#include "intsym.h" + +/* For --nagging compilation with -std=c89, we need + to disable the inline keyword. */ +#ifdef PLAIN_C89 +#ifndef inline +#define inline +#endif +#endif + +#include + +#ifdef HAVE_STDLIB_H +/* realloc, size_t */ +#include +#endif + +#include +#include + +#ifdef HAVE_SIGNAL_H +#include +#else +#ifdef HAVE_SYS_SIGNAL_H +#include +#endif +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +/* Types, types, types. */ +/* Do we actually need these two in addition to sys/types.h? As replacement? */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_INTTYPES_H +#include +#endif +#ifdef HAVE_STDINT_H +#include +#endif +/* We want SIZE_MAX, etc. */ +#ifdef HAVE_LIMITS_H +#include +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX ((size_t)-1) +#endif +#ifndef ULONG_MAX +#define ULONG_MAX ((unsigned long)-1) +#endif + +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#endif + +#ifdef OS2 +#include +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#endif +/* For select(), I need select.h according to POSIX 2001, else: sys/time.h sys/types.h unistd.h */ +#ifdef HAVE_SYS_SELECT_H +#include +#endif + +/* compat_open makes little sense without */ +#include + +/* To parse big numbers... */ +#ifdef HAVE_ATOLL +#define atobigint atoll +#else +#define atobigint atol +#endif + +typedef unsigned char byte; + +#if defined(_MSC_VER) && !defined(MPG123_DEF_SSIZE_T) +#define MPG123_DEF_SSIZE_T +#include +typedef ptrdiff_t ssize_t; +#endif + +/* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ +void *safe_realloc(void *ptr, size_t size); +#ifndef HAVE_STRERROR +const char *strerror(int errnum); +#endif + +/* Roll our own strdup() that does not depend on libc feature test macros + and returns NULL on NULL input instead of crashing. */ +char* compat_strdup(const char *s); + +/* If we have the size checks enabled, try to derive some sane printfs. + Simple start: Use max integer type and format if long is not big enough. + I am hesitating to use %ll without making sure that it's there... */ +#if !(defined PLAIN_C89) && (defined SIZEOF_OFF_T) && (SIZEOF_OFF_T > SIZEOF_LONG) && (defined PRIiMAX) +# define OFF_P PRIiMAX +typedef intmax_t off_p; +#else +# define OFF_P "li" +typedef long off_p; +#endif + +#if !(defined PLAIN_C89) && (defined SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > SIZEOF_LONG) && (defined PRIuMAX) +# define SIZE_P PRIuMAX +typedef uintmax_t size_p; +#else +# define SIZE_P "lu" +typedef unsigned long size_p; +#endif + +#if !(defined PLAIN_C89) && (defined SIZEOF_SSIZE_T) && (SIZEOF_SSIZE_T > SIZEOF_LONG) && (defined PRIiMAX) +# define SSIZE_P PRIuMAX +typedef intmax_t ssize_p; +#else +# define SSIZE_P "li" +typedef long ssize_p; +#endif + +/* Get an environment variable, possibly converted to UTF-8 from wide string. + The return value is a copy that you shall free. */ +char *compat_getenv(const char* name); + +/** + * Opening a file handle can be different. + * This function here is defined to take a path in native encoding (ISO8859 / UTF-8 / ...), or, when MS Windows Unicode support is enabled, an UTF-8 string that will be converted back to native UCS-2 (wide character) before calling the system's open function. + * @param[in] wptr Pointer to wide string. + * @param[in] mbptr Pointer to multibyte string. + * @return file descriptor (>=0) or error code. + */ +int compat_open(const char *filename, int flags); +FILE* compat_fopen(const char *filename, const char *mode); +/** + * Also fdopen to avoid having to define POSIX macros in various source files. + */ +FILE* compat_fdopen(int fd, const char *mode); + +/** + * Closing a file handle can be platform specific. + * This function takes a file descriptor that is to be closed. + * @param[in] infd File descriptor to be closed. + * @return 0 if the file was successfully closed. A return value of -1 indicates an error. + */ +int compat_close(int infd); +int compat_fclose(FILE* stream); + +/* Those do make sense in a separate file, but I chose to include them in compat.c because that's the one source whose object is shared between mpg123 and libmpg123 -- and both need the functionality internally. */ + +#ifdef WANT_WIN32_UNICODE +/** + * win32_uni2mbc + * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent. + * Caller is supposed to free allocated buffer. + * @param[in] wptr Pointer to wide string. + * @param[out] mbptr Pointer to multibyte string. + * @param[out] buflen Optional parameter for length of allocated buffer. + * @return status of WideCharToMultiByte conversion. + * + * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx + */ +int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen); + +/** + * win32_mbc2uni + * Converts a null terminated UTF-8 string to a UCS-2 equivalent. + * Caller is supposed to free allocated buffer. + * @param[out] mbptr Pointer to multibyte string. + * @param[in] wptr Pointer to wide string. + * @param[out] buflen Optional parameter for length of allocated buffer. + * @return status of WideCharToMultiByte conversion. + * + * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx + */ + +int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen); +#endif + +/* + A little bit of path abstraction: We always work with plain char strings + that usually represent POSIX-ish UTF-8 paths (something like c:/some/file + might appear). For Windows, those are converted to wide strings with \ + instead of / and possible fun is had with prefixes to get around the old + path length limit. Outside of the compat library, that stuff should not + matter, although something like //?/UNC/server/some/file could be thrown + around as UTF-8 string, to be converted to a wide \\?\UNC\server\some\file + just before handing it to Windows API. + + There is a lot of unnecessary memory allocation and string copying because + of this, but this filesystem stuff is not really relevant to mpg123 + performance, so the goal is to keep the code outside the compatibility layer + simple. +*/ + +/* + Concatenate a prefix and a path, one of them alowed to be NULL. + If the path is already absolute, the prefix is ignored. Relative + parts (like /..) are resolved if this is sensible for the platform + (meaning: for Windows), else they are preserved (on POSIX, actual + file system access would be needed because of symlinks). +*/ +char* compat_catpath(const char *prefix, const char* path); + +/* Return 1 if the given path indicates an existing directory, + 0 otherwise. */ +int compat_isdir(const char *path); + +/* + Directory traversal. This talks ASCII/UTF-8 paths externally, converts + to/from wchar_t internally if the platform wants that. Returning NULL + means failure to open/end of listing. + There is no promise about sorting entries. +*/ +struct compat_dir; +/* Returns NULL if either directory failed to open or listing is empty. + Listing can still be empty even if non-NULL, so always rely on the + nextfile/nextdir functions. */ +struct compat_dir* compat_diropen(char *path); +void compat_dirclose(struct compat_dir*); +/* Get the next entry that is a file (or symlink to one). + The returned string is a copy that needs to be freed after use. */ +char* compat_nextfile(struct compat_dir*); +/* Get the next entry that is a directory (or symlink to one). + The returned string is a copy that needs to be freed after use. */ +char* compat_nextdir (struct compat_dir*); + +#ifdef USE_MODULES +/* + For keeping the path mess local, a system-specific dlopen() variant + is contained in here, too. This is very thin wrapping, even sparing + definition of a handle type, just using void pointers. + Use of absolute paths is a good idea if you want to be sure which + file is openend, as default search paths vary. +*/ +void *compat_dlopen (const char *path); +void *compat_dlsym (void *handle, const char* name); +void compat_dlclose(void *handle); +#endif + +/* Blocking write/read of data with signal resilience. + Both continue after being interrupted by signals and always return the + amount of processed data (shortage indicating actual problem or EOF). */ +size_t unintr_write(int fd, void const *buffer, size_t bytes); +size_t unintr_read (int fd, void *buffer, size_t bytes); + +/* That one comes from Tellie on OS/2, needed in resolver. */ +#ifdef __KLIBC__ +typedef int socklen_t; +#endif + +/* OSX SDK defines an enum with "normal" as value. That clashes with + optimize.h */ +#ifdef __APPLE__ +#define normal mpg123_normal +#endif + +#include "true.h" + +#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +void (*catchsignal(int signum, void(*handler)()))(); +#endif + +#endif diff --git a/src/compat/compat_str.c b/src/compat/compat_str.c new file mode 100644 index 0000000..f58fc23 --- /dev/null +++ b/src/compat/compat_str.c @@ -0,0 +1,43 @@ +/* + compat: Some compatibility functions (basic memory and string stuff) + + The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX. + So anything possibly somewhat advanced should be considered to be put here, with proper #ifdef;-) + + copyright 2007-2016 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis, Windows Unicode stuff by JonY. +*/ + +#include "compat.h" +#include "debug.h" + +/* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ +void *safe_realloc(void *ptr, size_t size) +{ + if(ptr == NULL) return malloc(size); + else return realloc(ptr, size); +} + +#ifndef HAVE_STRERROR +const char *strerror(int errnum) +{ + extern int sys_nerr; + extern char *sys_errlist[]; + + return (errnum < sys_nerr) ? sys_errlist[errnum] : ""; +} +#endif + +char* compat_strdup(const char *src) +{ + char *dest = NULL; + if(src) + { + size_t len; + len = strlen(src)+1; + if((dest = malloc(len))) + memcpy(dest, src, len); + } + return dest; +} diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 0000000..508c532 --- /dev/null +++ b/src/config.h.in @@ -0,0 +1,477 @@ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +#undef ABI_ALIGN_FUN + +/* Define to use proper rounding. */ +#undef ACCURATE_ROUNDING + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Define if .balign is present. */ +#undef ASMALIGN_BALIGN + +/* Define if .align just takes byte count. */ +#undef ASMALIGN_BYTE + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +#undef ASMALIGN_EXP + +/* Define if __attribute__((aligned(16))) shall be used */ +#undef CCALIGN + +/* Define if debugging is enabled. */ +#undef DEBUG + +/* The default audio output module(s) to use */ +#undef DEFAULT_OUTPUT_MODULE + +/* Define if building with dynamcally linked libmpg123 */ +#undef DYNAMIC_BUILD + +/* Use EFBIG as substitude for EOVERFLOW, mingw.org may lack the latter */ +#undef EOVERFLOW + +/* Define if FIFO support is enabled. */ +#undef FIFO + +/* Define if frame index should be used. */ +#undef FRAME_INDEX + +/* Define if gapless is enabled. */ +#undef GAPLESS + +/* Define to 1 if you have the header file. */ +#undef HAVE_ALC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ALIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AL_ALC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AL_AL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_AUDIOIO_H + +/* Define to 1 if you have the `atoll' function. */ +#undef HAVE_ATOLL + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUDIOS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUDIOUNIT_AUDIOUNIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CORESERVICES_CORESERVICES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CULIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the `dlclose' function. */ +#undef HAVE_DLCLOSE + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `dlopen' function. */ +#undef HAVE_DLOPEN + +/* Define to 1 if you have the `dlsym' function. */ +#undef HAVE_DLSYM + +/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ +#undef HAVE_GAI_ADDRCONFIG + +/* Define to 1 if you have the `getaddrinfo' function. */ +#undef HAVE_GETADDRINFO + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `getuid' function. */ +#undef HAVE_GETUID + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LANGINFO_H + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `mx' library (-lmx). */ +#undef HAVE_LIBMX + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_SOUNDCARD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MACHINE_SOUNDCARD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mkfifo' function. */ +#undef HAVE_MKFIFO + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_TCP_H + +/* Define to 1 if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENAL_ALC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENAL_AL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OS2ME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OS2_H + +/* Define to 1 if you have the `random' function. */ +#undef HAVE_RANDOM + +/* Define to 1 if you have the header file. */ +#undef HAVE_SCHED_H + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#undef HAVE_SCHED_SETSCHEDULER + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the `setpriority' function. */ +#undef HAVE_SETPRIORITY + +/* Define to 1 if you have the `setuid' function. */ +#undef HAVE_SETUID + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SNDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SUN_AUDIOIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_AUDIOIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_AUDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOUNDCARD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define this if you have the POSIX termios library */ +#undef HAVE_TERMIOS + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WINDOWS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WS2TCPIP_H + +/* Define to indicate that float storage follows IEEE754. */ +#undef IEEE_FLOAT + +/* size of the frame index seek table */ +#undef INDEX_SIZE + +/* Define if IPV6 support is enabled. */ +#undef IPV6 + +/* Define this to the size of native offset type in bits, used for LFS alias + functions. */ +#undef LFS_ALIAS_BITS + +/* Define to the extension used for runtime loadable modules, say, ".so". */ +#undef LT_MODULE_EXT + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Define to the shared library suffix, say, ".dylib". */ +#undef LT_SHARED_EXT + +/* Define to the shared archive member specification, say "(shr.o)". */ +#undef LT_SHARED_LIB_MEMBER + +/* Define if network support is enabled. */ +#undef NETWORK + +/* Define to disable 16 bit integer output. */ +#undef NO_16BIT + +/* Define to disable 32 bit and 24 bit integer output. */ +#undef NO_32BIT + +/* Define to disable 8 bit integer output. */ +#undef NO_8BIT + +/* Define to disable downsampled decoding. */ +#undef NO_DOWNSAMPLE + +/* Define to disable equalizer. */ +#undef NO_EQUALIZER + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +#undef NO_ERETURN + +/* Define to disable error messages. */ +#undef NO_ERRORMSG + +/* Define to disable feeder and buffered readers. */ +#undef NO_FEEDER + +/* Define to disable ICY handling. */ +#undef NO_ICY + +/* Define to disable ID3v2 parsing. */ +#undef NO_ID3V2 + +/* Define to disable layer I. */ +#undef NO_LAYER1 + +/* Define to disable layer II. */ +#undef NO_LAYER2 + +/* Define to disable layer III. */ +#undef NO_LAYER3 + +/* Define to disable ntom resampling. */ +#undef NO_NTOM + +/* Define to disable real output. */ +#undef NO_REAL + +/* Define to disable string functions. */ +#undef NO_STRING + +/* Define for post-processed 32 bit formats. */ +#undef NO_SYNTH32 + +/* Define to disable warning messages. */ +#undef NO_WARNING + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if portaudio v18 API is wanted. */ +#undef PORTAUDIO18 + +/* The size of `int32_t', as computed by sizeof. */ +#undef SIZEOF_INT32_T + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `off_t', as computed by sizeof. */ +#undef SIZEOF_OFF_T + +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* The size of `ssize_t', as computed by sizeof. */ +#undef SIZEOF_SSIZE_T + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if modules are enabled */ +#undef USE_MODULES + +/* Define for new Huffman decoding scheme. */ +#undef USE_NEW_HUFFTABLE + +/* Define to use yasm for assemble AVX sources. */ +#undef USE_YASM_FOR_AVX + +/* Version number of package */ +#undef VERSION + +/* Define to use Win32 named pipes */ +#undef WANT_WIN32_FIFO + +/* Define to use Win32 sockets */ +#undef WANT_WIN32_SOCKETS + +/* Define to use Unicode for Windows */ +#undef WANT_WIN32_UNICODE + +/* WinXP and above for ipv6 */ +#undef WINVER + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* WinXP and above for ipv6 */ +#undef _WIN32_WINNT + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `short' if does not define. */ +#undef int16_t + +/* Define to `int' if does not define. */ +#undef int32_t + +/* Define to `long long' if does not define. */ +#undef int64_t + +/* Define to the native offset type (long or actually off_t). */ +#undef lfs_alias_t + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define to `unsigned long' if does not define. */ +#undef size_t + +/* Define to `long' if does not define. */ +#undef ssize_t + +/* Define to `unsigned short' if does not define. */ +#undef uint16_t + +/* Define to `unsigned int' if does not define. */ +#undef uint32_t + +/* Define to `unsigned long' if does not define. */ +#undef uintptr_t diff --git a/src/control_generic.c b/src/control_generic.c new file mode 100644 index 0000000..61dfa46 --- /dev/null +++ b/src/control_generic.c @@ -0,0 +1,832 @@ +/* + control_generic.c: control interface for frontends and real console warriors + + copyright 1997-99,2004-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Andreas Neuhaus and Michael Hipp + reworked by Thomas Orgis - it was the entry point for eventually becoming maintainer... +*/ + +#include "config.h" +/* _BSD_SOURCE needed for setlinebuf, erm, but that's deprecated + so trying _DEFAULT_SOURCE */ +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE +#endif +/* Defining that after _DEFAULT_SOURCE seems fine and is still + needed for older glibc. I guess I need a configure check + about setlinebuf()/setvbuf() if I really care about old + systems. */ +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#include "compat.h" + +#include "mpg123app.h" +#include "out123.h" +#include +#include +#if !defined (WIN32) || defined (__CYGWIN__) +#include +#include +#endif +#include +#include + +#include "common.h" +#include "genre.h" +#include "playlist.h" +#include "audio.h" +#define MODE_STOPPED 0 +#define MODE_PLAYING 1 +#define MODE_PAUSED 2 + +extern out123_handle *ao; + +#ifdef FIFO +#include +int control_file = STDIN_FILENO; +#else +#define control_file STDIN_FILENO +#ifdef WANT_WIN32_FIFO +#error Control interface does not work on win32 stdin +#endif /* WANT_WIN32_FIFO */ +#endif +FILE *outstream; +static int mode = MODE_STOPPED; +static int init = 0; + +#include "debug.h" + +void generic_sendmsg (const char *fmt, ...) +{ + va_list ap; + fprintf(outstream, "@"); + va_start(ap, fmt); + vfprintf(outstream, fmt, ap); + va_end(ap); + fprintf(outstream, "\n"); +} + +/* Split up a number of lines separated by \n, \r, both or just zero byte + and print out each line with specified prefix. */ +static void generic_send_lines(const char* fmt, mpg123_string *inlines) +{ + size_t i; + int hadcr = 0, hadlf = 0; + char *lines = NULL; + char *line = NULL; + size_t len = 0; + + if(inlines != NULL && inlines->fill) + { + lines = inlines->p; + len = inlines->fill; + } + else return; + + line = lines; + for(i=0; ititle, 30); + memcpy(info+30, v1->artist, 30); + memcpy(info+60, v1->album, 30); + memcpy(info+90, v1->year, 4); + memcpy(info+94, v1->comment, 30); + + for(i=0;i<124; ++i) if(info[i] == 0) info[i] = ' '; + info[i] = 0; + generic_sendmsg("%s ID3:%s%s", prefix, info, (v1->genre<=genre_count) ? genre_table[v1->genre] : "Unknown"); + generic_sendmsg("%s ID3.genre:%i", prefix, v1->genre); + if(v1->comment[28] == 0 && v1->comment[29] != 0) + generic_sendmsg("%s ID3.track:%i", prefix, (unsigned char)v1->comment[29]); +} + +static void generic_sendinfoid3(mpg123_handle *mh) +{ + mpg123_id3v1 *v1; + mpg123_id3v2 *v2; + if(MPG123_OK != mpg123_id3(mh, &v1, &v2)) + { + error1("Cannot get ID3 data: %s", mpg123_strerror(mh)); + return; + } + if(v1 != NULL) + { + generic_sendv1(v1, "I"); + } + if(v2 != NULL) + { + generic_send_lines("I ID3v2.title:%s", v2->title); + generic_send_lines("I ID3v2.artist:%s", v2->artist); + generic_send_lines("I ID3v2.album:%s", v2->album); + generic_send_lines("I ID3v2.year:%s", v2->year); + generic_send_lines("I ID3v2.comment:%s", v2->comment); + generic_send_lines("I ID3v2.genre:%s", v2->genre); + } +} + +void generic_sendalltag(mpg123_handle *mh) +{ + mpg123_id3v1 *v1; + mpg123_id3v2 *v2; + generic_sendmsg("T {"); + if(MPG123_OK != mpg123_id3(mh, &v1, &v2)) + { + error1("Cannot get ID3 data: %s", mpg123_strerror(mh)); + v2 = NULL; + v1 = NULL; + } + if(v1 != NULL) generic_sendv1(v1, "T"); + + if(v2 != NULL) + { + size_t i; + for(i=0; itexts; ++i) + { + char id[5]; + memcpy(id, v2->text[i].id, 4); + id[4] = 0; + generic_sendmsg("T ID3v2.%s:", id); + generic_send_lines("T =%s", &v2->text[i].text); + } + for(i=0; iextras; ++i) + { + char id[5]; + memcpy(id, v2->extra[i].id, 4); + id[4] = 0; + generic_sendmsg("T ID3v2.%s desc(%s):", + id, + v2->extra[i].description.fill ? v2->extra[i].description.p : "" ); + generic_send_lines("T =%s", &v2->extra[i].text); + } + for(i=0; icomments; ++i) + { + char id[5]; + char lang[4]; + memcpy(id, v2->comment_list[i].id, 4); + id[4] = 0; + memcpy(lang, v2->comment_list[i].lang, 3); + lang[3] = 0; + generic_sendmsg("T ID3v2.%s lang(%s) desc(%s):", + id, lang, + v2->comment_list[i].description.fill ? v2->comment_list[i].description.p : ""); + generic_send_lines("T =%s", &v2->comment_list[i].text); + } + } + generic_sendmsg("T }"); +} + +void generic_sendinfo (char *filename) +{ + char *s, *t; + s = strrchr(filename, '/'); + if (!s) + s = filename; + else + s++; + t = strrchr(s, '.'); + if (t) + *t = 0; + generic_sendmsg("I %s", s); +} + +static void generic_load(mpg123_handle *fr, char *arg, int state) +{ + out123_drop(ao); + if(mode != MODE_STOPPED) + { + close_track(); + mode = MODE_STOPPED; + } + if(!open_track(arg)) + { + generic_sendmsg("E Error opening stream: %s", arg); + generic_sendmsg("P 0"); + return; + } + mpg123_seek(fr, 0, SEEK_SET); /* This finds ID3v2 at beginning. */ + if(mpg123_meta_check(fr) & MPG123_NEW_ID3) + { + generic_sendinfoid3(fr); + } + else generic_sendinfo(arg); + + if(htd.icy_name.fill) generic_sendmsg("I ICY-NAME: %s", htd.icy_name.p); + if(htd.icy_url.fill) generic_sendmsg("I ICY-URL: %s", htd.icy_url.p); + + mode = state; + init = 1; + generic_sendmsg(mode == MODE_PAUSED ? "P 1" : "P 2"); +} + +static void generic_loadlist(mpg123_handle *fr, char *arg) +{ + /* arguments are two: first the index to play, then the URL */ + long entry; + long i = 0; + char *file = NULL; + char *thefile = NULL; + + /* I feel retarted with string parsing outside Perl. */ + while(*arg && isspace(*arg)) ++arg; + entry = atol(arg); + while(*arg && !isspace(*arg)) ++arg; + while(*arg && isspace(*arg)) ++arg; + if(!*arg) + { + generic_sendmsg("E empty list name"); + return; + } + + /* Now got the plain playlist path in arg. On to evil manupulation of mpg123's playlist code. */ + param.listname = arg; + param.listentry = 0; /* The playlist shall not filter. */ + param.loop = 1; + param.shuffle = 0; + prepare_playlist(0, NULL); + while((file = get_next_file())) + { + ++i; + /* semantics: 0 brings you to the last track */ + if(entry == 0 || entry == i) thefile = file; + + generic_sendmsg("I LISTENTRY %li: %s", i, file); + } + if(!i) generic_sendmsg("I LIST EMPTY"); + + /* If we have something to play, play it. */ + if(thefile) generic_load(fr, thefile, MODE_PLAYING); + + free_playlist(); /* Free memory after it is not needed anymore. */ +} + +int control_generic (mpg123_handle *fr) +{ + struct timeval tv; + fd_set fds; + int n; + + /* ThOr */ + char alive = 1; + char silent = 0; + + /* responses to stderr for frontends needing audio data from stdout */ + if (param.remote_err) + outstream = stderr; + else + outstream = stdout; + +#ifndef WIN32 + setlinebuf(outstream); +#else /* perhaps just use setvbuf as it's C89 */ + /* + fprintf(outstream, "You are on Win32 and want to use the control interface... tough luck: We need a replacement for select on STDIN first.\n"); + return 0; + setvbuf(outstream, (char*)NULL, _IOLBF, 0); + */ +#endif + /* the command behaviour is different, so is the ID */ + /* now also with version for command availability */ + fprintf(outstream, "@R MPG123 (ThOr) v8\n"); +#ifdef FIFO + if(param.fifo) + { + if(param.fifo[0] == 0) + { + error("You wanted an empty FIFO name??"); + return 1; + } +#ifndef WANT_WIN32_FIFO + unlink(param.fifo); + if(mkfifo(param.fifo, 0666) == -1) + { + error2("Failed to create FIFO at %s (%s)", param.fifo, strerror(errno)); + return 1; + } + debug("going to open named pipe ... blocking until someone gives command"); +#endif /* WANT_WIN32_FIFO */ +#ifdef WANT_WIN32_FIFO + control_file = win32_fifo_mkfifo(param.fifo); +#else + control_file = open(param.fifo,O_RDONLY); +#endif /* WANT_WIN32_FIFO */ + debug("opened"); + } +#endif + + while (alive) + { + tv.tv_sec = 0; + tv.tv_usec = 0; + FD_ZERO(&fds); + FD_SET(control_file, &fds); + /* play frame if no command needs to be processed */ + if (mode == MODE_PLAYING) { +#ifdef WANT_WIN32_FIFO + n = win32_fifo_read_peek(&tv); +#else + n = select(32, &fds, NULL, NULL, &tv); +#endif + if (n == 0) { + if (!play_frame()) + { + out123_pause(ao); + /* When the track ended, user may want to keep it open (to seek back), + so there is a decision between stopping and pausing at the end. */ + if(param.keep_open) + { + mode = MODE_PAUSED; + /* Hm, buffer should be stopped already, shouldn't it? */ + generic_sendmsg("P 1"); + } + else + { + mode = MODE_STOPPED; + close_track(); + generic_sendmsg("P 0"); + } + continue; + } + if (init) { + print_remote_header(fr); + init = 0; + } + if(silent == 0) + { + generic_sendstat(fr); + if(mpg123_meta_check(fr) & MPG123_NEW_ICY) + { + char *meta; + if(mpg123_icy(fr, &meta) == MPG123_OK) + generic_sendmsg("I ICY-META: %s", meta != NULL ? meta : ""); + } + } + } + } + else { + /* wait for command */ + while (1) { +#ifdef WANT_WIN32_FIFO + n = win32_fifo_read_peek(NULL); +#else + n = select(32, &fds, NULL, NULL, NULL); +#endif + if (n > 0) + break; + } + } + + /* on error */ + if (n < 0) { + fprintf(stderr, "Error waiting for command: %s\n", strerror(errno)); + return 1; + } + + /* read & process commands */ + if (n > 0) + { + short int len = 1; /* length of buffer */ + char *cmd, *arg; /* variables for parsing, */ + char *comstr = NULL; /* gcc thinks that this could be used uninitialited... */ + char buf[REMOTE_BUFFER_SIZE]; + short int counter; + char *next_comstr = buf; /* have it initialized for first command */ + + /* read as much as possible, maybe multiple commands */ + /* When there is nothing to read (EOF) or even an error, it is the end */ +#ifdef WANT_WIN32_FIFO + len = win32_fifo_read(buf,REMOTE_BUFFER_SIZE); +#else + len = read(control_file, buf, REMOTE_BUFFER_SIZE); +#endif + if(len < 1) + { +#ifdef FIFO + if(len == 0 && param.fifo) + { + debug("fifo ended... reopening"); +#ifdef WANT_WIN32_FIFO + win32_fifo_mkfifo(param.fifo); +#else + close(control_file); + control_file = open(param.fifo,O_RDONLY|O_NONBLOCK); +#endif + if(control_file < 0){ error1("open of fifo failed... %s", strerror(errno)); break; } + continue; + } +#endif + if(len < 0) error1("command read error: %s", strerror(errno)); + break; + } + + debug1("read %i bytes of commands", len); + /* one command on a line - separation by \n -> C strings in a row */ + for(counter = 0; counter < len; ++counter) + { + /* line end is command end */ + if( (buf[counter] == '\n') || (buf[counter] == '\r') ) + { + debug1("line end at counter=%i", counter); + buf[counter] = 0; /* now it's a properly ending C string */ + comstr = next_comstr; + + /* skip the additional line ender of \r\n or \n\r */ + if( (counter < (len - 1)) && ((buf[counter+1] == '\n') || (buf[counter+1] == '\r')) ) buf[++counter] = 0; + + /* next "real" char is first of next command */ + next_comstr = buf + counter+1; + + /* directly process the command now */ + debug1("interpreting command: %s", comstr); + if(strlen(comstr) == 0) continue; + + /* PAUSE */ + if (!strcasecmp(comstr, "P") || !strcasecmp(comstr, "PAUSE")) { + if(mode != MODE_STOPPED) + { + if (mode == MODE_PLAYING) { + mode = MODE_PAUSED; + out123_pause(ao); + generic_sendmsg("P 1"); + } else { + mode = MODE_PLAYING; + out123_continue(ao); + generic_sendmsg("P 2"); + } + } else generic_sendmsg("P 0"); + continue; + } + + /* STOP */ + if (!strcasecmp(comstr, "S") || !strcasecmp(comstr, "STOP")) { + if (mode != MODE_STOPPED) { + /* Do we want to drop here? */ + out123_drop(ao); + out123_pause(ao); + close_track(); + mode = MODE_STOPPED; + generic_sendmsg("P 0"); + } else generic_sendmsg("P 0"); + continue; + } + + /* SILENCE */ + if(!strcasecmp(comstr, "SILENCE")) { + silent = 1; + generic_sendmsg("silence"); + continue; + } + + if(!strcasecmp(comstr, "T") || !strcasecmp(comstr, "TAG")) { + generic_sendalltag(fr); + continue; + } + + if(!strcasecmp(comstr, "SCAN")) + { + if(mode != MODE_STOPPED) + { + if(mpg123_scan(fr) == MPG123_OK) + generic_sendmsg("SCAN done"); + else + generic_sendmsg("E %s", mpg123_strerror(fr)); + } + else generic_sendmsg("E No track loaded!"); + + continue; + } + + if(!strcasecmp(comstr, "SAMPLE")) + { + off_t pos = mpg123_tell(fr); + off_t len = mpg123_length(fr); + /* I need to have portable printf specifiers that do not truncate the type... more autoconf... */ + if(len < 0) generic_sendmsg("E %s", mpg123_strerror(fr)); + else generic_sendmsg("SAMPLE %li %li", (long)pos, (long)len); + continue; + } + + if(!strcasecmp(comstr, "FORMAT")) + { + long rate; + int ch; + int ret = mpg123_getformat2(fr, &rate, &ch, NULL, 0); + /* I need to have portable printf specifiers that do not truncate the type... more autoconf... */ + if(ret < 0) generic_sendmsg("E %s", mpg123_strerror(fr)); + else generic_sendmsg("FORMAT %li %i", rate, ch); + continue; + } + + if(!strcasecmp(comstr, "SHOWEQ")) + { + int i; + generic_sendmsg("SHOWEQ {"); + for(i=0; i<32; ++i) + { + generic_sendmsg("SHOWEQ %i : %i : %f", MPG123_LEFT, i, mpg123_geteq(fr, MPG123_LEFT, i)); + generic_sendmsg("SHOWEQ %i : %i : %f", MPG123_RIGHT, i, mpg123_geteq(fr, MPG123_RIGHT, i)); + } + generic_sendmsg("SHOWEQ }"); + continue; + } + + if(!strcasecmp(comstr, "STATE")) + { + long val; + generic_sendmsg("STATE {"); + /* Get some state information bits and display them. */ + if(mpg123_getstate(fr, MPG123_ACCURATE, &val, NULL) == MPG123_OK) + generic_sendmsg("STATE accurate %li", val); + + generic_sendmsg("STATE }"); + continue; + } + + /* QUIT */ + if (!strcasecmp(comstr, "Q") || !strcasecmp(comstr, "QUIT")){ + alive = FALSE; continue; + } + + /* some HELP */ + if (!strcasecmp(comstr, "H") || !strcasecmp(comstr, "HELP")) { + generic_sendmsg("H {"); + generic_sendmsg("H HELP/H: command listing (LONG/SHORT forms), command case insensitve"); + generic_sendmsg("H LOAD/L : load and start playing resource "); + generic_sendmsg("H LOADPAUSED/LP : load but do not start playing resource "); + generic_sendmsg("H LOADLIST/LL : load a playlist from given , and display its entries, optionally load and play one of these specificed by the integer (<0: just list, 0: play last track, >0:play track with that position in list)"); + generic_sendmsg("H PAUSE/P: pause playback"); + generic_sendmsg("H STOP/S: stop playback (closes file)"); + generic_sendmsg("H JUMP/J |<+offset>|<-offset>|<[+|-]seconds>s: jump to mpeg frame or change position by offset, same in seconds if number followed by \"s\""); + generic_sendmsg("H VOLUME/V : set volume in % (0..100...); float value"); + generic_sendmsg("H RVA off|(mix|radio)|(album|audiophile): set rva mode"); + generic_sendmsg("H EQ/E : set equalizer value for frequency band 0 to 31 on channel %i (left) or %i (right) or %i (both)", MPG123_LEFT, MPG123_RIGHT, MPG123_LR); + generic_sendmsg("H EQFILE : load EQ settings from a file"); + generic_sendmsg("H SHOWEQ: show all equalizer settings (as lines in a SHOWEQ block (like TAG))"); + generic_sendmsg("H SEEK/K |<+offset>|<-offset>: jump to output sample position or change position by offset"); + generic_sendmsg("H SCAN: scan through the file, building seek index"); + generic_sendmsg("H SAMPLE: print out the sample position and total number of samples"); + generic_sendmsg("H FORMAT: print out sampling rate in Hz and channel count"); + generic_sendmsg("H SEQ : simple eq setting..."); + generic_sendmsg("H PITCH <[+|-]value>: adjust playback speed (+0.01 is 1 %% faster)"); + generic_sendmsg("H SILENCE: be silent during playback (meaning silence in text form)"); + generic_sendmsg("H STATE: Print auxiliary state info in several lines (just try it to see what info is there)."); + generic_sendmsg("H TAG/T: Print all available (ID3) tag info, for ID3v2 that gives output of all collected text fields, using the ID3v2.3/4 4-character names. NOTE: ID3v2 data will be deleted on non-forward seeks."); + generic_sendmsg("H The output is multiple lines, begin marked by \"@T {\", end by \"@T }\"."); + generic_sendmsg("H ID3v1 data is like in the @I info lines (see below), just with \"@T\" in front."); + generic_sendmsg("H An ID3v2 data field is introduced via ([ ... ] means optional):"); + generic_sendmsg("H @T ID3v2.[ [lang()] desc()]:"); + generic_sendmsg("H The lines of data follow with \"=\" prefixed:"); + generic_sendmsg("H @T ="); + generic_sendmsg("H meaning of the @S stream info:"); + generic_sendmsg("H %s", remote_header_help); + generic_sendmsg("H The @I lines after loading a track give some ID3 info, the format:"); + generic_sendmsg("H @I ID3:artist album year comment genretext"); + generic_sendmsg("H where artist,album and comment are exactly 30 characters each, year is 4 characters, genre text unspecified."); + generic_sendmsg("H You will encounter \"@I ID3.genre:\" and \"@I ID3.track:\"."); + generic_sendmsg("H Then, there is an excerpt of ID3v2 info in the structure"); + generic_sendmsg("H @I ID3v2.title:Blabla bla Bla"); + generic_sendmsg("H for every line of the \"title\" data field. Likewise for other fields (author, album, etc)."); + generic_sendmsg("H }"); + continue; + } + + /* commands with arguments */ + cmd = NULL; + arg = NULL; + cmd = strtok(comstr," \t"); /* get the main command */ + arg = strtok(NULL,""); /* get the args */ + + if (cmd && strlen(cmd) && arg && strlen(arg)) + { +#ifndef NO_EQUALIZER + /* Simple EQ: SEQ */ + if (!strcasecmp(cmd, "SEQ")) { + double b,m,t; + int cn; + if(sscanf(arg, "%lf %lf %lf", &b, &m, &t) == 3) + { + /* Consider adding mpg123_seq()... but also, on could define a nicer courve for that. */ + if ((t >= 0) && (t <= 3)) + for(cn=0; cn < 1; ++cn) mpg123_eq(fr, MPG123_LEFT|MPG123_RIGHT, cn, b); + + if ((m >= 0) && (m <= 3)) + for(cn=1; cn < 2; ++cn) mpg123_eq(fr, MPG123_LEFT|MPG123_RIGHT, cn, m); + + if ((b >= 0) && (b <= 3)) + for(cn=2; cn < 32; ++cn) mpg123_eq(fr, MPG123_LEFT|MPG123_RIGHT, cn, t); + + generic_sendmsg("bass: %f mid: %f treble: %f", b, m, t); + } + else generic_sendmsg("E invalid arguments for SEQ: %s", arg); + continue; + } + + /* Equalizer control :) (JMG) */ + if (!strcasecmp(cmd, "E") || !strcasecmp(cmd, "EQ")) { + double e; /* ThOr: equalizer is of type real... whatever that is */ + int c, v; + /*generic_sendmsg("%s",updown);*/ + if(sscanf(arg, "%i %i %lf", &c, &v, &e) == 3) + { + if(mpg123_eq(fr, c, v, e) == MPG123_OK) + generic_sendmsg("%i : %i : %f", c, v, e); + else + generic_sendmsg("E failed to set eq: %s", mpg123_strerror(fr)); + } + else generic_sendmsg("E invalid arguments for EQ: %s", arg); + continue; + } + + if(!strcasecmp(cmd, "EQFILE")) + { + equalfile = arg; + if(load_equalizer(fr) == 0) + generic_sendmsg("EQFILE done"); + else + generic_sendmsg("E failed to parse given eq file"); + + continue; + } +#endif + /* SEEK to a sample offset */ + if(!strcasecmp(cmd, "K") || !strcasecmp(cmd, "SEEK")) + { + off_t soff; + off_t oldpos; + off_t newpos; + char *spos = arg; + int whence = SEEK_SET; + if(mode == MODE_STOPPED) + { + generic_sendmsg("E No track loaded!"); + continue; + } + oldpos = mpg123_tell(fr); + + soff = (off_t) atobigint(spos); + if(spos[0] == '-' || spos[0] == '+') whence = SEEK_CUR; + if(0 > (soff = mpg123_seek(fr, soff, whence))) + { + generic_sendmsg("E Error while seeking: %s", mpg123_strerror(fr)); + mpg123_seek(fr, 0, SEEK_SET); + } + out123_drop(ao); + + newpos = mpg123_tell(fr); + if(newpos <= oldpos) mpg123_meta_free(fr); + + generic_sendmsg("K %"OFF_P, (off_p)newpos); + continue; + } + /* JUMP */ + if (!strcasecmp(cmd, "J") || !strcasecmp(cmd, "JUMP")) { + char *spos; + off_t offset; + off_t oldpos; + double secs; + + spos = arg; + if(mode == MODE_STOPPED) + { + generic_sendmsg("E No track loaded!"); + continue; + } + oldpos = framenum; + + if(spos[strlen(spos)-1] == 's' && sscanf(arg, "%lf", &secs) == 1) offset = mpg123_timeframe(fr, secs); + else offset = atol(spos); + /* totally replaced that stuff - it never fully worked + a bit usure about why +pos -> spos+1 earlier... */ + if (spos[0] == '-' || spos[0] == '+') offset += framenum; + + if(0 > (framenum = mpg123_seek_frame(fr, offset, SEEK_SET))) + { + generic_sendmsg("E Error while seeking"); + mpg123_seek_frame(fr, 0, SEEK_SET); + } + out123_drop(ao); + + if(framenum <= oldpos) mpg123_meta_free(fr); + generic_sendmsg("J %d", framenum); + continue; + } + + /* VOLUME in percent */ + if(!strcasecmp(cmd, "V") || !strcasecmp(cmd, "VOLUME")) + { + double v; + mpg123_volume(fr, atof(arg)/100); + mpg123_getvolume(fr, &v, NULL, NULL); /* Necessary? */ + generic_sendmsg("V %f%%", v * 100); + continue; + } + + /* PITCH (playback speed) in percent */ + if(!strcasecmp(cmd, "PITCH")) + { + double p; + if(sscanf(arg, "%lf", &p) == 1) + { + set_pitch(fr, ao, p); + generic_sendmsg("PITCH %f", param.pitch); + } + else generic_sendmsg("E invalid arguments for PITCH: %s", arg); + continue; + } + + /* RVA mode */ + if(!strcasecmp(cmd, "RVA")) + { + if(!strcasecmp(arg, "off")) param.rva = MPG123_RVA_OFF; + else if(!strcasecmp(arg, "mix") || !strcasecmp(arg, "radio")) param.rva = MPG123_RVA_MIX; + else if(!strcasecmp(arg, "album") || !strcasecmp(arg, "audiophile")) param.rva = MPG123_RVA_ALBUM; + mpg123_volume_change(fr, 0.); + generic_sendmsg("RVA %s", rva_name[param.rva]); + continue; + } + + /* LOAD - actually play */ + if (!strcasecmp(cmd, "L") || !strcasecmp(cmd, "LOAD")){ generic_load(fr, arg, MODE_PLAYING); continue; } + + if (!strcasecmp(cmd, "LL") || !strcasecmp(cmd, "LOADLIST")){ generic_loadlist(fr, arg); continue; } + + /* LOADPAUSED */ + if (!strcasecmp(cmd, "LP") || !strcasecmp(cmd, "LOADPAUSED")){ generic_load(fr, arg, MODE_PAUSED); continue; } + + /* no command matched */ + generic_sendmsg("E Unknown command: %s", cmd); /* unknown command */ + } /* end commands with arguments */ + else generic_sendmsg("E Unknown command or no arguments: %s", comstr); /* unknown command */ + + } /* end of single command processing */ + } /* end of scanning the command buffer */ + + /* + when last command had no \n... should I discard it? + Ideally, I should remember the part and wait for next + read() to get the rest up to a \n. But that can go + to infinity. Too long commands too quickly are just + bad. Cannot/Won't change that. So, discard the unfinished + command and have fingers crossed that the rest of this + unfinished one qualifies as "unknown". + */ + if(buf[len-1] != 0) + { + char lasti = buf[len-1]; + buf[len-1] = 0; + generic_sendmsg("E Unfinished command: %s%c", comstr, lasti); + } + } /* end command reading & processing */ + } /* end main (alive) loop */ + debug("going to end"); + /* quit gracefully */ + debug("closing control"); +#ifdef FIFO +#if WANT_WIN32_FIFO + win32_fifo_close(); +#else + close(control_file); /* be it FIFO or STDIN */ + if(param.fifo) unlink(param.fifo); +#endif /* WANT_WIN32_FIFO */ +#endif + debug("control_generic returning"); + return 0; +} + +/* EOF */ diff --git a/src/equalizer.c b/src/equalizer.c new file mode 100644 index 0000000..f1d08b7 --- /dev/null +++ b/src/equalizer.c @@ -0,0 +1,50 @@ +/* + equalizer: code for loading equalizer settings + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp (exported to this file by Thomas Orgis) +*/ + +#include "mpg123app.h" + +/* Load the settings from the path in the global variable equalfile. + If there is no file, restore equalizer defaults. + If NO_EQUALIZER is defined, it does nothing else that return zero */ +int load_equalizer(mpg123_handle *mh) +{ +#ifndef NO_EQUALIZER + if(equalfile != NULL) + { /* tst; ThOr: not TRUE or FALSE: allocated or not... */ + FILE *fe; + int i; + fe = fopen(equalfile,"r"); + if(fe) { + char line[256]; + for(i=0;i<32;i++) { + float e0 = 1.0; + float e1 = 1.0; /* %f -> float! */ + do /* ignore comments */ + { + line[0]=0; + fgets(line,255,fe); + } + while(line[0]=='#'); + /* Hm, why not use fscanf? Comments... */ + sscanf(line,"%f %f",&e0,&e1); + /* If scanning failed, we have default 1.0 value. */ + mpg123_eq(mh, MPG123_LEFT, i, e0); + mpg123_eq(mh, MPG123_RIGHT, i, e1); + } + fclose(fe); + } + else + { + fprintf(stderr,"Can't open equalizer file '%s'\n",equalfile); + return -1; + } + } + else mpg123_reset_eq(mh); +#endif + return 0; +} diff --git a/src/genre.c b/src/genre.c new file mode 100644 index 0000000..f820d38 --- /dev/null +++ b/src/genre.c @@ -0,0 +1,271 @@ +/* + genre: id3 genre definition + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Shane Wegner +*/ + +char *genre_table[] = +{ + "Blues", + "Classic Rock", + "Country", + "Dance", + "Disco", + "Funk", + "Grunge", + "Hip-Hop", + "Jazz", + "Metal", + "New Age", + "Oldies", + "Other", + "Pop", + "R&B", + "Rap", + "Reggae", + "Rock", + "Techno", + "Industrial", + "Alternative", + "Ska", + "Death Metal", + "Pranks", + "Soundtrack", + "Euro-Techno", + "Ambient", + "Trip-Hop", + "Vocal", + "Jazz+Funk", + "Fusion", + "Trance", + "Classical", + "Instrumental", + "Acid", + "House", + "Game", + "Sound Clip", + "Gospel", + "Noise", + "AlternRock", + "Bass", + "Soul", + "Punk", + "Space", + "Meditative", + "Instrumental Pop", + "Instrumental Rock", + "Ethnic", + "Gothic", + "Darkwave", + "Techno-Industrial", + "Electronic", + "Pop-Folk", + "Eurodance", + "Dream", + "Southern Rock", + "Comedy", + "Cult", + "Gangsta", + "Top 40", + "Christian Rap", + "Pop/Funk", + "Jungle", + "Native American", + "Cabaret", + "New Wave", + "Psychedelic", + "Rave", + "Showtunes", + "Trailer", + "Lo-Fi", + "Tribal", + "Acid Punk", + "Acid Jazz", + "Polka", + "Retro", + "Musical", + "Rock & Roll", + "Hard Rock", + "Folk", + "Folk/Rock", + "National folk", + "Swing", + "Fast-fusion", + "Bebob", + "Latin", + "Revival", + "Celtic", + "Bluegrass", + "Avantgarde", + "Gothic Rock", + "Progressive Rock", + "Psychedelic Rock", + "Symphonic Rock", + "Slow Rock", + "Big Band", + "Chorus", + "Easy Listening", + "Acoustic", + "Humour", + "Speech", + "Chanson", + "Opera", + "Chamber Music", + "Sonata", + "Symphony", + "Booty Bass", + "Primus", + "Porn Groove", + "Satire", + "Slow Jam", + "Club", + "Tango", + "Samba", + "Folklore", + "Ballad", + "Powder Ballad", + "Rhythmic Soul", + "Freestyle", + "Duet", + "Punk Rock", + "Drum Solo", + "A Capella", + "Euro-House", + "Dance Hall", + "Goa", + "Drum & Bass", + "Club House", + "Hardcore", + "Terror", + "Indie", + "BritPop", + "NegerPunk", + "Polsk Punk", + "Beat", + "Christian Gangsta", + "Heavy Metal", + "Black Metal", + "Crossover", + "Contemporary C", + "Christian Rock", + "Merengue", + "Salsa", + "Thrash Metal", + "Anime", + "JPop", + "SynthPop" +/* , + "Unknown", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" +*/ +}; + +const int genre_count = ((int)(sizeof(genre_table)/sizeof(char*))-1); diff --git a/src/genre.h b/src/genre.h new file mode 100644 index 0000000..0a493d0 --- /dev/null +++ b/src/genre.h @@ -0,0 +1,15 @@ +/* + genre: id3 genre definition + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Shane Wegner +*/ + +#ifndef _MPG123_GENRE_H_ +#define _MPG123_GENRE_H_ + +extern char *genre_table[]; +extern const int genre_count; + +#endif diff --git a/src/getlopt.c b/src/getlopt.c new file mode 100644 index 0000000..36b0cc1 --- /dev/null +++ b/src/getlopt.c @@ -0,0 +1,155 @@ +/* + getlopt: command line option/parameter parsing + + copyright ?-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written Oliver Fromme + old timestamp: Tue Apr 8 07:15:13 MET DST 1997 +*/ + +#include "config.h" +#include "compat.h" +#include "getlopt.h" +#include "debug.h" + +int loptind = 1; /* index in argv[] */ +int loptchr = 0; /* index in argv[loptind] */ +char *loptarg; /* points to argument if present, else to option */ + +topt *findopt (int islong, char *opt, topt *opts) +{ + if (!opts) + return (0); + while (opts->lname) { + if (islong) { + if (!strcmp(opts->lname, opt)) + return (opts); + } + else + if (opts->sname == *opt) + return (opts); + opts++; + } + return (0); +} + +static int performoption (int argc, char *argv[], topt *opt) +{ + int result = GLO_CONTINUE; + /* this really is not supposed to happen, so the exit may be justified to create asap ficing pressure */ + #define prog_error() \ + { \ + fprintf(stderr, __FILE__ ":%i Option without type flag! This is a programming error! Developer: fix this ASAP to regain your honor.\n", __LINE__); \ + exit(1); \ + } + + debug2("performoption on %c / %s" + , opt->sname ? opt->sname : '_', opt->lname ? opt->lname : ""); + if (!(opt->flags & GLO_ARG)) { /* doesn't take argument */ + if (opt->var) { + if (opt->flags & GLO_CHAR) /* var is *char */ + { + debug1("char at %p", opt->var); + *((char *) opt->var) = (char) opt->value;\ + } + else if(opt->flags & GLO_LONG) + { + debug1("long at %p", opt->var); + *( (long *) opt->var ) = opt->value; + } + else if(opt->flags & GLO_INT) + { + debug1("int at %p", opt->var); + *( (int *) opt->var ) = (int) opt->value; + } + /* GLO_DOUBLE is not supported here */ + else prog_error(); + + debug("casting assignment done"); + } +#if 0 /* Oliver: What was this for?! --ThOr */ + else + result = opt->value ? opt->value : opt->sname; +#endif + } + else { /* requires argument */ + debug("argument required"); + if (loptind >= argc) + return (GLO_NOARG); + loptarg = argv[loptind++]+loptchr; + loptchr = 0; + if (opt->var) { + if (opt->flags & GLO_CHAR) /* var is *char */ + *((char **) opt->var) = compat_strdup(loptarg); /* valgrind claims lost memory here */ + else if(opt->flags & GLO_LONG) + *((long *) opt->var) = atol(loptarg); + else if(opt->flags & GLO_INT) + *((int *) opt->var) = atoi(loptarg); + else if(opt->flags & GLO_DOUBLE) + *((double *) opt->var) = atof(loptarg); + else prog_error(); + } +#if 0 /* Oliver: What was this for?! --ThOr */ + else + result = opt->value ? opt->value : opt->sname; +#endif + } + if (opt->func) + opt->func(loptarg); + debug4("result: %i (%p, %li, %i)", result, opt->var, opt->value, opt->sname); + return (result); +} + +int getsingleopt (int argc, char *argv[], topt *opts) +{ + char *thisopt; + topt *opt; + static char shortopt[2] = {0, 0}; + + if (loptind >= argc) + return (GLO_END); + thisopt = argv[loptind]; + debug1("getsingleopt: %s", thisopt); + if (!loptchr) { /* start new option string */ + if (thisopt[0] != '-' || !thisopt[1]) /* no more options */ + return (GLO_END); + if (thisopt[1] == '-') { /* "--" */ + if (thisopt[2]) { /* long option */ + loptarg = thisopt+2; + loptind++; + if (!(opt = findopt(1, thisopt+2, opts))) + return (GLO_UNKNOWN); + else + return (performoption(argc, argv, opt)); + } + else { /* "--" == end of options */ + loptind++; + return (GLO_END); + } + } + else /* start short option(s) */ + loptchr = 1; + } + shortopt[0] = thisopt[loptchr]; + loptarg = shortopt; + opt = findopt(0, thisopt+(loptchr++), opts); + if (!thisopt[loptchr]) { + loptind++; + loptchr = 0; + } + if (!opt) + return (GLO_UNKNOWN); + else + return (performoption(argc, argv, opt)); +} + +int getlopt (int argc, char *argv[], topt *opts) +{ + + int result; + + while ((result = getsingleopt(argc, argv, opts)) == GLO_CONTINUE); + return (result); +} + +/* EOF */ diff --git a/src/getlopt.h b/src/getlopt.h new file mode 100644 index 0000000..3fca39c --- /dev/null +++ b/src/getlopt.h @@ -0,0 +1,77 @@ +/* + getlopt: command line option/parameter parsing + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written Oliver Fromme + old timestamp: Tue Apr 8 07:13:39 MET DST 1997 +*/ + +#include +#include + + +#ifndef _MPG123_GETLOPT_H_ +#define _MPG123_GETLOPT_H_ + +extern int loptind; /* index in argv[] */ +extern int loptchr; /* index in argv[loptind] */ +extern char *loptarg; /* points to argument if present, else to option */ + +typedef struct { + char sname; /* short option name, can be 0 */ + char *lname; /* long option name, can be 0 */ + int flags; /* see below */ + void (*func)(char *); /* called if != 0 (after setting of var) */ + void *var; /* type is *long, *char or **char, see below */ + long value; +} topt; + +/* ThOr: make this clear; distict long from int (since this is != on my Alpha) and really use a flag for every case (spare the 0 case +for .... no flag) */ +#define GLO_ARG 1 +#define GLO_CHAR 2 +#define GLO_INT 4 +#define GLO_LONG 8 +#define GLO_DOUBLE 16 + +/* flags: + * bit 0 = 0 - no argument + * if var != NULL + * *var := value or (char)value [see bit 1] + * else + * loptarg = &option + * return ((value != 0) ? value : sname) + * bit 0 = 1 - argument required + * if var != NULL + * *var := atoi(arg) or strdup(arg) [see bit 1] + * else + * loptarg = &arg + * return ((value != 0) ? value : sname) + * + * bit 1 = 1 - var is a pointer to a char (or string), + * and value is interpreted as char + * bit 2 = 1 - var is a pointer to int + * bit 3 = 1 - var is a pointer to long + * + * Note: The options definition is terminated by a topt + * containing only zeroes. + */ + +#define GLO_END 0 +#define GLO_UNKNOWN -1 +#define GLO_NOARG -2 +#define GLO_CONTINUE -3 + +int getlopt (int argc, char *argv[], topt *opts); + +/* return values: + * GLO_END (0) end of options + * GLO_UNKNOWN (-1) unknown option *loptarg + * GLO_NOARG (-2) missing argument + * GLO_CONTINUE (-3) (reserved for internal use) + * else - return value according to flags (see above) + */ + + +#endif diff --git a/src/httpget.c b/src/httpget.c new file mode 100644 index 0000000..dd469d6 --- /dev/null +++ b/src/httpget.c @@ -0,0 +1,731 @@ +/* + httpget.c: http communication + + copyright ?-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written Oliver Fromme + old timestamp: Wed Apr 9 20:57:47 MET DST 1997 + + Thomas' notes: + ; + I used to do + GET http://server/path HTTP/1.0 + + But RFC 1945 says: The absoluteURI form is only allowed when the request is being made to a proxy. + + so I should not do that. Since name based virtual hosts need the hostname in the request, I still need to provide that info. + Enter HTTP/1.1... there is a Host eader field to use (that mpg123 supposedly has used since some time anyway - but did it really work with my vhost test server)? + Now + GET /path/bla HTTP/1.1\r\nHost: host[:port] + Should work, but as a funny sidenote: + + RFC2616: To allow for transition to absoluteURIs in all requests in future versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI form in requests, even though HTTP/1.1 clients will only generate them in requests to proxies. + + I was already full-on HTTP/1.1 as I recognized that mpg123 then would have to accept the chunked transfer encoding. + That is not desireable for its purpose... maybe when interleaving of shoutcasts with metadata chunks is supported, we can upgrade to 1.1. + Funny aspect there is that shoutcast servers do not do HTTP/1.1 chunked transfer but implement some different chunking themselves... +*/ + +#include "mpg123app.h" +#include "httpget.h" + +#ifdef NETWORK +#include "resolver.h" + +#include +#include "true.h" +#endif + +#include + +#include "debug.h" + +void httpdata_init(struct httpdata *e) +{ + mpg123_init_string(&e->content_type); + mpg123_init_string(&e->icy_url); + mpg123_init_string(&e->icy_name); + e->icy_interval = 0; + e->proxystate = PROXY_UNKNOWN; + mpg123_init_string(&e->proxyhost); + mpg123_init_string(&e->proxyport); +} + +void httpdata_reset(struct httpdata *e) +{ + mpg123_free_string(&e->content_type); + mpg123_free_string(&e->icy_url); + mpg123_free_string(&e->icy_name); + e->icy_interval = 0; + /* the other stuff shall persist */ +} + +void httpdata_free(struct httpdata *e) +{ + httpdata_reset(e); + mpg123_free_string(&e->proxyhost); + mpg123_free_string(&e->proxyport); +} + +/* mime type classes */ +#define M_FILE 0 +#define M_M3U 1 +#define M_PLS 2 +static const char* mime_file[] = +{ + "audio/mpeg", "audio/x-mpeg", + "audio/mp3", "audio/x-mp3", + "audio/mpeg3", "audio/x-mpeg3", + "audio/mpg", "audio/x-mpg", + "audio/x-mpegaudio", + "application/octet-stream", /* Assume raw binary data is some MPEG data. */ + NULL +}; +static const char* mime_m3u[] = { "audio/mpegurl", "audio/mpeg-url", "audio/x-mpegurl", NULL }; +static const char* mime_pls[] = +{ + "audio/x-scpls" +, "audio/scpls" +, "application/pls" +, "application/x-scpls" +, "application/pls+xml" +, NULL +}; +static const char** mimes[] = { mime_file, mime_m3u, mime_pls, NULL }; + +int debunk_mime(const char* mime) +{ + int i,j; + size_t len; + int r = 0; + char *aux; + /* Watch out for such: "audio/x-mpegurl; charset=utf-8" */ + aux = strchr(mime, ';'); + if(aux != NULL) + { + if(!param.quiet) + fprintf(stderr, "Warning: additional info in content-type ignored (%s)\n", aux+1); + /* Just compare up to before the ";" */ + len = aux-mime; + } + /* Else, compare the whole string -- including the end. */ + else len = strlen(mime)+1; + + /* Skip trailing whitespace, to ne nice to strange folks. */ + while(len && isspace(mime[len-1])) --len; + + for(i=0; mimes[i] != NULL; ++i) + for(j=0; mimes[i][j] != NULL; ++j) + if(!strncasecmp(mimes[i][j], mime, len)) goto debunk_result; + +debunk_result: + if(mimes[i] != NULL) + { + switch(i) + { + case M_FILE: r = IS_FILE; break; + case M_M3U: r = IS_LIST|IS_M3U; break; + case M_PLS: r = IS_LIST|IS_PLS; break; + default: error("unexpected MIME debunk result -- coding error?!"); + } + } + return r; +} + + +#ifdef NETWORK +#if !defined (WANT_WIN32_SOCKETS) +static int writestring (int fd, mpg123_string *string) +{ + size_t result, bytes; + char *ptr = string->p; + bytes = string->fill ? string->fill-1 : 0; + + while(bytes) + { + result = write(fd, ptr, bytes); + if(result < 0 && errno != EINTR) + { + perror ("writing http string"); + return FALSE; + } + else if(result == 0) + { + error("write: socket closed unexpectedly"); + return FALSE; + } + ptr += result; + bytes -= result; + } + return TRUE; +} + +static size_t readstring (mpg123_string *string, size_t maxlen, int fd) +{ + int err; + debug2("Attempting readstring on %d for %"SIZE_P" bytes", fd, (size_p)maxlen); + string->fill = 0; + while(maxlen == 0 || string->fill < maxlen) + { + if(string->size-string->fill < 1) + if(!mpg123_grow_string(string, string->fill+4096)) + { + error("Cannot allocate memory for reading."); + string->fill = 0; + return 0; + } + err = read(fd,string->p+string->fill,1); + /* Whoa... reading one byte at a time... one could ensure the line break in another way, but more work. */ + if( err == 1) + { + string->fill++; + if(string->p[string->fill-1] == '\n') break; + } + else if(errno != EINTR) + { + error("Error reading from socket or unexpected EOF."); + string->fill = 0; + /* bail out to prevent endless loop */ + return 0; + } + } + + if(!mpg123_grow_string(string, string->fill+1)) + { + string->fill=0; + } + else + { + string->p[string->fill] = 0; + string->fill++; + } + return string->fill; +} +#endif /* WANT_WIN32_SOCKETS */ + +void encode64 (char *source,char *destination) +{ + static char *Base64Digits = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + int n = 0; + int ssiz=strlen(source); + int i; + + for (i = 0 ; i < ssiz ; i += 3) { + unsigned int buf; + buf = ((unsigned char *)source)[i] << 16; + if (i+1 < ssiz) + buf |= ((unsigned char *)source)[i+1] << 8; + if (i+2 < ssiz) + buf |= ((unsigned char *)source)[i+2]; + + destination[n++] = Base64Digits[(buf >> 18) % 64]; + destination[n++] = Base64Digits[(buf >> 12) % 64]; + if (i+1 < ssiz) + destination[n++] = Base64Digits[(buf >> 6) % 64]; + else + destination[n++] = '='; + if (i+2 < ssiz) + destination[n++] = Base64Digits[buf % 64]; + else + destination[n++] = '='; + } + destination[n++] = 0; +} + +/* Look out for HTTP header field to parse, construct C string with the value. + Attention: Modifies argument, since it's so convenient... */ +char *get_header_val(const char *hname, mpg123_string *response) +{ + char *tmp = NULL; + size_t prelen = strlen(hname); + /* if header name found, next char is at least something, so just check for : */ + if(!strncasecmp(hname, response->p, prelen) && (response->p[prelen] == ':')) + { + ++prelen; + if((tmp = strchr(response->p, '\r')) != NULL ) tmp[0] = 0; + if((tmp = strchr(response->p, '\n')) != NULL ) tmp[0] = 0; + tmp = response->p+prelen; + /* I _know_ that there is a terminating zero, so this loop is safe. */ + while((tmp[0] == ' ') || (tmp[0] == '\t')) + { + ++tmp; + } + } + return tmp; +} + +/* Iterate over header field names and storage locations, to possibly get those values. */ +void get_header_string(mpg123_string *response, const char *fieldname, mpg123_string *store) +{ + char *tmp; + if((tmp = get_header_val(fieldname, response))) + { + if(mpg123_set_string(store, tmp)){ debug2("got %s %s", fieldname, store->p); return; } + else{ error2("unable to set %s to %s!", fieldname, tmp); } + } +} + +/* shoutcsast meta data: 1=on, 0=off */ + +char *httpauth = NULL; + +size_t accept_length(void) +{ + int i,j; + static size_t l = 0; + if(l) return l; + l += strlen("Accept: "); + for(i=0; mimes[i] != NULL; ++i) + for(j=0; mimes[i][j] != NULL; ++j){ l += strlen(mimes[i][j]) + strlen(", "); } + l += strlen("*/*\r\n"); + debug1("initial computation of accept header length: %lu", (unsigned long)l); + return l; +} + +/* Returns TRUE or FALSE for success. */ +int proxy_init(struct httpdata *hd) +{ + int ret = TRUE; + /* If we don't have explicit proxy given, probe the environment. */ + if (!param.proxyurl) + if (!(param.proxyurl = getenv("MP3_HTTP_PROXY"))) + if (!(param.proxyurl = getenv("http_proxy"))) + param.proxyurl = getenv("HTTP_PROXY"); + /* Now continue if we have something. */ + if (param.proxyurl && param.proxyurl[0] && strcmp(param.proxyurl, "none")) + { + mpg123_string proxyurl; + mpg123_init_string(&proxyurl); + if( !mpg123_set_string(&proxyurl, param.proxyurl) + || !split_url(&proxyurl, NULL, &hd->proxyhost, &hd->proxyport, NULL)) + { + error("splitting proxy URL"); + ret = FALSE; + } + else if(param.verbose > 1) fprintf(stderr, "Note: Using proxy %s\n", hd->proxyhost.p); +#if 0 /* not yet there */ + if(!try_host_lookup(proxyhost)) + { + error("Unknown proxy host \"%s\".\n", proxyhost.p); + ret = FALSE; + } +#endif + mpg123_free_string(&proxyurl); + if(ret) hd->proxystate = PROXY_HOST; /* We got hostname and port settled. */ + else hd->proxystate = PROXY_NONE; + } + else hd->proxystate = PROXY_NONE; + + return ret; +} + +static int append_accept(mpg123_string *s) +{ + size_t i,j; + if(!mpg123_add_string(s, "Accept: ")) return FALSE; + + /* We prefer what we know. */ + for(i=0; mimes[i] != NULL; ++i) + for(j=0; mimes[i][j] != NULL; ++j) + { + if( !mpg123_add_string(s, mimes[i][j]) + || !mpg123_add_string(s, ", ") ) + return FALSE; + } + /* Well... in the end, we accept everything, trying to make sense with reality. */ + if(!mpg123_add_string(s, "*/*\r\n")) return FALSE; + + return TRUE; +} + + +/* + Converts spaces to "%20" ... actually, I have to ask myself why. + What about converting them to "+" instead? Would make things a lot easier. + Or, on the other hand... what about avoiding HTML encoding at all? +*/ +int translate_url(const char *url, mpg123_string *purl) +{ + const char *sptr; + /* The length of purl is upper bound by 3*strlen(url) + 1 if + * everything in it is a space (%20) - or any encoded character */ + if (strlen(url) >= SIZE_MAX/3) + { + error("URL too long. Skipping..."); + return FALSE; + } + /* Prepare purl in one chunk, to minimize mallocs. */ + if(!mpg123_resize_string(purl, strlen(url) + 31)) return FALSE; + /* + * 2000-10-21: + * We would like spaces to be automatically converted to %20's when + * fetching via HTTP. + * -- Martin Sj�gren + * Hm, why only spaces? Maybe one should do this http stuff more properly... + */ + if ((sptr = strchr(url, ' ')) == NULL) + mpg123_set_string(purl, url); + else + { /* Note that sptr is set from the if to this else... */ + const char *urlptr = url; + mpg123_set_string(purl, ""); + do { + if(! ( mpg123_add_substring(purl, urlptr, 0, sptr-urlptr) + && mpg123_add_string(purl, "%20") ) ) + return FALSE; + urlptr = sptr + 1; + } while ((sptr = strchr (urlptr, ' ')) != NULL); + if(!mpg123_add_string(purl, urlptr)) return FALSE; + } + /* now see if a terminating / may be needed */ + if(strchr(purl->p+(strncmp("http://", purl->p, 7) ? 0 : 7), '/') == NULL + && !mpg123_add_string(purl, "/")) + return FALSE; + + return TRUE; +} + +int fill_request(mpg123_string *request, mpg123_string *host, mpg123_string *port, mpg123_string *httpauth1, int *try_without_port) +{ + char* ttemp; + int ret = TRUE; + const char *icy = param.talk_icy ? icy_yes : icy_no; + + /* hm, my test redirection had troubles with line break before HTTP/1.0 */ + if((ttemp = strchr(request->p,'\r')) != NULL){ *ttemp = 0; request->fill = ttemp-request->p+1; } + + if((ttemp = strchr(request->p,'\n')) != NULL){ *ttemp = 0; request->fill = ttemp-request->p+1; } + + /* Fill out the request further... */ + if( !mpg123_add_string(request, " HTTP/1.0\r\nUser-Agent: ") + || !mpg123_add_string(request, PACKAGE_NAME) + || !mpg123_add_string(request, "/") + || !mpg123_add_string(request, PACKAGE_VERSION) + || !mpg123_add_string(request, "\r\n") ) + return FALSE; + + if(host->fill) + { /* Give virtual hosting a chance... adding the "Host: ... " line. */ + debug2("Host: %s:%s", host->p, port->p); + if( mpg123_add_string(request, "Host: ") + && mpg123_add_string(request, host->p) + && ( *try_without_port || ( + mpg123_add_string(request, ":") + && mpg123_add_string(request, port->p) )) + && mpg123_add_string(request, "\r\n") ) + { + if(*try_without_port) *try_without_port = 0; + } + else return FALSE; + } + + /* Acceptance, stream setup. */ + if( !append_accept(request) + || !mpg123_add_string(request, CONN_HEAD) + || !mpg123_add_string(request, icy) ) + return FALSE; + + /* Authorization. */ + if (httpauth1->fill || httpauth) { + char *buf; + if(!mpg123_add_string(request,"Authorization: Basic ")) return FALSE; + if(httpauth1->fill) { + if(httpauth1->fill > SIZE_MAX / 4) return FALSE; + + buf=(char *)malloc(httpauth1->fill * 4); + if(!buf) + { + error("malloc() failed for http auth, out of memory."); + return FALSE; + } + encode64(httpauth1->p,buf); + } else { + if(strlen(httpauth) > SIZE_MAX / 4 - 4 ) return FALSE; + + buf=(char *)malloc((strlen(httpauth) + 1) * 4); + if(!buf) + { + error("malloc() for http auth failed, out of memory."); + return FALSE; + } + encode64(httpauth,buf); + } + + if( !mpg123_add_string(request, buf) || !mpg123_add_string(request, "\r\n")) + ret = FALSE; + + free(buf); /* Watch out for leaking if you introduce returns before this line. */ + } + if(ret) ret = mpg123_add_string(request, "\r\n"); + + return ret; +} +#if !defined (WANT_WIN32_SOCKETS) +static int resolve_redirect(mpg123_string *response, mpg123_string *request_url, mpg123_string *purl) +{ + debug1("request_url:%s", request_url->p); + /* initialized with full old url */ + if(!mpg123_copy_string(request_url, purl)) return FALSE; + + /* We may strip it down to a prefix ot totally. */ + if(strncasecmp(response->p, "Location: http://", 17)) + { /* OK, only partial strip, need prefix for relative path. */ + char* ptmp = NULL; + /* though it's not RFC (?), accept relative URIs as wget does */ + fprintf(stderr, "NOTE: no complete URL in redirect, constructing one\n"); + /* not absolute uri, could still be server-absolute */ + /* I prepend a part of the request... out of the request */ + if(response->p[10] == '/') + { + /* only prepend http://server/ */ + /* I null the first / after http:// */ + ptmp = strchr(purl->p+7,'/'); + if(ptmp != NULL){ purl->fill = ptmp-purl->p+1; purl->p[purl->fill-1] = 0; } + } + else + { + /* prepend http://server/path/ */ + /* now we want the last / */ + ptmp = strrchr(purl->p+7, '/'); + if(ptmp != NULL){ purl->fill = ptmp-purl->p+2; purl->p[purl->fill-1] = 0; } + } + } + else purl->fill = 0; + + debug1("prefix=%s", purl->fill ? purl->p : ""); + if(!mpg123_add_string(purl, response->p+10)) return FALSE; + + debug1(" purl: %s", purl->p); + debug1("old request_url: %s", request_url->p); + + return TRUE; +} + +int http_open(char* url, struct httpdata *hd) +{ + mpg123_string purl, host, port, path; + mpg123_string request, response, request_url; + mpg123_string httpauth1; + int sock = -1; + int oom = 0; + int relocate, numrelocs = 0; + int got_location = FALSE; + /* + workaround for http://www.global24music.com/rautemusik/files/extreme/isdn.pls + this site's apache gives me a relocation to the same place when I give the port in Host request field + for the record: Apache/2.0.51 (Fedora) + */ + int try_without_port = 0; + mpg123_init_string(&purl); + mpg123_init_string(&host); + mpg123_init_string(&port); + mpg123_init_string(&path); + mpg123_init_string(&request); + mpg123_init_string(&response); + mpg123_init_string(&request_url); + mpg123_init_string(&httpauth1); + + /* Get initial info for proxy server. Once. */ + if(hd->proxystate == PROXY_UNKNOWN && !proxy_init(hd)) goto exit; + + if(!translate_url(url, &purl)){ oom=1; goto exit; } + + /* Don't confuse the different auth strings... */ + if(!split_url(&purl, &httpauth1, NULL, NULL, NULL) ){ oom=1; goto exit; } + + /* "GET http://" 11 + * " HTTP/1.0\r\nUser-Agent: /\r\n" + * 26 + PACKAGE_NAME + PACKAGE_VERSION + * accept header + accept_length() + * "Authorization: Basic \r\n" 23 + * "\r\n" 2 + * ... plus the other predefined header lines + */ + /* Just use this estimate as first guess to reduce malloc calls in string library. */ + { + size_t length_estimate = 62 + strlen(PACKAGE_NAME) + strlen(PACKAGE_VERSION) + + accept_length() + strlen(CONN_HEAD) + strlen(icy_yes) + purl.fill; + if( !mpg123_grow_string(&request, length_estimate) + || !mpg123_grow_string(&response,4096) ) + { + oom=1; goto exit; + } + } + + do + { + /* Storing the request url, with http:// prepended if needed. */ + /* used to be url here... seemed wrong to me (when loop advanced...) */ + if(strncasecmp(purl.p, "http://", 7) != 0) mpg123_set_string(&request_url, "http://"); + else mpg123_set_string(&request_url, ""); + + mpg123_chomp_string(&purl); + mpg123_add_string(&request_url, purl.p); + + /* Always store the host and port from the URL for correct host header + in the request. Proxy server is used for connection, but never in the + host header! */ + if(!split_url(&purl, NULL, &host, &port, &path)){ oom=1; goto exit; } + if (hd->proxystate >= PROXY_HOST) + { + /* We will connect to proxy, full URL goes into the request. */ + if( !mpg123_set_string(&request, "GET ") + || !mpg123_add_string(&request, request_url.p) ) + { + oom=1; goto exit; + } + } + else + { + /* We will connect to the host from the URL and only the path goes into the request. */ + if( !mpg123_set_string(&request, "GET ") + || !mpg123_add_string(&request, path.p) ) + { + oom=1; goto exit; + } + } + + if(!fill_request(&request, &host, &port, &httpauth1, &try_without_port)){ oom=1; goto exit; } + + httpauth1.fill = 0; /* We use the auth data from the URL only once. */ + if (hd->proxystate >= PROXY_HOST) + { + /* Only the host:port used for actual connection is replaced by + proxy. */ + if( !mpg123_copy_string(&hd->proxyhost, &host) + || !mpg123_copy_string(&hd->proxyport, &port) ) + { + oom=1; goto exit; + } + } + debug2("attempting to open_connection to %s:%s", host.p, port.p); + sock = open_connection(&host, &port); + if(sock < 0) + { + error1("Unable to establish connection to %s", host.fill ? host.p : ""); + goto exit; + } +#define http_failure close(sock); sock=-1; goto exit; + + if(param.verbose > 2) fprintf(stderr, "HTTP request:\n%s\n",request.p); + if(!writestring(sock, &request)){ http_failure; } + relocate = FALSE; + /* Arbitrary length limit here... */ +#define safe_readstring \ + readstring(&response, SIZE_MAX/16, sock); \ + if(response.fill > SIZE_MAX/16) /* > because of appended zero. */ \ + { \ + error("HTTP response line exceeds max. length"); \ + http_failure; \ + } \ + else if(response.fill == 0) \ + { \ + error("readstring failed"); \ + http_failure; \ + } \ + if(param.verbose > 2) fprintf(stderr, "HTTP in: %s", response.p); + safe_readstring; + + { + char *sptr; + if((sptr = strchr(response.p, ' '))) + { + if(response.fill > sptr-response.p+2) + switch (sptr[1]) + { + case '3': + relocate = TRUE; + case '2': + break; + default: + fprintf (stderr, "HTTP request failed: %s", sptr+1); /* '\n' is included */ + http_failure; + } + else{ error("Too short response,"); http_failure; } + } + } + + /* If we are relocated, we need to look out for a Location header. */ + got_location = FALSE; + + do + { + safe_readstring; /* Think about that: Should we really error out when we get nothing? Could be that the server forgot the trailing empty line... */ + if (!strncasecmp(response.p, "Location: ", 10)) + { /* It is a redirection! */ + if(!resolve_redirect(&response, &request_url, &purl)){ oom=1, http_failure; } + + if(!strcmp(purl.p, request_url.p)) + { + warning("relocated to very same place! trying request again without host port"); + try_without_port = 1; + } + got_location = TRUE; + } + else + { /* We got a header line (or the closing empty line). */ + char *tmp; + debug1("searching for header values... %s", response.p); + /* Not sure if I want to bail out on error here. */ + /* Also: What text encoding are these strings in? Doesn't need to be plain ASCII... */ + get_header_string(&response, "content-type", &hd->content_type); + get_header_string(&response, "icy-name", &hd->icy_name); + get_header_string(&response, "icy-url", &hd->icy_url); + + /* watch out for icy-metaint */ + if((tmp = get_header_val("icy-metaint", &response))) + { + hd->icy_interval = (off_t) atol(tmp); /* atoll ? */ + debug1("got icy-metaint %li", (long int)hd->icy_interval); + } + } + } while(response.p[0] != '\r' && response.p[0] != '\n'); + if(relocate) + { + close(sock); + sock = -1; + /* Forget content type, might just relate to a displayed error page, + not the resource being redirected to. */ + mpg123_free_string(&hd->content_type); + mpg123_init_string(&hd->content_type); + } + } while(relocate && got_location && purl.fill && numrelocs++ < HTTP_MAX_RELOCATIONS); + if(relocate) + { + if(!got_location) + error("Server meant to redirect but failed to provide a location!"); + else + error1("Too many HTTP relocations (%i).", numrelocs); + + http_failure; + } + +exit: /* The end as well as the exception handling point... */ + if(oom) error("Apparently, I ran out of memory or had some bad input data..."); + + mpg123_free_string(&purl); + mpg123_free_string(&host); + mpg123_free_string(&port); + mpg123_free_string(&path); + mpg123_free_string(&request); + mpg123_free_string(&response); + mpg123_free_string(&request_url); + mpg123_free_string(&httpauth1); + return sock; +} +#endif /*WANT_WIN32_SOCKETS*/ + +#else /* NETWORK */ + +/* stub */ +int http_open (char* url, struct httpdata *hd) +{ + if(!param.quiet) + error("HTTP support not built in."); + return -1; +} +#endif + +/* EOF */ + diff --git a/src/httpget.h b/src/httpget.h new file mode 100644 index 0000000..2fccfaf --- /dev/null +++ b/src/httpget.h @@ -0,0 +1,66 @@ +/* + httpget: HTTP input routines (the header) + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis + + Note about MIME types: + You feed debunk_mime() a MIME string and it classifies it as it is relevant for mpg123. + In httpget.c are the MIME class lists, which may be appended to to support more bogus MIME types. +*/ + +#ifndef _HTTPGET_H_ +#define _HTTPGET_H_ +#include "mpg123.h" + +/* Pulled in by mpg123app.h! */ + +struct httpdata +{ + mpg123_string content_type; + mpg123_string icy_name; + mpg123_string icy_url; + off_t icy_interval; + mpg123_string proxyhost; + mpg123_string proxyport; + /* Partly dummy for now... later proxy host resolution will be cached (PROXY_ADDR). */ + enum { PROXY_UNKNOWN=0, PROXY_NONE, PROXY_HOST, PROXY_ADDR } proxystate; +}; + +void httpdata_init(struct httpdata *e); +void httpdata_reset(struct httpdata *e); +void httpdata_free(struct httpdata *e); + +/* There is a whole lot of MIME types for the same thing. + the function will reduce it to a combination of these flags */ +#define IS_FILE 1 +#define IS_LIST 2 +#define IS_M3U 4 +#define IS_PLS 8 + +#define HTTP_MAX_RELOCATIONS 20 + +int debunk_mime(const char* mime); + +/*Previously static functions, shared for win32_net_support */ +int proxy_init(struct httpdata *hd); +int translate_url(const char *url, mpg123_string *purl); +size_t accept_length(void); +int fill_request(mpg123_string *request, mpg123_string *host, mpg123_string *port, mpg123_string *httpauth1, int *try_without_port); +void get_header_string(mpg123_string *response, const char *fieldname, mpg123_string *store); +char *get_header_val(const char *hname, mpg123_string *response); + +/* needed for HTTP/1.1 non-pipelining mode */ +/* #define CONN_HEAD "Connection: close\r\n" */ +#define CONN_HEAD "" +#define icy_yes "Icy-MetaData: 1\r\n" +#define icy_no "Icy-MetaData: 0\r\n" + +extern char *proxyurl; +extern unsigned long proxyip; +/* takes url and content type string address, opens resource, returns fd for data, allocates and sets content type */ +extern int http_open (char* url, struct httpdata *hd); +extern char *httpauth; + +#endif diff --git a/src/intsym.h b/src/intsym.h new file mode 100644 index 0000000..74b0388 --- /dev/null +++ b/src/intsym.h @@ -0,0 +1,360 @@ +#ifndef MPG123_INTSYM_H +#define MPG123_INTSYM_H +/* Mapping of internal mpg123 symbols to something that is less likely to + conflict in case of static linking. */ +#include "config.h" +#define COS9 INT123_COS9 +#define tfcos36 INT123_tfcos36 +#define pnts INT123_pnts +#define catchsignal INT123_catchsignal +#define safe_realloc INT123_safe_realloc +#define compat_strdup INT123_compat_strdup +#define compat_open INT123_compat_open +#define compat_fopen INT123_compat_fopen +#define compat_fdopen INT123_compat_fdopen +#define compat_close INT123_compat_close +#define compat_fclose INT123_compat_fclose +#define win32_wide_utf8 INT123_win32_wide_utf8 +#define win32_utf8_wide INT123_win32_utf8_wide +#define unintr_write INT123_unintr_write +#define unintr_read INT123_unintr_read +#define ntom_set_ntom INT123_ntom_set_ntom +#define synth_1to1 INT123_synth_1to1 +#define synth_1to1_dither INT123_synth_1to1_dither +#define synth_1to1_i386 INT123_synth_1to1_i386 +#define synth_1to1_i586 INT123_synth_1to1_i586 +#define synth_1to1_i586_dither INT123_synth_1to1_i586_dither +#define synth_1to1_mmx INT123_synth_1to1_mmx +#define synth_1to1_3dnow INT123_synth_1to1_3dnow +#define synth_1to1_sse INT123_synth_1to1_sse +#define synth_1to1_stereo_sse INT123_synth_1to1_stereo_sse +#define synth_1to1_3dnowext INT123_synth_1to1_3dnowext +#define synth_1to1_altivec INT123_synth_1to1_altivec +#define synth_1to1_stereo_altivec INT123_synth_1to1_stereo_altivec +#define synth_1to1_x86_64 INT123_synth_1to1_x86_64 +#define synth_1to1_stereo_x86_64 INT123_synth_1to1_stereo_x86_64 +#define synth_1to1_avx INT123_synth_1to1_avx +#define synth_1to1_stereo_avx INT123_synth_1to1_stereo_avx +#define synth_1to1_arm INT123_synth_1to1_arm +#define synth_1to1_neon INT123_synth_1to1_neon +#define synth_1to1_stereo_neon INT123_synth_1to1_stereo_neon +#define synth_1to1_neon64 INT123_synth_1to1_neon64 +#define synth_1to1_stereo_neon64 INT123_synth_1to1_stereo_neon64 +#define absynth_1to1_i486 INT123_absynth_1to1_i486 +#define synth_1to1_mono INT123_synth_1to1_mono +#define synth_1to1_m2s INT123_synth_1to1_m2s +#define synth_2to1 INT123_synth_2to1 +#define synth_2to1_dither INT123_synth_2to1_dither +#define synth_2to1_i386 INT123_synth_2to1_i386 +#define synth_2to1_mono INT123_synth_2to1_mono +#define synth_2to1_m2s INT123_synth_2to1_m2s +#define synth_4to1 INT123_synth_4to1 +#define synth_4to1_dither INT123_synth_4to1_dither +#define synth_4to1_i386 INT123_synth_4to1_i386 +#define synth_4to1_mono INT123_synth_4to1_mono +#define synth_4to1_m2s INT123_synth_4to1_m2s +#define synth_ntom INT123_synth_ntom +#define synth_ntom_mono INT123_synth_ntom_mono +#define synth_ntom_m2s INT123_synth_ntom_m2s +#define synth_1to1_8bit INT123_synth_1to1_8bit +#define synth_1to1_8bit_i386 INT123_synth_1to1_8bit_i386 +#define synth_1to1_8bit_wrap INT123_synth_1to1_8bit_wrap +#define synth_1to1_8bit_mono INT123_synth_1to1_8bit_mono +#define synth_1to1_8bit_m2s INT123_synth_1to1_8bit_m2s +#define synth_1to1_8bit_wrap_mono INT123_synth_1to1_8bit_wrap_mono +#define synth_1to1_8bit_wrap_m2s INT123_synth_1to1_8bit_wrap_m2s +#define synth_2to1_8bit INT123_synth_2to1_8bit +#define synth_2to1_8bit_i386 INT123_synth_2to1_8bit_i386 +#define synth_2to1_8bit_mono INT123_synth_2to1_8bit_mono +#define synth_2to1_8bit_m2s INT123_synth_2to1_8bit_m2s +#define synth_4to1_8bit INT123_synth_4to1_8bit +#define synth_4to1_8bit_i386 INT123_synth_4to1_8bit_i386 +#define synth_4to1_8bit_mono INT123_synth_4to1_8bit_mono +#define synth_4to1_8bit_m2s INT123_synth_4to1_8bit_m2s +#define synth_ntom_8bit INT123_synth_ntom_8bit +#define synth_ntom_8bit_mono INT123_synth_ntom_8bit_mono +#define synth_ntom_8bit_m2s INT123_synth_ntom_8bit_m2s +#define synth_1to1_real INT123_synth_1to1_real +#define synth_1to1_real_i386 INT123_synth_1to1_real_i386 +#define synth_1to1_real_sse INT123_synth_1to1_real_sse +#define synth_1to1_real_stereo_sse INT123_synth_1to1_real_stereo_sse +#define synth_1to1_real_x86_64 INT123_synth_1to1_real_x86_64 +#define synth_1to1_real_stereo_x86_64 INT123_synth_1to1_real_stereo_x86_64 +#define synth_1to1_real_avx INT123_synth_1to1_real_avx +#define synth_1to1_fltst_avx INT123_synth_1to1_fltst_avx +#define synth_1to1_real_altivec INT123_synth_1to1_real_altivec +#define synth_1to1_fltst_altivec INT123_synth_1to1_fltst_altivec +#define synth_1to1_real_neon INT123_synth_1to1_real_neon +#define synth_1to1_real_stereo_neon INT123_synth_1to1_real_stereo_neon +#define synth_1to1_real_neon64 INT123_synth_1to1_real_neon64 +#define synth_1to1_fltst_neon64 INT123_synth_1to1_fltst_neon64 +#define synth_1to1_real_mono INT123_synth_1to1_real_mono +#define synth_1to1_real_m2s INT123_synth_1to1_real_m2s +#define synth_2to1_real INT123_synth_2to1_real +#define synth_2to1_real_i386 INT123_synth_2to1_real_i386 +#define synth_2to1_real_mono INT123_synth_2to1_real_mono +#define synth_2to1_real_m2s INT123_synth_2to1_real_m2s +#define synth_4to1_real INT123_synth_4to1_real +#define synth_4to1_real_i386 INT123_synth_4to1_real_i386 +#define synth_4to1_real_mono INT123_synth_4to1_real_mono +#define synth_4to1_real_m2s INT123_synth_4to1_real_m2s +#define synth_ntom_real INT123_synth_ntom_real +#define synth_ntom_real_mono INT123_synth_ntom_real_mono +#define synth_ntom_real_m2s INT123_synth_ntom_real_m2s +#define synth_1to1_s32 INT123_synth_1to1_s32 +#define synth_1to1_s32_i386 INT123_synth_1to1_s32_i386 +#define synth_1to1_s32_sse INT123_synth_1to1_s32_sse +#define synth_1to1_s32_stereo_sse INT123_synth_1to1_s32_stereo_sse +#define synth_1to1_s32_x86_64 INT123_synth_1to1_s32_x86_64 +#define synth_1to1_s32_stereo_x86_64 INT123_synth_1to1_s32_stereo_x86_64 +#define synth_1to1_s32_avx INT123_synth_1to1_s32_avx +#define synth_1to1_s32_stereo_avx INT123_synth_1to1_s32_stereo_avx +#define synth_1to1_s32_altivec INT123_synth_1to1_s32_altivec +#define synth_1to1_s32_stereo_altivec INT123_synth_1to1_s32_stereo_altivec +#define synth_1to1_s32_neon INT123_synth_1to1_s32_neon +#define synth_1to1_s32_stereo_neon INT123_synth_1to1_s32_stereo_neon +#define synth_1to1_s32_neon64 INT123_synth_1to1_s32_neon64 +#define synth_1to1_s32st_neon64 INT123_synth_1to1_s32st_neon64 +#define synth_1to1_s32_mono INT123_synth_1to1_s32_mono +#define synth_1to1_s32_m2s INT123_synth_1to1_s32_m2s +#define synth_2to1_s32 INT123_synth_2to1_s32 +#define synth_2to1_s32_i386 INT123_synth_2to1_s32_i386 +#define synth_2to1_s32_mono INT123_synth_2to1_s32_mono +#define synth_2to1_s32_m2s INT123_synth_2to1_s32_m2s +#define synth_4to1_s32 INT123_synth_4to1_s32 +#define synth_4to1_s32_i386 INT123_synth_4to1_s32_i386 +#define synth_4to1_s32_mono INT123_synth_4to1_s32_mono +#define synth_4to1_s32_m2s INT123_synth_4to1_s32_m2s +#define synth_ntom_s32 INT123_synth_ntom_s32 +#define synth_ntom_s32_mono INT123_synth_ntom_s32_mono +#define synth_ntom_s32_m2s INT123_synth_ntom_s32_m2s +#define dct64 INT123_dct64 +#define dct64_i386 INT123_dct64_i386 +#define dct64_altivec INT123_dct64_altivec +#define dct64_i486 INT123_dct64_i486 +#define dct36 INT123_dct36 +#define dct36_3dnow INT123_dct36_3dnow +#define dct36_3dnowext INT123_dct36_3dnowext +#define dct36_x86_64 INT123_dct36_x86_64 +#define dct36_sse INT123_dct36_sse +#define dct36_avx INT123_dct36_avx +#define dct36_neon INT123_dct36_neon +#define dct36_neon64 INT123_dct36_neon64 +#define synth_ntom_set_step INT123_synth_ntom_set_step +#define ntom_val INT123_ntom_val +#define ntom_frame_outsamples INT123_ntom_frame_outsamples +#define ntom_frmouts INT123_ntom_frmouts +#define ntom_ins2outs INT123_ntom_ins2outs +#define ntom_frameoff INT123_ntom_frameoff +#define init_layer3 INT123_init_layer3 +#define init_layer3_gainpow2 INT123_init_layer3_gainpow2 +#define init_layer3_stuff INT123_init_layer3_stuff +#define init_layer12 INT123_init_layer12 +#define init_layer12_table INT123_init_layer12_table +#define init_layer12_stuff INT123_init_layer12_stuff +#define prepare_decode_tables INT123_prepare_decode_tables +#define make_decode_tables INT123_make_decode_tables +#define make_decode_tables_mmx INT123_make_decode_tables_mmx +#define init_layer3_gainpow2_mmx INT123_init_layer3_gainpow2_mmx +#define init_layer12_table_mmx INT123_init_layer12_table_mmx +#define make_conv16to8_table INT123_make_conv16to8_table +#define do_layer3 INT123_do_layer3 +#define do_layer2 INT123_do_layer2 +#define do_layer1 INT123_do_layer1 +#define do_equalizer INT123_do_equalizer +#define dither_table_init INT123_dither_table_init +#define frame_dither_init INT123_frame_dither_init +#define invalidate_format INT123_invalidate_format +#define frame_init INT123_frame_init +#define frame_init_par INT123_frame_init_par +#define frame_outbuffer INT123_frame_outbuffer +#define frame_output_format INT123_frame_output_format +#define frame_buffers INT123_frame_buffers +#define frame_reset INT123_frame_reset +#define frame_buffers_reset INT123_frame_buffers_reset +#define frame_exit INT123_frame_exit +#define frame_index_find INT123_frame_index_find +#define frame_index_setup INT123_frame_index_setup +#define do_volume INT123_do_volume +#define do_rva INT123_do_rva +#define frame_gapless_init INT123_frame_gapless_init +#define frame_gapless_realinit INT123_frame_gapless_realinit +#define frame_gapless_update INT123_frame_gapless_update +#define frame_gapless_bytify INT123_frame_gapless_bytify +#define frame_gapless_ignore INT123_frame_gapless_ignore +#define frame_expect_outsamples INT123_frame_expect_outsamples +#define frame_skip INT123_frame_skip +#define frame_ins2outs INT123_frame_ins2outs +#define frame_outs INT123_frame_outs +#define frame_expect_outsampels INT123_frame_expect_outsampels +#define frame_offset INT123_frame_offset +#define frame_set_frameseek INT123_frame_set_frameseek +#define frame_set_seek INT123_frame_set_seek +#define frame_tell_seek INT123_frame_tell_seek +#define frame_fill_toc INT123_frame_fill_toc +#define getbits INT123_getbits +#define getcpuflags INT123_getcpuflags +#define icy2utf8 INT123_icy2utf8 +#define init_icy INT123_init_icy +#define clear_icy INT123_clear_icy +#define reset_icy INT123_reset_icy +#define init_id3 INT123_init_id3 +#define exit_id3 INT123_exit_id3 +#define reset_id3 INT123_reset_id3 +#define id3_link INT123_id3_link +#define parse_new_id3 INT123_parse_new_id3 +#define id3_to_utf8 INT123_id3_to_utf8 +#define fi_init INT123_fi_init +#define fi_exit INT123_fi_exit +#define fi_resize INT123_fi_resize +#define fi_add INT123_fi_add +#define fi_set INT123_fi_set +#define fi_reset INT123_fi_reset +#define double_to_long_rounded INT123_double_to_long_rounded +#define scale_rounded INT123_scale_rounded +#define decode_update INT123_decode_update +#define decoder_synth_bytes INT123_decoder_synth_bytes +#define samples_to_bytes INT123_samples_to_bytes +#define bytes_to_samples INT123_bytes_to_samples +#define outblock_bytes INT123_outblock_bytes +#define postprocess_buffer INT123_postprocess_buffer +#define frame_cpu_opt INT123_frame_cpu_opt +#define set_synth_functions INT123_set_synth_functions +#define dectype INT123_dectype +#define defdec INT123_defdec +#define decclass INT123_decclass +#define check_decoders INT123_check_decoders +#define read_frame_init INT123_read_frame_init +#define frame_bitrate INT123_frame_bitrate +#define frame_freq INT123_frame_freq +#define read_frame_recover INT123_read_frame_recover +#define read_frame INT123_read_frame +#define set_pointer INT123_set_pointer +#define position_info INT123_position_info +#define compute_bpf INT123_compute_bpf +#define time_to_frame INT123_time_to_frame +#define get_songlen INT123_get_songlen +#define bc_prepare INT123_bc_prepare +#define bc_cleanup INT123_bc_cleanup +#define bc_poolsize INT123_bc_poolsize +#define bc_fill INT123_bc_fill +#define open_stream INT123_open_stream +#define open_stream_handle INT123_open_stream_handle +#define open_feed INT123_open_feed +#define feed_more INT123_feed_more +#define feed_forget INT123_feed_forget +#define feed_set_pos INT123_feed_set_pos +#define open_bad INT123_open_bad +#define open_module INT123_open_module +#define close_module INT123_close_module +#define list_modules INT123_list_modules +#define buffer_init INT123_buffer_init +#define buffer_exit INT123_buffer_exit +#define buffer_sync_param INT123_buffer_sync_param +#define buffer_open INT123_buffer_open +#define buffer_encodings INT123_buffer_encodings +#define buffer_formats INT123_buffer_formats +#define buffer_start INT123_buffer_start +#define buffer_ndrain INT123_buffer_ndrain +#define buffer_stop INT123_buffer_stop +#define buffer_close INT123_buffer_close +#define buffer_continue INT123_buffer_continue +#define buffer_ignore_lowmem INT123_buffer_ignore_lowmem +#define buffer_drain INT123_buffer_drain +#define buffer_end INT123_buffer_end +#define buffer_pause INT123_buffer_pause +#define buffer_drop INT123_buffer_drop +#define buffer_write INT123_buffer_write +#define buffer_fill INT123_buffer_fill +#define read_buf INT123_read_buf +#define xfer_write_string INT123_xfer_write_string +#define xfer_read_string INT123_xfer_read_string +#define xfermem_init INT123_xfermem_init +#define xfermem_init_writer INT123_xfermem_init_writer +#define xfermem_init_reader INT123_xfermem_init_reader +#define xfermem_get_freespace INT123_xfermem_get_freespace +#define xfermem_get_usedspace INT123_xfermem_get_usedspace +#define xfermem_getcmd INT123_xfermem_getcmd +#define xfermem_getcmds INT123_xfermem_getcmds +#define xfermem_putcmd INT123_xfermem_putcmd +#define xfermem_writer_block INT123_xfermem_writer_block +#define xfermem_write INT123_xfermem_write +#define xfermem_done INT123_xfermem_done +#define au_open INT123_au_open +#define cdr_open INT123_cdr_open +#define raw_open INT123_raw_open +#define wav_open INT123_wav_open +#define wav_write INT123_wav_write +#define wav_close INT123_wav_close +#define au_close INT123_au_close +#define raw_close INT123_raw_close +#define cdr_formats INT123_cdr_formats +#define au_formats INT123_au_formats +#define raw_formats INT123_raw_formats +#define wav_formats INT123_wav_formats +#define wav_drain INT123_wav_drain +#define write_parameters INT123_write_parameters +#define read_parameters INT123_read_parameters +#define stringlists_add INT123_stringlists_add +#define check_neon INT123_check_neon +#define dct64_3dnow INT123_dct64_3dnow +#define dct64_3dnowext INT123_dct64_3dnowext +#define dct64_avx INT123_dct64_avx +#define dct64_real_avx INT123_dct64_real_avx +#define dct64_mmx INT123_dct64_mmx +#define dct64_MMX INT123_dct64_MMX +#define dct64_neon INT123_dct64_neon +#define dct64_neon64 INT123_dct64_neon64 +#define dct64_real_neon64 INT123_dct64_real_neon64 +#define dct64_real_neon INT123_dct64_real_neon +#define dct64_sse INT123_dct64_sse +#define dct64_real_sse INT123_dct64_real_sse +#define dct64_x86_64 INT123_dct64_x86_64 +#define dct64_real_x86_64 INT123_dct64_real_x86_64 +#define do_equalizer_3dnow INT123_do_equalizer_3dnow +#define synth_1to1_3dnow_asm INT123_synth_1to1_3dnow_asm +#define synth_1to1_arm_asm INT123_synth_1to1_arm_asm +#define synth_1to1_arm_accurate_asm INT123_synth_1to1_arm_accurate_asm +#define synth_1to1_i586_asm INT123_synth_1to1_i586_asm +#define synth_1to1_i586_asm_dither INT123_synth_1to1_i586_asm_dither +#define synth_1to1_MMX INT123_synth_1to1_MMX +#define synth_1to1_neon_asm INT123_synth_1to1_neon_asm +#define synth_1to1_neon64_asm INT123_synth_1to1_neon64_asm +#define synth_1to1_neon64_accurate_asm INT123_synth_1to1_neon64_accurate_asm +#define synth_1to1_real_neon64_asm INT123_synth_1to1_real_neon64_asm +#define synth_1to1_s32_neon64_asm INT123_synth_1to1_s32_neon64_asm +#define synth_1to1_neon_accurate_asm INT123_synth_1to1_neon_accurate_asm +#define synth_1to1_real_neon_asm INT123_synth_1to1_real_neon_asm +#define synth_1to1_s32_neon_asm INT123_synth_1to1_s32_neon_asm +#define synth_1to1_sse_accurate_asm INT123_synth_1to1_sse_accurate_asm +#define synth_1to1_real_sse_asm INT123_synth_1to1_real_sse_asm +#define synth_1to1_s32_sse_asm INT123_synth_1to1_s32_sse_asm +#define synth_1to1_s_avx_asm INT123_synth_1to1_s_avx_asm +#define synth_1to1_s_avx_accurate_asm INT123_synth_1to1_s_avx_accurate_asm +#define synth_1to1_real_s_avx_asm INT123_synth_1to1_real_s_avx_asm +#define synth_1to1_s32_s_avx_asm INT123_synth_1to1_s32_s_avx_asm +#define synth_1to1_s_neon_asm INT123_synth_1to1_s_neon_asm +#define synth_1to1_s_neon64_asm INT123_synth_1to1_s_neon64_asm +#define synth_1to1_s_neon64_accurate_asm INT123_synth_1to1_s_neon64_accurate_asm +#define synth_1to1_real_s_neon64_asm INT123_synth_1to1_real_s_neon64_asm +#define synth_1to1_s32_s_neon64_asm INT123_synth_1to1_s32_s_neon64_asm +#define synth_1to1_s_neon_accurate_asm INT123_synth_1to1_s_neon_accurate_asm +#define synth_1to1_real_s_neon_asm INT123_synth_1to1_real_s_neon_asm +#define synth_1to1_s32_s_neon_asm INT123_synth_1to1_s32_s_neon_asm +#define synth_1to1_s_sse_accurate_asm INT123_synth_1to1_s_sse_accurate_asm +#define synth_1to1_real_s_sse_asm INT123_synth_1to1_real_s_sse_asm +#define synth_1to1_s32_s_sse_asm INT123_synth_1to1_s32_s_sse_asm +#define synth_1to1_s_x86_64_asm INT123_synth_1to1_s_x86_64_asm +#define synth_1to1_s_x86_64_accurate_asm INT123_synth_1to1_s_x86_64_accurate_asm +#define synth_1to1_real_s_x86_64_asm INT123_synth_1to1_real_s_x86_64_asm +#define synth_1to1_s32_s_x86_64_asm INT123_synth_1to1_s32_s_x86_64_asm +#define synth_1to1_x86_64_asm INT123_synth_1to1_x86_64_asm +#define synth_1to1_x86_64_accurate_asm INT123_synth_1to1_x86_64_accurate_asm +#define synth_1to1_real_x86_64_asm INT123_synth_1to1_real_x86_64_asm +#define synth_1to1_s32_x86_64_asm INT123_synth_1to1_s32_x86_64_asm +#define costab_mmxsse INT123_costab_mmxsse +#define make_decode_tables_mmx_asm INT123_make_decode_tables_mmx_asm +#ifndef HAVE_STRERROR +#define strerror INT123_strerror +#endif +#endif diff --git a/src/libmpg123/Makemodule.am b/src/libmpg123/Makemodule.am new file mode 100644 index 0000000..91dfaa3 --- /dev/null +++ b/src/libmpg123/Makemodule.am @@ -0,0 +1,193 @@ +# Module for non-recursive mpg123 build system. + +EXTRA_DIST += src/libmpg123/mpg123.h.in + +EXTRA_PROGRAMS += src/libmpg123/testcpu +src_libmpg123_testcpu_DEPENDENCIES = src/libmpg123/getcpuflags.$(OBJEXT) +src_libmpg123_testcpu_SOURCES = src/libmpg123/testcpu.c +src_libmpg123_testcpu_LDADD = \ + src/compat/libcompat.la \ + src/libmpg123/getcpuflags.$(OBJEXT) + +# Necessary? +CLEANFILES += src/libmpg123/*.a + +lib_LTLIBRARIES += src/libmpg123/libmpg123.la +nodist_include_HEADERS += src/libmpg123/mpg123.h +include_HEADERS += src/libmpg123/fmt123.h + +src_libmpg123_libmpg123_la_LDFLAGS = \ + -no-undefined \ + -version-info @LIBMPG123_VERSION@ \ + -export-symbols-regex '^mpg123_' +src_libmpg123_libmpg123_la_LIBADD = \ + src/compat/libcompat.la \ + @DECODER_LOBJ@ @LFS_LOBJ@ @LIBS@ +src_libmpg123_libmpg123_la_DEPENDENCIES = \ + src/compat/libcompat.la \ + @DECODER_LOBJ@ @LFS_LOBJ@ + +src_libmpg123_libmpg123_la_SOURCES = \ + src/libmpg123/fmt123.h \ + src/libmpg123/mpeghead.h \ + src/libmpg123/parse.c \ + src/libmpg123/parse.h \ + src/libmpg123/frame.c \ + src/libmpg123/format.c \ + src/libmpg123/frame.h \ + src/libmpg123/reader.h \ + src/libmpg123/debug.h \ + src/libmpg123/decode.h \ + src/libmpg123/sample.h \ + src/libmpg123/dct64.c \ + src/libmpg123/synth.h \ + src/libmpg123/synth_mono.h \ + src/libmpg123/synth_ntom.h \ + src/libmpg123/synth_8bit.h \ + src/libmpg123/synths.h \ + src/libmpg123/equalizer.c \ + src/libmpg123/huffman.h \ + src/libmpg123/newhuffman.h \ + src/libmpg123/icy.h \ + src/libmpg123/icy2utf8.h \ + src/libmpg123/id3.h \ + src/libmpg123/id3.c \ + src/libmpg123/true.h \ + src/libmpg123/getbits.h \ + src/libmpg123/optimize.h \ + src/libmpg123/optimize.c \ + src/libmpg123/readers.c \ + src/libmpg123/tabinit.c \ + src/libmpg123/libmpg123.c \ + src/libmpg123/gapless.h \ + src/libmpg123/mpg123lib_intern.h \ + src/libmpg123/abi_align.h \ + src/libmpg123/mangle.h \ + src/libmpg123/getcpuflags.h \ + src/libmpg123/index.h \ + src/libmpg123/index.c + +EXTRA_src_libmpg123_libmpg123_la_SOURCES = \ + src/libmpg123/lfs_alias.c \ + src/libmpg123/lfs_wrap.c \ + src/libmpg123/icy.c \ + src/libmpg123/icy2utf8.c \ + src/libmpg123/l2tables.h \ + src/libmpg123/layer1.c \ + src/libmpg123/layer2.c \ + src/libmpg123/layer3.c \ + src/libmpg123/dither.h \ + src/libmpg123/dither_impl.h \ + src/libmpg123/dither.c \ + src/libmpg123/feature.c \ + src/libmpg123/dct36_3dnowext.S \ + src/libmpg123/dct36_3dnow.S \ + src/libmpg123/dct36_sse.S \ + src/libmpg123/dct36_x86_64.S \ + src/libmpg123/dct36_avx.S \ + src/libmpg123/dct36_neon.S \ + src/libmpg123/dct36_neon64.S \ + src/libmpg123/dct64_3dnowext.S \ + src/libmpg123/dct64_3dnow.S \ + src/libmpg123/dct64_altivec.c \ + src/libmpg123/dct64_i386.c \ + src/libmpg123/dct64_i486.c \ + src/libmpg123/dct64_mmx.S \ + src/libmpg123/dct64_sse.S \ + src/libmpg123/dct64_sse_float.S \ + src/libmpg123/dct64_x86_64.S \ + src/libmpg123/dct64_x86_64_float.S \ + src/libmpg123/dct64_neon.S \ + src/libmpg123/dct64_neon_float.S \ + src/libmpg123/dct64_neon64.S \ + src/libmpg123/dct64_neon64_float.S \ + src/libmpg123/dct64_avx.S \ + src/libmpg123/dct64_avx_float.S \ + src/libmpg123/synth_3dnowext.S \ + src/libmpg123/synth_3dnow.S \ + src/libmpg123/synth_altivec.c \ + src/libmpg123/synth_i486.c \ + src/libmpg123/synth_i586_dither.S \ + src/libmpg123/synth_i586.S \ + src/libmpg123/synth_mmx.S \ + src/libmpg123/synth_sse3d.h \ + src/libmpg123/synth_sse.S \ + src/libmpg123/synth_sse_float.S \ + src/libmpg123/synth_sse_s32.S \ + src/libmpg123/synth_sse_accurate.S \ + src/libmpg123/synth_stereo_sse_float.S \ + src/libmpg123/synth_stereo_sse_s32.S \ + src/libmpg123/synth_stereo_sse_accurate.S \ + src/libmpg123/synth_x86_64.S \ + src/libmpg123/synth_x86_64_float.S \ + src/libmpg123/synth_x86_64_s32.S \ + src/libmpg123/synth_x86_64_accurate.S \ + src/libmpg123/synth_stereo_x86_64.S \ + src/libmpg123/synth_stereo_x86_64_float.S \ + src/libmpg123/synth_stereo_x86_64_s32.S \ + src/libmpg123/synth_stereo_x86_64_accurate.S \ + src/libmpg123/synth_arm.S \ + src/libmpg123/synth_arm_accurate.S \ + src/libmpg123/synth_neon.S \ + src/libmpg123/synth_neon_float.S \ + src/libmpg123/synth_neon_s32.S \ + src/libmpg123/synth_neon_accurate.S \ + src/libmpg123/synth_stereo_neon.S \ + src/libmpg123/synth_stereo_neon_float.S \ + src/libmpg123/synth_stereo_neon_s32.S \ + src/libmpg123/synth_stereo_neon_accurate.S \ + src/libmpg123/synth_neon64.S \ + src/libmpg123/synth_neon64_float.S \ + src/libmpg123/synth_neon64_s32.S \ + src/libmpg123/synth_neon64_accurate.S \ + src/libmpg123/synth_stereo_neon64.S \ + src/libmpg123/synth_stereo_neon64_float.S \ + src/libmpg123/synth_stereo_neon64_s32.S \ + src/libmpg123/synth_stereo_neon64_accurate.S \ + src/libmpg123/synth_stereo_avx.S \ + src/libmpg123/synth_stereo_avx_float.S \ + src/libmpg123/synth_stereo_avx_s32.S \ + src/libmpg123/synth_stereo_avx_accurate.S \ + src/libmpg123/ntom.c \ + src/libmpg123/synth.c \ + src/libmpg123/synth_8bit.c \ + src/libmpg123/synth_real.c \ + src/libmpg123/synth_s32.c \ + src/libmpg123/equalizer_3dnow.S \ + src/libmpg123/tabinit_mmx.S \ + src/libmpg123/stringbuf.c \ + src/libmpg123/getcpuflags.S \ + src/libmpg123/getcpuflags_x86_64.S \ + src/libmpg123/getcpuflags_arm.c \ + src/libmpg123/check_neon.S \ + src/libmpg123/l12_integer_tables.h \ + src/libmpg123/l3_integer_tables.h + +if USE_YASM_FOR_AVX +## Override rules for the sources that should be assembled with yasm + +AVX_SRCS = \ + src/libmpg123/dct36_avx.S \ + src/libmpg123/dct64_avx.S \ + src/libmpg123/dct64_avx_float.S \ + src/libmpg123/synth_stereo_avx.S \ + src/libmpg123/synth_stereo_avx_float.S \ + src/libmpg123/synth_stereo_avx_s32.S \ + src/libmpg123/synth_stereo_avx_accurate.S + +AVX_OBJS = $(AVX_SRCS:.S=.@OBJEXT@) + +ASM_DEPS = \ + src/libmpg123/mangle.h \ + $(top_builddir)/src/config.h \ + src/intsym.h + +$(AVX_OBJS): %.@OBJEXT@: %.S $(ASM_DEPS) + $(CPP) $(DEFAULT_INCLUDES) $(INCLUDES) -DASMALIGN_BALIGN $< | @YASM@ - @YASMFLAGS@ @YASM_FORMAT@ -o $@ + +$(AVX_OBJS:.@OBJEXT@=.lo): %.lo: %.@OBJEXT@ + @echo "# Generated by ltmain.sh (GNU libtool)" >$@ + @echo "pic_object='`basename $<`'" >>$@ + @echo "non_pic_object='`basename $<`'" >>$@ + +endif diff --git a/src/libmpg123/abi_align.h b/src/libmpg123/abi_align.h new file mode 100644 index 0000000..9ae46f4 --- /dev/null +++ b/src/libmpg123/abi_align.h @@ -0,0 +1,41 @@ +/* + abi_align: An attempt to avoid breakage because of mixing + compilers with different alignment. + + copyright 1995-2015 by the mpg123 project + free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + There used to be code that checks alignment, but it did not really + work anyway. The only straw we have is putting that alignment + attribute to API functions. +*/ + +#ifndef MPG123_H_ABI_ALIGN +#define MPG123_H_ABI_ALIGN + +#include "config.h" + +/* ABI conformance for other compilers. + mpg123 needs 16byte-aligned (or more) stack for SSE and friends. + gcc provides that, but others don't necessarily. */ +#ifdef ABI_ALIGN_FUN + +#ifndef attribute_align_arg + +#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1) +# define attribute_align_arg __attribute__((force_align_arg_pointer)) +/* The gcc that can align the stack does not need the check... nor does it work with gcc 4.3+, anyway. */ +#else +# define attribute_align_arg +#endif + +#endif /* attribute_align_arg */ + +#else /* ABI_ALIGN_FUN */ + +#define attribute_align_arg + +#endif /* ABI_ALIGN_FUN */ + +#endif /* MPG123_H_ABI_ALIGN */ diff --git a/src/libmpg123/check_neon.S b/src/libmpg123/check_neon.S new file mode 100644 index 0000000..7c76904 --- /dev/null +++ b/src/libmpg123/check_neon.S @@ -0,0 +1,35 @@ +/* + check_neon: check NEON availability + + copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Momma +*/ + +#include "mangle.h" + +#ifndef __aarch64__ +#ifndef _M_ARM + .code 32 +#endif +#ifndef __APPLE__ + .fpu neon +#endif +#endif + + .text + GLOBAL_SYMBOL ASM_NAME(check_neon) +#ifdef __ELF__ + .type ASM_NAME(check_neon), %function +#endif + ALIGN4 +ASM_NAME(check_neon): +#ifdef __aarch64__ + orr v0.16b, v0.16b, v0.16b + ret +#else + vorr d0, d0, d0 + bx lr +#endif + +NONEXEC_STACK diff --git a/src/libmpg123/dct36_3dnow.S b/src/libmpg123/dct36_3dnow.S new file mode 100644 index 0000000..2d45dc0 --- /dev/null +++ b/src/libmpg123/dct36_3dnow.S @@ -0,0 +1,560 @@ +/* + dct64_3dnow.s: Replacement of dct36() with AMD's 3DNow! SIMD operations support + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Syuuhei Kashiyama + + This code based 'dct36_3dnow.s' by Syuuhei Kashiyama + ,only two types of changes have been made: + + - remove PREFETCH instruction for speedup + - change function name for support 3DNow! automatic detect + + You can find Kashiyama's original 3dnow! support patch + (for mpg123-0.59o) at + http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese). + + by KIMURA Takuhiro - until 31.Mar.1999 + - after 1.Apr.1999 + + Replacement of dct36() with AMD's 3DNow! SIMD operations support + + Syuuhei Kashiyama + + The author of this program disclaim whole expressed or implied + warranties with regard to this program, and in no event shall the + author of this program liable to whatever resulted from the use of + this program. Use it at your own risk. +*/ + +#include "mangle.h" + + .globl ASM_NAME(dct36_3dnow) +/* .type ASM_NAME(dct36_3dnow),@function */ +ASM_NAME(dct36_3dnow): + pushl %ebp + movl %esp,%ebp +#if defined(PIC) && defined(__APPLE__) + sub $4,%esp +#endif + pushl %esi + pushl %ebx + + #undef _EBX_ + #define _EBX_ %edi + PREPARE_GOT + GET_GOT +#if defined(PIC) && defined(__APPLE__) + #define _COS9_ 0(%edi) + #define _tfcos36_ 0(%eax) + mov GLOBAL_VAR_PTR(tfcos36), %eax + mov GLOBAL_VAR_PTR(COS9), %edi + mov %eax, -4(%ebp) +#else + #define _COS9_ GLOBAL_VAR(COS9) + #define _tfcos36_ GLOBAL_VAR(tfcos36) +#endif + + movl 8(%ebp),%eax + movl 12(%ebp),%esi + movl 16(%ebp),%ecx + movl 20(%ebp),%edx + movl 24(%ebp),%ebx + + femms + movq (%eax),%mm0 + movq 4(%eax),%mm1 + pfadd %mm1,%mm0 + movq %mm0,4(%eax) + psrlq $32,%mm1 + movq 12(%eax),%mm2 + punpckldq %mm2,%mm1 + pfadd %mm2,%mm1 + movq %mm1,12(%eax) + psrlq $32,%mm2 + movq 20(%eax),%mm3 + punpckldq %mm3,%mm2 + pfadd %mm3,%mm2 + movq %mm2,20(%eax) + psrlq $32,%mm3 + movq 28(%eax),%mm4 + punpckldq %mm4,%mm3 + pfadd %mm4,%mm3 + movq %mm3,28(%eax) + psrlq $32,%mm4 + movq 36(%eax),%mm5 + punpckldq %mm5,%mm4 + pfadd %mm5,%mm4 + movq %mm4,36(%eax) + psrlq $32,%mm5 + movq 44(%eax),%mm6 + punpckldq %mm6,%mm5 + pfadd %mm6,%mm5 + movq %mm5,44(%eax) + psrlq $32,%mm6 + movq 52(%eax),%mm7 + punpckldq %mm7,%mm6 + pfadd %mm7,%mm6 + movq %mm6,52(%eax) + psrlq $32,%mm7 + movq 60(%eax),%mm0 + punpckldq %mm0,%mm7 + pfadd %mm0,%mm7 + movq %mm7,60(%eax) + psrlq $32,%mm0 + movd 68(%eax),%mm1 + pfadd %mm1,%mm0 + movd %mm0,68(%eax) + movd 4(%eax),%mm0 + movd 12(%eax),%mm1 + punpckldq %mm1,%mm0 + punpckldq 20(%eax),%mm1 + pfadd %mm1,%mm0 + movd %mm0,12(%eax) + psrlq $32,%mm0 + movd %mm0,20(%eax) + psrlq $32,%mm1 + movd 28(%eax),%mm2 + punpckldq %mm2,%mm1 + punpckldq 36(%eax),%mm2 + pfadd %mm2,%mm1 + movd %mm1,28(%eax) + psrlq $32,%mm1 + movd %mm1,36(%eax) + psrlq $32,%mm2 + movd 44(%eax),%mm3 + punpckldq %mm3,%mm2 + punpckldq 52(%eax),%mm3 + pfadd %mm3,%mm2 + movd %mm2,44(%eax) + psrlq $32,%mm2 + movd %mm2,52(%eax) + psrlq $32,%mm3 + movd 60(%eax),%mm4 + punpckldq %mm4,%mm3 + punpckldq 68(%eax),%mm4 + pfadd %mm4,%mm3 + movd %mm3,60(%eax) + psrlq $32,%mm3 + movd %mm3,68(%eax) + + movq 24(%eax),%mm0 + movq 48(%eax),%mm1 + movd 12+_COS9_,%mm2 + punpckldq %mm2,%mm2 + movd 24+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm2,%mm0 + pfmul %mm3,%mm1 + pushl %eax + movl $1,%eax + movd %eax,%mm7 + pi2fd %mm7,%mm7 + popl %eax + movq 8(%eax),%mm2 + movd 4+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfadd %mm0,%mm2 + movq 40(%eax),%mm3 + movd 20+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq 56(%eax),%mm3 + movd 28+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd 8+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq 32(%eax),%mm4 + movd 16+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd 32+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 0+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 108(%edx),%mm6 + punpckldq 104(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,36(%ecx) + psrlq $32,%mm5 + movd %mm5,32(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 32(%edx),%mm6 + punpckldq 36(%edx),%mm6 + pfmul %mm6,%mm5 + movd 32(%esi),%mm6 + punpckldq 36(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,1024(%ebx) + psrlq $32,%mm5 + movd %mm5,1152(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq 32+_tfcos36_,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov 8(%ebp),%eax +#endif + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 140(%edx),%mm6 + punpckldq 72(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,68(%ecx) + psrlq $32,%mm5 + movd %mm5,0(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 0(%edx),%mm6 + punpckldq 68(%edx),%mm6 + pfmul %mm6,%mm5 + movd 0(%esi),%mm6 + punpckldq 68(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,0(%ebx) + psrlq $32,%mm5 + movd %mm5,2176(%ebx) + movq 8(%eax),%mm2 + movq 40(%eax),%mm3 + pfsub %mm3,%mm2 + movq 56(%eax),%mm3 + pfsub %mm3,%mm2 + movd 12+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + movq 16(%eax),%mm3 + movq 32(%eax),%mm4 + pfsub %mm4,%mm3 + movq 64(%eax),%mm4 + pfsub %mm4,%mm3 + movd 24+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + movq 48(%eax),%mm4 + pfsub %mm4,%mm3 + movq (%eax),%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 4+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 112(%edx),%mm6 + punpckldq 100(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,40(%ecx) + psrlq $32,%mm5 + movd %mm5,28(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 28(%edx),%mm6 + punpckldq 40(%edx),%mm6 + pfmul %mm6,%mm5 + movd 28(%esi),%mm6 + punpckldq 40(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,896(%ebx) + psrlq $32,%mm5 + movd %mm5,1280(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq 28+_tfcos36_,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov 8(%ebp),%eax +#endif + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 136(%edx),%mm6 + punpckldq 76(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,64(%ecx) + psrlq $32,%mm5 + movd %mm5,4(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 4(%edx),%mm6 + punpckldq 64(%edx),%mm6 + pfmul %mm6,%mm5 + movd 4(%esi),%mm6 + punpckldq 64(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,128(%ebx) + psrlq $32,%mm5 + movd %mm5,2048(%ebx) + + movq 8(%eax),%mm2 + movd 20+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfsub %mm0,%mm2 + movq 40(%eax),%mm3 + movd 28+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfsub %mm3,%mm2 + movq 56(%eax),%mm3 + movd 4+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd 32+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq 32(%eax),%mm4 + movd 8+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd 16+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 8+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 116(%edx),%mm6 + punpckldq 96(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,44(%ecx) + psrlq $32,%mm5 + movd %mm5,24(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 24(%edx),%mm6 + punpckldq 44(%edx),%mm6 + pfmul %mm6,%mm5 + movd 24(%esi),%mm6 + punpckldq 44(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,768(%ebx) + psrlq $32,%mm5 + movd %mm5,1408(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq 24+_tfcos36_,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov 8(%ebp),%eax +#endif + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 132(%edx),%mm6 + punpckldq 80(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,60(%ecx) + psrlq $32,%mm5 + movd %mm5,8(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 8(%edx),%mm6 + punpckldq 60(%edx),%mm6 + pfmul %mm6,%mm5 + movd 8(%esi),%mm6 + punpckldq 60(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,256(%ebx) + psrlq $32,%mm5 + movd %mm5,1920(%ebx) + movq 8(%eax),%mm2 + movd 28+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfsub %mm0,%mm2 + movq 40(%eax),%mm3 + movd 4+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq 56(%eax),%mm3 + movd 20+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfsub %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd 16+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq 32(%eax),%mm4 + movd 32+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd 8+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 12+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 120(%edx),%mm6 + punpckldq 92(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,48(%ecx) + psrlq $32,%mm5 + movd %mm5,20(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 20(%edx),%mm6 + punpckldq 48(%edx),%mm6 + pfmul %mm6,%mm5 + movd 20(%esi),%mm6 + punpckldq 48(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,640(%ebx) + psrlq $32,%mm5 + movd %mm5,1536(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq 20+_tfcos36_,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov 8(%ebp),%eax +#endif + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 128(%edx),%mm6 + punpckldq 84(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,56(%ecx) + psrlq $32,%mm5 + movd %mm5,12(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 12(%edx),%mm6 + punpckldq 56(%edx),%mm6 + pfmul %mm6,%mm5 + movd 12(%esi),%mm6 + punpckldq 56(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,384(%ebx) + psrlq $32,%mm5 + movd %mm5,1792(%ebx) + + movq (%eax),%mm4 + movq 16(%eax),%mm3 + pfsub %mm3,%mm4 + movq 32(%eax),%mm3 + pfadd %mm3,%mm4 + movq 48(%eax),%mm3 + pfsub %mm3,%mm4 + movq 64(%eax),%mm3 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 16+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 124(%edx),%mm6 + punpckldq 88(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,52(%ecx) + psrlq $32,%mm5 + movd %mm5,16(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 16(%edx),%mm6 + punpckldq 52(%edx),%mm6 + pfmul %mm6,%mm5 + movd 16(%esi),%mm6 + punpckldq 52(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,512(%ebx) + psrlq $32,%mm5 + movd %mm5,1664(%ebx) + + femms + RESTORE_GOT + popl %ebx + popl %esi + movl %ebp,%esp + popl %ebp + ret + +#if defined(PIC) && defined(__APPLE__) + .section __IMPORT,__pointers,non_lazy_symbol_pointers +L_tfcos36: + .indirect_symbol ASM_NAME(tfcos36) + .long 0 +L_COS9: + .indirect_symbol ASM_NAME(COS9) + .long 0 +#endif + +NONEXEC_STACK diff --git a/src/libmpg123/dct36_3dnowext.S b/src/libmpg123/dct36_3dnowext.S new file mode 100644 index 0000000..287b6b9 --- /dev/null +++ b/src/libmpg123/dct36_3dnowext.S @@ -0,0 +1,570 @@ +/* + dct36_3dnowext: extended 3DNow optimized DCT36 + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + Transformed back into standalone asm, with help of + gcc -S -DHAVE_CONFIG_H -I. -march=k6-3 -O3 -Wall -pedantic -fno-strict-aliasing -DREAL_IS_FLOAT -c -o dct36_3dnowext.{S,c} + + MPlayer comment follows. +*/ + +/* + * dct36_3dnow.c - 3DNow! optimized dct36() + * + * This code based 'dct36_3dnow.s' by Syuuhei Kashiyama + * , only two types of changes have been made: + * + * - removed PREFETCH instruction for speedup + * - changed function name for support 3DNow! automatic detection + * + * You can find Kashiyama's original 3dnow! support patch + * (for mpg123-0.59o) at + * http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese). + * + * by KIMURA Takuhiro - until 31.Mar.1999 + * - after 1.Apr.1999 + * + * Modified for use with MPlayer, for details see the changelog at + * http://svn.mplayerhq.hu/mplayer/trunk/ + * $Id: dct36_3dnow.c 18786 2006-06-22 13:34:00Z diego $ + * + * Original disclaimer: + * The author of this program disclaim whole expressed or implied + * warranties with regard to this program, and in no event shall the + * author of this program liable to whatever resulted from the use of + * this program. Use it at your own risk. + * + * 2003/06/21: Moved to GCC inline assembly - Alex Beregszaszi + */ + +#include "mangle.h" + + .text + ALIGN32 +.globl ASM_NAME(dct36_3dnowext) + /* .type ASM_NAME(dct36_3dnowext), @function */ +ASM_NAME(dct36_3dnowext): + pushl %ebp + movl %esp, %ebp +#if defined(PIC) && defined(__APPLE__) + sub $4, %esp +#endif + pushl %esi + pushl %ebx + + #undef _EBX_ + #define _EBX_ %edi + PREPARE_GOT + GET_GOT +#if defined(PIC) && defined(__APPLE__) + #define _COS9_ 0(%edi) + #define _tfcos36_ 0(%eax) + mov GLOBAL_VAR_PTR(tfcos36), %eax + mov GLOBAL_VAR_PTR(COS9), %edi + mov %eax, -4(%ebp) +#else + #define _COS9_ GLOBAL_VAR(COS9) + #define _tfcos36_ GLOBAL_VAR(tfcos36) +#endif + + movl 8(%ebp), %eax + movl 12(%ebp), %esi + movl 16(%ebp), %ecx + movl 20(%ebp), %edx + movl 24(%ebp), %ebx +/* APP */ + movq (%eax),%mm0 + movq 4(%eax),%mm1 + pfadd %mm1,%mm0 + movq %mm0,4(%eax) + psrlq $32,%mm1 + movq 12(%eax),%mm2 + punpckldq %mm2,%mm1 + pfadd %mm2,%mm1 + movq %mm1,12(%eax) + psrlq $32,%mm2 + movq 20(%eax),%mm3 + punpckldq %mm3,%mm2 + pfadd %mm3,%mm2 + movq %mm2,20(%eax) + psrlq $32,%mm3 + movq 28(%eax),%mm4 + punpckldq %mm4,%mm3 + pfadd %mm4,%mm3 + movq %mm3,28(%eax) + psrlq $32,%mm4 + movq 36(%eax),%mm5 + punpckldq %mm5,%mm4 + pfadd %mm5,%mm4 + movq %mm4,36(%eax) + psrlq $32,%mm5 + movq 44(%eax),%mm6 + punpckldq %mm6,%mm5 + pfadd %mm6,%mm5 + movq %mm5,44(%eax) + psrlq $32,%mm6 + movq 52(%eax),%mm7 + punpckldq %mm7,%mm6 + pfadd %mm7,%mm6 + movq %mm6,52(%eax) + psrlq $32,%mm7 + movq 60(%eax),%mm0 + punpckldq %mm0,%mm7 + pfadd %mm0,%mm7 + movq %mm7,60(%eax) + psrlq $32,%mm0 + movd 68(%eax),%mm1 + pfadd %mm1,%mm0 + movd %mm0,68(%eax) + movd 4(%eax),%mm0 + movd 12(%eax),%mm1 + punpckldq %mm1,%mm0 + punpckldq 20(%eax),%mm1 + pfadd %mm1,%mm0 + movd %mm0,12(%eax) + psrlq $32,%mm0 + movd %mm0,20(%eax) + psrlq $32,%mm1 + movd 28(%eax),%mm2 + punpckldq %mm2,%mm1 + punpckldq 36(%eax),%mm2 + pfadd %mm2,%mm1 + movd %mm1,28(%eax) + psrlq $32,%mm1 + movd %mm1,36(%eax) + psrlq $32,%mm2 + movd 44(%eax),%mm3 + punpckldq %mm3,%mm2 + punpckldq 52(%eax),%mm3 + pfadd %mm3,%mm2 + movd %mm2,44(%eax) + psrlq $32,%mm2 + movd %mm2,52(%eax) + psrlq $32,%mm3 + movd 60(%eax),%mm4 + punpckldq %mm4,%mm3 + punpckldq 68(%eax),%mm4 + pfadd %mm4,%mm3 + movd %mm3,60(%eax) + psrlq $32,%mm3 + movd %mm3,68(%eax) + movq 24(%eax),%mm0 + movq 48(%eax),%mm1 + movd 12+_COS9_,%mm2 + punpckldq %mm2,%mm2 + movd 24+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm2,%mm0 + pfmul %mm3,%mm1 + pushl %eax + movl $1,%eax + movd %eax,%mm7 + pi2fd %mm7,%mm7 + popl %eax + movq 8(%eax),%mm2 + movd 4+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfadd %mm0,%mm2 + movq 40(%eax),%mm3 + movd 20+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq 56(%eax),%mm3 + movd 28+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd 8+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq 32(%eax),%mm4 + movd 16+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd 32+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 0+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 108(%edx),%mm6 + punpckldq 104(%edx),%mm6 + pfmul %mm6,%mm5 + pswapd %mm5,%mm5 + movq %mm5,32(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 32(%edx),%mm6 + punpckldq 36(%edx),%mm6 + pfmul %mm6,%mm5 + movd 32(%esi),%mm6 + punpckldq 36(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,1024(%ebx) + psrlq $32,%mm5 + movd %mm5,1152(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq 32+_tfcos36_,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov 8(%ebp),%eax +#endif + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 140(%edx),%mm6 + punpckldq 72(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,68(%ecx) + psrlq $32,%mm5 + movd %mm5,0(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 0(%edx),%mm6 + punpckldq 68(%edx),%mm6 + pfmul %mm6,%mm5 + movd 0(%esi),%mm6 + punpckldq 68(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,0(%ebx) + psrlq $32,%mm5 + movd %mm5,2176(%ebx) + movq 8(%eax),%mm2 + movq 40(%eax),%mm3 + pfsub %mm3,%mm2 + movq 56(%eax),%mm3 + pfsub %mm3,%mm2 + movd 12+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + movq 16(%eax),%mm3 + movq 32(%eax),%mm4 + pfsub %mm4,%mm3 + movq 64(%eax),%mm4 + pfsub %mm4,%mm3 + movd 24+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + movq 48(%eax),%mm4 + pfsub %mm4,%mm3 + movq (%eax),%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 4+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 112(%edx),%mm6 + punpckldq 100(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,40(%ecx) + psrlq $32,%mm5 + movd %mm5,28(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 28(%edx),%mm6 + punpckldq 40(%edx),%mm6 + pfmul %mm6,%mm5 + movd 28(%esi),%mm6 + punpckldq 40(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,896(%ebx) + psrlq $32,%mm5 + movd %mm5,1280(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq 28+_tfcos36_,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov 8(%ebp),%eax +#endif + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 136(%edx),%mm6 + punpckldq 76(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,64(%ecx) + psrlq $32,%mm5 + movd %mm5,4(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 4(%edx),%mm6 + punpckldq 64(%edx),%mm6 + pfmul %mm6,%mm5 + movd 4(%esi),%mm6 + punpckldq 64(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,128(%ebx) + psrlq $32,%mm5 + movd %mm5,2048(%ebx) + movq 8(%eax),%mm2 + movd 20+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfsub %mm0,%mm2 + movq 40(%eax),%mm3 + movd 28+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfsub %mm3,%mm2 + movq 56(%eax),%mm3 + movd 4+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd 32+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq 32(%eax),%mm4 + movd 8+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd 16+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 8+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 116(%edx),%mm6 + punpckldq 96(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,44(%ecx) + psrlq $32,%mm5 + movd %mm5,24(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 24(%edx),%mm6 + punpckldq 44(%edx),%mm6 + pfmul %mm6,%mm5 + movd 24(%esi),%mm6 + punpckldq 44(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,768(%ebx) + psrlq $32,%mm5 + movd %mm5,1408(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq 24+_tfcos36_,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov 8(%ebp),%eax +#endif + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 132(%edx),%mm6 + punpckldq 80(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,60(%ecx) + psrlq $32,%mm5 + movd %mm5,8(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 8(%edx),%mm6 + punpckldq 60(%edx),%mm6 + pfmul %mm6,%mm5 + movd 8(%esi),%mm6 + punpckldq 60(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,256(%ebx) + psrlq $32,%mm5 + movd %mm5,1920(%ebx) + movq 8(%eax),%mm2 + movd 28+_COS9_,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfsub %mm0,%mm2 + movq 40(%eax),%mm3 + movd 4+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq 56(%eax),%mm3 + movd 20+_COS9_,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfsub %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd 16+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq 32(%eax),%mm4 + movd 32+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd 8+_COS9_,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 12+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 120(%edx),%mm6 + punpckldq 92(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,48(%ecx) + psrlq $32,%mm5 + movd %mm5,20(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 20(%edx),%mm6 + punpckldq 48(%edx),%mm6 + pfmul %mm6,%mm5 + movd 20(%esi),%mm6 + punpckldq 48(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,640(%ebx) + psrlq $32,%mm5 + movd %mm5,1536(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq 20+_tfcos36_,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov 8(%ebp),%eax +#endif + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 128(%edx),%mm6 + punpckldq 84(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,56(%ecx) + psrlq $32,%mm5 + movd %mm5,12(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 12(%edx),%mm6 + punpckldq 56(%edx),%mm6 + pfmul %mm6,%mm5 + movd 12(%esi),%mm6 + punpckldq 56(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,384(%ebx) + psrlq $32,%mm5 + movd %mm5,1792(%ebx) + movq (%eax),%mm4 + movq 16(%eax),%mm3 + pfsub %mm3,%mm4 + movq 32(%eax),%mm3 + pfadd %mm3,%mm4 + movq 48(%eax),%mm3 + pfsub %mm3,%mm4 + movq 64(%eax),%mm3 + pfadd %mm3,%mm4 + movq %mm7,%mm5 +#if defined(PIC) && defined(__APPLE__) + mov -4(%ebp),%eax +#endif + punpckldq 16+_tfcos36_,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 124(%edx),%mm6 + punpckldq 88(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,52(%ecx) + psrlq $32,%mm5 + movd %mm5,16(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 16(%edx),%mm6 + punpckldq 52(%edx),%mm6 + pfmul %mm6,%mm5 + movd 16(%esi),%mm6 + punpckldq 52(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,512(%ebx) + psrlq $32,%mm5 + movd %mm5,1664(%ebx) + femms + +/* NO_APP */ + RESTORE_GOT + + popl %ebx + popl %esi + leave + ret + /* .size ASM_NAME(dct36_3dnowext), .-ASM_NAME(dct36_3dnowext) */ + +#if defined(PIC) && defined(__APPLE__) + .section __IMPORT,__pointers,non_lazy_symbol_pointers +L_tfcos36: + .indirect_symbol ASM_NAME(tfcos36) + .long 0 +L_COS9: + .indirect_symbol ASM_NAME(COS9) + .long 0 +#endif + +NONEXEC_STACK diff --git a/src/libmpg123/dct36_avx.S b/src/libmpg123/dct36_avx.S new file mode 100644 index 0000000..e302b6d --- /dev/null +++ b/src/libmpg123/dct36_avx.S @@ -0,0 +1,358 @@ +/* + dct36_avx: AVX optimized dct36 for x86-64 + + copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifdef IS_MSABI +#define in %rcx +#define out1 %rdx +#define out2 %r8 +#define w %r9 +#define ts %r10 +#define COS9_ %rax +#define tfcos36_ %r11 +#else +#define in %rdi +#define out1 %rsi +#define out2 %rdx +#define w %rcx +#define ts %r8 +#define COS9_ %rax +#define tfcos36_ %r9 +#endif + +/* + void dct36_avx(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +dct36_avx_COS9: + .long 0x3f5db3d7 + .long 0x3f5db3d7 + .long 0x3f000000 + .long 0x3f000000 + .long 0x3f7c1c5c + .long 0x3f7c1c5c + .long 0x3f708fb2 + .long 0x3f708fb2 + .long 0x3f248dbb + .long 0x3f248dbb + .long 0x3e31d0d4 + .long 0x3e31d0d4 + .long 0x3eaf1d44 + .long 0x3eaf1d44 + .long 0x3f441b7d + .long 0x3f441b7d + ALIGN16 +dct36_avx_tfcos36: + .long 0x3f007d2b + .long 0x3f0483ee + .long 0x3f0d3b7d + .long 0x3f1c4257 + .long 0x40b79454 + .long 0x3ff746ea + .long 0x3f976fd9 + .long 0x3f5f2944 + .long 0x3f3504f3 + ALIGN16 +dct36_avx_sign: + .long 0x80000000,0x80000000,0x80000000,0x80000000 + .text + ALIGN16 + .globl ASM_NAME(dct36_avx) +ASM_NAME(dct36_avx): +#ifdef IS_MSABI + push %rbp + mov %rsp, %rbp + sub $160, %rsp + movaps %xmm6, (%rsp) + movaps %xmm7, 16(%rsp) + movaps %xmm8, 32(%rsp) + movaps %xmm9, 48(%rsp) + movaps %xmm10, 64(%rsp) + movaps %xmm11, 80(%rsp) + movaps %xmm12, 96(%rsp) + movaps %xmm13, 112(%rsp) + movaps %xmm14, 128(%rsp) + movaps %xmm15, 144(%rsp) + movq 48(%rbp), ts +#endif + lea dct36_avx_COS9(%rip), COS9_ + lea dct36_avx_tfcos36(%rip), tfcos36_ + + xorps %xmm4, %xmm4 + movups (in), %xmm0 + movups 16(in), %xmm1 + movups 32(in), %xmm2 + movups 48(in), %xmm3 + movlps 64(in), %xmm4 + vshufps $0x93, %xmm0, %xmm0, %xmm5 + vshufps $0x93, %xmm1, %xmm1, %xmm6 + vshufps $0x93, %xmm2, %xmm2, %xmm7 + vshufps $0x93, %xmm3, %xmm3, %xmm8 + vshufps $0xe1, %xmm4, %xmm4, %xmm9 + movss %xmm8, %xmm9 #[fg--] + addps %xmm9, %xmm4 #[gh--] + movss %xmm7, %xmm8 + addps %xmm8, %xmm3 #[cdef] + movss %xmm6, %xmm7 + addps %xmm7, %xmm2 #[89ab] + movss %xmm5, %xmm6 + addps %xmm6, %xmm1 #[4567] + xorps %xmm6, %xmm6 + movss %xmm6, %xmm5 + addps %xmm5, %xmm0 #[0123] + + vblendps $0x5, %xmm6, %xmm3, %xmm7 + vshufps $0x4e, %xmm4, %xmm3, %xmm4 + addps %xmm7, %xmm4 + vblendps $0x5, %xmm6, %xmm2, %xmm7 + vshufps $0x4e, %xmm3, %xmm2, %xmm3 + addps %xmm7, %xmm3 + vblendps $0x5, %xmm6, %xmm1, %xmm7 + vshufps $0x4e, %xmm2, %xmm1, %xmm2 + addps %xmm7, %xmm2 + vblendps $0x5, %xmm6, %xmm0, %xmm7 + vshufps $0x4e, %xmm1, %xmm0, %xmm1 + addps %xmm7, %xmm1 + vmovlhps %xmm0, %xmm6, %xmm0 + +/* +xmm0 in[-,-,0,1] +xmm1 in[2,3,4,5] +xmm2 in[6,7,8,9] +xmm3 in[10,11,12,13] +xmm4 in[14,15,16,17] +*/ + + vblendps $0xc, %xmm3, %xmm2, %xmm5 + blendps $0xc, %xmm4, %xmm3 + blendps $0xc, %xmm2, %xmm4 + movaps %xmm5, %xmm2 + +/* +xmm2 in[6,7,12,13] +xmm3 in[10,11,16,17] +xmm4 in[14,15,8,9] +*/ + + movaps (COS9_), %xmm15 + movaps 16(COS9_), %xmm6 + movaps 32(COS9_), %xmm7 + movaps 48(COS9_), %xmm8 + vmulps %xmm2, %xmm15, %xmm5 + addps %xmm0, %xmm5 + +/* +xmm5 [ta33,tb33,ta66,tb66] +xmm6 COS9_[1,1,2,2] +xmm7 COS9_[5,5,8,8] +xmm8 COS9_[7,7,4,4] +xmm15 COS9_[3,3,6,6] +*/ + + vmulps %xmm1, %xmm6, %xmm9 + vmulps %xmm3, %xmm7, %xmm12 + vmulps %xmm4, %xmm8, %xmm13 + addps %xmm5, %xmm9 + addps %xmm13, %xmm12 + addps %xmm9, %xmm12 + + vsubps %xmm3, %xmm1, %xmm13 + vshufps $0xe0, %xmm2, %xmm0, %xmm14 + vsubps %xmm14, %xmm0, %xmm14 + subps %xmm4, %xmm13 + mulps %xmm15, %xmm13 + addps %xmm14, %xmm13 + + vmulps %xmm1, %xmm7, %xmm9 + vmulps %xmm3, %xmm8, %xmm15 + vmulps %xmm4, %xmm6, %xmm14 + subps %xmm5, %xmm9 + subps %xmm15, %xmm14 + addps %xmm9, %xmm14 + + mulps %xmm1, %xmm8 + mulps %xmm3, %xmm6 + mulps %xmm4, %xmm7 + subps %xmm5, %xmm8 + subps %xmm7, %xmm6 + vaddps %xmm6, %xmm8, %xmm15 + + movss 32(tfcos36_), %xmm5 + subps %xmm1, %xmm0 + subps %xmm2, %xmm4 + addps %xmm3, %xmm0 + addps %xmm4, %xmm0 + shufps $0xaf, %xmm0, %xmm0 + vmulss %xmm5, %xmm0, %xmm11 + +/* +xmm12 [1a-0,1b-0, 2a-0, 2b-0] +xmm13 [1a-1,1b-1, 2a-1, 2b-1] +xmm14 [1a-2,1b-2,-2a-2,-2b-2] +xmm15 [1a-3,1b-3,-2a-3,-2b-3] +*/ + vunpckhps %xmm13, %xmm12, %xmm5 + vunpcklps %xmm13, %xmm12, %xmm12 + vunpckhps %xmm15, %xmm14, %xmm6 + vunpcklps %xmm15, %xmm14, %xmm14 + xorps dct36_avx_sign(%rip), %xmm6 + +/* +xmm12 [1a-0,1a-1,1b-0,1b-1] +xmm5 [2a-0,2a-1,2b-0,2b-1] +xmm14 [1a-2,1a-3,1b-2,1b-3] +xmm6 [2a-2,2a-3,2b-2,2b-3] +*/ + + vmovlhps %xmm14, %xmm12, %xmm0 + movhlps %xmm12, %xmm14 + vmovlhps %xmm6, %xmm5, %xmm1 + vmovhlps %xmm5, %xmm6, %xmm15 + +/* +xmm0 tmp1a +xmm1 tmp2a +xmm14 tmp1b +xmm15 tmp2b +*/ + + movaps (tfcos36_), %xmm6 + movaps 16(tfcos36_), %xmm7 + vsubps %xmm14, %xmm15, %xmm10 + addps %xmm14, %xmm15 + vsubps %xmm0, %xmm1, %xmm14 + addps %xmm1, %xmm0 + vmulps %xmm6, %xmm15, %xmm1 + mulps %xmm10, %xmm7 + +/* +%xmm0 tmp[0,1,2,3] +%xmm1 tmp[17,16,15,14] +%xmm14 tmp[8,7,6,5] +%xmm7 tmp[9,10,11,12] +%xmm11 tmp[13,-,4,-] +*/ + + movups 108(w), %xmm2 + movups 92(w), %xmm3 + shufps $0x1b, %xmm3, %xmm3 + movups 36(w), %xmm4 + movups 20(w), %xmm5 + shufps $0x1b, %xmm5, %xmm5 + vsubps %xmm1, %xmm0, %xmm6 + addps %xmm1, %xmm0 + mulps %xmm0, %xmm2 + mulps %xmm3, %xmm0 + mulps %xmm6, %xmm4 + mulps %xmm5, %xmm6 + movups 36(out1), %xmm1 + movups 20(out1), %xmm3 + shufps $0x1b, %xmm6, %xmm6 + addps %xmm4, %xmm1 + addps %xmm6, %xmm3 + shufps $0x1b, %xmm0, %xmm0 + movups %xmm2, 36(out2) + movups %xmm0, 20(out2) + movss %xmm1, 32*36(ts) + movss %xmm3, 32*20(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*44(ts) + movss %xmm4, 32*28(ts) + shufps $0xb1, %xmm1, %xmm1 + shufps $0xb1, %xmm3, %xmm3 + movss %xmm1, 32*40(ts) + movss %xmm3, 32*24(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*48(ts) + movss %xmm4, 32*32(ts) + + movhlps %xmm11, %xmm0 + movss 124(w), %xmm2 + movss 88(w), %xmm3 + movss 52(w), %xmm4 + movss 16(w), %xmm5 + movss %xmm0, %xmm6 + addss %xmm11, %xmm0 + subss %xmm11, %xmm6 + mulss %xmm0, %xmm2 + mulss %xmm3, %xmm0 + mulss %xmm6, %xmm4 + mulss %xmm5, %xmm6 + addss 52(out1), %xmm4 + addss 16(out1), %xmm6 + movss %xmm2, 52(out2) + movss %xmm0, 16(out2) + movss %xmm4, 32*52(ts) + movss %xmm6, 32*16(ts) + + movaps %xmm14, %xmm0 + movaps %xmm7, %xmm1 + MOVUAPS 128(w), %xmm2 + movups 72(w), %xmm3 + shufps $0x1b, %xmm2, %xmm2 + movlps 56(w), %xmm4 + movhps 64(w), %xmm4 + MOVUAPS (w), %xmm5 + shufps $0x1b, %xmm4, %xmm4 + vsubps %xmm1, %xmm0, %xmm6 + addps %xmm1, %xmm0 + mulps %xmm0, %xmm2 + mulps %xmm3, %xmm0 + mulps %xmm6, %xmm4 + mulps %xmm5, %xmm6 + movlps 56(out1), %xmm1 + movhps 64(out1), %xmm1 + movups (out1), %xmm3 + shufps $0x1b, %xmm4, %xmm4 + addps %xmm6, %xmm3 + addps %xmm4, %xmm1 + shufps $0x1b, %xmm2, %xmm2 + movups %xmm0, (out2) + movlps %xmm2, 56(out2) + movhps %xmm2, 64(out2) + movss %xmm1, 32*56(ts) + movss %xmm3, (ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*64(ts) + movss %xmm4, 32*8(ts) + shufps $0xb1, %xmm1, %xmm1 + shufps $0xb1, %xmm3, %xmm3 + movss %xmm1, 32*60(ts) + movss %xmm3, 32*4(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*68(ts) + movss %xmm4, 32*12(ts) + +#ifdef IS_MSABI + movaps (%rsp), %xmm6 + movaps 16(%rsp), %xmm7 + movaps 32(%rsp), %xmm8 + movaps 48(%rsp), %xmm9 + movaps 64(%rsp), %xmm10 + movaps 80(%rsp), %xmm11 + movaps 96(%rsp), %xmm12 + movaps 112(%rsp), %xmm13 + movaps 128(%rsp), %xmm14 + movaps 144(%rsp), %xmm15 + mov %rbp, %rsp + pop %rbp +#endif + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct36_neon.S b/src/libmpg123/dct36_neon.S new file mode 100644 index 0000000..e7fa3af --- /dev/null +++ b/src/libmpg123/dct36_neon.S @@ -0,0 +1,283 @@ +/* + dct36_neon: ARM NEON optimized dct36 + + copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + + +#include "mangle.h" + +#ifndef _M_ARM + .code 32 +#endif +#ifndef __APPLE__ + .fpu neon +#endif + + .text + ALIGN16 +dct36_neon_COS9: + .word 0x3f5db3d7 + .word 0x3f5db3d7 + .word 0x3f000000 + .word 0x3f000000 + .word 0x3f7c1c5c + .word 0x3f7c1c5c + .word 0x3f708fb2 + .word 0x3f708fb2 + .word 0x3f248dbb + .word 0x3f248dbb + .word 0x3e31d0d4 + .word 0x3e31d0d4 + .word 0x3eaf1d44 + .word 0x3eaf1d44 + .word 0x3f441b7d + .word 0x3f441b7d + .word 0x3f007d2b + .word 0x3f0483ee + .word 0x3f0d3b7d + .word 0x3f1c4257 + .word 0x40b79454 + .word 0x3ff746ea + .word 0x3f976fd9 + .word 0x3f5f2944 + .word 0x3f800000 + .word 0x3f3504f3 + + ALIGN4 + GLOBAL_SYMBOL ASM_NAME(dct36_neon) +#ifdef __ELF__ + .type ASM_NAME(dct36_neon), %function +#endif +ASM_NAME(dct36_neon): + push {r4-r5, lr} + vpush {q4-q7} + ldr r4, [sp, #76] + adr r5, dct36_neon_COS9 + + vceq.i32 q14, q14, q14 + veor q15, q15, q15 + vshl.i64 q14, q14, #32 + vld1.32 {q0, q1}, [r0]! + vld1.32 {q2, q3}, [r0]! + vld1.32 {d8}, [r0] + + vext.8 q5, q15, q0, #12 + vext.8 q6, q0, q1, #12 + vext.8 q7, q1, q2, #12 + vext.8 q8, q2, q3, #12 + vext.8 d18, d7, d8, #4 + vadd.f32 q0, q0, q5 + vadd.f32 q1, q1, q6 + vadd.f32 q2, q2, q7 + vadd.f32 q3, q3, q8 + vadd.f32 d8, d8, d18 + + vext.8 q6, q0, q1, #8 + vext.8 q7, q1, q2, #8 + vext.8 q8, q2, q3, #8 + vext.8 q9, q3, q4, #8 + vand q10, q0, q14 + vext.8 q0, q15, q0, #8 + vand q11, q1, q14 + vand q12, q2, q14 + vand q13, q3, q14 + vadd.f32 q1, q10, q6 + vadd.f32 q2, q11, q7 + vadd.f32 q3, q12, q8 + vadd.f32 q4, q13, q9 + +/* +q0 in[-,-,0,1] +q1 in[2,3,4,5] +q2 in[6,7,8,9] +q3 in[10,11,12,13] +q4 in[14,15,16,17] +*/ + + vswp d5, d7 + vswp d7, d9 + +/* +q2 in[6,7,12,13] +q3 in[10,11,16,17] +q4 in[14,15,8,9] +*/ + + vld1.32 {q5, q6}, [r5, :128]! + vld1.32 {q7, q8}, [r5, :128]! + vmov q9, q0 + vmla.f32 q9, q2, q5 + +/* +q6 COS9_[1,1,2,2] +q7 COS9_[5,5,8,8] +q8 COS9_[7,7,4,4] +q5 COS9_[3,3,6,6] +q9 [ta33,tb33,ta66,tb66] +*/ + + vmov q10, q9 + vmov d26, d0 + vmov d27, d5 + vmul.f32 q12, q1, q6 + vsub.f32 q11, q1, q3 + vmla.f32 q10, q3, q7 + vsub.f32 q13, q0, q13 + vmla.f32 q12, q4, q8 + vsub.f32 q11, q11, q4 + vmul.f32 q14, q1, q7 + vmul.f32 q15, q1, q8 + vadd.f32 q12, q12, q10 + vmov q10, q9 + vmla.f32 q13, q11, q5 + vmla.f32 q10, q3, q8 + vmla.f32 q14, q4, q6 + vmla.f32 q9, q4, q7 + vmla.f32 q15, q3, q6 + vsub.f32 q14, q14, q10 + vsub.f32 q15, q15, q9 + +/* +q12 [1a-0,1b-0, 2a-0, 2b-0] +q13 [1a-1,1b-1, 2a-1, 2b-1] +q14 [1a-2,1b-2,-2a-2,-2b-2] +q15 [1a-3,1b-3,-2a-3,-2b-3] +*/ + + vzip.32 q12, q13 + vzip.32 q14, q15 + vneg.f32 q15, q15 + +/* +q12 [1a-0,1a-1,1b-0,1b-1] +q13 [2a-0,2a-1,2b-0,2b-1] +q14 [1a-2,1a-3,1b-2,1b-3] +q15 [2a-2,2a-3,2b-2,2b-3] +*/ + + vswp d25, d28 + vswp d27, d30 + +/* +q12 tmp1a +q13 tmp2a +q14 tmp1b +q15 tmp2b +*/ + vsub.f32 d1, d1, d3 + vsub.f32 d9, d9, d5 + vld1.32 {q5, q6}, [r5, :128]! + vld1.32 {d0}, [r5, :64] + vadd.f32 q10, q14, q15 + vsub.f32 q8, q15, q14 + vadd.f32 d1, d1, d7 + vadd.f32 q9, q12, q13 + vsub.f32 q7, q13, q12 + vadd.f32 d1, d1, d9 + vmul.f32 q10, q10, q5 + vmul.f32 q8, q8, q6 + vmul.f32 d0, d1, d0 + +/* +q9 tmp[0,1,2,3] +q10 tmp[17,16,15,14] +q7 tmp[8,7,6,5] +q8 tmp[9,10,11,12] +d0 tmp[4,13] +*/ + + add r0, r4, #640 + add r5, r3, #20 + vld1.32 {q1,q2}, [r5] + add r5, r3, #92 + vld1.32 {q3,q4}, [r5] + add r5, r1, #20 + vld1.32 {q5,q6}, [r5] + vadd.f32 q11, q9, q10 + vsub.f32 q12, q9, q10 + vmul.f32 q10, q11, q4 + vmla.f32 q6, q12, q2 + vrev64.32 q11, q11 + vrev64.32 q12, q12 + vswp d22, d23 + vswp d24, d25 + vmul.f32 q9, q11, q3 + vmla.f32 q5, q12, q1 + add r5, r2, #20 + vst1.32 {q9,q10}, [r5] + mov r5, #128 + vst1.32 {d10[0]}, [r0], r5 + vst1.32 {d10[1]}, [r0], r5 + vst1.32 {d11[0]}, [r0], r5 + vst1.32 {d11[1]}, [r0], r5 + vst1.32 {d12[0]}, [r0], r5 + vst1.32 {d12[1]}, [r0], r5 + vst1.32 {d13[0]}, [r0], r5 + vst1.32 {d13[1]}, [r0], r5 + + add r0, r4, #1792 + add r5, r3, #56 + vld1.32 {q1}, [r3] + vld1.32 {q2,q3}, [r5] + add r5, r3, #128 + vld1.32 {q4}, [r5] + add r5, r1, #56 + vld1.32 {q5}, [r1] + vld1.32 {q6}, [r5] + vadd.f32 q9, q7, q8 + vsub.f32 q10, q7, q8 + vmul.f32 q7, q9, q3 + vmla.f32 q5, q10, q1 + vrev64.32 q9, q9 + vrev64.32 q10, q10 + vswp d18, d19 + vswp d20, d21 + vmul.f32 q8, q9, q4 + vmla.f32 q6, q10, q2 + add r5, r2, #56 + vst1.32 {q7}, [r2] + vst1.32 {q8}, [r5] + mov r5, #128 + vst1.32 {d10[0]}, [r4], r5 + vst1.32 {d10[1]}, [r4], r5 + vst1.32 {d11[0]}, [r4], r5 + vst1.32 {d11[1]}, [r4], r5 + vst1.32 {d12[0]}, [r0], r5 + vst1.32 {d12[1]}, [r0], r5 + vst1.32 {d13[0]}, [r0], r5 + vst1.32 {d13[1]}, [r0], r5 + + vtrn.32 d0, d1 + add r5, r3, #16 + vld1.32 {d2}, [r5] + add r5, r3, #52 + vld1.32 {d3}, [r5] + add r5, r3, #88 + vld1.32 {d4}, [r5] + add r3, r3, #124 + vld1.32 {d5}, [r3] + add r5, r1, #16 + vld1.32 {d6}, [r5] + add r1, r1, #52 + vld1.32 {d7}, [r1] + vadd.f32 d8, d0, d1 + vsub.f32 d9, d0, d1 + vmul.f32 d4, d8, d4 + vmul.f32 d5, d8, d5 + vmla.f32 d6, d9, d2 + vmla.f32 d7, d9, d3 + add r2, r2, #16 + vst1.32 {d4[0]}, [r2] + add r2, r2, #36 + vst1.32 {d5[0]}, [r2] + vst1.32 {d6[0]}, [r4] + add r4, r4, #1152 + vst1.32 {d7[0]}, [r4] + + vpop {q4-q7} + pop {r4-r5, pc} + +NONEXEC_STACK diff --git a/src/libmpg123/dct36_neon64.S b/src/libmpg123/dct36_neon64.S new file mode 100644 index 0000000..89db65a --- /dev/null +++ b/src/libmpg123/dct36_neon64.S @@ -0,0 +1,249 @@ +/* + dct36_neon64: NEON optimized dct36 for AArch64 + + copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +dct36_aarch64_COS9: + .word 0x3f5db3d7 + .word 0x3f5db3d7 + .word 0x3f000000 + .word 0x3f000000 + .word 0x3f7c1c5c + .word 0x3f7c1c5c + .word 0x3f708fb2 + .word 0x3f708fb2 + .word 0x3f248dbb + .word 0x3f248dbb + .word 0x3e31d0d4 + .word 0x3e31d0d4 + .word 0x3eaf1d44 + .word 0x3eaf1d44 + .word 0x3f441b7d + .word 0x3f441b7d + .word 0x3f007d2b + .word 0x3f0483ee + .word 0x3f0d3b7d + .word 0x3f1c4257 + .word 0x40b79454 + .word 0x3ff746ea + .word 0x3f976fd9 + .word 0x3f5f2944 + .word 0x3f800000 + .word 0x3f3504f3 + + .text + ALIGN4 + .globl ASM_NAME(dct36_neon64) +#ifdef __ELF__ + .type ASM_NAME(dct36_neon64), %function +#endif +ASM_NAME(dct36_neon64): + adrp x5, AARCH64_PCREL_HI(dct36_aarch64_COS9) + add x5, x5, AARCH64_PCREL_LO(dct36_aarch64_COS9) + cmeq v28.16b, v28.16b, v28.16b + eor v29.16b, v29.16b, v29.16b + shl v28.2d, v28.2d, #32 + ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x0], #64 + ld1 {v4.2s}, [x0] + + ext v16.16b, v29.16b, v0.16b, #12 + ext v17.16b, v0.16b, v1.16b, #12 + ext v18.16b, v1.16b, v2.16b, #12 + ext v19.16b, v2.16b, v3.16b, #12 + ext v20.16b, v3.16b, v4.16b, #12 + fadd v0.4s, v0.4s, v16.4s + fadd v1.4s, v1.4s, v17.4s + fadd v2.4s, v2.4s, v18.4s + fadd v3.4s, v3.4s, v19.4s + fadd v4.2s, v4.2s, v20.2s + + ext v16.16b, v0.16b, v1.16b, #8 + ext v17.16b, v1.16b, v2.16b, #8 + ext v18.16b, v2.16b, v3.16b, #8 + ext v19.16b, v3.16b, v4.16b, #8 + and v20.16b, v0.16b, v28.16b + ext v0.16b, v29.16b, v0.16b, #8 + and v21.16b, v1.16b, v28.16b + and v22.16b, v2.16b, v28.16b + and v23.16b, v3.16b, v28.16b + fadd v1.4s, v20.4s, v16.4s + fadd v2.4s, v21.4s, v17.4s + fadd v3.4s, v22.4s, v18.4s + fadd v4.4s, v23.4s, v19.4s + +/* +v0 in[-,-,0,1] +v1 in[2,3,4,5] +v2 in[6,7,8,9] +v3 in[10,11,12,13] +v4 in[14,15,16,17] +*/ + + orr v5.16b, v2.16b, v2.16b + ins v2.d[1], v3.d[1] + ins v3.d[1], v4.d[1] + ins v4.d[1], v5.d[1] + +/* +v2 in[6,7,12,13] +v3 in[10,11,16,17] +v4 in[14,15,8,9] +*/ + + ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x5], #64 + orr v20.16b, v0.16b, v0.16b + fmla v20.4s, v2.4s, v16.4s + +/* +v17 COS9_[1,1,2,2] +v18 COS9_[5,5,8,8] +v19 COS9_[7,7,4,4] +v16 COS9_[3,3,6,6] +v20 [ta33,tb33,ta66,tb66] +*/ + + orr v21.16b, v20.16b, v20.16b + orr v23.16b, v20.16b, v20.16b + zip2 v25.2d, v29.2d, v2.2d + fsub v22.4s, v1.4s, v3.4s + fmul v24.4s, v1.4s, v17.4s + fmul v26.4s, v1.4s, v18.4s + fmul v27.4s, v1.4s, v19.4s + fmla v21.4s, v3.4s, v18.4s + fmla v23.4s, v3.4s, v19.4s + fmla v20.4s, v4.4s, v18.4s + fsub v25.4s, v0.4s, v25.4s + fsub v22.4s, v22.4s, v4.4s + fmla v24.4s, v4.4s, v19.4s + fmla v26.4s, v4.4s, v17.4s + fmla v27.4s, v3.4s, v17.4s + fmla v25.4s, v22.4s, v16.4s + fadd v24.4s, v24.4s, v21.4s + fsub v26.4s, v26.4s, v23.4s + fsub v27.4s, v27.4s, v20.4s + + zip1 v16.4s, v24.4s, v25.4s + zip2 v17.4s, v24.4s, v25.4s + zip1 v18.4s, v26.4s, v27.4s + zip2 v19.4s, v26.4s, v27.4s + fneg v19.4s, v19.4s + zip1 v20.2d, v16.2d, v18.2d + zip1 v21.2d, v17.2d, v19.2d + zip2 v22.2d, v16.2d, v18.2d + zip2 v23.2d, v17.2d, v19.2d + + ld1 {v5.4s,v6.4s}, [x5], #32 + ld1 {v7.2s}, [x5] + fsub v0.4s, v0.4s, v1.4s + fsub v4.4s, v4.4s, v2.4s + fadd v17.4s, v22.4s, v23.4s + fsub v19.4s, v23.4s, v22.4s + fadd v0.4s, v0.4s, v3.4s + fadd v16.4s, v20.4s, v21.4s + fsub v18.4s, v21.4s, v20.4s + fadd v0.4s, v0.4s, v4.4s + fmul v17.4s, v17.4s, v5.4s + fmul v19.4s, v19.4s, v6.4s + AARCH64_DUP_2D(v0, v0, 1) + fmul v0.2s, v0.2s, v7.2s + +/* +v16 tmp[0,1,2,3] +v17 tmp[17,16,15,14] +v18 tmp[8,7,6,5] +v19 tmp[9,10,11,12] +v0 tmp[4,13] +*/ + + add x0, x4, #640 + add x5, x3, #20 + add x6, x3, #92 + add x7, x1, #20 + ld1 {v1.4s,v2.4s}, [x5] + ld1 {v3.4s,v4.4s}, [x6] + ld1 {v5.4s,v6.4s}, [x7] + fadd v20.4s, v16.4s, v17.4s + fsub v21.4s, v16.4s, v17.4s + fmul v4.4s, v20.4s, v4.4s + fmla v6.4s, v21.4s, v2.4s + rev64 v20.4s, v20.4s + rev64 v21.4s, v21.4s + ext v20.16b, v20.16b, v20.16b, #8 + ext v21.16b, v21.16b, v21.16b, #8 + fmul v3.4s, v20.4s, v3.4s + fmla v5.4s, v21.4s, v1.4s + add x5, x2, #20 + mov x9, #128 + st1 {v3.4s,v4.4s}, [x5] + st1 {v5.s}[0], [x0], x9 + st1 {v5.s}[1], [x0], x9 + st1 {v5.s}[2], [x0], x9 + st1 {v5.s}[3], [x0], x9 + st1 {v6.s}[0], [x0], x9 + st1 {v6.s}[1], [x0], x9 + st1 {v6.s}[2], [x0], x9 + st1 {v6.s}[3], [x0], x9 + + add x0, x4, #1792 + add x5, x3, #56 + add x6, x3, #128 + add x7, x1, #56 + ld1 {v1.4s}, [x3] + ld1 {v2.4s,v3.4s}, [x5] + ld1 {v4.4s}, [x6] + ld1 {v5.4s}, [x1] + ld1 {v6.4s}, [x7] + fadd v20.4s, v18.4s, v19.4s + fsub v21.4s, v18.4s, v19.4s + fmul v3.4s, v20.4s, v3.4s + fmla v5.4s, v21.4s, v1.4s + rev64 v20.4s, v20.4s + rev64 v21.4s, v21.4s + ext v20.16b, v20.16b, v20.16b, #8 + ext v21.16b, v21.16b, v21.16b, #8 + fmul v4.4s, v20.4s, v4.4s + fmla v6.4s, v21.4s, v2.4s + add x5, x2, #56 + st1 {v3.4s}, [x2] + st1 {v4.4s}, [x5] + st1 {v5.s}[0], [x4], x9 + st1 {v5.s}[1], [x4], x9 + st1 {v5.s}[2], [x4], x9 + st1 {v5.s}[3], [x4], x9 + st1 {v6.s}[0], [x0], x9 + st1 {v6.s}[1], [x0], x9 + st1 {v6.s}[2], [x0], x9 + st1 {v6.s}[3], [x0], x9 + + ins v1.s[0], v0.s[1] + ldr s2, [x3, #16] + ldr s3, [x3, #52] + ldr s4, [x3, #88] + ldr s5, [x3, #124] + ldr s6, [x1, #16] + ldr s7, [x1, #52] + fadd s16, s0, s1 + fsub s17, s0, s1 + fmul s4, s16, s4 + fmul s5, s16, s5 + fmadd s6, s17, s2, s6 + fmadd s7, s17, s3, s7 + str s4, [x2, #16] + str s5, [x2, #52] + str s6, [x4] + str s7, [x4, #1152] + + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct36_sse.S b/src/libmpg123/dct36_sse.S new file mode 100644 index 0000000..fa4c625 --- /dev/null +++ b/src/libmpg123/dct36_sse.S @@ -0,0 +1,387 @@ +/* + dct36_sse: SSE optimized dct36 + + copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#define in %edi +#define out1 %edi +#define out2 %edx +#define w %ecx +#define ts %eax +#define tmp %esi + +/* + void dct36_sse(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +dct36_sse_COS9: + .long 0x3f5db3d7 + .long 0x3f5db3d7 + .long 0x3f000000 + .long 0x3f000000 + .long 0x3f7c1c5c + .long 0x3f7c1c5c + .long 0x3f708fb2 + .long 0x3f708fb2 + .long 0x3f248dbb + .long 0x3f248dbb + .long 0x3e31d0d4 + .long 0x3e31d0d4 + .long 0x3eaf1d44 + .long 0x3eaf1d44 + .long 0x3f441b7d + .long 0x3f441b7d + ALIGN16 +dct36_sse_tfcos36: + .long 0x3f007d2b + .long 0x3f0483ee + .long 0x3f0d3b7d + .long 0x3f1c4257 + .long 0x40b79454 + .long 0x3ff746ea + .long 0x3f976fd9 + .long 0x3f5f2944 + .long 0x3f3504f3 + ALIGN16 +dct36_sse_mask: + .long 0,0xffffffff,0,0xffffffff + ALIGN16 +dct36_sse_sign: + .long 0x80000000,0x80000000,0x80000000,0x80000000 + .text + ALIGN16 + .globl ASM_NAME(dct36_sse) +ASM_NAME(dct36_sse): + push %ebp + mov %esp, %ebp + and $-16, %esp + sub $80, %esp + push %ebx + push %esi + push %edi + lea 12(%esp), tmp + movl 8(%ebp), in + + GET_GOT + + lea LOCAL_VAR(dct36_sse_COS9), %eax + lea LOCAL_VAR(dct36_sse_tfcos36), %edx + + xorps %xmm0, %xmm0 + xorps %xmm5, %xmm5 + movlps 64(in), %xmm5 + movups 48(in), %xmm4 + movups 32(in), %xmm3 + movups 16(in), %xmm2 + movups (in), %xmm1 + movaps %xmm5, %xmm6 + shufps $0xe1, %xmm6, %xmm6 + movaps %xmm4, %xmm7 + shufps $0x93, %xmm7, %xmm7 + movss %xmm7, %xmm6 + addps %xmm6, %xmm5 + movaps %xmm3, %xmm6 + shufps $0x93, %xmm6, %xmm6 + movss %xmm6, %xmm7 + addps %xmm7, %xmm4 + movaps %xmm2, %xmm7 + shufps $0x93, %xmm7, %xmm7 + movss %xmm7, %xmm6 + addps %xmm6, %xmm3 + movaps %xmm1, %xmm6 + shufps $0x93, %xmm6, %xmm6 + movss %xmm6, %xmm7 + addps %xmm7, %xmm2 + movss %xmm0, %xmm6 + addps %xmm6, %xmm1 + + movaps LOCAL_VAR(dct36_sse_mask), %xmm0 + movaps %xmm4, %xmm6 + shufps $0x4e, %xmm5, %xmm4 + movaps %xmm3, %xmm7 + shufps $0x4e, %xmm6, %xmm3 + andps %xmm0, %xmm6 + addps %xmm6, %xmm4 + movaps %xmm2, %xmm6 + shufps $0x4e, %xmm7, %xmm2 + andps %xmm0, %xmm7 + addps %xmm7, %xmm3 + movaps %xmm1, %xmm7 + shufps $0x4e, %xmm6, %xmm1 + andps %xmm0, %xmm6 + addps %xmm6, %xmm2 + movaps %xmm7, %xmm6 + andps %xmm0, %xmm7 + xorps %xmm0, %xmm0 + addps %xmm7, %xmm1 + movlhps %xmm6, %xmm0 + +/* +xmm0 in[-,-,0,1] +xmm1 in[2,3,4,5] +xmm2 in[6,7,8,9] +xmm3 in[10,11,12,13] +xmm4 in[14,15,16,17] +*/ + + movaps %xmm2, %xmm5 + shufps $0xe4, %xmm3, %xmm5 + shufps $0xe4, %xmm4, %xmm3 + shufps $0xe4, %xmm2, %xmm4 + movaps %xmm5, %xmm2 + +/* +xmm2 in[6,7,12,13] +xmm3 in[10,11,16,17] +xmm4 in[14,15,8,9] +*/ + + mulps (%eax), %xmm5 + addps %xmm0, %xmm5 + + movaps %xmm0, (tmp) + movaps %xmm2, 16(tmp) + +/* +0(tmp) in[-,-,0,1] +xmm5 [ta33,tb33,ta66,tb66] +*/ + + movaps %xmm1, %xmm6 + subps %xmm3, %xmm6 + subps %xmm4, %xmm6 + xorps %xmm7, %xmm7 + shufps $0xe0, %xmm2, %xmm7 + mulps (%eax), %xmm6 + subps %xmm7, %xmm0 + addps %xmm0, %xmm6 + movaps %xmm6, 48(tmp) + + movaps 16(%eax), %xmm2 + + movaps %xmm1, %xmm0 + movaps %xmm3, %xmm6 + movaps %xmm4, %xmm7 + mulps %xmm2, %xmm0 + mulps 32(%eax), %xmm6 + mulps 48(%eax), %xmm7 + addps %xmm5, %xmm0 + addps %xmm7, %xmm6 + addps %xmm6, %xmm0 + movaps %xmm0, 32(tmp) + + movaps %xmm1, %xmm0 + movaps %xmm3, %xmm6 + movaps %xmm4, %xmm7 + mulps 32(%eax), %xmm0 + mulps 48(%eax), %xmm6 + mulps %xmm2, %xmm7 + subps %xmm5, %xmm0 + subps %xmm6, %xmm7 + addps %xmm7, %xmm0 + movaps %xmm0, 64(tmp) + + movaps %xmm1, %xmm6 + movaps %xmm4, %xmm7 + mulps 48(%eax), %xmm6 + mulps %xmm3, %xmm2 + mulps 32(%eax), %xmm7 + subps %xmm5, %xmm6 + subps %xmm7, %xmm2 + addps %xmm2, %xmm6 + + movaps (tmp), %xmm0 + movss 32(%edx), %xmm5 + subps %xmm1, %xmm0 + subps 16(tmp), %xmm4 + addps %xmm3, %xmm0 + addps %xmm4, %xmm0 + shufps $0xaf, %xmm0, %xmm0 + mulss %xmm5, %xmm0 + movaps %xmm0, (tmp) + + movaps 32(tmp), %xmm0 + movaps 48(tmp), %xmm1 + movaps 64(tmp), %xmm2 + +/* +xmm0 [1a-0,1b-0, 2a-0, 2b-0] +xmm1 [1a-1,1b-1, 2a-1, 2b-1] +xmm2 [1a-2,1b-2,-2a-2,-2b-2] +xmm6 [1a-3,1b-3,-2a-3,-2b-3] +*/ + + movaps %xmm0, %xmm3 + unpcklps %xmm1, %xmm0 + unpckhps %xmm1, %xmm3 + movaps %xmm2, %xmm5 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm5 + xorps LOCAL_VAR(dct36_sse_sign), %xmm5 + +/* +xmm0 [1a-0,1a-1,1b-0,1b-1] +xmm3 [2a-0,2a-1,2b-0,2b-1] +xmm2 [1a-2,1a-3,1b-2,1b-3] +xmm5 [2a-2,2a-3,2b-2,2b-3] +*/ + + movaps %xmm0, %xmm1 + movlhps %xmm2, %xmm0 + movhlps %xmm1, %xmm2 + movaps %xmm3, %xmm4 + movlhps %xmm5, %xmm3 + movhlps %xmm4, %xmm5 + +/* +xmm0 tmp1a +xmm3 tmp2a +xmm2 tmp1b +xmm5 tmp2b +*/ + + movaps (%edx), %xmm6 + movaps 16(%edx), %xmm7 + movaps %xmm5, %xmm1 + addps %xmm2, %xmm5 + subps %xmm2, %xmm1 + movaps %xmm3, %xmm2 + addps %xmm0, %xmm3 + subps %xmm0, %xmm2 + mulps %xmm6, %xmm5 + mulps %xmm1, %xmm7 + + movaps %xmm2, 16(tmp) + +/* +%xmm3 tmp[0,1,2,3] +%xmm5 tmp[17,16,15,14] +16(tmp) tmp[8,7,6,5] +%xmm7 tmp[9,10,11,12] +0(tmp) tmp[13,-,4,-] +*/ + + movl 12(%ebp), out1 + movl 16(%ebp), out2 + movl 20(%ebp), w + movl 24(%ebp), ts + + movaps %xmm3, %xmm0 + movaps %xmm5, %xmm1 + movups 108(w), %xmm2 + movups 92(w), %xmm3 + shufps $0x1b, %xmm3, %xmm3 + movups 36(w), %xmm4 + movups 20(w), %xmm5 + shufps $0x1b, %xmm5, %xmm5 + movaps %xmm0, %xmm6 + addps %xmm1, %xmm0 + subps %xmm1, %xmm6 + mulps %xmm0, %xmm2 + mulps %xmm3, %xmm0 + mulps %xmm6, %xmm4 + mulps %xmm5, %xmm6 + movups 36(out1), %xmm1 + movups 20(out1), %xmm3 + shufps $0x1b, %xmm6, %xmm6 + addps %xmm4, %xmm1 + addps %xmm6, %xmm3 + shufps $0x1b, %xmm0, %xmm0 + movups %xmm2, 36(out2) + movups %xmm0, 20(out2) + movss %xmm1, 32*36(ts) + movss %xmm3, 32*20(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*44(ts) + movss %xmm4, 32*28(ts) + shufps $0xb1, %xmm1, %xmm1 + shufps $0xb1, %xmm3, %xmm3 + movss %xmm1, 32*40(ts) + movss %xmm3, 32*24(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*48(ts) + movss %xmm4, 32*32(ts) + + movss 8(tmp), %xmm0 + movss (tmp), %xmm1 + movss 124(w), %xmm2 + movss 88(w), %xmm3 + movss 52(w), %xmm4 + movss 16(w), %xmm5 + movss %xmm0, %xmm6 + addss %xmm1, %xmm0 + subss %xmm1, %xmm6 + mulss %xmm0, %xmm2 + mulss %xmm3, %xmm0 + mulss %xmm6, %xmm4 + mulss %xmm5, %xmm6 + addss 52(out1), %xmm4 + addss 16(out1), %xmm6 + movss %xmm2, 52(out2) + movss %xmm0, 16(out2) + movss %xmm4, 32*52(ts) + movss %xmm6, 32*16(ts) + + movaps 16(tmp), %xmm0 + movaps %xmm7, %xmm1 + MOVUAPS 128(w), %xmm2 + movups 72(w), %xmm3 + shufps $0x1b, %xmm2, %xmm2 + movlps 56(w), %xmm4 + movhps 64(w), %xmm4 + MOVUAPS (w), %xmm5 + shufps $0x1b, %xmm4, %xmm4 + movaps %xmm0, %xmm6 + addps %xmm1, %xmm0 + subps %xmm1, %xmm6 + mulps %xmm0, %xmm2 + mulps %xmm3, %xmm0 + mulps %xmm6, %xmm4 + mulps %xmm5, %xmm6 + movlps 56(out1), %xmm1 + movhps 64(out1), %xmm1 + movups (out1), %xmm3 + shufps $0x1b, %xmm4, %xmm4 + addps %xmm6, %xmm3 + addps %xmm4, %xmm1 + shufps $0x1b, %xmm2, %xmm2 + movups %xmm0, (out2) + movlps %xmm2, 56(out2) + movhps %xmm2, 64(out2) + movss %xmm1, 32*56(ts) + movss %xmm3, (ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*64(ts) + movss %xmm4, 32*8(ts) + shufps $0xb1, %xmm1, %xmm1 + shufps $0xb1, %xmm3, %xmm3 + movss %xmm1, 32*60(ts) + movss %xmm3, 32*4(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*68(ts) + movss %xmm4, 32*12(ts) + + pop %edi + pop %esi + pop %ebx + mov %ebp, %esp + pop %ebp + + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct36_x86_64.S b/src/libmpg123/dct36_x86_64.S new file mode 100644 index 0000000..35676c3 --- /dev/null +++ b/src/libmpg123/dct36_x86_64.S @@ -0,0 +1,394 @@ +/* + dct36_x86_64: SSE optimized dct36 for x86-64 + + copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifdef IS_MSABI +#define in %rcx +#define out1 %rdx +#define out2 %r8 +#define w %r9 +#define ts %r10 +#define COS9_ %rax +#define tfcos36_ %r11 +#else +#define in %rdi +#define out1 %rsi +#define out2 %rdx +#define w %rcx +#define ts %r8 +#define COS9_ %rax +#define tfcos36_ %r9 +#endif + +/* + void dct36_x86_64(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +dct36_x86_64_COS9: + .long 0x3f5db3d7 + .long 0x3f5db3d7 + .long 0x3f000000 + .long 0x3f000000 + .long 0x3f7c1c5c + .long 0x3f7c1c5c + .long 0x3f708fb2 + .long 0x3f708fb2 + .long 0x3f248dbb + .long 0x3f248dbb + .long 0x3e31d0d4 + .long 0x3e31d0d4 + .long 0x3eaf1d44 + .long 0x3eaf1d44 + .long 0x3f441b7d + .long 0x3f441b7d + ALIGN16 +dct36_x86_64_tfcos36: + .long 0x3f007d2b + .long 0x3f0483ee + .long 0x3f0d3b7d + .long 0x3f1c4257 + .long 0x40b79454 + .long 0x3ff746ea + .long 0x3f976fd9 + .long 0x3f5f2944 + .long 0x3f3504f3 + ALIGN16 +dct36_x86_64_mask: + .long 0,0xffffffff,0,0xffffffff + ALIGN16 +dct36_x86_64_sign: + .long 0x80000000,0x80000000,0x80000000,0x80000000 + .text + ALIGN16 + .globl ASM_NAME(dct36_x86_64) +ASM_NAME(dct36_x86_64): +#ifdef IS_MSABI + push %rbp + mov %rsp, %rbp + sub $160, %rsp + movaps %xmm6, (%rsp) + movaps %xmm7, 16(%rsp) + movaps %xmm8, 32(%rsp) + movaps %xmm9, 48(%rsp) + movaps %xmm10, 64(%rsp) + movaps %xmm11, 80(%rsp) + movaps %xmm12, 96(%rsp) + movaps %xmm13, 112(%rsp) + movaps %xmm14, 128(%rsp) + movaps %xmm15, 144(%rsp) + movq 48(%rbp), ts +#endif + lea dct36_x86_64_COS9(%rip), COS9_ + lea dct36_x86_64_tfcos36(%rip), tfcos36_ + + xorps %xmm5, %xmm5 + movups (in), %xmm1 + movups 16(in), %xmm2 + movups 32(in), %xmm3 + movups 48(in), %xmm4 + movlps 64(in), %xmm5 + xorps %xmm6, %xmm6 + movaps %xmm1, %xmm7 + shufps $0x93, %xmm7, %xmm7 + movaps %xmm2, %xmm8 + shufps $0x93, %xmm8, %xmm8 + movaps %xmm3, %xmm9 + shufps $0x93, %xmm9, %xmm9 + movaps %xmm4, %xmm10 + shufps $0x93, %xmm10, %xmm10 + movaps %xmm5, %xmm11 + shufps $0xe1, %xmm11, %xmm11 + movss %xmm10, %xmm11 + addps %xmm11, %xmm5 + movss %xmm9, %xmm10 + addps %xmm10, %xmm4 + movss %xmm8, %xmm9 + addps %xmm9, %xmm3 + movss %xmm7, %xmm8 + addps %xmm8, %xmm2 + movss %xmm6, %xmm7 + addps %xmm7, %xmm1 + + movaps dct36_x86_64_mask(%rip), %xmm0 + movaps %xmm4, %xmm6 + shufps $0x4e, %xmm5, %xmm4 + movaps %xmm3, %xmm7 + shufps $0x4e, %xmm6, %xmm3 + andps %xmm0, %xmm6 + addps %xmm6, %xmm4 + movaps %xmm2, %xmm6 + shufps $0x4e, %xmm7, %xmm2 + andps %xmm0, %xmm7 + addps %xmm7, %xmm3 + movaps %xmm1, %xmm7 + shufps $0x4e, %xmm6, %xmm1 + andps %xmm0, %xmm6 + addps %xmm6, %xmm2 + movaps %xmm7, %xmm6 + andps %xmm0, %xmm7 + xorps %xmm0, %xmm0 + addps %xmm7, %xmm1 + movlhps %xmm6, %xmm0 + +/* +xmm0 in[-,-,0,1] +xmm1 in[2,3,4,5] +xmm2 in[6,7,8,9] +xmm3 in[10,11,12,13] +xmm4 in[14,15,16,17] +*/ + + movaps %xmm2, %xmm5 + shufps $0xe4, %xmm3, %xmm5 + shufps $0xe4, %xmm4, %xmm3 + shufps $0xe4, %xmm2, %xmm4 + movaps %xmm5, %xmm2 +/* +xmm2 in[6,7,12,13] +xmm3 in[10,11,16,17] +xmm4 in[14,15,8,9] +*/ + + movaps (COS9_), %xmm15 + movaps 16(COS9_), %xmm6 + movaps 32(COS9_), %xmm7 + movaps 48(COS9_), %xmm8 + mulps %xmm15, %xmm5 + addps %xmm0, %xmm5 + +/* +xmm5 [ta33,tb33,ta66,tb66] +xmm6 COS9_[1,1,2,2] +xmm7 COS9_[5,5,8,8] +xmm8 COS9_[7,7,4,4] +xmm15 COS9_[3,3,6,6] +*/ + movaps %xmm6, %xmm9 + movaps %xmm7, %xmm12 + movaps %xmm8, %xmm13 + mulps %xmm1, %xmm9 + mulps %xmm3, %xmm12 + mulps %xmm4, %xmm13 + addps %xmm5, %xmm9 + addps %xmm13, %xmm12 + addps %xmm9, %xmm12 + + movaps %xmm1, %xmm13 + subps %xmm3, %xmm13 + movaps %xmm0, %xmm10 + shufps $0xe0, %xmm2, %xmm10 + movaps %xmm0, %xmm14 + subps %xmm10, %xmm14 + subps %xmm4, %xmm13 + mulps %xmm15, %xmm13 + addps %xmm14, %xmm13 + + movaps %xmm7, %xmm9 + movaps %xmm8, %xmm15 + movaps %xmm6, %xmm14 + mulps %xmm1, %xmm9 + mulps %xmm3, %xmm15 + mulps %xmm4, %xmm14 + subps %xmm5, %xmm9 + subps %xmm15, %xmm14 + addps %xmm9, %xmm14 + + mulps %xmm1, %xmm8 + mulps %xmm3, %xmm6 + mulps %xmm4, %xmm7 + subps %xmm5, %xmm8 + subps %xmm7, %xmm6 + addps %xmm6, %xmm8 + movaps %xmm8, %xmm15 + + movss 32(tfcos36_), %xmm5 + subps %xmm1, %xmm0 + subps %xmm2, %xmm4 + addps %xmm3, %xmm0 + addps %xmm4, %xmm0 + shufps $0xaf, %xmm0, %xmm0 + mulss %xmm5, %xmm0 + movaps %xmm0, %xmm11 + +/* +xmm12 [1a-0,1b-0, 2a-0, 2b-0] +xmm13 [1a-1,1b-1, 2a-1, 2b-1] +xmm14 [1a-2,1b-2,-2a-2,-2b-2] +xmm15 [1a-3,1b-3,-2a-3,-2b-3] +*/ + movaps %xmm12, %xmm5 + unpckhps %xmm13, %xmm5 + unpcklps %xmm13, %xmm12 + movaps %xmm14, %xmm6 + unpckhps %xmm15, %xmm6 + unpcklps %xmm15, %xmm14 + xorps dct36_x86_64_sign(%rip), %xmm6 + +/* +xmm12 [1a-0,1a-1,1b-0,1b-1] +xmm5 [2a-0,2a-1,2b-0,2b-1] +xmm14 [1a-2,1a-3,1b-2,1b-3] +xmm6 [2a-2,2a-3,2b-2,2b-3] +*/ + + movaps %xmm12, %xmm0 + movlhps %xmm14, %xmm12 + movhlps %xmm0, %xmm14 + movaps %xmm5, %xmm0 + movlhps %xmm6, %xmm0 + movhlps %xmm5, %xmm6 + movaps %xmm6, %xmm15 + +/* +xmm12 tmp1a +xmm0 tmp2a +xmm14 tmp1b +xmm15 tmp2b +*/ + + movaps (tfcos36_), %xmm6 + movaps 16(tfcos36_), %xmm7 + movaps %xmm15, %xmm10 + addps %xmm14, %xmm15 + subps %xmm14, %xmm10 + movaps %xmm0, %xmm14 + addps %xmm12, %xmm0 + subps %xmm12, %xmm14 + mulps %xmm6, %xmm15 + mulps %xmm10, %xmm7 + +/* +%xmm0 tmp[0,1,2,3] +%xmm15 tmp[17,16,15,14] +%xmm14 tmp[8,7,6,5] +%xmm7 tmp[9,10,11,12] +%xmm11 tmp[13,-,4,-] +*/ + + movaps %xmm15, %xmm1 + movups 108(w), %xmm2 + movups 92(w), %xmm3 + shufps $0x1b, %xmm3, %xmm3 + movups 36(w), %xmm4 + movups 20(w), %xmm5 + shufps $0x1b, %xmm5, %xmm5 + movaps %xmm0, %xmm6 + addps %xmm1, %xmm0 + subps %xmm1, %xmm6 + mulps %xmm0, %xmm2 + mulps %xmm3, %xmm0 + mulps %xmm6, %xmm4 + mulps %xmm5, %xmm6 + movups 36(out1), %xmm1 + movups 20(out1), %xmm3 + shufps $0x1b, %xmm6, %xmm6 + addps %xmm4, %xmm1 + addps %xmm6, %xmm3 + shufps $0x1b, %xmm0, %xmm0 + movups %xmm2, 36(out2) + movups %xmm0, 20(out2) + movss %xmm1, 32*36(ts) + movss %xmm3, 32*20(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*44(ts) + movss %xmm4, 32*28(ts) + shufps $0xb1, %xmm1, %xmm1 + shufps $0xb1, %xmm3, %xmm3 + movss %xmm1, 32*40(ts) + movss %xmm3, 32*24(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*48(ts) + movss %xmm4, 32*32(ts) + + movhlps %xmm11, %xmm0 + movaps %xmm11, %xmm1 + movss 124(w), %xmm2 + movss 88(w), %xmm3 + movss 52(w), %xmm4 + movss 16(w), %xmm5 + movss %xmm0, %xmm6 + addss %xmm1, %xmm0 + subss %xmm1, %xmm6 + mulss %xmm0, %xmm2 + mulss %xmm3, %xmm0 + mulss %xmm6, %xmm4 + mulss %xmm5, %xmm6 + addss 52(out1), %xmm4 + addss 16(out1), %xmm6 + movss %xmm2, 52(out2) + movss %xmm0, 16(out2) + movss %xmm4, 32*52(ts) + movss %xmm6, 32*16(ts) + + movaps %xmm14, %xmm0 + movaps %xmm7, %xmm1 + MOVUAPS 128(w), %xmm2 + movups 72(w), %xmm3 + shufps $0x1b, %xmm2, %xmm2 + movlps 56(w), %xmm4 + movhps 64(w), %xmm4 + MOVUAPS (w), %xmm5 + shufps $0x1b, %xmm4, %xmm4 + movaps %xmm0, %xmm6 + addps %xmm1, %xmm0 + subps %xmm1, %xmm6 + mulps %xmm0, %xmm2 + mulps %xmm3, %xmm0 + mulps %xmm6, %xmm4 + mulps %xmm5, %xmm6 + movlps 56(out1), %xmm1 + movhps 64(out1), %xmm1 + movups (out1), %xmm3 + shufps $0x1b, %xmm4, %xmm4 + addps %xmm6, %xmm3 + addps %xmm4, %xmm1 + shufps $0x1b, %xmm2, %xmm2 + movups %xmm0, (out2) + movlps %xmm2, 56(out2) + movhps %xmm2, 64(out2) + movss %xmm1, 32*56(ts) + movss %xmm3, (ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*64(ts) + movss %xmm4, 32*8(ts) + shufps $0xb1, %xmm1, %xmm1 + shufps $0xb1, %xmm3, %xmm3 + movss %xmm1, 32*60(ts) + movss %xmm3, 32*4(ts) + movhlps %xmm1, %xmm2 + movhlps %xmm3, %xmm4 + movss %xmm2, 32*68(ts) + movss %xmm4, 32*12(ts) + +#ifdef IS_MSABI + movaps (%rsp), %xmm6 + movaps 16(%rsp), %xmm7 + movaps 32(%rsp), %xmm8 + movaps 48(%rsp), %xmm9 + movaps 64(%rsp), %xmm10 + movaps 80(%rsp), %xmm11 + movaps 96(%rsp), %xmm12 + movaps 112(%rsp), %xmm13 + movaps 128(%rsp), %xmm14 + movaps 144(%rsp), %xmm15 + mov %rbp, %rsp + pop %rbp +#endif + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct64.c b/src/libmpg123/dct64.c new file mode 100644 index 0000000..a25047a --- /dev/null +++ b/src/libmpg123/dct64.c @@ -0,0 +1,174 @@ +/* + dct64.c: DCT64, the plain C version + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +/* + * Discrete Cosine Tansform (DCT) for subband synthesis + * + * -funroll-loops (for gcc) will remove the loops for better performance + * using loops in the source-code enhances readabillity + * + * + * TODO: write an optimized version for the down-sampling modes + * (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero + */ + +#include "mpg123lib_intern.h" + +void dct64(real *out0,real *out1,real *samples) +{ + real bufs[64]; + + { + register int i,j; + register real *b1,*b2,*bs,*costab; + + b1 = samples; + bs = bufs; + costab = pnts[0]+16; + b2 = b1 + 32; + + for(i=15;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=15;i>=0;i--) + *bs++ = REAL_MUL((*--b2 - *b1++), *--costab); + + b1 = bufs; + costab = pnts[1]+8; + b2 = b1 + 16; + + { + for(i=7;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=7;i>=0;i--) + *bs++ = REAL_MUL((*--b2 - *b1++), *--costab); + b2 += 32; + costab += 8; + for(i=7;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=7;i>=0;i--) + *bs++ = REAL_MUL((*b1++ - *--b2), *--costab); + b2 += 32; + } + + bs = bufs; + costab = pnts[2]; + b2 = b1 + 8; + + for(j=2;j;j--) + { + for(i=3;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=3;i>=0;i--) + *bs++ = REAL_MUL((*--b2 - *b1++), costab[i]); + b2 += 16; + for(i=3;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=3;i>=0;i--) + *bs++ = REAL_MUL((*b1++ - *--b2), costab[i]); + b2 += 16; + } + + b1 = bufs; + costab = pnts[3]; + b2 = b1 + 4; + + for(j=4;j;j--) + { + *bs++ = (*b1++ + *--b2); + *bs++ = (*b1++ + *--b2); + *bs++ = REAL_MUL((*--b2 - *b1++), costab[1]); + *bs++ = REAL_MUL((*--b2 - *b1++), costab[0]); + b2 += 8; + *bs++ = (*b1++ + *--b2); + *bs++ = (*b1++ + *--b2); + *bs++ = REAL_MUL((*b1++ - *--b2), costab[1]); + *bs++ = REAL_MUL((*b1++ - *--b2), costab[0]); + b2 += 8; + } + bs = bufs; + costab = pnts[4]; + + for(j=8;j;j--) + { + real v0,v1; + v0=*b1++; v1 = *b1++; + *bs++ = (v0 + v1); + *bs++ = REAL_MUL((v0 - v1), (*costab)); + v0=*b1++; v1 = *b1++; + *bs++ = (v0 + v1); + *bs++ = REAL_MUL((v1 - v0), (*costab)); + } + + } + + + { + register real *b1; + register int i; + + for(b1=bufs,i=8;i;i--,b1+=4) + b1[2] += b1[3]; + + for(b1=bufs,i=4;i;i--,b1+=8) + { + b1[4] += b1[6]; + b1[6] += b1[5]; + b1[5] += b1[7]; + } + + for(b1=bufs,i=2;i;i--,b1+=16) + { + b1[8] += b1[12]; + b1[12] += b1[10]; + b1[10] += b1[14]; + b1[14] += b1[9]; + b1[9] += b1[13]; + b1[13] += b1[11]; + b1[11] += b1[15]; + } + } + + + out0[0x10*16] = REAL_SCALE_DCT64(bufs[0]); + out0[0x10*15] = REAL_SCALE_DCT64(bufs[16+0] + bufs[16+8]); + out0[0x10*14] = REAL_SCALE_DCT64(bufs[8]); + out0[0x10*13] = REAL_SCALE_DCT64(bufs[16+8] + bufs[16+4]); + out0[0x10*12] = REAL_SCALE_DCT64(bufs[4]); + out0[0x10*11] = REAL_SCALE_DCT64(bufs[16+4] + bufs[16+12]); + out0[0x10*10] = REAL_SCALE_DCT64(bufs[12]); + out0[0x10* 9] = REAL_SCALE_DCT64(bufs[16+12] + bufs[16+2]); + out0[0x10* 8] = REAL_SCALE_DCT64(bufs[2]); + out0[0x10* 7] = REAL_SCALE_DCT64(bufs[16+2] + bufs[16+10]); + out0[0x10* 6] = REAL_SCALE_DCT64(bufs[10]); + out0[0x10* 5] = REAL_SCALE_DCT64(bufs[16+10] + bufs[16+6]); + out0[0x10* 4] = REAL_SCALE_DCT64(bufs[6]); + out0[0x10* 3] = REAL_SCALE_DCT64(bufs[16+6] + bufs[16+14]); + out0[0x10* 2] = REAL_SCALE_DCT64(bufs[14]); + out0[0x10* 1] = REAL_SCALE_DCT64(bufs[16+14] + bufs[16+1]); + out0[0x10* 0] = REAL_SCALE_DCT64(bufs[1]); + + out1[0x10* 0] = REAL_SCALE_DCT64(bufs[1]); + out1[0x10* 1] = REAL_SCALE_DCT64(bufs[16+1] + bufs[16+9]); + out1[0x10* 2] = REAL_SCALE_DCT64(bufs[9]); + out1[0x10* 3] = REAL_SCALE_DCT64(bufs[16+9] + bufs[16+5]); + out1[0x10* 4] = REAL_SCALE_DCT64(bufs[5]); + out1[0x10* 5] = REAL_SCALE_DCT64(bufs[16+5] + bufs[16+13]); + out1[0x10* 6] = REAL_SCALE_DCT64(bufs[13]); + out1[0x10* 7] = REAL_SCALE_DCT64(bufs[16+13] + bufs[16+3]); + out1[0x10* 8] = REAL_SCALE_DCT64(bufs[3]); + out1[0x10* 9] = REAL_SCALE_DCT64(bufs[16+3] + bufs[16+11]); + out1[0x10*10] = REAL_SCALE_DCT64(bufs[11]); + out1[0x10*11] = REAL_SCALE_DCT64(bufs[16+11] + bufs[16+7]); + out1[0x10*12] = REAL_SCALE_DCT64(bufs[7]); + out1[0x10*13] = REAL_SCALE_DCT64(bufs[16+7] + bufs[16+15]); + out1[0x10*14] = REAL_SCALE_DCT64(bufs[15]); + out1[0x10*15] = REAL_SCALE_DCT64(bufs[16+15]); + +} + + diff --git a/src/libmpg123/dct64_3dnow.S b/src/libmpg123/dct64_3dnow.S new file mode 100644 index 0000000..99e6a2c --- /dev/null +++ b/src/libmpg123/dct64_3dnow.S @@ -0,0 +1,749 @@ +/* + dct64_3dnow.s: Replacement of dct64() with AMD's 3DNow! SIMD operations support + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Syuuhei Kashiyama + + Original "license" statement: + The author of this program disclaim whole expressed or implied + warranties with regard to this program, and in no event shall the + author of this program liable to whatever resulted from the use of + this program. Use it at your own risk. +*/ + +#include "mangle.h" + + .globl ASM_NAME(dct64_3dnow) +/* .type ASM_NAME(dct64_3dnow),@function */ +ASM_NAME(dct64_3dnow): + subl $256,%esp + pushl %ebp + pushl %edi + pushl %esi + pushl %ebx + + #undef _EBX_ + #define _EBX_ %ecx + GET_GOT + + leal 16(%esp),%ebx + movl 284(%esp),%edi + movl 276(%esp),%ebp + movl 280(%esp),%edx + leal 128(%ebx),%esi + + /* femms */ + + /* 1 */ +#if defined(PIC) && defined(__APPLE__) + movl GLOBAL_VAR_PTR(pnts),%eax + movl (%eax),%eax +#else + movl GLOBAL_VAR(pnts),%eax +#endif + movq 0(%edi),%mm0 + movq %mm0,%mm1 + movd 124(%edi),%mm2 + punpckldq 120(%edi),%mm2 + movq 0(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,0(%ebx) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,124(%ebx) + psrlq $32,%mm1 + movd %mm1,120(%ebx) + movq 8(%edi),%mm4 + movq %mm4,%mm5 + movd 116(%edi),%mm6 + punpckldq 112(%edi),%mm6 + movq 8(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,8(%ebx) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,116(%ebx) + psrlq $32,%mm5 + movd %mm5,112(%ebx) + movq 16(%edi),%mm0 + movq %mm0,%mm1 + movd 108(%edi),%mm2 + punpckldq 104(%edi),%mm2 + movq 16(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,16(%ebx) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,108(%ebx) + psrlq $32,%mm1 + movd %mm1,104(%ebx) + movq 24(%edi),%mm4 + movq %mm4,%mm5 + movd 100(%edi),%mm6 + punpckldq 96(%edi),%mm6 + movq 24(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,24(%ebx) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,100(%ebx) + psrlq $32,%mm5 + movd %mm5,96(%ebx) + movq 32(%edi),%mm0 + movq %mm0,%mm1 + movd 92(%edi),%mm2 + punpckldq 88(%edi),%mm2 + movq 32(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,32(%ebx) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,92(%ebx) + psrlq $32,%mm1 + movd %mm1,88(%ebx) + movq 40(%edi),%mm4 + movq %mm4,%mm5 + movd 84(%edi),%mm6 + punpckldq 80(%edi),%mm6 + movq 40(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,40(%ebx) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,84(%ebx) + psrlq $32,%mm5 + movd %mm5,80(%ebx) + movq 48(%edi),%mm0 + movq %mm0,%mm1 + movd 76(%edi),%mm2 + punpckldq 72(%edi),%mm2 + movq 48(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,48(%ebx) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,76(%ebx) + psrlq $32,%mm1 + movd %mm1,72(%ebx) + movq 56(%edi),%mm4 + movq %mm4,%mm5 + movd 68(%edi),%mm6 + punpckldq 64(%edi),%mm6 + movq 56(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,56(%ebx) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,68(%ebx) + psrlq $32,%mm5 + movd %mm5,64(%ebx) + + /* 2 */ +#if defined(PIC) && defined(__APPLE__) + movl GLOBAL_VAR_PTR(pnts),%eax + movl 4(%eax),%eax +#else + movl 4+GLOBAL_VAR(pnts),%eax +#endif + /* 0,14 */ + movq 0(%ebx),%mm0 + movq %mm0,%mm1 + movd 60(%ebx),%mm2 + punpckldq 56(%ebx),%mm2 + movq 0(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,0(%esi) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,60(%esi) + psrlq $32,%mm1 + movd %mm1,56(%esi) + /* 16,30 */ + movq 64(%ebx),%mm0 + movq %mm0,%mm1 + movd 124(%ebx),%mm2 + punpckldq 120(%ebx),%mm2 + pfadd %mm2,%mm0 + movq %mm0,64(%esi) + pfsubr %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,124(%esi) + psrlq $32,%mm1 + movd %mm1,120(%esi) + /* 2,12 */ + movq 8(%ebx),%mm4 + movq %mm4,%mm5 + movd 52(%ebx),%mm6 + punpckldq 48(%ebx),%mm6 + movq 8(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,8(%esi) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,52(%esi) + psrlq $32,%mm5 + movd %mm5,48(%esi) + /* 18,28 */ + movq 72(%ebx),%mm4 + movq %mm4,%mm5 + movd 116(%ebx),%mm6 + punpckldq 112(%ebx),%mm6 + pfadd %mm6,%mm4 + movq %mm4,72(%esi) + pfsubr %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,116(%esi) + psrlq $32,%mm5 + movd %mm5,112(%esi) + /* 4,10 */ + movq 16(%ebx),%mm0 + movq %mm0,%mm1 + movd 44(%ebx),%mm2 + punpckldq 40(%ebx),%mm2 + movq 16(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,16(%esi) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,44(%esi) + psrlq $32,%mm1 + movd %mm1,40(%esi) + /* 20,26 */ + movq 80(%ebx),%mm0 + movq %mm0,%mm1 + movd 108(%ebx),%mm2 + punpckldq 104(%ebx),%mm2 + pfadd %mm2,%mm0 + movq %mm0,80(%esi) + pfsubr %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,108(%esi) + psrlq $32,%mm1 + movd %mm1,104(%esi) + /* 6,8 */ + movq 24(%ebx),%mm4 + movq %mm4,%mm5 + movd 36(%ebx),%mm6 + punpckldq 32(%ebx),%mm6 + movq 24(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,24(%esi) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,36(%esi) + psrlq $32,%mm5 + movd %mm5,32(%esi) + /* 22,24 */ + movq 88(%ebx),%mm4 + movq %mm4,%mm5 + movd 100(%ebx),%mm6 + punpckldq 96(%ebx),%mm6 + pfadd %mm6,%mm4 + movq %mm4,88(%esi) + pfsubr %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,100(%esi) + psrlq $32,%mm5 + movd %mm5,96(%esi) + + /* 3 */ +#if defined(PIC) && defined(__APPLE__) + movl GLOBAL_VAR_PTR(pnts),%eax + movl 8(%eax),%eax +#else + movl 8+GLOBAL_VAR(pnts),%eax +#endif + movq 0(%eax),%mm0 + movq 8(%eax),%mm1 + /* 0,6 */ + movq 0(%esi),%mm2 + movq %mm2,%mm3 + movd 28(%esi),%mm4 + punpckldq 24(%esi),%mm4 + pfadd %mm4,%mm2 + pfsub %mm4,%mm3 + pfmul %mm0,%mm3 + movq %mm2,0(%ebx) + movd %mm3,28(%ebx) + psrlq $32,%mm3 + movd %mm3,24(%ebx) + /* 2,4 */ + movq 8(%esi),%mm5 + movq %mm5,%mm6 + movd 20(%esi),%mm7 + punpckldq 16(%esi),%mm7 + pfadd %mm7,%mm5 + pfsub %mm7,%mm6 + pfmul %mm1,%mm6 + movq %mm5,8(%ebx) + movd %mm6,20(%ebx) + psrlq $32,%mm6 + movd %mm6,16(%ebx) + /* 8,14 */ + movq 32(%esi),%mm2 + movq %mm2,%mm3 + movd 60(%esi),%mm4 + punpckldq 56(%esi),%mm4 + pfadd %mm4,%mm2 + pfsubr %mm4,%mm3 + pfmul %mm0,%mm3 + movq %mm2,32(%ebx) + movd %mm3,60(%ebx) + psrlq $32,%mm3 + movd %mm3,56(%ebx) + /* 10,12 */ + movq 40(%esi),%mm5 + movq %mm5,%mm6 + movd 52(%esi),%mm7 + punpckldq 48(%esi),%mm7 + pfadd %mm7,%mm5 + pfsubr %mm7,%mm6 + pfmul %mm1,%mm6 + movq %mm5,40(%ebx) + movd %mm6,52(%ebx) + psrlq $32,%mm6 + movd %mm6,48(%ebx) + /* 16,22 */ + movq 64(%esi),%mm2 + movq %mm2,%mm3 + movd 92(%esi),%mm4 + punpckldq 88(%esi),%mm4 + pfadd %mm4,%mm2 + pfsub %mm4,%mm3 + pfmul %mm0,%mm3 + movq %mm2,64(%ebx) + movd %mm3,92(%ebx) + psrlq $32,%mm3 + movd %mm3,88(%ebx) + /* 18,20 */ + movq 72(%esi),%mm5 + movq %mm5,%mm6 + movd 84(%esi),%mm7 + punpckldq 80(%esi),%mm7 + pfadd %mm7,%mm5 + pfsub %mm7,%mm6 + pfmul %mm1,%mm6 + movq %mm5,72(%ebx) + movd %mm6,84(%ebx) + psrlq $32,%mm6 + movd %mm6,80(%ebx) + /* 24,30 */ + movq 96(%esi),%mm2 + movq %mm2,%mm3 + movd 124(%esi),%mm4 + punpckldq 120(%esi),%mm4 + pfadd %mm4,%mm2 + pfsubr %mm4,%mm3 + pfmul %mm0,%mm3 + movq %mm2,96(%ebx) + movd %mm3,124(%ebx) + psrlq $32,%mm3 + movd %mm3,120(%ebx) + /* 26,28 */ + movq 104(%esi),%mm5 + movq %mm5,%mm6 + movd 116(%esi),%mm7 + punpckldq 112(%esi),%mm7 + pfadd %mm7,%mm5 + pfsubr %mm7,%mm6 + pfmul %mm1,%mm6 + movq %mm5,104(%ebx) + movd %mm6,116(%ebx) + psrlq $32,%mm6 + movd %mm6,112(%ebx) + + /* 4 */ +#if defined(PIC) && defined(__APPLE__) + movl GLOBAL_VAR_PTR(pnts),%eax + movl 12(%eax),%eax +#else + movl 12+GLOBAL_VAR(pnts),%eax +#endif + movq 0(%eax),%mm0 + /* 0 */ + movq 0(%ebx),%mm1 + movq %mm1,%mm2 + movd 12(%ebx),%mm3 + punpckldq 8(%ebx),%mm3 + pfadd %mm3,%mm1 + pfsub %mm3,%mm2 + pfmul %mm0,%mm2 + movq %mm1,0(%esi) + movd %mm2,12(%esi) + psrlq $32,%mm2 + movd %mm2,8(%esi) + /* 4 */ + movq 16(%ebx),%mm4 + movq %mm4,%mm5 + movd 28(%ebx),%mm6 + punpckldq 24(%ebx),%mm6 + pfadd %mm6,%mm4 + pfsubr %mm6,%mm5 + pfmul %mm0,%mm5 + movq %mm4,16(%esi) + movd %mm5,28(%esi) + psrlq $32,%mm5 + movd %mm5,24(%esi) + /* 8 */ + movq 32(%ebx),%mm1 + movq %mm1,%mm2 + movd 44(%ebx),%mm3 + punpckldq 40(%ebx),%mm3 + pfadd %mm3,%mm1 + pfsub %mm3,%mm2 + pfmul %mm0,%mm2 + movq %mm1,32(%esi) + movd %mm2,44(%esi) + psrlq $32,%mm2 + movd %mm2,40(%esi) + /* 12 */ + movq 48(%ebx),%mm4 + movq %mm4,%mm5 + movd 60(%ebx),%mm6 + punpckldq 56(%ebx),%mm6 + pfadd %mm6,%mm4 + pfsubr %mm6,%mm5 + pfmul %mm0,%mm5 + movq %mm4,48(%esi) + movd %mm5,60(%esi) + psrlq $32,%mm5 + movd %mm5,56(%esi) + /* 16 */ + movq 64(%ebx),%mm1 + movq %mm1,%mm2 + movd 76(%ebx),%mm3 + punpckldq 72(%ebx),%mm3 + pfadd %mm3,%mm1 + pfsub %mm3,%mm2 + pfmul %mm0,%mm2 + movq %mm1,64(%esi) + movd %mm2,76(%esi) + psrlq $32,%mm2 + movd %mm2,72(%esi) + /* 20 */ + movq 80(%ebx),%mm4 + movq %mm4,%mm5 + movd 92(%ebx),%mm6 + punpckldq 88(%ebx),%mm6 + pfadd %mm6,%mm4 + pfsubr %mm6,%mm5 + pfmul %mm0,%mm5 + movq %mm4,80(%esi) + movd %mm5,92(%esi) + psrlq $32,%mm5 + movd %mm5,88(%esi) + /* 24 */ + movq 96(%ebx),%mm1 + movq %mm1,%mm2 + movd 108(%ebx),%mm3 + punpckldq 104(%ebx),%mm3 + pfadd %mm3,%mm1 + pfsub %mm3,%mm2 + pfmul %mm0,%mm2 + movq %mm1,96(%esi) + movd %mm2,108(%esi) + psrlq $32,%mm2 + movd %mm2,104(%esi) + /* 28 */ + movq 112(%ebx),%mm4 + movq %mm4,%mm5 + movd 124(%ebx),%mm6 + punpckldq 120(%ebx),%mm6 + pfadd %mm6,%mm4 + pfsubr %mm6,%mm5 + pfmul %mm0,%mm5 + movq %mm4,112(%esi) + movd %mm5,124(%esi) + psrlq $32,%mm5 + movd %mm5,120(%esi) + + /* 5 */ + movl $-1,%eax + movd %eax,%mm1 + movl $1,%eax + /* L | H */ + movd %eax,%mm0 + punpckldq %mm1,%mm0 + /* 1.0 | -1.0 */ + pi2fd %mm0,%mm0 + movd %eax,%mm1 + pi2fd %mm1,%mm1 +#if defined(PIC) && defined(__APPLE__) + movl GLOBAL_VAR_PTR(pnts),%eax + movl 16(%eax),%eax +#else + movl 16+GLOBAL_VAR(pnts),%eax +#endif + movd 0(%eax),%mm2 + /* 1.0 | cos0 */ + punpckldq %mm2,%mm1 + /* 0 */ + movq 0(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq %mm2,0(%ebx) + movq 8(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm4,8(%ebx) + /* 4 */ + movq 16(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq 24(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm2,%mm3 + psrlq $32,%mm3 + pfadd %mm4,%mm2 + pfadd %mm3,%mm4 + movq %mm2,16(%ebx) + movq %mm4,24(%ebx) + /* 8 */ + movq 32(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq %mm2,32(%ebx) + movq 40(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm4,40(%ebx) + /* 12 */ + movq 48(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq 56(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm2,%mm3 + psrlq $32,%mm3 + pfadd %mm4,%mm2 + pfadd %mm3,%mm4 + movq %mm2,48(%ebx) + movq %mm4,56(%ebx) + /* 16 */ + movq 64(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq %mm2,64(%ebx) + movq 72(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm4,72(%ebx) + /* 20 */ + movq 80(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq 88(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm2,%mm3 + psrlq $32,%mm3 + pfadd %mm4,%mm2 + pfadd %mm3,%mm4 + movq %mm2,80(%ebx) + movq %mm4,88(%ebx) + /* 24 */ + movq 96(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq %mm2,96(%ebx) + movq 104(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm4,104(%ebx) + /* 28 */ + movq 112(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq 120(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm2,%mm3 + psrlq $32,%mm3 + pfadd %mm4,%mm2 + pfadd %mm3,%mm4 + movq %mm2,112(%ebx) + movq %mm4,120(%ebx) + + /* Phase6 */ + movl 0(%ebx),%eax + movl %eax,1024(%ebp) + movl 4(%ebx),%eax + movl %eax,0(%ebp) + movl %eax,0(%edx) + movl 8(%ebx),%eax + movl %eax,512(%ebp) + movl 12(%ebx),%eax + movl %eax,512(%edx) + + movl 16(%ebx),%eax + movl %eax,768(%ebp) + movl 20(%ebx),%eax + movl %eax,256(%edx) + + movl 24(%ebx),%eax + movl %eax,256(%ebp) + movl 28(%ebx),%eax + movl %eax,768(%edx) + + movq 32(%ebx),%mm0 + movq 48(%ebx),%mm1 + pfadd %mm1,%mm0 + movd %mm0,896(%ebp) + psrlq $32,%mm0 + movd %mm0,128(%edx) + movq 40(%ebx),%mm2 + pfadd %mm2,%mm1 + movd %mm1,640(%ebp) + psrlq $32,%mm1 + movd %mm1,384(%edx) + + movq 56(%ebx),%mm3 + pfadd %mm3,%mm2 + movd %mm2,384(%ebp) + psrlq $32,%mm2 + movd %mm2,640(%edx) + + movd 36(%ebx),%mm4 + pfadd %mm4,%mm3 + movd %mm3,128(%ebp) + psrlq $32,%mm3 + movd %mm3,896(%edx) + movq 96(%ebx),%mm0 + movq 64(%ebx),%mm1 + + movq 112(%ebx),%mm2 + pfadd %mm2,%mm0 + movq %mm0,%mm3 + pfadd %mm1,%mm3 + movd %mm3,960(%ebp) + psrlq $32,%mm3 + movd %mm3,64(%edx) + movq 80(%ebx),%mm1 + pfadd %mm1,%mm0 + movd %mm0,832(%ebp) + psrlq $32,%mm0 + movd %mm0,192(%edx) + movq 104(%ebx),%mm3 + pfadd %mm3,%mm2 + movq %mm2,%mm4 + pfadd %mm1,%mm4 + movd %mm4,704(%ebp) + psrlq $32,%mm4 + movd %mm4,320(%edx) + movq 72(%ebx),%mm1 + pfadd %mm1,%mm2 + movd %mm2,576(%ebp) + psrlq $32,%mm2 + movd %mm2,448(%edx) + + movq 120(%ebx),%mm4 + pfadd %mm4,%mm3 + movq %mm3,%mm5 + pfadd %mm1,%mm5 + movd %mm5,448(%ebp) + psrlq $32,%mm5 + movd %mm5,576(%edx) + movq 88(%ebx),%mm1 + pfadd %mm1,%mm3 + movd %mm3,320(%ebp) + psrlq $32,%mm3 + movd %mm3,704(%edx) + + movd 100(%ebx),%mm5 + pfadd %mm5,%mm4 + movq %mm4,%mm6 + pfadd %mm1,%mm6 + movd %mm6,192(%ebp) + psrlq $32,%mm6 + movd %mm6,832(%edx) + movd 68(%ebx),%mm1 + pfadd %mm1,%mm4 + movd %mm4,64(%ebp) + psrlq $32,%mm4 + movd %mm4,960(%edx) + + /* femms */ + + popl %ebx + popl %esi + popl %edi + popl %ebp + addl $256,%esp + + ret + +#if defined(PIC) && defined(__APPLE__) + .section __IMPORT,__pointers,non_lazy_symbol_pointers +L_pnts: + .indirect_symbol ASM_NAME(pnts) + .long 0 +#endif + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_3dnowext.S b/src/libmpg123/dct64_3dnowext.S new file mode 100644 index 0000000..69367bf --- /dev/null +++ b/src/libmpg123/dct64_3dnowext.S @@ -0,0 +1,735 @@ +/* + dct64_3dnowext: extended 3DNow optimized DCT64 + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + Transformed back into standalone asm, with help of + gcc -S -DHAVE_CONFIG_H -I. -march=k6-3 -O3 -Wall -pedantic -fno-strict-aliasing -DREAL_IS_FLOAT -c -o dct64_3dnowext.{S,c} + + MPlayer comment follows. +*/ + +/* +* This code was taken from http://www.mpg123.org +* See ChangeLog of mpg123-0.59s-pre.1 for detail +* Applied to mplayer by Nick Kurshev +* Partial 3dnowex-DSP! optimization by Nick Kurshev +* +* TODO: optimize scalar 3dnow! code +* Warning: Phases 7 & 8 are not tested +*/ + +#include "mangle.h" + + .data + ALIGN4 + /* .type plus_1f, @object + .size plus_1f, 4 */ +plus_1f: + .long 1065353216 + ALIGN8 + /* .type x_plus_minus_3dnow, @object + .size x_plus_minus_3dnow, 8 */ +x_plus_minus_3dnow: + .long 0 + .long -2147483648 + + .text + ALIGN32 +.globl ASM_NAME(dct64_3dnowext) + /* .type ASM_NAME(dct64_3dnowext), @function */ +ASM_NAME(dct64_3dnowext): + pushl %ebp + movl %esp, %ebp + pushl %edi + pushl %esi + pushl %ebx + subl $260, %esp + + GET_GOT +#if defined(OPT_X86) && defined(PIC) + movl _EBX_, (%esp) /* save PIC register */ +#endif +/* APP */ + movl 16(%ebp),%eax + leal 128+-268(%ebp),%edx + movl 8(%ebp),%esi + movl 12(%ebp),%edi +#if defined(PIC) && defined(__APPLE__) + movl GLOBAL_VAR_PTR(costab_mmxsse),%ebx +#else + leal GLOBAL_VAR(costab_mmxsse),%ebx +#endif + leal -268(%ebp),%ecx + movq (%eax), %mm0 + movq 8(%eax), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 120(%eax), %mm1 + pswapd 112(%eax), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, (%edx) + movq %mm4, 8(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul (%ebx), %mm3 + pfmul 8(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 120(%edx) + movq %mm7, 112(%edx) + movq 16(%eax), %mm0 + movq 24(%eax), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 104(%eax), %mm1 + pswapd 96(%eax), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 16(%edx) + movq %mm4, 24(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 16(%ebx), %mm3 + pfmul 24(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 104(%edx) + movq %mm7, 96(%edx) + movq 32(%eax), %mm0 + movq 40(%eax), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 88(%eax), %mm1 + pswapd 80(%eax), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 32(%edx) + movq %mm4, 40(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 32(%ebx), %mm3 + pfmul 40(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 88(%edx) + movq %mm7, 80(%edx) + movq 48(%eax), %mm0 + movq 56(%eax), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 72(%eax), %mm1 + pswapd 64(%eax), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 48(%edx) + movq %mm4, 56(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 48(%ebx), %mm3 + pfmul 56(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 72(%edx) + movq %mm7, 64(%edx) + movq (%edx), %mm0 + movq 8(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 56(%edx), %mm1 + pswapd 48(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, (%ecx) + movq %mm4, 8(%ecx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 64(%ebx), %mm3 + pfmul 72(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 56(%ecx) + movq %mm7, 48(%ecx) + movq 16(%edx), %mm0 + movq 24(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 40(%edx), %mm1 + pswapd 32(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 16(%ecx) + movq %mm4, 24(%ecx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 80(%ebx), %mm3 + pfmul 88(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 40(%ecx) + movq %mm7, 32(%ecx) + movq 64(%edx), %mm0 + movq 72(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 120(%edx), %mm1 + pswapd 112(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 64(%ecx) + movq %mm4, 72(%ecx) + pfsubr %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul 64(%ebx), %mm3 + pfmul 72(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 120(%ecx) + movq %mm7, 112(%ecx) + movq 80(%edx), %mm0 + movq 88(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 104(%edx), %mm1 + pswapd 96(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 80(%ecx) + movq %mm4, 88(%ecx) + pfsubr %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul 80(%ebx), %mm3 + pfmul 88(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 104(%ecx) + movq %mm7, 96(%ecx) + movq 96(%ebx), %mm2 + movq 104(%ebx), %mm6 + movq (%ecx), %mm0 + movq 8(%ecx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 24(%ecx), %mm1 + pswapd 16(%ecx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, (%edx) + movq %mm4, 8(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm6, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 24(%edx) + movq %mm7, 16(%edx) + movq 32(%ecx), %mm0 + movq 40(%ecx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 56(%ecx), %mm1 + pswapd 48(%ecx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 32(%edx) + movq %mm4, 40(%edx) + pfsubr %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm6, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 56(%edx) + movq %mm7, 48(%edx) + movq 64(%ecx), %mm0 + movq 72(%ecx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 88(%ecx), %mm1 + pswapd 80(%ecx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 64(%edx) + movq %mm4, 72(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm6, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 88(%edx) + movq %mm7, 80(%edx) + movq 96(%ecx), %mm0 + movq 104(%ecx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 120(%ecx), %mm1 + pswapd 112(%ecx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 96(%edx) + movq %mm4, 104(%edx) + pfsubr %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm6, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 120(%edx) + movq %mm7, 112(%edx) + movq 112(%ebx), %mm2 + movq (%edx), %mm0 + movq 16(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 8(%edx), %mm1 + pswapd 24(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, (%ecx) + movq %mm4, 16(%ecx) + pfsub %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm2, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 8(%ecx) + movq %mm7, 24(%ecx) + movq 32(%edx), %mm0 + movq 48(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 40(%edx), %mm1 + pswapd 56(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 32(%ecx) + movq %mm4, 48(%ecx) + pfsub %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm2, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 40(%ecx) + movq %mm7, 56(%ecx) + movq 64(%edx), %mm0 + movq 80(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 72(%edx), %mm1 + pswapd 88(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 64(%ecx) + movq %mm4, 80(%ecx) + pfsub %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm2, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 72(%ecx) + movq %mm7, 88(%ecx) + movq 96(%edx), %mm0 + movq 112(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 104(%edx), %mm1 + pswapd 120(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 96(%ecx) + movq %mm4, 112(%ecx) + pfsub %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm2, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 104(%ecx) + movq %mm7, 120(%ecx) +#if defined(OPT_X86) && defined(PIC) + #undef _EBX_ + #define _EBX_ %eax + movl (%esp), _EBX_ +#endif + movd LOCAL_VAR(plus_1f), %mm6 + punpckldq 120(%ebx), %mm6 + movq LOCAL_VAR(x_plus_minus_3dnow), %mm7 + movq 32(%ecx), %mm0 + movq 64(%ecx), %mm2 + movq %mm0, %mm1 + movq %mm2, %mm3 + pxor %mm7, %mm1 + pxor %mm7, %mm3 + pfacc %mm1, %mm0 + pfacc %mm3, %mm2 + pfmul %mm6, %mm0 + pfmul %mm6, %mm2 + movq %mm0, 32(%edx) + movq %mm2, 64(%edx) + movd 44(%ecx), %mm0 + movd 40(%ecx), %mm2 + movd 120(%ebx), %mm3 + punpckldq 76(%ecx), %mm0 + punpckldq 72(%ecx), %mm2 + punpckldq %mm3, %mm3 + movq %mm0, %mm4 + movq %mm2, %mm5 + pfsub %mm2, %mm0 + pfmul %mm3, %mm0 + movq %mm0, %mm1 + pfadd %mm5, %mm0 + pfadd %mm4, %mm0 + movq %mm0, %mm2 + punpckldq %mm1, %mm0 + punpckhdq %mm1, %mm2 + movq %mm0, 40(%edx) + movq %mm2, 72(%edx) + movd 48(%ecx), %mm3 + movd 60(%ecx), %mm2 + pfsub 52(%ecx), %mm3 + pfsub 56(%ecx), %mm2 + pfmul 120(%ebx), %mm3 + pfmul 120(%ebx), %mm2 + movq %mm2, %mm1 + pfadd 56(%ecx), %mm1 + pfadd 60(%ecx), %mm1 + movq %mm1, %mm0 + pfadd 48(%ecx), %mm0 + pfadd 52(%ecx), %mm0 + pfadd %mm3, %mm1 + punpckldq %mm2, %mm1 + pfadd %mm3, %mm2 + punpckldq %mm2, %mm0 + movq %mm1, 56(%edx) + movq %mm0, 48(%edx) + movd 92(%ecx), %mm1 + pfsub 88(%ecx), %mm1 + pfmul 120(%ebx), %mm1 + movd %mm1, 92(%edx) + pfadd 92(%ecx), %mm1 + pfadd 88(%ecx), %mm1 + movq %mm1, %mm0 + pfadd 80(%ecx), %mm0 + pfadd 84(%ecx), %mm0 + movd %mm0, 80(%edx) + movd 80(%ecx), %mm0 + pfsub 84(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + pfadd %mm0, %mm1 + pfadd 92(%edx), %mm0 + punpckldq %mm1, %mm0 + movq %mm0, 84(%edx) + movq 96(%ecx), %mm0 + movq %mm0, %mm1 + pxor %mm7, %mm1 + pfacc %mm1, %mm0 + pfmul %mm6, %mm0 + movq %mm0, 96(%edx) + movd 108(%ecx), %mm0 + pfsub 104(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movd %mm0, 108(%edx) + pfadd 104(%ecx), %mm0 + pfadd 108(%ecx), %mm0 + movd %mm0, 104(%edx) + movd 124(%ecx), %mm1 + pfsub 120(%ecx), %mm1 + pfmul 120(%ebx), %mm1 + movd %mm1, 124(%edx) + pfadd 120(%ecx), %mm1 + pfadd 124(%ecx), %mm1 + movq %mm1, %mm0 + pfadd 112(%ecx), %mm0 + pfadd 116(%ecx), %mm0 + movd %mm0, 112(%edx) + movd 112(%ecx), %mm0 + pfsub 116(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + pfadd %mm0,%mm1 + pfadd 124(%edx), %mm0 + punpckldq %mm1, %mm0 + movq %mm0, 116(%edx) + jnz .L01 + movd (%ecx), %mm0 + pfadd 4(%ecx), %mm0 + movd %mm0, 1024(%esi) + movd (%ecx), %mm0 + pfsub 4(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movd %mm0, (%esi) + movd %mm0, (%edi) + movd 12(%ecx), %mm0 + pfsub 8(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movd %mm0, 512(%edi) + pfadd 12(%ecx), %mm0 + pfadd 8(%ecx), %mm0 + movd %mm0, 512(%esi) + movd 16(%ecx), %mm0 + pfsub 20(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movq %mm0, %mm3 + movd 28(%ecx), %mm0 + pfsub 24(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movd %mm0, 768(%edi) + movq %mm0, %mm2 + pfadd 24(%ecx), %mm0 + pfadd 28(%ecx), %mm0 + movq %mm0, %mm1 + pfadd 16(%ecx), %mm0 + pfadd 20(%ecx), %mm0 + movd %mm0, 768(%esi) + pfadd %mm3, %mm1 + movd %mm1, 256(%esi) + pfadd %mm3, %mm2 + movd %mm2, 256(%edi) + movq 32(%edx), %mm0 + movq 48(%edx), %mm1 + pfadd 48(%edx), %mm0 + pfadd 40(%edx), %mm1 + movd %mm0, 896(%esi) + movd %mm1, 640(%esi) + psrlq $32, %mm0 + psrlq $32, %mm1 + movd %mm0, 128(%edi) + movd %mm1, 384(%edi) + movd 40(%edx), %mm0 + pfadd 56(%edx), %mm0 + movd %mm0, 384(%esi) + movd 56(%edx), %mm0 + pfadd 36(%edx), %mm0 + movd %mm0, 128(%esi) + movd 60(%edx), %mm0 + movd %mm0, 896(%edi) + pfadd 44(%edx), %mm0 + movd %mm0, 640(%edi) + movq 96(%edx), %mm0 + movq 112(%edx), %mm2 + movq 104(%edx), %mm4 + pfadd 112(%edx), %mm0 + pfadd 104(%edx), %mm2 + pfadd 120(%edx), %mm4 + movq %mm0, %mm1 + movq %mm2, %mm3 + movq %mm4, %mm5 + pfadd 64(%edx), %mm0 + pfadd 80(%edx), %mm2 + pfadd 72(%edx), %mm4 + movd %mm0, 960(%esi) + movd %mm2, 704(%esi) + movd %mm4, 448(%esi) + psrlq $32, %mm0 + psrlq $32, %mm2 + psrlq $32, %mm4 + movd %mm0, 64(%edi) + movd %mm2, 320(%edi) + movd %mm4, 576(%edi) + pfadd 80(%edx), %mm1 + pfadd 72(%edx), %mm3 + pfadd 88(%edx), %mm5 + movd %mm1, 832(%esi) + movd %mm3, 576(%esi) + movd %mm5, 320(%esi) + psrlq $32, %mm1 + psrlq $32, %mm3 + psrlq $32, %mm5 + movd %mm1, 192(%edi) + movd %mm3, 448(%edi) + movd %mm5, 704(%edi) + movd 120(%edx), %mm0 + pfadd 100(%edx), %mm0 + movq %mm0, %mm1 + pfadd 88(%edx), %mm0 + movd %mm0, 192(%esi) + pfadd 68(%edx), %mm1 + movd %mm1, 64(%esi) + movd 124(%edx), %mm0 + movd %mm0, 960(%edi) + pfadd 92(%edx), %mm0 + movd %mm0, 832(%edi) + jmp .L_bye +.L01: + movq (%ecx), %mm0 + movq %mm0, %mm1 + pxor %mm7, %mm1 + pfacc %mm1, %mm0 + pfmul %mm6, %mm0 + pf2iw %mm0, %mm0 + movd %mm0, %eax + movw %ax, 512(%esi) + psrlq $32, %mm0 + movd %mm0, %eax + movw %ax, (%esi) + movd 12(%ecx), %mm0 + pfsub 8(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + pf2iw %mm0, %mm7 + movd %mm7, %eax + movw %ax, 256(%edi) + pfadd 12(%ecx), %mm0 + pfadd 8(%ecx), %mm0 + pf2iw %mm0, %mm0 + movd %mm0, %eax + movw %ax, 256(%esi) + movd 16(%ecx), %mm3 + pfsub 20(%ecx), %mm3 + pfmul 120(%ebx), %mm3 + movq %mm3, %mm2 + movd 28(%ecx), %mm2 + pfsub 24(%ecx), %mm2 + pfmul 120(%ebx), %mm2 + movq %mm2, %mm1 + pf2iw %mm2, %mm7 + movd %mm7, %eax + movw %ax, 384(%edi) + pfadd 24(%ecx), %mm1 + pfadd 28(%ecx), %mm1 + movq %mm1, %mm0 + pfadd 16(%ecx), %mm0 + pfadd 20(%ecx), %mm0 + pf2iw %mm0, %mm0 + movd %mm0, %eax + movw %ax, 384(%esi) + pfadd %mm3, %mm1 + pf2iw %mm1, %mm1 + movd %mm1, %eax + movw %ax, 128(%esi) + pfadd %mm3, %mm2 + pf2iw %mm2, %mm2 + movd %mm2, %eax + movw %ax, 128(%edi) + movq 32(%edx), %mm0 + movq 48(%edx), %mm1 + pfadd 48(%edx), %mm0 + pfadd 40(%edx), %mm1 + pf2iw %mm0, %mm0 + pf2iw %mm1, %mm1 + movd %mm0, %eax + movd %mm1, %ecx + movw %ax, 448(%esi) + movw %cx, 320(%esi) + psrlq $32, %mm0 + psrlq $32, %mm1 + movd %mm0, %eax + movd %mm1, %ecx + movw %ax, 64(%edi) + movw %cx, 192(%edi) + movd 40(%edx), %mm3 + movd 56(%edx), %mm4 + movd 60(%edx), %mm0 + movd 44(%edx), %mm2 + movd 120(%edx), %mm5 + punpckldq %mm4, %mm3 + punpckldq 124(%edx), %mm0 + pfadd 100(%edx), %mm5 + punpckldq 36(%edx), %mm4 + punpckldq 92(%edx), %mm2 + movq %mm5, %mm6 + pfadd %mm4, %mm3 + pf2iw %mm0, %mm1 + pf2iw %mm3, %mm3 + pfadd 88(%edx), %mm5 + movd %mm1, %eax + movd %mm3, %ecx + movw %ax, 448(%edi) + movw %cx, 192(%esi) + pf2iw %mm5, %mm5 + psrlq $32, %mm1 + psrlq $32, %mm3 + movd %mm5, %ebx + movd %mm1, %eax + movd %mm3, %ecx + movw %bx, 96(%esi) + movw %ax, 480(%edi) + movw %cx, 64(%esi) + pfadd %mm2, %mm0 + pf2iw %mm0, %mm0 + movd %mm0, %eax + pfadd 68(%edx), %mm6 + movw %ax, 320(%edi) + psrlq $32, %mm0 + pf2iw %mm6, %mm6 + movd %mm0, %eax + movd %mm6, %ebx + movw %ax, 416(%edi) + movw %bx, 32(%esi) + movq 96(%edx), %mm0 + movq 112(%edx), %mm2 + movq 104(%edx), %mm4 + pfadd %mm2, %mm0 + pfadd %mm4, %mm2 + pfadd 120(%edx), %mm4 + movq %mm0, %mm1 + movq %mm2, %mm3 + movq %mm4, %mm5 + pfadd 64(%edx), %mm0 + pfadd 80(%edx), %mm2 + pfadd 72(%edx), %mm4 + pf2iw %mm0, %mm0 + pf2iw %mm2, %mm2 + pf2iw %mm4, %mm4 + movd %mm0, %eax + movd %mm2, %ecx + movd %mm4, %ebx + movw %ax, 480(%esi) + movw %cx, 352(%esi) + movw %bx, 224(%esi) + psrlq $32, %mm0 + psrlq $32, %mm2 + psrlq $32, %mm4 + movd %mm0, %eax + movd %mm2, %ecx + movd %mm4, %ebx + movw %ax, 32(%edi) + movw %cx, 160(%edi) + movw %bx, 288(%edi) + pfadd 80(%edx), %mm1 + pfadd 72(%edx), %mm3 + pfadd 88(%edx), %mm5 + pf2iw %mm1, %mm1 + pf2iw %mm3, %mm3 + pf2iw %mm5, %mm5 + movd %mm1, %eax + movd %mm3, %ecx + movd %mm5, %ebx + movw %ax, 416(%esi) + movw %cx, 288(%esi) + movw %bx, 160(%esi) + psrlq $32, %mm1 + psrlq $32, %mm3 + psrlq $32, %mm5 + movd %mm1, %eax + movd %mm3, %ecx + movd %mm5, %ebx + movw %ax, 96(%edi) + movw %cx, 224(%edi) + movw %bx, 352(%edi) + movsw +.L_bye: + femms + +/* NO_APP */ + addl $260, %esp + popl %ebx + popl %esi + popl %edi + leave + ret + /* .size ASM_NAME(dct64_3dnowext), .-ASM_NAME(dct64_3dnowext) */ + +#if defined(PIC) && defined(__APPLE__) + .section __IMPORT,__pointers,non_lazy_symbol_pointers +L_costab_mmxsse: + .indirect_symbol ASM_NAME(costab_mmxsse) + .long 0 +#endif + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_altivec.c b/src/libmpg123/dct64_altivec.c new file mode 100644 index 0000000..3d6c7e1 --- /dev/null +++ b/src/libmpg123/dct64_altivec.c @@ -0,0 +1,315 @@ +/* + dct64_altivec.c: Discrete Cosine Tansform (DCT) for Altivec + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + altivec optimization by tmkk +*/ + +/* + * Discrete Cosine Tansform (DCT) for subband synthesis + * + * -funroll-loops (for gcc) will remove the loops for better performance + * using loops in the source-code enhances readabillity + * + * + * TODO: write an optimized version for the down-sampling modes + * (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero + */ + +#include "mpg123lib_intern.h" + +#ifndef __APPLE__ +#include +#endif + +void dct64_altivec(real *out0,real *out1,real *samples) +{ + ALIGNED(16) real bufs[32]; + + { + register real *b1,*costab; + + vector unsigned char vinvert,vperm1,vperm2,vperm3,vperm4; + vector float v1,v2,v3,v4,v5,v6,v7,v8; + vector float vbs1,vbs2,vbs3,vbs4,vbs5,vbs6,vbs7,vbs8; + vector float vbs9,vbs10,vbs11,vbs12,vbs13,vbs14,vbs15,vbs16; + vector float vzero; + b1 = samples; + costab = pnts[0]; + + vzero = vec_xor(vzero,vzero); +#ifdef __APPLE__ + vinvert = (vector unsigned char)(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3); +#else + vinvert = (vector unsigned char){12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3}; +#endif + vperm1 = vec_lvsl(0,b1); + vperm2 = vec_perm(vperm1,vperm1,vinvert); + + v1 = vec_ld(0,b1); + v2 = vec_ld(16,b1); + v3 = vec_ld(112,b1); + v4 = vec_ld(127,b1); + v5 = vec_perm(v1,v2,vperm1); /* b1[0,1,2,3] */ + v6 = vec_perm(v3,v4,vperm2); /* b1[31,30,29,28] */ + + vbs1 = vec_add(v5,v6); + vbs8 = vec_sub(v5,v6); + + v1 = vec_ld(32,b1); + v4 = vec_ld(96,b1); + v5 = vec_perm(v2,v1,vperm1); /* b1[4,5,6,7] */ + v6 = vec_perm(v4,v3,vperm2); /* b1[27,26,25,24] */ + + vbs2 = vec_add(v5,v6); + vbs7 = vec_sub(v5,v6); + + v2 = vec_ld(48,b1); + v3 = vec_ld(80,b1); + v5 = vec_perm(v1,v2,vperm1); /* b1[8,9,10,11] */ + v6 = vec_perm(v3,v4,vperm2); /* b1[23,22,21,20] */ + + vbs3 = vec_add(v5,v6); + vbs6 = vec_sub(v5,v6); + + v1 = vec_ld(64,b1); + v5 = vec_perm(v2,v1,vperm1); /* b1[12,13,14,15] */ + v6 = vec_perm(v1,v3,vperm2); /* b1[19,18,17,16] */ + + vbs4 = vec_add(v5,v6); + vbs5 = vec_sub(v5,v6); + + v1 = vec_ld(0,costab); + vbs8 = vec_madd(vbs8,v1,vzero); + v2 = vec_ld(16,costab); + vbs7 = vec_madd(vbs7,v2,vzero); + v3 = vec_ld(32,costab); + vbs6 = vec_madd(vbs6,v3,vzero); + v4 = vec_ld(48,costab); + vbs5 = vec_madd(vbs5,v4,vzero); + vbs6 = vec_perm(vbs6,vbs6,vinvert); + vbs5 = vec_perm(vbs5,vbs5,vinvert); + + + costab = pnts[1]; + + v1 = vec_perm(vbs4,vbs4,vinvert); + vbs9 = vec_add(vbs1,v1); + v3 = vec_sub(vbs1,v1); + v5 = vec_ld(0,costab); + v2 = vec_perm(vbs3,vbs3,vinvert); + vbs10 = vec_add(vbs2,v2); + v4 = vec_sub(vbs2,v2); + v6 = vec_ld(16,costab); + vbs12 = vec_madd(v3,v5,vzero); + vbs11 = vec_madd(v4,v6,vzero); + + v7 = vec_sub(vbs7,vbs6); + v8 = vec_sub(vbs8,vbs5); + vbs13 = vec_add(vbs5,vbs8); + vbs14 = vec_add(vbs6,vbs7); + vbs15 = vec_madd(v7,v6,vzero); + vbs16 = vec_madd(v8,v5,vzero); + + + costab = pnts[2]; + + v1 = vec_perm(vbs10,vbs10,vinvert); + v5 = vec_perm(vbs14,vbs14,vinvert); + vbs1 = vec_add(v1,vbs9); + vbs5 = vec_add(v5,vbs13); + v2 = vec_sub(vbs9,v1); + v6 = vec_sub(vbs13,v5); + v3 = vec_ld(0,costab); + vbs11 = vec_perm(vbs11,vbs11,vinvert); + vbs15 = vec_perm(vbs15,vbs15,vinvert); + vbs3 = vec_add(vbs11,vbs12); + vbs7 = vec_add(vbs15,vbs16); + v4 = vec_sub(vbs12,vbs11); + v7 = vec_sub(vbs16,vbs15); + vbs2 = vec_madd(v2,v3,vzero); + vbs4 = vec_madd(v4,v3,vzero); + vbs6 = vec_madd(v6,v3,vzero); + vbs8 = vec_madd(v7,v3,vzero); + + vbs2 = vec_perm(vbs2,vbs2,vinvert); + vbs4 = vec_perm(vbs4,vbs4,vinvert); + vbs6 = vec_perm(vbs6,vbs6,vinvert); + vbs8 = vec_perm(vbs8,vbs8,vinvert); + + + costab = pnts[3]; + +#ifdef __APPLE__ + vperm1 = (vector unsigned char)(0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23); + vperm2 = (vector unsigned char)(12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27); + vperm3 = (vector unsigned char)(0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19); +#else + vperm1 = (vector unsigned char){0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23}; + vperm2 = (vector unsigned char){12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27}; + vperm3 = (vector unsigned char){0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19}; +#endif + vperm4 = vec_add(vperm3,vec_splat_u8(8)); + + v1 = vec_ld(0,costab); + v2 = vec_splat(v1,0); + v3 = vec_splat(v1,1); + v1 = vec_mergeh(v2,v3); + + v2 = vec_perm(vbs1,vbs3,vperm1); + v3 = vec_perm(vbs2,vbs4,vperm1); + v4 = vec_perm(vbs1,vbs3,vperm2); + v5 = vec_perm(vbs2,vbs4,vperm2); + v6 = vec_sub(v2,v4); + v7 = vec_sub(v3,v5); + v2 = vec_add(v2,v4); + v3 = vec_add(v3,v5); + v4 = vec_madd(v6,v1,vzero); + v5 = vec_nmsub(v7,v1,vzero); + vbs9 = vec_perm(v2,v4,vperm3); + vbs11 = vec_perm(v2,v4,vperm4); + vbs10 = vec_perm(v3,v5,vperm3); + vbs12 = vec_perm(v3,v5,vperm4); + + v2 = vec_perm(vbs5,vbs7,vperm1); + v3 = vec_perm(vbs6,vbs8,vperm1); + v4 = vec_perm(vbs5,vbs7,vperm2); + v5 = vec_perm(vbs6,vbs8,vperm2); + v6 = vec_sub(v2,v4); + v7 = vec_sub(v3,v5); + v2 = vec_add(v2,v4); + v3 = vec_add(v3,v5); + v4 = vec_madd(v6,v1,vzero); + v5 = vec_nmsub(v7,v1,vzero); + vbs13 = vec_perm(v2,v4,vperm3); + vbs15 = vec_perm(v2,v4,vperm4); + vbs14 = vec_perm(v3,v5,vperm3); + vbs16 = vec_perm(v3,v5,vperm4); + + + costab = pnts[4]; + + v1 = vec_lde(0,costab); +#ifdef __APPLE__ + v2 = (vector float)(1.0f,-1.0f,1.0f,-1.0f); +#else + v2 = (vector float){1.0f,-1.0f,1.0f,-1.0f}; +#endif + v3 = vec_splat(v1,0); + v1 = vec_madd(v2,v3,vzero); + + v2 = vec_mergeh(vbs9,vbs10); + v3 = vec_mergel(vbs9,vbs10); + v4 = vec_mergeh(vbs11,vbs12); + v5 = vec_mergel(vbs11,vbs12); + v6 = vec_mergeh(v2,v3); + v7 = vec_mergel(v2,v3); + v2 = vec_mergeh(v4,v5); + v3 = vec_mergel(v4,v5); + v4 = vec_sub(v6,v7); + v5 = vec_sub(v2,v3); + v6 = vec_add(v6,v7); + v7 = vec_add(v2,v3); + v2 = vec_madd(v4,v1,vzero); + v3 = vec_madd(v5,v1,vzero); + vbs1 = vec_mergeh(v6,v2); + vbs2 = vec_mergel(v6,v2); + vbs3 = vec_mergeh(v7,v3); + vbs4 = vec_mergel(v7,v3); + + v2 = vec_mergeh(vbs13,vbs14); + v3 = vec_mergel(vbs13,vbs14); + v4 = vec_mergeh(vbs15,vbs16); + v5 = vec_mergel(vbs15,vbs16); + v6 = vec_mergeh(v2,v3); + v7 = vec_mergel(v2,v3); + v2 = vec_mergeh(v4,v5); + v3 = vec_mergel(v4,v5); + v4 = vec_sub(v6,v7); + v5 = vec_sub(v2,v3); + v6 = vec_add(v6,v7); + v7 = vec_add(v2,v3); + v2 = vec_madd(v4,v1,vzero); + v3 = vec_madd(v5,v1,vzero); + vbs5 = vec_mergeh(v6,v2); + vbs6 = vec_mergel(v6,v2); + vbs7 = vec_mergeh(v7,v3); + vbs8 = vec_mergel(v7,v3); + + vec_st(vbs1,0,bufs); + vec_st(vbs2,16,bufs); + vec_st(vbs3,32,bufs); + vec_st(vbs4,48,bufs); + vec_st(vbs5,64,bufs); + vec_st(vbs6,80,bufs); + vec_st(vbs7,96,bufs); + vec_st(vbs8,112,bufs); + } + + { + register real *b1; + register int i; + + for(b1=bufs,i=8;i;i--,b1+=4) + b1[2] += b1[3]; + + for(b1=bufs,i=4;i;i--,b1+=8) + { + b1[4] += b1[6]; + b1[6] += b1[5]; + b1[5] += b1[7]; + } + + for(b1=bufs,i=2;i;i--,b1+=16) + { + b1[8] += b1[12]; + b1[12] += b1[10]; + b1[10] += b1[14]; + b1[14] += b1[9]; + b1[9] += b1[13]; + b1[13] += b1[11]; + b1[11] += b1[15]; + } + } + + + out0[0x10*16] = bufs[0]; + out0[0x10*15] = bufs[16+0] + bufs[16+8]; + out0[0x10*14] = bufs[8]; + out0[0x10*13] = bufs[16+8] + bufs[16+4]; + out0[0x10*12] = bufs[4]; + out0[0x10*11] = bufs[16+4] + bufs[16+12]; + out0[0x10*10] = bufs[12]; + out0[0x10* 9] = bufs[16+12] + bufs[16+2]; + out0[0x10* 8] = bufs[2]; + out0[0x10* 7] = bufs[16+2] + bufs[16+10]; + out0[0x10* 6] = bufs[10]; + out0[0x10* 5] = bufs[16+10] + bufs[16+6]; + out0[0x10* 4] = bufs[6]; + out0[0x10* 3] = bufs[16+6] + bufs[16+14]; + out0[0x10* 2] = bufs[14]; + out0[0x10* 1] = bufs[16+14] + bufs[16+1]; + out0[0x10* 0] = bufs[1]; + + out1[0x10* 0] = bufs[1]; + out1[0x10* 1] = bufs[16+1] + bufs[16+9]; + out1[0x10* 2] = bufs[9]; + out1[0x10* 3] = bufs[16+9] + bufs[16+5]; + out1[0x10* 4] = bufs[5]; + out1[0x10* 5] = bufs[16+5] + bufs[16+13]; + out1[0x10* 6] = bufs[13]; + out1[0x10* 7] = bufs[16+13] + bufs[16+3]; + out1[0x10* 8] = bufs[3]; + out1[0x10* 9] = bufs[16+3] + bufs[16+11]; + out1[0x10*10] = bufs[11]; + out1[0x10*11] = bufs[16+11] + bufs[16+7]; + out1[0x10*12] = bufs[7]; + out1[0x10*13] = bufs[16+7] + bufs[16+15]; + out1[0x10*14] = bufs[15]; + out1[0x10*15] = bufs[16+15]; + +} + + diff --git a/src/libmpg123/dct64_avx.S b/src/libmpg123/dct64_avx.S new file mode 100644 index 0000000..3a8468e --- /dev/null +++ b/src/libmpg123/dct64_avx.S @@ -0,0 +1,324 @@ +/* + dct36_sse: AVX optimized dct64 for x86-64 + + copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#define samples %rdx +#define costab %rcx +#define out0 %rdi +#define out1 %rsi + +/* + void dct64_avx(short *out0, short *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN32 +costab_avx: + .long 1056974725 + .long 1057056395 + .long 1057223771 + .long 1057485416 + .long 1057855544 + .long 1058356026 + .long 1059019886 + .long 1059897405 + .long 1061067246 + .long 1062657950 + .long 1064892987 + .long 1066774581 + .long 1069414683 + .long 1073984175 + .long 1079645762 + .long 1092815430 + .long 1057005197 + .long 1057342072 + .long 1058087743 + .long 1059427869 + .long 1061799040 + .long 1065862217 + .long 1071413542 + .long 1084439708 + .long 1057128951 + .long 1058664893 + .long 1063675095 + .long 1076102863 + .long 1057655764 + .long 1067924853 + .long 1060439283 + .long 0 + .text + ALIGN16 +.globl ASM_NAME(dct64_avx) +ASM_NAME(dct64_avx): +#ifdef IS_MSABI + push %rbp + mov %rsp, %rbp + sub $112, %rsp + movaps %xmm6, (%rsp) + movaps %xmm7, 16(%rsp) + movaps %xmm8, 32(%rsp) + movaps %xmm9, 48(%rsp) + movaps %xmm10, 64(%rsp) + movaps %xmm11, 80(%rsp) + movaps %xmm12, 96(%rsp) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + mov %r8, %rdx +#endif + leaq costab_avx(%rip), costab + + vmovups (samples), %ymm0 # input[0,1,2,3,4,5,6,7] + vmovups 32(samples), %ymm1 # input[8,9,10,11,12,13,14,15] + vperm2f128 $0x23, 64(samples), %ymm2, %ymm2 + vperm2f128 $0x23, 96(samples), %ymm3, %ymm3 + vshufps $0x1b, %ymm2, %ymm2, %ymm2 # input[23,22,21,20,19,18,17,16] + vshufps $0x1b, %ymm3, %ymm3, %ymm3 # input[31,30,29,28,27,26,25,24] + vsubps %ymm2, %ymm1, %ymm6 + vsubps %ymm3, %ymm0, %ymm7 + vaddps %ymm0, %ymm3, %ymm4 # bufs[0,1,2,3,4,5,6,7] + vaddps %ymm1, %ymm2, %ymm5 # bufs[8,9,10,11,12,13,14,15] + vmulps (costab), %ymm7, %ymm7 # bufs[31,30,29,28,27,26,25,24] cos64[0,1,2,3,4,5,6,7] + vmulps 32(costab), %ymm6, %ymm6 # bufs[23,22,21,20,19,18,17,16] cos64[8,9,10,11,12,13,14,15] + + vmovaps 64(costab), %ymm8 # cos32[0,1,2,3,4,5,6,7] + + vshufps $0x1b, %ymm5, %ymm5, %ymm5 + vshufps $0x1b, %ymm6, %ymm6, %ymm6 + vperm2f128 $0x01, %ymm5, %ymm5, %ymm5 # bufs[15,14,13,12,11,10,9,8] + vperm2f128 $0x01, %ymm6, %ymm6, %ymm6 # bufs[16,17,18,19,20,21,22,23] + vsubps %ymm5, %ymm4, %ymm1 + vsubps %ymm6, %ymm7, %ymm3 + vaddps %ymm5, %ymm4, %ymm0 # bufs[32,33,34,35,36,37,38,39] + vaddps %ymm6, %ymm7, %ymm2 # bufs[48,49,50,51,52,53,54,55] + vmulps %ymm1, %ymm8, %ymm1 # bufs[47,46,45,44,43,42,41,40] + vmulps %ymm3, %ymm8, %ymm3 # bufs[63,62,61,60,59,58,57,56] + + vmovaps 96(costab), %ymm8 # cos16[0,1,2,3]:cos8[0,1]:cos4[0]:- + vperm2f128 $0x00, %ymm8, %ymm8, %ymm9 # cos16[0,1,2,3,0,1,2,3] + + vperm2f128 $0x20, %ymm1, %ymm0, %ymm4 # bufs[32,33,34,35,47,46,45,44] + vperm2f128 $0x31, %ymm1, %ymm0, %ymm5 + vshufps $0x1b, %ymm5, %ymm5, %ymm5 # bufs[39,38,37,36,40,41,42,43] + vperm2f128 $0x20, %ymm3, %ymm2, %ymm6 # bufs[48,49,50,51,63,62,61,60] + vperm2f128 $0x31, %ymm3, %ymm2, %ymm7 + vshufps $0x1b, %ymm7, %ymm7, %ymm7 # bufs[55,54,53,52,56,57,58,59] + vsubps %ymm5, %ymm4, %ymm1 + vsubps %ymm7, %ymm6, %ymm3 + vaddps %ymm5, %ymm4, %ymm0 # bufs[0,1,2,3,8,9,10,11] + vaddps %ymm7, %ymm6, %ymm2 # bufs[16,17,18,19,24,25,26,27] + vmulps %ymm1, %ymm9, %ymm1 # bufs[7,6,5,4,15,14,13,12] + vmulps %ymm3, %ymm9, %ymm3 # bufs[23,22,21,20,31,30,29,28] + + vperm2f128 $0x11, %ymm8, %ymm8, %ymm8 # cos8[0,1]:cos4[0]:-:cos8[0,1]:cos4[0]:- + vmovddup %ymm8, %ymm9 # cos8[0,1,0,1,0,1,0,1] + + vunpcklps %ymm1, %ymm0, %ymm4 # bufs[0,7,1,6,8,15,9,14] + vunpckhps %ymm1, %ymm0, %ymm5 # bufs[2,5,3,4,10,13,11,12] + vunpcklps %ymm3, %ymm2, %ymm6 # bufs[16,23,17,22,24,31,25,30] + vunpckhps %ymm3, %ymm2, %ymm7 # bufs[18,21,19,20,26,29,27,28] + vshufps $0xd8, %ymm4, %ymm4, %ymm4 # bufs[0,1,7,6,8,9,15,14] + vshufps $0x72, %ymm5, %ymm5, %ymm5 # bufs[3,2,4,5,11,10,12,13] + vshufps $0xd8, %ymm6, %ymm6, %ymm6 # bufs[16,17,23,22,24,25,31,30] + vshufps $0x72, %ymm7, %ymm7, %ymm7 # bufs[19,18,20,21,27,26,28,29] + vsubps %ymm5, %ymm4, %ymm1 + vsubps %ymm7, %ymm6, %ymm3 + vaddps %ymm5, %ymm4, %ymm0 # bufs[32,33,36,37,40,41,44,45] + vaddps %ymm7, %ymm6, %ymm2 # bufs[48,49,52,53,56,57,60,61] + vmulps %ymm1, %ymm9, %ymm1 # bufs[35,34,39,38,43,42,47,46] + vmulps %ymm3, %ymm9, %ymm3 # bufs[51,50,55,54,59,58,63,62] + + vpermilps $0xaa, %ymm8, %ymm8 # cos4[0,0,0,0,0,0,0,0] + + vshufps $0xd8, %ymm0, %ymm0, %ymm0 # bufs[32,36,33,37,40,44,41,45] + vshufps $0xd8, %ymm1, %ymm1, %ymm1 # bufs[35,39,34,38,43,47,42,46] + vshufps $0xd8, %ymm2, %ymm2, %ymm2 # bufs[48,52,49,53,56,60,57,61] + vshufps $0xd8, %ymm3, %ymm3, %ymm3 # bufs[51,55,50,54,59,63,58,62] + vunpcklps %ymm1, %ymm0, %ymm4 # bufs[32,35,36,39,40,43,44,47] + vunpckhps %ymm1, %ymm0, %ymm5 # bufs[33,34,37,38,41,42,45,46] + vunpcklps %ymm3, %ymm2, %ymm6 # bufs[48,51,52,55,56,59,60,63] + vunpckhps %ymm3, %ymm2, %ymm7 # bufs[49,50,53,54,57,58,61,62] + vsubps %ymm5, %ymm4, %ymm1 + vsubps %ymm7, %ymm6, %ymm3 + vaddps %ymm5, %ymm4, %ymm0 # bufs[0,2,4,6,8,10,12,14] + vaddps %ymm7, %ymm6, %ymm2 # bufs[16,18,20,22,24,26,28,30] + vmulps %ymm1, %ymm8, %ymm1 # bufs[1,3,5,7,9,11,13,15] + vmulps %ymm3, %ymm8, %ymm3 # bufs[17,19,21,23,25,27,29,31] + + vxorps %ymm8, %ymm8, %ymm8 + vblendps $0xaa, %ymm1, %ymm8, %ymm5 + vblendps $0xaa, %ymm3, %ymm8, %ymm6 + vaddps %ymm5, %ymm0, %ymm0 + vaddps %ymm6, %ymm2, %ymm2 + vunpcklps %ymm1, %ymm0, %ymm4 # bufs[0,1,2,3,8,9,10,11] + vunpckhps %ymm1, %ymm0, %ymm5 # bufs[4,5,6,7,12,13,14,15] + vunpcklps %ymm3, %ymm2, %ymm6 # bufs[16,17,18,19,24,25,26,27] + vunpckhps %ymm3, %ymm2, %ymm7 # bufs[20,21,22,23,28,29,30,31] + + vextractf128 $0x1, %ymm4, %xmm0 # bufs[8,9,10,11] + vextractf128 $0x1, %ymm5, %xmm1 # bufs[12,13,14,15] + vextractf128 $0x1, %ymm6, %xmm2 # bufs[24,25,26,27] + vextractf128 $0x1, %ymm7, %xmm3 # bufs[28,29,30,31] + + vshufps $0x1e, %xmm5, %xmm5, %xmm9 # bufs[6,7,5,4] + vshufps $0x1e, %xmm1, %xmm1, %xmm10 # bufs[14,15,13,12] + vshufps $0x1e, %xmm7, %xmm7, %xmm11 # bufs[22,23,21,20] + vshufps $0x1e, %xmm3, %xmm3, %xmm12 # bufs[30,31,29,28] + vblendps $0x7, %xmm9, %xmm8, %xmm9 # bufs[6,7,5,-] + vblendps $0x7, %xmm10, %xmm8, %xmm10 # bufs[14,15,13,-] + vblendps $0x7, %xmm11, %xmm8, %xmm11 # bufs[22,23,21,-] + vblendps $0x7, %xmm12, %xmm8, %xmm12 # bufs[30,31,29,-] + vaddps %xmm5, %xmm9, %xmm5 + vaddps %xmm1, %xmm10, %xmm1 + vaddps %xmm7, %xmm11, %xmm7 + vaddps %xmm3, %xmm12, %xmm3 + + prefetcht0 512(out0) + + vshufps $0x1e, %xmm0, %xmm0, %xmm9 # bufs[10,11,9,8] + vshufps $0x1e, %xmm2, %xmm2, %xmm10 # bufs[26,27,25,24] + vaddps %xmm1, %xmm0, %xmm0 + vaddps %xmm3, %xmm2, %xmm2 + vblendps $0x7, %xmm9, %xmm8, %xmm9 # bufs[10,11,9,-] + vblendps $0x7, %xmm10, %xmm8, %xmm10 # bufs[26,27,25,-] + vaddps %xmm1, %xmm9, %xmm1 + vaddps %xmm3, %xmm10, %xmm3 + + vzeroupper + prefetcht0 512(out1) + + cvtps2dq %xmm4, %xmm4 + cvtps2dq %xmm0, %xmm0 + cvtps2dq %xmm5, %xmm5 + cvtps2dq %xmm1, %xmm1 + packssdw %xmm5, %xmm4 + packssdw %xmm1, %xmm0 + movq %xmm4, %rcx + pshufd $0x4e, %xmm4, %xmm5 + movq %xmm0, %rdx + pshufd $0x4e, %xmm0, %xmm1 + movq %xmm5, %r8 + movq %xmm1, %r9 + + addq $512, out0 + movq $-64, %rax + + movw %cx, (out0) + movw %dx, (out0,%rax,1) + movw %r8w, (out0,%rax,2) + movw %r9w, -64(out0,%rax,2) + leaq (out0,%rax,4), out0 + shr $16, %rcx + shr $16, %rdx + shr $16, %r8 + shr $16, %r9 + movw %cx, (out0,%rax,4) + negq %rax + movw %cx, (out1) + movw %dx, (out1,%rax,1) + movw %r8w, (out1,%rax,2) + movw %r9w, 64(out1,%rax,2) + leaq (out1,%rax,4), out1 + shr $16, %rcx + shr $16, %rdx + shr $16, %r8 + shr $16, %r9 + negq %rax + movw %cx, (out0) + movw %dx, (out0,%rax,1) + movw %r8w, (out0,%rax,2) + movw %r9w, -64(out0,%rax,2) + shr $16, %rcx + shr $16, %rdx + shr $16, %r8 + shr $16, %r9 + negq %rax + movw %cx, (out1) + movw %dx, (out1,%rax,1) + movw %r8w, (out1,%rax,2) + movw %r9w, 64(out1,%rax,2) + + leaq -32(out0,%rax,4), out0 + negq %rax + leaq 32(out1,%rax,4), out1 + + vshufps $0x1e, %xmm6, %xmm6, %xmm0 + vblendps $0x7, %xmm0, %xmm8, %xmm0 + addps %xmm2, %xmm6 + addps %xmm7, %xmm2 + addps %xmm3, %xmm7 + addps %xmm0, %xmm3 + cvtps2dq %xmm6, %xmm6 + cvtps2dq %xmm2, %xmm2 + cvtps2dq %xmm7, %xmm7 + cvtps2dq %xmm3, %xmm3 + packssdw %xmm7, %xmm6 + packssdw %xmm3, %xmm2 + movq %xmm6, %rcx + pshufd $0x4e, %xmm6, %xmm7 + movq %xmm2, %rdx + pshufd $0x4e, %xmm2, %xmm3 + movq %xmm7, %r8 + movq %xmm3, %r9 + + movw %cx, (out0) + movw %dx, (out0,%rax,1) + movw %r8w, (out0,%rax,2) + movw %r9w, -64(out0,%rax,2) + leaq (out0,%rax,4), out0 + shr $16, %rcx + shr $16, %rdx + shr $16, %r8 + shr $16, %r9 + negq %rax + movw %cx, (out1) + movw %dx, (out1,%rax,1) + movw %r8w, (out1,%rax,2) + movw %r9w, 64(out1,%rax,2) + leaq (out1,%rax,4), out1 + shr $16, %rcx + shr $16, %rdx + shr $16, %r8 + shr $16, %r9 + negq %rax + movw %cx, (out0) + movw %dx, (out0,%rax,1) + movw %r8w, (out0,%rax,2) + movw %r9w, -64(out0,%rax,2) + shr $16, %rcx + shr $16, %rdx + shr $16, %r8 + shr $16, %r9 + negq %rax + movw %cx, (out1) + movw %dx, (out1,%rax,1) + movw %r8w, (out1,%rax,2) + movw %r9w, 64(out1,%rax,2) + +#ifdef IS_MSABI + pop %rsi + pop %rdi + movaps (%rsp), %xmm6 + movaps 16(%rsp), %xmm7 + movaps 32(%rsp), %xmm8 + movaps 48(%rsp), %xmm9 + movaps 64(%rsp), %xmm10 + movaps 80(%rsp), %xmm11 + movaps 96(%rsp), %xmm12 + mov %rbp, %rsp + pop %rbp +#endif + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_avx_float.S b/src/libmpg123/dct64_avx_float.S new file mode 100644 index 0000000..e4c024e --- /dev/null +++ b/src/libmpg123/dct64_avx_float.S @@ -0,0 +1,294 @@ +/* + dct64_x86_64_float: SSE optimized dct64 for x86-64 (float output version) + + copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#define samples %rdx +#define costab %rcx +#define out0 %rdi +#define out1 %rsi + +/* + void dct64_real_avx(real *out0, real *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN32 +costab_avx: + .long 1056974725 + .long 1057056395 + .long 1057223771 + .long 1057485416 + .long 1057855544 + .long 1058356026 + .long 1059019886 + .long 1059897405 + .long 1061067246 + .long 1062657950 + .long 1064892987 + .long 1066774581 + .long 1069414683 + .long 1073984175 + .long 1079645762 + .long 1092815430 + .long 1057005197 + .long 1057342072 + .long 1058087743 + .long 1059427869 + .long 1061799040 + .long 1065862217 + .long 1071413542 + .long 1084439708 + .long 1057128951 + .long 1058664893 + .long 1063675095 + .long 1076102863 + .long 1057655764 + .long 1067924853 + .long 1060439283 + .long 0 + .text + ALIGN16 +.globl ASM_NAME(dct64_real_avx) +ASM_NAME(dct64_real_avx): +#ifdef IS_MSABI + push %rbp + mov %rsp, %rbp + sub $112, %rsp + movaps %xmm6, (%rsp) + movaps %xmm7, 16(%rsp) + movaps %xmm8, 32(%rsp) + movaps %xmm9, 48(%rsp) + movaps %xmm10, 64(%rsp) + movaps %xmm11, 80(%rsp) + movaps %xmm12, 96(%rsp) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + mov %r8, %rdx +#endif + leaq costab_avx(%rip), costab + + vmovups (samples), %ymm0 # input[0,1,2,3,4,5,6,7] + vmovups 32(samples), %ymm1 # input[8,9,10,11,12,13,14,15] + vperm2f128 $0x23, 64(samples), %ymm2, %ymm2 + vperm2f128 $0x23, 96(samples), %ymm3, %ymm3 + vshufps $0x1b, %ymm2, %ymm2, %ymm2 # input[23,22,21,20,19,18,17,16] + vshufps $0x1b, %ymm3, %ymm3, %ymm3 # input[31,30,29,28,27,26,25,24] + vsubps %ymm2, %ymm1, %ymm6 + vsubps %ymm3, %ymm0, %ymm7 + vaddps %ymm0, %ymm3, %ymm4 # bufs[0,1,2,3,4,5,6,7] + vaddps %ymm1, %ymm2, %ymm5 # bufs[8,9,10,11,12,13,14,15] + vmulps (costab), %ymm7, %ymm7 # bufs[31,30,29,28,27,26,25,24] cos64[0,1,2,3,4,5,6,7] + vmulps 32(costab), %ymm6, %ymm6 # bufs[23,22,21,20,19,18,17,16] cos64[8,9,10,11,12,13,14,15] + + vmovaps 64(costab), %ymm8 # cos32[0,1,2,3,4,5,6,7] + + vshufps $0x1b, %ymm5, %ymm5, %ymm5 + vshufps $0x1b, %ymm6, %ymm6, %ymm6 + vperm2f128 $0x01, %ymm5, %ymm5, %ymm5 # bufs[15,14,13,12,11,10,9,8] + vperm2f128 $0x01, %ymm6, %ymm6, %ymm6 # bufs[16,17,18,19,20,21,22,23] + vsubps %ymm5, %ymm4, %ymm1 + vsubps %ymm6, %ymm7, %ymm3 + vaddps %ymm5, %ymm4, %ymm0 # bufs[32,33,34,35,36,37,38,39] + vaddps %ymm6, %ymm7, %ymm2 # bufs[48,49,50,51,52,53,54,55] + vmulps %ymm1, %ymm8, %ymm1 # bufs[47,46,45,44,43,42,41,40] + vmulps %ymm3, %ymm8, %ymm3 # bufs[63,62,61,60,59,58,57,56] + + vmovaps 96(costab), %ymm8 # cos16[0,1,2,3]:cos8[0,1]:cos4[0]:- + vperm2f128 $0x00, %ymm8, %ymm8, %ymm9 # cos16[0,1,2,3,0,1,2,3] + + vperm2f128 $0x20, %ymm1, %ymm0, %ymm4 # bufs[32,33,34,35,47,46,45,44] + vperm2f128 $0x31, %ymm1, %ymm0, %ymm5 + vshufps $0x1b, %ymm5, %ymm5, %ymm5 # bufs[39,38,37,36,40,41,42,43] + vperm2f128 $0x20, %ymm3, %ymm2, %ymm6 # bufs[48,49,50,51,63,62,61,60] + vperm2f128 $0x31, %ymm3, %ymm2, %ymm7 + vshufps $0x1b, %ymm7, %ymm7, %ymm7 # bufs[55,54,53,52,56,57,58,59] + vsubps %ymm5, %ymm4, %ymm1 + vsubps %ymm7, %ymm6, %ymm3 + vaddps %ymm5, %ymm4, %ymm0 # bufs[0,1,2,3,8,9,10,11] + vaddps %ymm7, %ymm6, %ymm2 # bufs[16,17,18,19,24,25,26,27] + vmulps %ymm1, %ymm9, %ymm1 # bufs[7,6,5,4,15,14,13,12] + vmulps %ymm3, %ymm9, %ymm3 # bufs[23,22,21,20,31,30,29,28] + + vperm2f128 $0x11, %ymm8, %ymm8, %ymm8 # cos8[0,1]:cos4[0]:-:cos8[0,1]:cos4[0]:- + vmovddup %ymm8, %ymm9 # cos8[0,1,0,1,0,1,0,1] + + vunpcklps %ymm1, %ymm0, %ymm4 # bufs[0,7,1,6,8,15,9,14] + vunpckhps %ymm1, %ymm0, %ymm5 # bufs[2,5,3,4,10,13,11,12] + vunpcklps %ymm3, %ymm2, %ymm6 # bufs[16,23,17,22,24,31,25,30] + vunpckhps %ymm3, %ymm2, %ymm7 # bufs[18,21,19,20,26,29,27,28] + vshufps $0xd8, %ymm4, %ymm4, %ymm4 # bufs[0,1,7,6,8,9,15,14] + vshufps $0x72, %ymm5, %ymm5, %ymm5 # bufs[3,2,4,5,11,10,12,13] + vshufps $0xd8, %ymm6, %ymm6, %ymm6 # bufs[16,17,23,22,24,25,31,30] + vshufps $0x72, %ymm7, %ymm7, %ymm7 # bufs[19,18,20,21,27,26,28,29] + vsubps %ymm5, %ymm4, %ymm1 + vsubps %ymm7, %ymm6, %ymm3 + vaddps %ymm5, %ymm4, %ymm0 # bufs[32,33,36,37,40,41,44,45] + vaddps %ymm7, %ymm6, %ymm2 # bufs[48,49,52,53,56,57,60,61] + vmulps %ymm1, %ymm9, %ymm1 # bufs[35,34,39,38,43,42,47,46] + vmulps %ymm3, %ymm9, %ymm3 # bufs[51,50,55,54,59,58,63,62] + + vpermilps $0xaa, %ymm8, %ymm8 # cos4[0,0,0,0,0,0,0,0] + + vshufps $0xd8, %ymm0, %ymm0, %ymm0 # bufs[32,36,33,37,40,44,41,45] + vshufps $0xd8, %ymm1, %ymm1, %ymm1 # bufs[35,39,34,38,43,47,42,46] + vshufps $0xd8, %ymm2, %ymm2, %ymm2 # bufs[48,52,49,53,56,60,57,61] + vshufps $0xd8, %ymm3, %ymm3, %ymm3 # bufs[51,55,50,54,59,63,58,62] + vunpcklps %ymm1, %ymm0, %ymm4 # bufs[32,35,36,39,40,43,44,47] + vunpckhps %ymm1, %ymm0, %ymm5 # bufs[33,34,37,38,41,42,45,46] + vunpcklps %ymm3, %ymm2, %ymm6 # bufs[48,51,52,55,56,59,60,63] + vunpckhps %ymm3, %ymm2, %ymm7 # bufs[49,50,53,54,57,58,61,62] + vsubps %ymm5, %ymm4, %ymm1 + vsubps %ymm7, %ymm6, %ymm3 + vaddps %ymm5, %ymm4, %ymm0 # bufs[0,2,4,6,8,10,12,14] + vaddps %ymm7, %ymm6, %ymm2 # bufs[16,18,20,22,24,26,28,30] + vmulps %ymm1, %ymm8, %ymm1 # bufs[1,3,5,7,9,11,13,15] + vmulps %ymm3, %ymm8, %ymm3 # bufs[17,19,21,23,25,27,29,31] + + vxorps %ymm8, %ymm8, %ymm8 + vblendps $0xaa, %ymm1, %ymm8, %ymm5 + vblendps $0xaa, %ymm3, %ymm8, %ymm6 + vaddps %ymm5, %ymm0, %ymm0 + vaddps %ymm6, %ymm2, %ymm2 + vunpcklps %ymm1, %ymm0, %ymm4 # bufs[0,1,2,3,8,9,10,11] + vunpckhps %ymm1, %ymm0, %ymm5 # bufs[4,5,6,7,12,13,14,15] + vunpcklps %ymm3, %ymm2, %ymm6 # bufs[16,17,18,19,24,25,26,27] + vunpckhps %ymm3, %ymm2, %ymm7 # bufs[20,21,22,23,28,29,30,31] + + vextractf128 $0x1, %ymm4, %xmm0 # bufs[8,9,10,11] + vextractf128 $0x1, %ymm5, %xmm1 # bufs[12,13,14,15] + vextractf128 $0x1, %ymm6, %xmm2 # bufs[24,25,26,27] + vextractf128 $0x1, %ymm7, %xmm3 # bufs[28,29,30,31] + + vshufps $0x1e, %xmm5, %xmm5, %xmm9 # bufs[6,7,5,4] + vshufps $0x1e, %xmm1, %xmm1, %xmm10 # bufs[14,15,13,12] + vshufps $0x1e, %xmm7, %xmm7, %xmm11 # bufs[22,23,21,20] + vshufps $0x1e, %xmm3, %xmm3, %xmm12 # bufs[30,31,29,28] + vblendps $0x7, %xmm9, %xmm8, %xmm9 # bufs[6,7,5,-] + vblendps $0x7, %xmm10, %xmm8, %xmm10 # bufs[14,15,13,-] + vblendps $0x7, %xmm11, %xmm8, %xmm11 # bufs[22,23,21,-] + vblendps $0x7, %xmm12, %xmm8, %xmm12 # bufs[30,31,29,-] + vaddps %xmm5, %xmm9, %xmm5 + vaddps %xmm1, %xmm10, %xmm1 + vaddps %xmm7, %xmm11, %xmm7 + vaddps %xmm3, %xmm12, %xmm3 + + prefetcht0 1024(out0) + + vshufps $0x1e, %xmm0, %xmm0, %xmm9 # bufs[10,11,9,8] + vshufps $0x1e, %xmm2, %xmm2, %xmm10 # bufs[26,27,25,24] + vaddps %xmm1, %xmm0, %xmm0 + vaddps %xmm3, %xmm2, %xmm2 + vblendps $0x7, %xmm9, %xmm8, %xmm9 # bufs[10,11,9,-] + vblendps $0x7, %xmm10, %xmm8, %xmm10 # bufs[26,27,25,-] + vaddps %xmm1, %xmm9, %xmm1 + vaddps %xmm3, %xmm10, %xmm3 + + vzeroupper + prefetcht0 1024(out1) + + addq $1024, out0 + movq $-128, %rax + movss %xmm4, (out0) + movss %xmm0, (out0,%rax,1) + movss %xmm5, (out0,%rax,2) + movss %xmm1, -128(out0,%rax,2) + leaq (out0,%rax,4), out0 + movhlps %xmm4, %xmm9 + movhlps %xmm0, %xmm10 + movhlps %xmm5, %xmm11 + movhlps %xmm1, %xmm12 + vmovss %xmm9, (out0) + vmovss %xmm10, (out0,%rax,1) + vmovss %xmm11, (out0,%rax,2) + vmovss %xmm12, -128(out0,%rax,2) + leaq (out0,%rax,4), out0 + negq %rax + shufps $0xb1, %xmm4, %xmm4 + shufps $0xb1, %xmm0, %xmm0 + shufps $0xb1, %xmm5, %xmm5 + shufps $0xb1, %xmm1, %xmm1 + movss %xmm4, (out0) + movss %xmm4, (out1) + leaq (out1,%rax,1), out1 + movss %xmm0, (out1) + movss %xmm5, (out1,%rax,1) + movss %xmm1, (out1,%rax,2) + leaq (out1,%rax,4), out1 + movhlps %xmm4, %xmm4 + movhlps %xmm0, %xmm0 + movhlps %xmm5, %xmm5 + movhlps %xmm1, %xmm1 + movss %xmm4, -128(out1) + movss %xmm0, (out1) + movss %xmm5, (out1,%rax,1) + movss %xmm1, (out1,%rax,2) + + leaq -64(out0,%rax,8), out0 + negq %rax + vshufps $0x1e, %xmm6, %xmm6, %xmm0 + vblendps $0x7, %xmm0, %xmm8, %xmm0 + addps %xmm2, %xmm6 + addps %xmm7, %xmm2 + addps %xmm3, %xmm7 + addps %xmm0, %xmm3 + movss %xmm6, (out0) + movss %xmm2, (out0,%rax,1) + movss %xmm7, (out0,%rax,2) + movss %xmm3, -128(out0,%rax,2) + leaq (out0,%rax,4), out0 + movhlps %xmm6, %xmm0 + movhlps %xmm2, %xmm1 + movhlps %xmm7, %xmm4 + movhlps %xmm3, %xmm5 + movss %xmm0, (out0) + movss %xmm1, (out0,%rax,1) + movss %xmm4, (out0,%rax,2) + movss %xmm5, -128(out0,%rax,2) + leaq 64(out1,%rax,4), out1 + negq %rax + shufps $0xb1, %xmm6, %xmm6 + shufps $0xb1, %xmm2, %xmm2 + shufps $0xb1, %xmm7, %xmm7 + shufps $0xb1, %xmm3, %xmm3 + movss %xmm6, -128(out1) + movss %xmm2, (out1) + movss %xmm7, (out1,%rax,1) + movss %xmm3, (out1,%rax,2) + leaq (out1,%rax,4), out1 + movhlps %xmm6, %xmm6 + movhlps %xmm2, %xmm2 + movhlps %xmm7, %xmm7 + movhlps %xmm3, %xmm3 + movss %xmm6, -128(out1) + movss %xmm2, (out1) + movss %xmm7, (out1,%rax,1) + movss %xmm3, (out1,%rax,2) + +#ifdef IS_MSABI + pop %rsi + pop %rdi + movaps (%rsp), %xmm6 + movaps 16(%rsp), %xmm7 + movaps 32(%rsp), %xmm8 + movaps 48(%rsp), %xmm9 + movaps 64(%rsp), %xmm10 + movaps 80(%rsp), %xmm11 + movaps 96(%rsp), %xmm12 + mov %rbp, %rsp + pop %rbp +#endif + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_i386.c b/src/libmpg123/dct64_i386.c new file mode 100644 index 0000000..abc05b9 --- /dev/null +++ b/src/libmpg123/dct64_i386.c @@ -0,0 +1,336 @@ +/* + dct64_i386.c: DCT64, a C variant for i386 + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +/* + * Discrete Cosine Tansform (DCT) for subband synthesis + * optimized for machines with no auto-increment. + * The performance is highly compiler dependend. Maybe + * the dct64.c version for 'normal' processor may be faster + * even for Intel processors. + */ + +#include "mpg123lib_intern.h" + +static void dct64_1(real *out0,real *out1,real *b1,real *b2,real *samples) +{ + { + register real *costab = pnts[0]; + + b1[0x00] = samples[0x00] + samples[0x1F]; + b1[0x01] = samples[0x01] + samples[0x1E]; + b1[0x1F] = REAL_MUL(samples[0x00] - samples[0x1F], costab[0x0]); + b1[0x1E] = REAL_MUL(samples[0x01] - samples[0x1E], costab[0x1]); + + b1[0x02] = samples[0x02] + samples[0x1D]; + b1[0x03] = samples[0x03] + samples[0x1C]; + b1[0x1D] = REAL_MUL(samples[0x02] - samples[0x1D], costab[0x2]); + b1[0x1C] = REAL_MUL(samples[0x03] - samples[0x1C], costab[0x3]); + + b1[0x04] = samples[0x04] + samples[0x1B]; + b1[0x05] = samples[0x05] + samples[0x1A]; + b1[0x1B] = REAL_MUL(samples[0x04] - samples[0x1B], costab[0x4]); + b1[0x1A] = REAL_MUL(samples[0x05] - samples[0x1A], costab[0x5]); + + b1[0x06] = samples[0x06] + samples[0x19]; + b1[0x07] = samples[0x07] + samples[0x18]; + b1[0x19] = REAL_MUL(samples[0x06] - samples[0x19], costab[0x6]); + b1[0x18] = REAL_MUL(samples[0x07] - samples[0x18], costab[0x7]); + + b1[0x08] = samples[0x08] + samples[0x17]; + b1[0x09] = samples[0x09] + samples[0x16]; + b1[0x17] = REAL_MUL(samples[0x08] - samples[0x17], costab[0x8]); + b1[0x16] = REAL_MUL(samples[0x09] - samples[0x16], costab[0x9]); + + b1[0x0A] = samples[0x0A] + samples[0x15]; + b1[0x0B] = samples[0x0B] + samples[0x14]; + b1[0x15] = REAL_MUL(samples[0x0A] - samples[0x15], costab[0xA]); + b1[0x14] = REAL_MUL(samples[0x0B] - samples[0x14], costab[0xB]); + + b1[0x0C] = samples[0x0C] + samples[0x13]; + b1[0x0D] = samples[0x0D] + samples[0x12]; + b1[0x13] = REAL_MUL(samples[0x0C] - samples[0x13], costab[0xC]); + b1[0x12] = REAL_MUL(samples[0x0D] - samples[0x12], costab[0xD]); + + b1[0x0E] = samples[0x0E] + samples[0x11]; + b1[0x0F] = samples[0x0F] + samples[0x10]; + b1[0x11] = REAL_MUL(samples[0x0E] - samples[0x11], costab[0xE]); + b1[0x10] = REAL_MUL(samples[0x0F] - samples[0x10], costab[0xF]); + + } + + + { + register real *costab = pnts[1]; + + b2[0x00] = b1[0x00] + b1[0x0F]; + b2[0x01] = b1[0x01] + b1[0x0E]; + b2[0x0F] = REAL_MUL(b1[0x00] - b1[0x0F], costab[0]); + b2[0x0E] = REAL_MUL(b1[0x01] - b1[0x0E], costab[1]); + + b2[0x02] = b1[0x02] + b1[0x0D]; + b2[0x03] = b1[0x03] + b1[0x0C]; + b2[0x0D] = REAL_MUL(b1[0x02] - b1[0x0D], costab[2]); + b2[0x0C] = REAL_MUL(b1[0x03] - b1[0x0C], costab[3]); + + b2[0x04] = b1[0x04] + b1[0x0B]; + b2[0x05] = b1[0x05] + b1[0x0A]; + b2[0x0B] = REAL_MUL(b1[0x04] - b1[0x0B], costab[4]); + b2[0x0A] = REAL_MUL(b1[0x05] - b1[0x0A], costab[5]); + + b2[0x06] = b1[0x06] + b1[0x09]; + b2[0x07] = b1[0x07] + b1[0x08]; + b2[0x09] = REAL_MUL(b1[0x06] - b1[0x09], costab[6]); + b2[0x08] = REAL_MUL(b1[0x07] - b1[0x08], costab[7]); + + /* */ + + b2[0x10] = b1[0x10] + b1[0x1F]; + b2[0x11] = b1[0x11] + b1[0x1E]; + b2[0x1F] = REAL_MUL(b1[0x1F] - b1[0x10], costab[0]); + b2[0x1E] = REAL_MUL(b1[0x1E] - b1[0x11], costab[1]); + + b2[0x12] = b1[0x12] + b1[0x1D]; + b2[0x13] = b1[0x13] + b1[0x1C]; + b2[0x1D] = REAL_MUL(b1[0x1D] - b1[0x12], costab[2]); + b2[0x1C] = REAL_MUL(b1[0x1C] - b1[0x13], costab[3]); + + b2[0x14] = b1[0x14] + b1[0x1B]; + b2[0x15] = b1[0x15] + b1[0x1A]; + b2[0x1B] = REAL_MUL(b1[0x1B] - b1[0x14], costab[4]); + b2[0x1A] = REAL_MUL(b1[0x1A] - b1[0x15], costab[5]); + + b2[0x16] = b1[0x16] + b1[0x19]; + b2[0x17] = b1[0x17] + b1[0x18]; + b2[0x19] = REAL_MUL(b1[0x19] - b1[0x16], costab[6]); + b2[0x18] = REAL_MUL(b1[0x18] - b1[0x17], costab[7]); + } + + { + register real *costab = pnts[2]; + + b1[0x00] = b2[0x00] + b2[0x07]; + b1[0x07] = REAL_MUL(b2[0x00] - b2[0x07], costab[0]); + b1[0x01] = b2[0x01] + b2[0x06]; + b1[0x06] = REAL_MUL(b2[0x01] - b2[0x06], costab[1]); + b1[0x02] = b2[0x02] + b2[0x05]; + b1[0x05] = REAL_MUL(b2[0x02] - b2[0x05], costab[2]); + b1[0x03] = b2[0x03] + b2[0x04]; + b1[0x04] = REAL_MUL(b2[0x03] - b2[0x04], costab[3]); + + b1[0x08] = b2[0x08] + b2[0x0F]; + b1[0x0F] = REAL_MUL(b2[0x0F] - b2[0x08], costab[0]); + b1[0x09] = b2[0x09] + b2[0x0E]; + b1[0x0E] = REAL_MUL(b2[0x0E] - b2[0x09], costab[1]); + b1[0x0A] = b2[0x0A] + b2[0x0D]; + b1[0x0D] = REAL_MUL(b2[0x0D] - b2[0x0A], costab[2]); + b1[0x0B] = b2[0x0B] + b2[0x0C]; + b1[0x0C] = REAL_MUL(b2[0x0C] - b2[0x0B], costab[3]); + + b1[0x10] = b2[0x10] + b2[0x17]; + b1[0x17] = REAL_MUL(b2[0x10] - b2[0x17], costab[0]); + b1[0x11] = b2[0x11] + b2[0x16]; + b1[0x16] = REAL_MUL(b2[0x11] - b2[0x16], costab[1]); + b1[0x12] = b2[0x12] + b2[0x15]; + b1[0x15] = REAL_MUL(b2[0x12] - b2[0x15], costab[2]); + b1[0x13] = b2[0x13] + b2[0x14]; + b1[0x14] = REAL_MUL(b2[0x13] - b2[0x14], costab[3]); + + b1[0x18] = b2[0x18] + b2[0x1F]; + b1[0x1F] = REAL_MUL(b2[0x1F] - b2[0x18], costab[0]); + b1[0x19] = b2[0x19] + b2[0x1E]; + b1[0x1E] = REAL_MUL(b2[0x1E] - b2[0x19], costab[1]); + b1[0x1A] = b2[0x1A] + b2[0x1D]; + b1[0x1D] = REAL_MUL(b2[0x1D] - b2[0x1A], costab[2]); + b1[0x1B] = b2[0x1B] + b2[0x1C]; + b1[0x1C] = REAL_MUL(b2[0x1C] - b2[0x1B], costab[3]); + } + + { + register real const cos0 = pnts[3][0]; + register real const cos1 = pnts[3][1]; + + b2[0x00] = b1[0x00] + b1[0x03]; + b2[0x03] = REAL_MUL(b1[0x00] - b1[0x03], cos0); + b2[0x01] = b1[0x01] + b1[0x02]; + b2[0x02] = REAL_MUL(b1[0x01] - b1[0x02], cos1); + + b2[0x04] = b1[0x04] + b1[0x07]; + b2[0x07] = REAL_MUL(b1[0x07] - b1[0x04], cos0); + b2[0x05] = b1[0x05] + b1[0x06]; + b2[0x06] = REAL_MUL(b1[0x06] - b1[0x05], cos1); + + b2[0x08] = b1[0x08] + b1[0x0B]; + b2[0x0B] = REAL_MUL(b1[0x08] - b1[0x0B], cos0); + b2[0x09] = b1[0x09] + b1[0x0A]; + b2[0x0A] = REAL_MUL(b1[0x09] - b1[0x0A], cos1); + + b2[0x0C] = b1[0x0C] + b1[0x0F]; + b2[0x0F] = REAL_MUL(b1[0x0F] - b1[0x0C], cos0); + b2[0x0D] = b1[0x0D] + b1[0x0E]; + b2[0x0E] = REAL_MUL(b1[0x0E] - b1[0x0D], cos1); + + b2[0x10] = b1[0x10] + b1[0x13]; + b2[0x13] = REAL_MUL(b1[0x10] - b1[0x13], cos0); + b2[0x11] = b1[0x11] + b1[0x12]; + b2[0x12] = REAL_MUL(b1[0x11] - b1[0x12], cos1); + + b2[0x14] = b1[0x14] + b1[0x17]; + b2[0x17] = REAL_MUL(b1[0x17] - b1[0x14], cos0); + b2[0x15] = b1[0x15] + b1[0x16]; + b2[0x16] = REAL_MUL(b1[0x16] - b1[0x15], cos1); + + b2[0x18] = b1[0x18] + b1[0x1B]; + b2[0x1B] = REAL_MUL(b1[0x18] - b1[0x1B], cos0); + b2[0x19] = b1[0x19] + b1[0x1A]; + b2[0x1A] = REAL_MUL(b1[0x19] - b1[0x1A], cos1); + + b2[0x1C] = b1[0x1C] + b1[0x1F]; + b2[0x1F] = REAL_MUL(b1[0x1F] - b1[0x1C], cos0); + b2[0x1D] = b1[0x1D] + b1[0x1E]; + b2[0x1E] = REAL_MUL(b1[0x1E] - b1[0x1D], cos1); + } + + { + register real const cos0 = pnts[4][0]; + + b1[0x00] = b2[0x00] + b2[0x01]; + b1[0x01] = REAL_MUL(b2[0x00] - b2[0x01], cos0); + b1[0x02] = b2[0x02] + b2[0x03]; + b1[0x03] = REAL_MUL(b2[0x03] - b2[0x02], cos0); + b1[0x02] += b1[0x03]; + + b1[0x04] = b2[0x04] + b2[0x05]; + b1[0x05] = REAL_MUL(b2[0x04] - b2[0x05], cos0); + b1[0x06] = b2[0x06] + b2[0x07]; + b1[0x07] = REAL_MUL(b2[0x07] - b2[0x06], cos0); + b1[0x06] += b1[0x07]; + b1[0x04] += b1[0x06]; + b1[0x06] += b1[0x05]; + b1[0x05] += b1[0x07]; + + b1[0x08] = b2[0x08] + b2[0x09]; + b1[0x09] = REAL_MUL(b2[0x08] - b2[0x09], cos0); + b1[0x0A] = b2[0x0A] + b2[0x0B]; + b1[0x0B] = REAL_MUL(b2[0x0B] - b2[0x0A], cos0); + b1[0x0A] += b1[0x0B]; + + b1[0x0C] = b2[0x0C] + b2[0x0D]; + b1[0x0D] = REAL_MUL(b2[0x0C] - b2[0x0D], cos0); + b1[0x0E] = b2[0x0E] + b2[0x0F]; + b1[0x0F] = REAL_MUL(b2[0x0F] - b2[0x0E], cos0); + b1[0x0E] += b1[0x0F]; + b1[0x0C] += b1[0x0E]; + b1[0x0E] += b1[0x0D]; + b1[0x0D] += b1[0x0F]; + + b1[0x10] = b2[0x10] + b2[0x11]; + b1[0x11] = REAL_MUL(b2[0x10] - b2[0x11], cos0); + b1[0x12] = b2[0x12] + b2[0x13]; + b1[0x13] = REAL_MUL(b2[0x13] - b2[0x12], cos0); + b1[0x12] += b1[0x13]; + + b1[0x14] = b2[0x14] + b2[0x15]; + b1[0x15] = REAL_MUL(b2[0x14] - b2[0x15], cos0); + b1[0x16] = b2[0x16] + b2[0x17]; + b1[0x17] = REAL_MUL(b2[0x17] - b2[0x16], cos0); + b1[0x16] += b1[0x17]; + b1[0x14] += b1[0x16]; + b1[0x16] += b1[0x15]; + b1[0x15] += b1[0x17]; + + b1[0x18] = b2[0x18] + b2[0x19]; + b1[0x19] = REAL_MUL(b2[0x18] - b2[0x19], cos0); + b1[0x1A] = b2[0x1A] + b2[0x1B]; + b1[0x1B] = REAL_MUL(b2[0x1B] - b2[0x1A], cos0); + b1[0x1A] += b1[0x1B]; + + b1[0x1C] = b2[0x1C] + b2[0x1D]; + b1[0x1D] = REAL_MUL(b2[0x1C] - b2[0x1D], cos0); + b1[0x1E] = b2[0x1E] + b2[0x1F]; + b1[0x1F] = REAL_MUL(b2[0x1F] - b2[0x1E], cos0); + b1[0x1E] += b1[0x1F]; + b1[0x1C] += b1[0x1E]; + b1[0x1E] += b1[0x1D]; + b1[0x1D] += b1[0x1F]; + } + + out0[0x10*16] = REAL_SCALE_DCT64(b1[0x00]); + out0[0x10*12] = REAL_SCALE_DCT64(b1[0x04]); + out0[0x10* 8] = REAL_SCALE_DCT64(b1[0x02]); + out0[0x10* 4] = REAL_SCALE_DCT64(b1[0x06]); + out0[0x10* 0] = REAL_SCALE_DCT64(b1[0x01]); + out1[0x10* 0] = REAL_SCALE_DCT64(b1[0x01]); + out1[0x10* 4] = REAL_SCALE_DCT64(b1[0x05]); + out1[0x10* 8] = REAL_SCALE_DCT64(b1[0x03]); + out1[0x10*12] = REAL_SCALE_DCT64(b1[0x07]); + +#if 1 + out0[0x10*14] = REAL_SCALE_DCT64(b1[0x08] + b1[0x0C]); + out0[0x10*10] = REAL_SCALE_DCT64(b1[0x0C] + b1[0x0a]); + out0[0x10* 6] = REAL_SCALE_DCT64(b1[0x0A] + b1[0x0E]); + out0[0x10* 2] = REAL_SCALE_DCT64(b1[0x0E] + b1[0x09]); + out1[0x10* 2] = REAL_SCALE_DCT64(b1[0x09] + b1[0x0D]); + out1[0x10* 6] = REAL_SCALE_DCT64(b1[0x0D] + b1[0x0B]); + out1[0x10*10] = REAL_SCALE_DCT64(b1[0x0B] + b1[0x0F]); + out1[0x10*14] = REAL_SCALE_DCT64(b1[0x0F]); +#else + b1[0x08] += b1[0x0C]; + out0[0x10*14] = REAL_SCALE_DCT64(b1[0x08]); + b1[0x0C] += b1[0x0a]; + out0[0x10*10] = REAL_SCALE_DCT64(b1[0x0C]); + b1[0x0A] += b1[0x0E]; + out0[0x10* 6] = REAL_SCALE_DCT64(b1[0x0A]); + b1[0x0E] += b1[0x09]; + out0[0x10* 2] = REAL_SCALE_DCT64(b1[0x0E]); + b1[0x09] += b1[0x0D]; + out1[0x10* 2] = REAL_SCALE_DCT64(b1[0x09]); + b1[0x0D] += b1[0x0B]; + out1[0x10* 6] = REAL_SCALE_DCT64(b1[0x0D]); + b1[0x0B] += b1[0x0F]; + out1[0x10*10] = REAL_SCALE_DCT64(b1[0x0B]); + out1[0x10*14] = REAL_SCALE_DCT64(b1[0x0F]); +#endif + + { + real tmp; + tmp = b1[0x18] + b1[0x1C]; + out0[0x10*15] = REAL_SCALE_DCT64(tmp + b1[0x10]); + out0[0x10*13] = REAL_SCALE_DCT64(tmp + b1[0x14]); + tmp = b1[0x1C] + b1[0x1A]; + out0[0x10*11] = REAL_SCALE_DCT64(tmp + b1[0x14]); + out0[0x10* 9] = REAL_SCALE_DCT64(tmp + b1[0x12]); + tmp = b1[0x1A] + b1[0x1E]; + out0[0x10* 7] = REAL_SCALE_DCT64(tmp + b1[0x12]); + out0[0x10* 5] = REAL_SCALE_DCT64(tmp + b1[0x16]); + tmp = b1[0x1E] + b1[0x19]; + out0[0x10* 3] = REAL_SCALE_DCT64(tmp + b1[0x16]); + out0[0x10* 1] = REAL_SCALE_DCT64(tmp + b1[0x11]); + tmp = b1[0x19] + b1[0x1D]; + out1[0x10* 1] = REAL_SCALE_DCT64(tmp + b1[0x11]); + out1[0x10* 3] = REAL_SCALE_DCT64(tmp + b1[0x15]); + tmp = b1[0x1D] + b1[0x1B]; + out1[0x10* 5] = REAL_SCALE_DCT64(tmp + b1[0x15]); + out1[0x10* 7] = REAL_SCALE_DCT64(tmp + b1[0x13]); + tmp = b1[0x1B] + b1[0x1F]; + out1[0x10* 9] = REAL_SCALE_DCT64(tmp + b1[0x13]); + out1[0x10*11] = REAL_SCALE_DCT64(tmp + b1[0x17]); + out1[0x10*13] = REAL_SCALE_DCT64(b1[0x17] + b1[0x1F]); + out1[0x10*15] = REAL_SCALE_DCT64(b1[0x1F]); + } +} + +/* + * the call via dct64 is a trick to force GCC to use + * (new) registers for the b1,b2 pointer to the bufs[xx] field + */ +void dct64_i386(real *a,real *b,real *c) +{ + real bufs[0x40]; + dct64_1(a,b,bufs,bufs+0x20,c); +} + diff --git a/src/libmpg123/dct64_i486.c b/src/libmpg123/dct64_i486.c new file mode 100644 index 0000000..b81d060 --- /dev/null +++ b/src/libmpg123/dct64_i486.c @@ -0,0 +1,342 @@ +/* + dct64_i486.c: DCT64, a plain C variant for i486 + + copyright 1998-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Fabrice Bellard +*/ + +/* Discrete Cosine Tansform (DCT) for subband synthesis. + * + * This code is optimized for 80486. It should be compiled with gcc + * 2.7.2 or higher. + * + * Note: This code does not give the necessary accuracy. Moreover, no + * overflow test are done. + * + * (c) 1998 Fabrice Bellard. + */ + +#include "mpg123lib_intern.h" + +#define COS_0_0 16403 +#define COS_0_1 16563 +#define COS_0_2 16890 +#define COS_0_3 17401 +#define COS_0_4 18124 +#define COS_0_5 19101 +#define COS_0_6 20398 +#define COS_0_7 22112 +#define COS_0_8 24396 +#define COS_0_9 27503 +#define COS_0_10 31869 +#define COS_0_11 38320 +#define COS_0_12 48633 +#define COS_0_13 67429 +#define COS_0_14 111660 +#define COS_0_15 333906 +#define COS_1_0 16463 +#define COS_1_1 17121 +#define COS_1_2 18577 +#define COS_1_3 21195 +#define COS_1_4 25826 +#define COS_1_5 34756 +#define COS_1_6 56441 +#define COS_1_7 167154 +#define COS_2_0 16704 +#define COS_2_1 19704 +#define COS_2_2 29490 +#define COS_2_3 83981 +#define COS_3_0 17733 +#define COS_3_1 42813 +#define COS_4_0 23170 + +#define SETOUT(out,n,expr) out[FIR_BUFFER_SIZE*(n)]=(expr) +#define MULL(a,b) (((long long)(a)*(long long)(b)) >> 15) +#define MUL(a,b) \ +(\ + ((!(b & 0x3F)) ? (((a)*(b >> 6)) >> 9) :\ + ((!(b & 0x1F)) ? (((a)*(b >> 5)) >> 10) :\ + ((!(b & 0x0F)) ? (((a)*(b >> 4)) >> 11) :\ + ((!(b & 0x07)) ? (((a)*(b >> 3)) >> 12) :\ + ((!(b & 0x03)) ? (((a)*(b >> 2)) >> 13) :\ + ((!(b & 0x01)) ? (((a)*(b >> 1)) >> 14) :\ + (((a)*(b )) >> 15)))))))) + + +void dct64_1_486(int *out0,int *out1,int *b1,int *b2) +{ + b1[0x00] = b2[0x00] + b2[0x1F]; + b1[0x1F] = MUL((b2[0x00] - b2[0x1F]),COS_0_0); + + b1[0x01] = b2[0x01] + b2[0x1E]; + b1[0x1E] = MUL((b2[0x01] - b2[0x1E]),COS_0_1); + + b1[0x02] = b2[0x02] + b2[0x1D]; + b1[0x1D] = MUL((b2[0x02] - b2[0x1D]),COS_0_2); + + b1[0x03] = b2[0x03] + b2[0x1C]; + b1[0x1C] = MUL((b2[0x03] - b2[0x1C]),COS_0_3); + + b1[0x04] = b2[0x04] + b2[0x1B]; + b1[0x1B] = MUL((b2[0x04] - b2[0x1B]),COS_0_4); + + b1[0x05] = b2[0x05] + b2[0x1A]; + b1[0x1A] = MUL((b2[0x05] - b2[0x1A]),COS_0_5); + + b1[0x06] = b2[0x06] + b2[0x19]; + b1[0x19] = MUL((b2[0x06] - b2[0x19]),COS_0_6); + + b1[0x07] = b2[0x07] + b2[0x18]; + b1[0x18] = MUL((b2[0x07] - b2[0x18]),COS_0_7); + + b1[0x08] = b2[0x08] + b2[0x17]; + b1[0x17] = MUL((b2[0x08] - b2[0x17]),COS_0_8); + + b1[0x09] = b2[0x09] + b2[0x16]; + b1[0x16] = MUL((b2[0x09] - b2[0x16]),COS_0_9); + + b1[0x0A] = b2[0x0A] + b2[0x15]; + b1[0x15] = MUL((b2[0x0A] - b2[0x15]),COS_0_10); + + b1[0x0B] = b2[0x0B] + b2[0x14]; + b1[0x14] = MUL((b2[0x0B] - b2[0x14]),COS_0_11); + + b1[0x0C] = b2[0x0C] + b2[0x13]; + b1[0x13] = MUL((b2[0x0C] - b2[0x13]),COS_0_12); + + b1[0x0D] = b2[0x0D] + b2[0x12]; + b1[0x12] = MULL((b2[0x0D] - b2[0x12]),COS_0_13); + + b1[0x0E] = b2[0x0E] + b2[0x11]; + b1[0x11] = MULL((b2[0x0E] - b2[0x11]),COS_0_14); + + b1[0x0F] = b2[0x0F] + b2[0x10]; + b1[0x10] = MULL((b2[0x0F] - b2[0x10]),COS_0_15); + + + b2[0x00] = b1[0x00] + b1[0x0F]; + b2[0x0F] = MUL((b1[0x00] - b1[0x0F]),COS_1_0); + b2[0x01] = b1[0x01] + b1[0x0E]; + b2[0x0E] = MUL((b1[0x01] - b1[0x0E]),COS_1_1); + b2[0x02] = b1[0x02] + b1[0x0D]; + b2[0x0D] = MUL((b1[0x02] - b1[0x0D]),COS_1_2); + b2[0x03] = b1[0x03] + b1[0x0C]; + b2[0x0C] = MUL((b1[0x03] - b1[0x0C]),COS_1_3); + b2[0x04] = b1[0x04] + b1[0x0B]; + b2[0x0B] = MUL((b1[0x04] - b1[0x0B]),COS_1_4); + b2[0x05] = b1[0x05] + b1[0x0A]; + b2[0x0A] = MUL((b1[0x05] - b1[0x0A]),COS_1_5); + b2[0x06] = b1[0x06] + b1[0x09]; + b2[0x09] = MUL((b1[0x06] - b1[0x09]),COS_1_6); + b2[0x07] = b1[0x07] + b1[0x08]; + b2[0x08] = MULL((b1[0x07] - b1[0x08]),COS_1_7); + + b2[0x10] = b1[0x10] + b1[0x1F]; + b2[0x1F] = MUL((b1[0x1F] - b1[0x10]),COS_1_0); + b2[0x11] = b1[0x11] + b1[0x1E]; + b2[0x1E] = MUL((b1[0x1E] - b1[0x11]),COS_1_1); + b2[0x12] = b1[0x12] + b1[0x1D]; + b2[0x1D] = MUL((b1[0x1D] - b1[0x12]),COS_1_2); + b2[0x13] = b1[0x13] + b1[0x1C]; + b2[0x1C] = MUL((b1[0x1C] - b1[0x13]),COS_1_3); + b2[0x14] = b1[0x14] + b1[0x1B]; + b2[0x1B] = MUL((b1[0x1B] - b1[0x14]),COS_1_4); + b2[0x15] = b1[0x15] + b1[0x1A]; + b2[0x1A] = MUL((b1[0x1A] - b1[0x15]),COS_1_5); + b2[0x16] = b1[0x16] + b1[0x19]; + b2[0x19] = MUL((b1[0x19] - b1[0x16]),COS_1_6); + b2[0x17] = b1[0x17] + b1[0x18]; + b2[0x18] = MULL((b1[0x18] - b1[0x17]),COS_1_7); + + + b1[0x00] = b2[0x00] + b2[0x07]; + b1[0x07] = MUL((b2[0x00] - b2[0x07]),COS_2_0); + b1[0x01] = b2[0x01] + b2[0x06]; + b1[0x06] = MUL((b2[0x01] - b2[0x06]),COS_2_1); + b1[0x02] = b2[0x02] + b2[0x05]; + b1[0x05] = MUL((b2[0x02] - b2[0x05]),COS_2_2); + b1[0x03] = b2[0x03] + b2[0x04]; + b1[0x04] = MULL((b2[0x03] - b2[0x04]),COS_2_3); + + b1[0x08] = b2[0x08] + b2[0x0F]; + b1[0x0F] = MUL((b2[0x0F] - b2[0x08]),COS_2_0); + b1[0x09] = b2[0x09] + b2[0x0E]; + b1[0x0E] = MUL((b2[0x0E] - b2[0x09]),COS_2_1); + b1[0x0A] = b2[0x0A] + b2[0x0D]; + b1[0x0D] = MUL((b2[0x0D] - b2[0x0A]),COS_2_2); + b1[0x0B] = b2[0x0B] + b2[0x0C]; + b1[0x0C] = MULL((b2[0x0C] - b2[0x0B]),COS_2_3); + + b1[0x10] = b2[0x10] + b2[0x17]; + b1[0x17] = MUL((b2[0x10] - b2[0x17]),COS_2_0); + b1[0x11] = b2[0x11] + b2[0x16]; + b1[0x16] = MUL((b2[0x11] - b2[0x16]),COS_2_1); + b1[0x12] = b2[0x12] + b2[0x15]; + b1[0x15] = MUL((b2[0x12] - b2[0x15]),COS_2_2); + b1[0x13] = b2[0x13] + b2[0x14]; + b1[0x14] = MULL((b2[0x13] - b2[0x14]),COS_2_3); + + b1[0x18] = b2[0x18] + b2[0x1F]; + b1[0x1F] = MUL((b2[0x1F] - b2[0x18]),COS_2_0); + b1[0x19] = b2[0x19] + b2[0x1E]; + b1[0x1E] = MUL((b2[0x1E] - b2[0x19]),COS_2_1); + b1[0x1A] = b2[0x1A] + b2[0x1D]; + b1[0x1D] = MUL((b2[0x1D] - b2[0x1A]),COS_2_2); + b1[0x1B] = b2[0x1B] + b2[0x1C]; + b1[0x1C] = MULL((b2[0x1C] - b2[0x1B]),COS_2_3); + + + b2[0x00] = b1[0x00] + b1[0x03]; + b2[0x03] = MUL((b1[0x00] - b1[0x03]),COS_3_0); + b2[0x01] = b1[0x01] + b1[0x02]; + b2[0x02] = MUL((b1[0x01] - b1[0x02]),COS_3_1); + + b2[0x04] = b1[0x04] + b1[0x07]; + b2[0x07] = MUL((b1[0x07] - b1[0x04]),COS_3_0); + b2[0x05] = b1[0x05] + b1[0x06]; + b2[0x06] = MUL((b1[0x06] - b1[0x05]),COS_3_1); + + b2[0x08] = b1[0x08] + b1[0x0B]; + b2[0x0B] = MUL((b1[0x08] - b1[0x0B]),COS_3_0); + b2[0x09] = b1[0x09] + b1[0x0A]; + b2[0x0A] = MUL((b1[0x09] - b1[0x0A]),COS_3_1); + + b2[0x0C] = b1[0x0C] + b1[0x0F]; + b2[0x0F] = MUL((b1[0x0F] - b1[0x0C]),COS_3_0); + b2[0x0D] = b1[0x0D] + b1[0x0E]; + b2[0x0E] = MUL((b1[0x0E] - b1[0x0D]),COS_3_1); + + b2[0x10] = b1[0x10] + b1[0x13]; + b2[0x13] = MUL((b1[0x10] - b1[0x13]),COS_3_0); + b2[0x11] = b1[0x11] + b1[0x12]; + b2[0x12] = MUL((b1[0x11] - b1[0x12]),COS_3_1); + + b2[0x14] = b1[0x14] + b1[0x17]; + b2[0x17] = MUL((b1[0x17] - b1[0x14]),COS_3_0); + b2[0x15] = b1[0x15] + b1[0x16]; + b2[0x16] = MUL((b1[0x16] - b1[0x15]),COS_3_1); + + b2[0x18] = b1[0x18] + b1[0x1B]; + b2[0x1B] = MUL((b1[0x18] - b1[0x1B]),COS_3_0); + b2[0x19] = b1[0x19] + b1[0x1A]; + b2[0x1A] = MUL((b1[0x19] - b1[0x1A]),COS_3_1); + + b2[0x1C] = b1[0x1C] + b1[0x1F]; + b2[0x1F] = MUL((b1[0x1F] - b1[0x1C]),COS_3_0); + b2[0x1D] = b1[0x1D] + b1[0x1E]; + b2[0x1E] = MUL((b1[0x1E] - b1[0x1D]),COS_3_1); + + { + int i; + for(i=0;i<32;i+=4) { + b1[i+0x00] = b2[i+0x00] + b2[i+0x01]; + b1[i+0x01] = MUL((b2[i+0x00] - b2[i+0x01]),COS_4_0); + b1[i+0x02] = b2[i+0x02] + b2[i+0x03]; + b1[i+0x03] = MUL((b2[i+0x03] - b2[i+0x02]),COS_4_0); + } + } + + b1[0x02] += b1[0x03]; + b1[0x06] += b1[0x07]; + b1[0x04] += b1[0x06]; + b1[0x06] += b1[0x05]; + b1[0x05] += b1[0x07]; + + b1[0x0A] += b1[0x0B]; + b1[0x0E] += b1[0x0F]; + b1[0x0C] += b1[0x0E]; + b1[0x0E] += b1[0x0D]; + b1[0x0D] += b1[0x0F]; + + b1[0x12] += b1[0x13]; + b1[0x16] += b1[0x17]; + b1[0x14] += b1[0x16]; + b1[0x16] += b1[0x15]; + b1[0x15] += b1[0x17]; + + b1[0x1A] += b1[0x1B]; + b1[0x1E] += b1[0x1F]; + b1[0x1C] += b1[0x1E]; + b1[0x1E] += b1[0x1D]; + b1[0x1D] += b1[0x1F]; + + SETOUT(out0,16,b1[0x00]); + SETOUT(out0,12,b1[0x04]); + SETOUT(out0, 8,b1[0x02]); + SETOUT(out0, 4,b1[0x06]); + SETOUT(out0, 0,b1[0x01]); + SETOUT(out1, 0,b1[0x01]); + SETOUT(out1, 4,b1[0x05]); + SETOUT(out1, 8,b1[0x03]); + SETOUT(out1,12,b1[0x07]); + + b1[0x08] += b1[0x0C]; + SETOUT(out0,14,b1[0x08]); + b1[0x0C] += b1[0x0a]; + SETOUT(out0,10,b1[0x0C]); + b1[0x0A] += b1[0x0E]; + SETOUT(out0, 6,b1[0x0A]); + b1[0x0E] += b1[0x09]; + SETOUT(out0, 2,b1[0x0E]); + b1[0x09] += b1[0x0D]; + SETOUT(out1, 2,b1[0x09]); + b1[0x0D] += b1[0x0B]; + SETOUT(out1, 6,b1[0x0D]); + b1[0x0B] += b1[0x0F]; + SETOUT(out1,10,b1[0x0B]); + SETOUT(out1,14,b1[0x0F]); + + b1[0x18] += b1[0x1C]; + SETOUT(out0,15,b1[0x10] + b1[0x18]); + SETOUT(out0,13,b1[0x18] + b1[0x14]); + b1[0x1C] += b1[0x1a]; + SETOUT(out0,11,b1[0x14] + b1[0x1C]); + SETOUT(out0, 9,b1[0x1C] + b1[0x12]); + b1[0x1A] += b1[0x1E]; + SETOUT(out0, 7,b1[0x12] + b1[0x1A]); + SETOUT(out0, 5,b1[0x1A] + b1[0x16]); + b1[0x1E] += b1[0x19]; + SETOUT(out0, 3,b1[0x16] + b1[0x1E]); + SETOUT(out0, 1,b1[0x1E] + b1[0x11]); + b1[0x19] += b1[0x1D]; + SETOUT(out1, 1,b1[0x11] + b1[0x19]); + SETOUT(out1, 3,b1[0x19] + b1[0x15]); + b1[0x1D] += b1[0x1B]; + SETOUT(out1, 5,b1[0x15] + b1[0x1D]); + SETOUT(out1, 7,b1[0x1D] + b1[0x13]); + b1[0x1B] += b1[0x1F]; + SETOUT(out1, 9,b1[0x13] + b1[0x1B]); + SETOUT(out1,11,b1[0x1B] + b1[0x17]); + SETOUT(out1,13,b1[0x17] + b1[0x1F]); + SETOUT(out1,15,b1[0x1F]); +} + + +/* + * the call via dct64 is a trick to force GCC to use + * (new) registers for the b1,b2 pointer to the bufs[xx] field + */ +void dct64_i486(int *a,int *b,real *samples) +{ + int bufs[64]; + int i; + +#ifdef REAL_IS_FIXED +#define TOINT(a) ((a) * 32768 / (int)REAL_FACTOR) + + for(i=0;i<32;i++) { + bufs[i]=TOINT(samples[i]); + } +#else + int *p = bufs; + register double const scale = ((65536.0 * 32) + 1) * 65536.0; + + for(i=0;i<32;i++) { + *((double *) (p++)) = scale + *samples++; /* beware on bufs overrun: 8B store from x87 */ + } +#endif + + dct64_1_486(a,b,bufs+32,bufs); +} + diff --git a/src/libmpg123/dct64_mmx.S b/src/libmpg123/dct64_mmx.S new file mode 100644 index 0000000..ff8d403 --- /dev/null +++ b/src/libmpg123/dct64_mmx.S @@ -0,0 +1,825 @@ +/* + dct64_mmx.s: MMX optimized DCT64 + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by the mysterious higway (apparently) +*/ + +#include "mangle.h" + +.text + + ALIGN32 +.globl ASM_NAME(dct64_mmx) +ASM_NAME(dct64_mmx): + + xorl %ecx,%ecx +.globl ASM_NAME(dct64_MMX) +ASM_NAME(dct64_MMX): + pushl %ebx + pushl %esi + pushl %edi + subl $256,%esp + + GET_GOT + + movl 280(%esp),%eax + flds (%eax) + leal 128(%esp),%edx + fadds 124(%eax) + movl 272(%esp),%esi + fstps (%edx) + movl 276(%esp),%edi + flds 4(%eax) +#if defined(PIC) && defined(__APPLE__) + movl GLOBAL_VAR_PTR(costab_mmxsse),%ebx +#else + leal GLOBAL_VAR(costab_mmxsse),%ebx +#endif + fadds 120(%eax) + orl %ecx,%ecx + fstps 4(%edx) + flds (%eax) + movl %esp,%ecx + fsubs 124(%eax) + fmuls (%ebx) + fstps 124(%edx) + flds 4(%eax) + fsubs 120(%eax) + fmuls 4(%ebx) + fstps 120(%edx) + flds 8(%eax) + fadds 116(%eax) + fstps 8(%edx) + flds 12(%eax) + fadds 112(%eax) + fstps 12(%edx) + flds 8(%eax) + fsubs 116(%eax) + fmuls 8(%ebx) + fstps 116(%edx) + flds 12(%eax) + fsubs 112(%eax) + fmuls 12(%ebx) + fstps 112(%edx) + flds 16(%eax) + fadds 108(%eax) + fstps 16(%edx) + flds 20(%eax) + fadds 104(%eax) + fstps 20(%edx) + flds 16(%eax) + fsubs 108(%eax) + fmuls 16(%ebx) + fstps 108(%edx) + flds 20(%eax) + fsubs 104(%eax) + fmuls 20(%ebx) + fstps 104(%edx) + flds 24(%eax) + fadds 100(%eax) + fstps 24(%edx) + flds 28(%eax) + fadds 96(%eax) + fstps 28(%edx) + flds 24(%eax) + fsubs 100(%eax) + fmuls 24(%ebx) + fstps 100(%edx) + flds 28(%eax) + fsubs 96(%eax) + fmuls 28(%ebx) + fstps 96(%edx) + flds 32(%eax) + fadds 92(%eax) + fstps 32(%edx) + flds 36(%eax) + fadds 88(%eax) + fstps 36(%edx) + flds 32(%eax) + fsubs 92(%eax) + fmuls 32(%ebx) + fstps 92(%edx) + flds 36(%eax) + fsubs 88(%eax) + fmuls 36(%ebx) + fstps 88(%edx) + flds 40(%eax) + fadds 84(%eax) + fstps 40(%edx) + flds 44(%eax) + fadds 80(%eax) + fstps 44(%edx) + flds 40(%eax) + fsubs 84(%eax) + fmuls 40(%ebx) + fstps 84(%edx) + flds 44(%eax) + fsubs 80(%eax) + fmuls 44(%ebx) + fstps 80(%edx) + flds 48(%eax) + fadds 76(%eax) + fstps 48(%edx) + flds 52(%eax) + fadds 72(%eax) + fstps 52(%edx) + flds 48(%eax) + fsubs 76(%eax) + fmuls 48(%ebx) + fstps 76(%edx) + flds 52(%eax) + fsubs 72(%eax) + fmuls 52(%ebx) + fstps 72(%edx) + flds 56(%eax) + fadds 68(%eax) + fstps 56(%edx) + flds 60(%eax) + fadds 64(%eax) + fstps 60(%edx) + flds 56(%eax) + fsubs 68(%eax) + fmuls 56(%ebx) + fstps 68(%edx) + flds 60(%eax) + fsubs 64(%eax) + fmuls 60(%ebx) + fstps 64(%edx) + + flds (%edx) + fadds 60(%edx) + fstps (%ecx) + flds 4(%edx) + fadds 56(%edx) + fstps 4(%ecx) + flds (%edx) + fsubs 60(%edx) + fmuls 64(%ebx) + fstps 60(%ecx) + flds 4(%edx) + fsubs 56(%edx) + fmuls 68(%ebx) + fstps 56(%ecx) + flds 8(%edx) + fadds 52(%edx) + fstps 8(%ecx) + flds 12(%edx) + fadds 48(%edx) + fstps 12(%ecx) + flds 8(%edx) + fsubs 52(%edx) + fmuls 72(%ebx) + fstps 52(%ecx) + flds 12(%edx) + fsubs 48(%edx) + fmuls 76(%ebx) + fstps 48(%ecx) + flds 16(%edx) + fadds 44(%edx) + fstps 16(%ecx) + flds 20(%edx) + fadds 40(%edx) + fstps 20(%ecx) + flds 16(%edx) + fsubs 44(%edx) + fmuls 80(%ebx) + fstps 44(%ecx) + flds 20(%edx) + fsubs 40(%edx) + fmuls 84(%ebx) + fstps 40(%ecx) + flds 24(%edx) + fadds 36(%edx) + fstps 24(%ecx) + flds 28(%edx) + fadds 32(%edx) + fstps 28(%ecx) + flds 24(%edx) + fsubs 36(%edx) + fmuls 88(%ebx) + fstps 36(%ecx) + flds 28(%edx) + fsubs 32(%edx) + fmuls 92(%ebx) + fstps 32(%ecx) + + flds 64(%edx) + fadds 124(%edx) + fstps 64(%ecx) + flds 68(%edx) + fadds 120(%edx) + fstps 68(%ecx) + flds 124(%edx) + fsubs 64(%edx) + fmuls 64(%ebx) + fstps 124(%ecx) + flds 120(%edx) + fsubs 68(%edx) + fmuls 68(%ebx) + fstps 120(%ecx) + flds 72(%edx) + fadds 116(%edx) + fstps 72(%ecx) + flds 76(%edx) + fadds 112(%edx) + fstps 76(%ecx) + flds 116(%edx) + fsubs 72(%edx) + fmuls 72(%ebx) + fstps 116(%ecx) + flds 112(%edx) + fsubs 76(%edx) + fmuls 76(%ebx) + fstps 112(%ecx) + flds 80(%edx) + fadds 108(%edx) + fstps 80(%ecx) + flds 84(%edx) + fadds 104(%edx) + fstps 84(%ecx) + flds 108(%edx) + fsubs 80(%edx) + fmuls 80(%ebx) + fstps 108(%ecx) + flds 104(%edx) + fsubs 84(%edx) + fmuls 84(%ebx) + fstps 104(%ecx) + flds 88(%edx) + fadds 100(%edx) + fstps 88(%ecx) + flds 92(%edx) + fadds 96(%edx) + fstps 92(%ecx) + flds 100(%edx) + fsubs 88(%edx) + fmuls 88(%ebx) + fstps 100(%ecx) + flds 96(%edx) + fsubs 92(%edx) + fmuls 92(%ebx) + fstps 96(%ecx) + + flds (%ecx) + fadds 28(%ecx) + fstps (%edx) + flds (%ecx) + fsubs 28(%ecx) + fmuls 96(%ebx) + fstps 28(%edx) + flds 4(%ecx) + fadds 24(%ecx) + fstps 4(%edx) + flds 4(%ecx) + fsubs 24(%ecx) + fmuls 100(%ebx) + fstps 24(%edx) + flds 8(%ecx) + fadds 20(%ecx) + fstps 8(%edx) + flds 8(%ecx) + fsubs 20(%ecx) + fmuls 104(%ebx) + fstps 20(%edx) + flds 12(%ecx) + fadds 16(%ecx) + fstps 12(%edx) + flds 12(%ecx) + fsubs 16(%ecx) + fmuls 108(%ebx) + fstps 16(%edx) + flds 32(%ecx) + fadds 60(%ecx) + fstps 32(%edx) + flds 60(%ecx) + fsubs 32(%ecx) + fmuls 96(%ebx) + fstps 60(%edx) + flds 36(%ecx) + fadds 56(%ecx) + fstps 36(%edx) + flds 56(%ecx) + fsubs 36(%ecx) + fmuls 100(%ebx) + fstps 56(%edx) + flds 40(%ecx) + fadds 52(%ecx) + fstps 40(%edx) + flds 52(%ecx) + fsubs 40(%ecx) + fmuls 104(%ebx) + fstps 52(%edx) + flds 44(%ecx) + fadds 48(%ecx) + fstps 44(%edx) + flds 48(%ecx) + fsubs 44(%ecx) + fmuls 108(%ebx) + fstps 48(%edx) + flds 64(%ecx) + fadds 92(%ecx) + fstps 64(%edx) + flds 64(%ecx) + fsubs 92(%ecx) + fmuls 96(%ebx) + fstps 92(%edx) + flds 68(%ecx) + fadds 88(%ecx) + fstps 68(%edx) + flds 68(%ecx) + fsubs 88(%ecx) + fmuls 100(%ebx) + fstps 88(%edx) + flds 72(%ecx) + fadds 84(%ecx) + fstps 72(%edx) + flds 72(%ecx) + fsubs 84(%ecx) + fmuls 104(%ebx) + fstps 84(%edx) + flds 76(%ecx) + fadds 80(%ecx) + fstps 76(%edx) + flds 76(%ecx) + fsubs 80(%ecx) + fmuls 108(%ebx) + fstps 80(%edx) + flds 96(%ecx) + fadds 124(%ecx) + fstps 96(%edx) + flds 124(%ecx) + fsubs 96(%ecx) + fmuls 96(%ebx) + fstps 124(%edx) + flds 100(%ecx) + fadds 120(%ecx) + fstps 100(%edx) + flds 120(%ecx) + fsubs 100(%ecx) + fmuls 100(%ebx) + fstps 120(%edx) + flds 104(%ecx) + fadds 116(%ecx) + fstps 104(%edx) + flds 116(%ecx) + fsubs 104(%ecx) + fmuls 104(%ebx) + fstps 116(%edx) + flds 108(%ecx) + fadds 112(%ecx) + fstps 108(%edx) + flds 112(%ecx) + fsubs 108(%ecx) + fmuls 108(%ebx) + fstps 112(%edx) + flds (%edx) + fadds 12(%edx) + fstps (%ecx) + flds (%edx) + fsubs 12(%edx) + fmuls 112(%ebx) + fstps 12(%ecx) + flds 4(%edx) + fadds 8(%edx) + fstps 4(%ecx) + flds 4(%edx) + fsubs 8(%edx) + fmuls 116(%ebx) + fstps 8(%ecx) + flds 16(%edx) + fadds 28(%edx) + fstps 16(%ecx) + flds 28(%edx) + fsubs 16(%edx) + fmuls 112(%ebx) + fstps 28(%ecx) + flds 20(%edx) + fadds 24(%edx) + fstps 20(%ecx) + flds 24(%edx) + fsubs 20(%edx) + fmuls 116(%ebx) + fstps 24(%ecx) + flds 32(%edx) + fadds 44(%edx) + fstps 32(%ecx) + flds 32(%edx) + fsubs 44(%edx) + fmuls 112(%ebx) + fstps 44(%ecx) + flds 36(%edx) + fadds 40(%edx) + fstps 36(%ecx) + flds 36(%edx) + fsubs 40(%edx) + fmuls 116(%ebx) + fstps 40(%ecx) + flds 48(%edx) + fadds 60(%edx) + fstps 48(%ecx) + flds 60(%edx) + fsubs 48(%edx) + fmuls 112(%ebx) + fstps 60(%ecx) + flds 52(%edx) + fadds 56(%edx) + fstps 52(%ecx) + flds 56(%edx) + fsubs 52(%edx) + fmuls 116(%ebx) + fstps 56(%ecx) + flds 64(%edx) + fadds 76(%edx) + fstps 64(%ecx) + flds 64(%edx) + fsubs 76(%edx) + fmuls 112(%ebx) + fstps 76(%ecx) + flds 68(%edx) + fadds 72(%edx) + fstps 68(%ecx) + flds 68(%edx) + fsubs 72(%edx) + fmuls 116(%ebx) + fstps 72(%ecx) + flds 80(%edx) + fadds 92(%edx) + fstps 80(%ecx) + flds 92(%edx) + fsubs 80(%edx) + fmuls 112(%ebx) + fstps 92(%ecx) + flds 84(%edx) + fadds 88(%edx) + fstps 84(%ecx) + flds 88(%edx) + fsubs 84(%edx) + fmuls 116(%ebx) + fstps 88(%ecx) + flds 96(%edx) + fadds 108(%edx) + fstps 96(%ecx) + flds 96(%edx) + fsubs 108(%edx) + fmuls 112(%ebx) + fstps 108(%ecx) + flds 100(%edx) + fadds 104(%edx) + fstps 100(%ecx) + flds 100(%edx) + fsubs 104(%edx) + fmuls 116(%ebx) + fstps 104(%ecx) + flds 112(%edx) + fadds 124(%edx) + fstps 112(%ecx) + flds 124(%edx) + fsubs 112(%edx) + fmuls 112(%ebx) + fstps 124(%ecx) + flds 116(%edx) + fadds 120(%edx) + fstps 116(%ecx) + flds 120(%edx) + fsubs 116(%edx) + fmuls 116(%ebx) + fstps 120(%ecx) + + flds 32(%ecx) + fadds 36(%ecx) + fstps 32(%edx) + flds 32(%ecx) + fsubs 36(%ecx) + fmuls 120(%ebx) + fstps 36(%edx) + flds 44(%ecx) + fsubs 40(%ecx) + fmuls 120(%ebx) + fsts 44(%edx) + fadds 40(%ecx) + fadds 44(%ecx) + fstps 40(%edx) + flds 48(%ecx) + fsubs 52(%ecx) + fmuls 120(%ebx) + flds 60(%ecx) + fsubs 56(%ecx) + fmuls 120(%ebx) + fld %st(0) + fadds 56(%ecx) + fadds 60(%ecx) + fld %st(0) + fadds 48(%ecx) + fadds 52(%ecx) + fstps 48(%edx) + fadd %st(2) + fstps 56(%edx) + fsts 60(%edx) + faddp %st(1) + fstps 52(%edx) + flds 64(%ecx) + fadds 68(%ecx) + fstps 64(%edx) + flds 64(%ecx) + fsubs 68(%ecx) + fmuls 120(%ebx) + fstps 68(%edx) + flds 76(%ecx) + fsubs 72(%ecx) + fmuls 120(%ebx) + fsts 76(%edx) + fadds 72(%ecx) + fadds 76(%ecx) + fstps 72(%edx) + flds 92(%ecx) + fsubs 88(%ecx) + fmuls 120(%ebx) + fsts 92(%edx) + fadds 92(%ecx) + fadds 88(%ecx) + fld %st(0) + fadds 80(%ecx) + fadds 84(%ecx) + fstps 80(%edx) + flds 80(%ecx) + fsubs 84(%ecx) + fmuls 120(%ebx) + fadd %st(0), %st(1) + fadds 92(%edx) + fstps 84(%edx) + fstps 88(%edx) + flds 96(%ecx) + fadds 100(%ecx) + fstps 96(%edx) + flds 96(%ecx) + fsubs 100(%ecx) + fmuls 120(%ebx) + fstps 100(%edx) + flds 108(%ecx) + fsubs 104(%ecx) + fmuls 120(%ebx) + fsts 108(%edx) + fadds 104(%ecx) + fadds 108(%ecx) + fstps 104(%edx) + flds 124(%ecx) + fsubs 120(%ecx) + fmuls 120(%ebx) + fsts 124(%edx) + fadds 120(%ecx) + fadds 124(%ecx) + fld %st(0) + fadds 112(%ecx) + fadds 116(%ecx) + fstps 112(%edx) + flds 112(%ecx) + fsubs 116(%ecx) + fmuls 120(%ebx) + fadd %st(0),%st(1) + fadds 124(%edx) + fstps 116(%edx) + fstps 120(%edx) + jnz .L01 + + flds (%ecx) + fadds 4(%ecx) + fstps 1024(%esi) + flds (%ecx) + fsubs 4(%ecx) + fmuls 120(%ebx) + fsts (%esi) + fstps (%edi) + flds 12(%ecx) + fsubs 8(%ecx) + fmuls 120(%ebx) + fsts 512(%edi) + fadds 12(%ecx) + fadds 8(%ecx) + fstps 512(%esi) + flds 16(%ecx) + fsubs 20(%ecx) + fmuls 120(%ebx) + flds 28(%ecx) + fsubs 24(%ecx) + fmuls 120(%ebx) + fsts 768(%edi) + fld %st(0) + fadds 24(%ecx) + fadds 28(%ecx) + fld %st(0) + fadds 16(%ecx) + fadds 20(%ecx) + fstps 768(%esi) + fadd %st(2) + fstps 256(%esi) + faddp %st(1) + fstps 256(%edi) + + flds 32(%edx) + fadds 48(%edx) + fstps 896(%esi) + flds 48(%edx) + fadds 40(%edx) + fstps 640(%esi) + flds 40(%edx) + fadds 56(%edx) + fstps 384(%esi) + flds 56(%edx) + fadds 36(%edx) + fstps 128(%esi) + flds 36(%edx) + fadds 52(%edx) + fstps 128(%edi) + flds 52(%edx) + fadds 44(%edx) + fstps 384(%edi) + flds 60(%edx) + fsts 896(%edi) + fadds 44(%edx) + fstps 640(%edi) + flds 96(%edx) + fadds 112(%edx) + fld %st(0) + fadds 64(%edx) + fstps 960(%esi) + fadds 80(%edx) + fstps 832(%esi) + flds 112(%edx) + fadds 104(%edx) + fld %st(0) + fadds 80(%edx) + fstps 704(%esi) + fadds 72(%edx) + fstps 576(%esi) + flds 104(%edx) + fadds 120(%edx) + fld %st(0) + fadds 72(%edx) + fstps 448(%esi) + fadds 88(%edx) + fstps 320(%esi) + flds 120(%edx) + fadds 100(%edx) + fld %st(0) + fadds 88(%edx) + fstps 192(%esi) + fadds 68(%edx) + fstps 64(%esi) + flds 100(%edx) + fadds 116(%edx) + fld %st(0) + fadds 68(%edx) + fstps 64(%edi) + fadds 84(%edx) + fstps 192(%edi) + flds 116(%edx) + fadds 108(%edx) + fld %st(0) + fadds 84(%edx) + fstps 320(%edi) + fadds 76(%edx) + fstps 448(%edi) + flds 108(%edx) + fadds 124(%edx) + fld %st(0) + fadds 76(%edx) + fstps 576(%edi) + fadds 92(%edx) + fstps 704(%edi) + flds 124(%edx) + fsts 960(%edi) + fadds 92(%edx) + fstps 832(%edi) + addl $256,%esp + popl %edi + popl %esi + popl %ebx + ret +.L01: + flds (%ecx) + fadds 4(%ecx) + fistps 512(%esi) + flds (%ecx) + fsubs 4(%ecx) + fmuls 120(%ebx) + + fistps (%esi) + + flds 12(%ecx) + fsubs 8(%ecx) + fmuls 120(%ebx) + fists 256(%edi) + fadds 12(%ecx) + fadds 8(%ecx) + fistps 256(%esi) + flds 16(%ecx) + fsubs 20(%ecx) + fmuls 120(%ebx) + flds 28(%ecx) + fsubs 24(%ecx) + fmuls 120(%ebx) + fists 384(%edi) + fld %st(0) + fadds 24(%ecx) + fadds 28(%ecx) + fld %st(0) + fadds 16(%ecx) + fadds 20(%ecx) + fistps 384(%esi) + fadd %st(2) + fistps 128(%esi) + faddp %st(1) + fistps 128(%edi) + + flds 32(%edx) + fadds 48(%edx) + fistps 448(%esi) + flds 48(%edx) + fadds 40(%edx) + fistps 320(%esi) + flds 40(%edx) + fadds 56(%edx) + fistps 192(%esi) + flds 56(%edx) + fadds 36(%edx) + fistps 64(%esi) + flds 36(%edx) + fadds 52(%edx) + fistps 64(%edi) + flds 52(%edx) + fadds 44(%edx) + fistps 192(%edi) + flds 60(%edx) + fists 448(%edi) + fadds 44(%edx) + fistps 320(%edi) + flds 96(%edx) + fadds 112(%edx) + fld %st(0) + fadds 64(%edx) + fistps 480(%esi) + fadds 80(%edx) + fistps 416(%esi) + flds 112(%edx) + fadds 104(%edx) + fld %st(0) + fadds 80(%edx) + fistps 352(%esi) + fadds 72(%edx) + fistps 288(%esi) + flds 104(%edx) + fadds 120(%edx) + fld %st(0) + fadds 72(%edx) + fistps 224(%esi) + fadds 88(%edx) + fistps 160(%esi) + flds 120(%edx) + fadds 100(%edx) + fld %st(0) + fadds 88(%edx) + fistps 96(%esi) + fadds 68(%edx) + fistps 32(%esi) + flds 100(%edx) + fadds 116(%edx) + fld %st(0) + fadds 68(%edx) + fistps 32(%edi) + fadds 84(%edx) + fistps 96(%edi) + flds 116(%edx) + fadds 108(%edx) + fld %st(0) + fadds 84(%edx) + fistps 160(%edi) + fadds 76(%edx) + fistps 224(%edi) + flds 108(%edx) + fadds 124(%edx) + fld %st(0) + fadds 76(%edx) + fistps 288(%edi) + fadds 92(%edx) + fistps 352(%edi) + flds 124(%edx) + fists 480(%edi) + fadds 92(%edx) + fistps 416(%edi) + movsw + addl $256,%esp + popl %edi + popl %esi + popl %ebx + ret + +#if defined(PIC) && defined(__APPLE__) + .section __IMPORT,__pointers,non_lazy_symbol_pointers +L_costab_mmxsse: + .indirect_symbol ASM_NAME(costab_mmxsse) + .long 0 +#endif + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_neon.S b/src/libmpg123/dct64_neon.S new file mode 100644 index 0000000..de8c363 --- /dev/null +++ b/src/libmpg123/dct64_neon.S @@ -0,0 +1,310 @@ +/* + dct64_neon: ARM NEON optimized dct64 + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifndef _M_ARM + .code 32 +#endif +#ifndef __APPLE__ + .fpu neon +#endif + + .text + ALIGN16 +costab_arm: + .word 1056974725 + .word 1057056395 + .word 1057223771 + .word 1057485416 + .word 1057855544 + .word 1058356026 + .word 1059019886 + .word 1059897405 + .word 1061067246 + .word 1062657950 + .word 1064892987 + .word 1066774581 + .word 1069414683 + .word 1073984175 + .word 1079645762 + .word 1092815430 + .word 1057005197 + .word 1057342072 + .word 1058087743 + .word 1059427869 + .word 1061799040 + .word 1065862217 + .word 1071413542 + .word 1084439708 + .word 1057128951 + .word 1058664893 + .word 1063675095 + .word 1076102863 + .word 1057655764 + .word 1067924853 + .word 1060439283 + .word 1060439283 + ALIGN4 + GLOBAL_SYMBOL ASM_NAME(dct64_neon) +#ifdef __ELF__ + .type ASM_NAME(dct64_neon), %function +#endif +ASM_NAME(dct64_neon): + vpush {q4-q7} + + adr r3, costab_arm + vld1.32 {q0, q1}, [r2]! + vld1.32 {q2, q3}, [r2]! + vld1.32 {q4, q5}, [r2]! + vld1.32 {q6, q7}, [r2] + vld1.32 {q12, q13}, [r3, :128]! + vld1.32 {q14, q15}, [r3, :128]! + + vrev64.32 q4, q4 + vrev64.32 q5, q5 + vrev64.32 q6, q6 + vrev64.32 q7, q7 + vswp d8, d9 + vswp d10, d11 + vswp d12, d13 + vswp d14, d15 + + vsub.f32 q8, q0, q7 + vsub.f32 q9, q1, q6 + vsub.f32 q10, q2, q5 + vsub.f32 q11, q3, q4 + vadd.f32 q0, q0, q7 + vadd.f32 q1, q1, q6 + vadd.f32 q2, q2, q5 + vadd.f32 q3, q3, q4 + vmul.f32 q4, q8, q12 + vmul.f32 q5, q9, q13 + vmul.f32 q6, q10, q14 + vmul.f32 q7, q11, q15 + + vld1.32 {q12, q13}, [r3, :128]! + vld1.32 {q14, q15}, [r3, :128] + + vrev64.32 q2, q2 + vrev64.32 q3, q3 + vrev64.32 q6, q6 + vrev64.32 q7, q7 + vswp d4, d5 + vswp d6, d7 + vswp d12, d13 + vswp d14, d15 + + vsub.f32 q8, q0, q3 + vsub.f32 q9, q1, q2 + vsub.f32 q10, q4, q7 + vsub.f32 q11, q5, q6 + vadd.f32 q0, q0, q3 + vadd.f32 q1, q1, q2 + vadd.f32 q4, q4, q7 + vadd.f32 q5, q5, q6 + vmul.f32 q2, q8, q12 + vmul.f32 q3, q9, q13 + vmul.f32 q6, q10, q12 + vmul.f32 q7, q11, q13 + + vrev64.32 q1, q1 + vrev64.32 q3, q3 + vrev64.32 q5, q5 + vrev64.32 q7, q7 + vswp d2, d3 + vswp d6, d7 + vswp d10, d11 + vswp d14, d15 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q14 + vmul.f32 q3, q9, q14 + vmul.f32 q5, q10, q14 + vmul.f32 q7, q11, q14 + + vdup.32 q12, d31[0] + vmov d31, d30 + + vswp d1, d2 + vswp d5, d6 + vswp d9, d10 + vswp d13, d14 + vrev64.32 q1, q1 + vrev64.32 q3, q3 + vrev64.32 q5, q5 + vrev64.32 q7, q7 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q15 + vmul.f32 q3, q9, q15 + vmul.f32 q5, q10, q15 + vmul.f32 q7, q11, q15 + + vtrn.32 q0, q1 + vtrn.32 q2, q3 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q12 + vmul.f32 q3, q9, q12 + vmul.f32 q5, q10, q12 + vmul.f32 q7, q11, q12 + + vtrn.32 q0, q1 + vtrn.32 q2, q3 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + vswp d1, d2 + vswp d5, d6 + vswp d9, d10 + vswp d13, d14 + + vshr.u64 d16, d1, #32 + vshr.u64 d17, d3, #32 + vshr.u64 d18, d5, #32 + vshr.u64 d19, d7, #32 + vadd.f32 d1, d1, d16 + vadd.f32 d3, d3, d17 + vadd.f32 d5, d5, d18 + vadd.f32 d7, d7, d19 + vshr.u64 d20, d9, #32 + vshr.u64 d21, d11, #32 + vshr.u64 d22, d13, #32 + vshr.u64 d23, d15, #32 + vadd.f32 d9, d9, d20 + vadd.f32 d11, d11, d21 + vadd.f32 d13, d13, d22 + vadd.f32 d15, d15, d23 + + vshr.u64 d16, d2, #32 + vshr.u64 d18, d6, #32 + vshr.u64 d20, d10, #32 + vshr.u64 d22, d14, #32 + vext.8 q8, q1, q8, #8 + vext.8 q9, q3, q9, #8 + vext.8 q10, q5, q10, #8 + vext.8 q11, q7, q11, #8 + vadd.f32 q1, q1, q8 + vadd.f32 q3, q3, q9 + vadd.f32 q5, q5, q10 + vadd.f32 q7, q7, q11 + + vshr.u64 d16, d4, #32 + vshr.u64 d18, d12, #32 + vext.8 q8, q2, q8, #8 + vext.8 q9, q6, q9, #8 + vadd.f32 q2, q2, q3 + vadd.f32 q6, q6, q7 + vadd.f32 q3, q3, q8 + vadd.f32 q7, q7, q9 + + vrev64.32 q8, q4 + vshr.u64 d19, d9, #32 + vext.8 d17, d17, d16, #4 + vswp d9, d10 + vswp d13, d14 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + vmov d16, d9 + vmov d18, d11 + + vadd.f32 q4, q6 + vadd.f32 q5, q7 + vadd.f32 q6, q8 + vadd.f32 q7, q9 + + vmov.i32 q8, #0x4b000000 + vorr.i32 q8, #0x00400000 + vadd.f32 q0, q0, q8 + vadd.f32 q1, q1, q8 + vadd.f32 q2, q2, q8 + vadd.f32 q3, q3, q8 + vadd.f32 q4, q4, q8 + vadd.f32 q5, q5, q8 + vadd.f32 q6, q6, q8 + vadd.f32 q7, q7, q8 + vshl.i32 q0, q0, #10 + vshl.i32 q1, q1, #10 + vshl.i32 q2, q2, #10 + vshl.i32 q3, q3, #10 + vshl.i32 q4, q4, #10 + vshl.i32 q5, q5, #10 + vshl.i32 q6, q6, #10 + vshl.i32 q7, q7, #10 + vqshrn.s32 d0, q0, #10 + vqshrn.s32 d2, q1, #10 + vqshrn.s32 d4, q2, #10 + vqshrn.s32 d6, q3, #10 + vqshrn.s32 d8, q4, #10 + vqshrn.s32 d10, q5, #10 + vqshrn.s32 d12, q6, #10 + vqshrn.s32 d14, q7, #10 + + mov r3, #32 + vst1.16 {d0[1]}, [r0, :16], r3 + vst1.16 {d12[3]}, [r0, :16], r3 + vst1.16 {d6[2]}, [r0, :16], r3 + vst1.16 {d8[3]}, [r0, :16], r3 + vst1.16 {d2[2]}, [r0, :16], r3 + vst1.16 {d12[1]}, [r0, :16], r3 + vst1.16 {d4[2]}, [r0, :16], r3 + vst1.16 {d8[1]}, [r0, :16], r3 + vst1.16 {d0[2]}, [r0, :16], r3 + vst1.16 {d12[2]}, [r0, :16], r3 + vst1.16 {d6[0]}, [r0, :16], r3 + vst1.16 {d8[2]}, [r0, :16], r3 + vst1.16 {d2[0]}, [r0, :16], r3 + vst1.16 {d12[0]}, [r0, :16], r3 + vst1.16 {d4[0]}, [r0, :16], r3 + vst1.16 {d8[0]}, [r0, :16], r3 + vst1.16 {d0[0]}, [r0, :16] + + vst1.16 {d0[1]}, [r1, :16], r3 + vst1.16 {d10[0]}, [r1, :16], r3 + vst1.16 {d4[1]}, [r1, :16], r3 + vst1.16 {d14[0]}, [r1, :16], r3 + vst1.16 {d2[1]}, [r1, :16], r3 + vst1.16 {d10[2]}, [r1, :16], r3 + vst1.16 {d6[1]}, [r1, :16], r3 + vst1.16 {d14[2]}, [r1, :16], r3 + vst1.16 {d0[3]}, [r1, :16], r3 + vst1.16 {d10[1]}, [r1, :16], r3 + vst1.16 {d4[3]}, [r1, :16], r3 + vst1.16 {d14[1]}, [r1, :16], r3 + vst1.16 {d2[3]}, [r1, :16], r3 + vst1.16 {d10[3]}, [r1, :16], r3 + vst1.16 {d6[3]}, [r1, :16], r3 + vst1.16 {d14[3]}, [r1, :16] + + vpop {q4-q7} + bx lr + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_neon64.S b/src/libmpg123/dct64_neon64.S new file mode 100644 index 0000000..32b8a0b --- /dev/null +++ b/src/libmpg123/dct64_neon64.S @@ -0,0 +1,299 @@ +/* + dct64_neon64: NEON optimized dct64 for AArch64 + + copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +costab_neon_aarch64: + .word 1056974725 + .word 1057056395 + .word 1057223771 + .word 1057485416 + .word 1057855544 + .word 1058356026 + .word 1059019886 + .word 1059897405 + .word 1061067246 + .word 1062657950 + .word 1064892987 + .word 1066774581 + .word 1069414683 + .word 1073984175 + .word 1079645762 + .word 1092815430 + .word 1057005197 + .word 1057342072 + .word 1058087743 + .word 1059427869 + .word 1061799040 + .word 1065862217 + .word 1071413542 + .word 1084439708 + .word 1057128951 + .word 1058664893 + .word 1063675095 + .word 1076102863 + .word 1057655764 + .word 1067924853 + .word 1060439283 + .word 1060439283 + .text + ALIGN4 + .globl ASM_NAME(dct64_neon64) +#ifdef __ELF__ + .type ASM_NAME(dct64_neon64), %function +#endif +ASM_NAME(dct64_neon64): + add x3, x2, #64 + adrp x4, AARCH64_PCREL_HI(costab_neon_aarch64) + add x4, x4, AARCH64_PCREL_LO(costab_neon_aarch64) + ld1 {v0.4s, v1.4s, v2.4s, v3.4s}, [x2] + ld1 {v16.4s, v17.4s, v18.4s, v19.4s}, [x3] + ld1 {v20.4s, v21.4s, v22.4s, v23.4s}, [x4], #64 + + rev64 v19.4s, v19.4s + rev64 v18.4s, v18.4s + rev64 v17.4s, v17.4s + rev64 v16.4s, v16.4s + ext v4.16b, v19.16b, v19.16b, #8 + ext v5.16b, v18.16b, v18.16b, #8 + ext v6.16b, v17.16b, v17.16b, #8 + ext v7.16b, v16.16b, v16.16b, #8 + + fsub v16.4s, v3.4s, v7.4s + fsub v17.4s, v2.4s, v6.4s + fsub v18.4s, v1.4s, v5.4s + fsub v19.4s, v0.4s, v4.4s + fadd v0.4s, v0.4s, v4.4s /* bs[0,1,2,3] */ + fadd v1.4s, v1.4s, v5.4s /* bs[4,5,6,7] */ + fadd v2.4s, v2.4s, v6.4s /* bs[8,9,10,11] */ + fadd v3.4s, v3.4s, v7.4s /* bs[12,13,14,15] */ + fmul v16.4s, v16.4s, v23.4s /* bs[19,18,17,16] */ + fmul v17.4s, v17.4s, v22.4s /* bs[23,22,21,20] */ + fmul v18.4s, v18.4s, v21.4s /* bs[27,26,25,24] */ + fmul v19.4s, v19.4s, v20.4s /* bs[31,30,29,28] */ + + ld1 {v20.4s, v21.4s}, [x4], #32 + rev64 v22.4s, v3.4s + rev64 v23.4s, v2.4s + rev64 v24.4s, v16.4s + rev64 v25.4s, v17.4s + ext v4.16b, v22.16b, v22.16b, #8 /* bs[15,14,13,12] */ + ext v5.16b, v23.16b, v23.16b, #8 /* bs[11,10,9,8] */ + ext v6.16b, v24.16b, v24.16b, #8 /* bs[16,17,18,19] */ + ext v7.16b, v25.16b, v25.16b, #8 /* bs[20,21,22,23] */ + + fsub v26.4s, v1.4s, v5.4s + fsub v27.4s, v0.4s, v4.4s + fsub v28.4s, v18.4s, v7.4s + fsub v29.4s, v19.4s, v6.4s + fadd v4.4s, v0.4s, v4.4s /* bs[32,33,34,35] */ + fadd v5.4s, v1.4s, v5.4s /* bs[36,37,38,39] */ + fadd v6.4s, v6.4s, v19.4s /* bs[48,49,50,51] */ + fadd v7.4s, v7.4s, v18.4s /* bs[52,53,54,55] */ + fmul v26.4s, v26.4s, v21.4s /* bs[43,42,41,40] */ + fmul v27.4s, v27.4s, v20.4s /* bs[47,46,45,44] */ + fmul v28.4s, v28.4s, v21.4s /* bs[59,58,57,56] */ + fmul v29.4s, v29.4s, v20.4s /* bs[63,62,61,60] */ + + ld1 {v20.4s}, [x4], #16 + rev64 v16.4s, v5.4s + rev64 v17.4s, v26.4s + rev64 v18.4s, v7.4s + rev64 v19.4s, v28.4s + ext v0.16b, v16.16b, v16.16b, #8 /* bs[39,38,37,36] */ + ext v1.16b, v17.16b, v17.16b, #8 /* bs[40,41,42,43] */ + ext v2.16b, v18.16b, v18.16b, #8 /* bs[55,54,53,52] */ + ext v3.16b, v19.16b, v19.16b, #8 /* bs[56,57,58,59] */ + + fsub v16.4s, v4.4s, v0.4s + fsub v17.4s, v27.4s, v1.4s + fsub v18.4s, v6.4s, v2.4s + fsub v19.4s, v29.4s, v3.4s + fadd v0.4s, v4.4s, v0.4s /* bs[0,1,2,3] */ + fadd v1.4s, v1.4s, v27.4s /* bs[8,9,10,11] */ + fadd v2.4s, v6.4s, v2.4s /* bs[16,17,18,19] */ + fadd v3.4s, v3.4s, v29.4s /* bs[24,25,26,27] */ + fmul v16.4s, v16.4s, v20.4s /* bs[7,6,5,4] */ + fmul v17.4s, v17.4s, v20.4s /* bs[15,14,13,12] */ + fmul v18.4s, v18.4s, v20.4s /* bs[23,22,21,20] */ + fmul v19.4s, v19.4s, v20.4s /* bs[31,30,29,28] */ + + ld1 {v28.4s}, [x4] + zip1 v4.2d, v0.2d, v16.2d /* bs[0,1,7,6] */ + zip2 v5.2d, v0.2d, v16.2d /* bs[2,3,5,4] */ + zip1 v6.2d, v1.2d, v17.2d /* bs[8,9,15,14] */ + zip2 v7.2d, v1.2d, v17.2d /* bs[10,11,13,12] */ + zip1 v20.2d, v2.2d, v18.2d /* bs[16,17,23,22] */ + zip2 v21.2d, v2.2d, v18.2d /* bs[18,19,21,20] */ + zip1 v22.2d, v3.2d, v19.2d /* bs[24,25,31,30] */ + zip2 v23.2d, v3.2d, v19.2d /* bs[26,27,29,28] */ + rev64 v5.4s, v5.4s /* bs[3,2,4,5] */ + rev64 v7.4s, v7.4s /* bs[11,10,12,13] */ + rev64 v21.4s, v21.4s /* bs[19,18,20,21] */ + rev64 v23.4s, v23.4s /* bs[27,26,28,29] */ + AARCH64_DUP_2D(v29, v28, 0) + AARCH64_DUP_4S(v28, v28, 2) + + fsub v16.4s, v4.4s, v5.4s + fsub v17.4s, v6.4s, v7.4s + fsub v18.4s, v20.4s, v21.4s + fsub v19.4s, v22.4s, v23.4s + fadd v0.4s, v4.4s, v5.4s /* bs[32,33,36,37] */ + fadd v1.4s, v6.4s, v7.4s /* bs[40,41,44,45] */ + fadd v2.4s, v20.4s, v21.4s /* bs[48,49,52,53] */ + fadd v3.4s, v22.4s, v23.4s /* bs[56,57,60,61] */ + fmul v16.4s, v16.4s, v29.4s /* bs[35,34,39,38] */ + fmul v17.4s, v17.4s, v29.4s /* bs[43,42,47,46] */ + fmul v18.4s, v18.4s, v29.4s /* bs[51,50,55,54] */ + fmul v19.4s, v19.4s, v29.4s /* bs[59,58,63,62] */ + + uzp1 v4.4s, v0.4s, v16.4s /* bs[32,36,35,39] */ + uzp2 v5.4s, v0.4s, v16.4s /* bs[33,37,34,38] */ + uzp1 v6.4s, v1.4s, v17.4s /* bs[40,44,43,47] */ + uzp2 v7.4s, v1.4s, v17.4s /* bs[41,45,42,46] */ + uzp1 v20.4s, v2.4s, v18.4s /* bs[48,52,51,55] */ + uzp2 v21.4s, v2.4s, v18.4s /* bs[49,53,50,54] */ + uzp1 v22.4s, v3.4s, v19.4s /* bs[56,60,59,63] */ + uzp2 v23.4s, v3.4s, v19.4s /* bs[57,61,58,62] */ + + fsub v16.4s, v4.4s, v5.4s + fsub v17.4s, v6.4s, v7.4s + fsub v18.4s, v20.4s, v21.4s + fsub v19.4s, v22.4s, v23.4s + fadd v0.4s, v4.4s, v5.4s /* bs[0,4,2,6] */ + fadd v1.4s, v6.4s, v7.4s /* bs[8,12,10,14] */ + fadd v2.4s, v20.4s, v21.4s /* bs[16,20,18,22] */ + fadd v3.4s, v22.4s, v23.4s /* bs[24,28,26,30] */ + fmul v16.4s, v16.4s, v28.4s /* bs[1,5,3,7] */ + fmul v17.4s, v17.4s, v28.4s /* bs[9,13,11,15] */ + fmul v18.4s, v18.4s, v28.4s /* bs[17,21,19,23] */ + fmul v19.4s, v19.4s, v28.4s /* bs[25,29,27,31] */ + + zip2 v4.2d, v0.2d, v1.2d /* bs[2,6,10,14] */ + zip2 v5.2d, v16.2d, v17.2d /* bs[3,7,11,15] */ + zip2 v6.2d, v2.2d, v3.2d /* bs[18,22,26,30] */ + zip2 v7.2d, v18.2d, v19.2d /* bs[19,23,27,31] */ + fadd v4.4s, v4.4s, v5.4s /* bs[2,6,10,14] */ + fadd v6.4s, v6.4s, v7.4s /* bs[18,22,26,30] */ + ins v0.d[1], v4.d[0] /* bs[0,4,2,6] */ + ins v1.d[1], v4.d[1] /* bs[8,12,10,14] */ + ins v2.d[1], v6.d[0] /* bs[16,20,18,22] */ + ins v3.d[1], v6.d[1] /* bs[24,28,26,30] */ + + eor v31.16b, v31.16b, v31.16b + zip1 v4.4s, v0.4s, v16.4s /* bs[0,1,4,5] */ + zip2 v5.4s, v0.4s, v16.4s /* bs[2,3,6,7] */ + zip1 v6.4s, v1.4s, v17.4s /* bs[8,9,12,13] */ + zip2 v7.4s, v1.4s, v17.4s /* bs[10,11,14,15] */ + zip1 v20.4s, v2.4s, v18.4s /* bs[16,17,20,21] */ + zip2 v21.4s, v2.4s, v18.4s /* bs[18,19,22,23] */ + zip1 v22.4s, v3.4s, v19.4s /* bs[24,25,28,29] */ + zip2 v23.4s, v3.4s, v19.4s /* bs[26,27,30,31] */ + zip1 v0.2d, v4.2d, v5.2d /* bs[0,1,2,3] */ + zip2 v1.2d, v4.2d, v5.2d /* bs[4,5,6,7] */ + zip1 v2.2d, v6.2d, v7.2d /* bs[8,9,10,11] */ + zip2 v3.2d, v6.2d, v7.2d /* bs[12,13,14,15] */ + rev64 v16.4s, v4.4s + rev64 v17.4s, v6.4s + zip1 v24.2d, v7.2d, v17.2d + zip2 v16.2d, v5.2d, v16.2d + zip2 v17.2d, v7.2d, v17.2d + zip1 v4.2d, v20.2d, v21.2d /* bs[16,17,18,19] */ + zip2 v5.2d, v20.2d, v21.2d /* bs[20,21,22,23] */ + zip1 v6.2d, v22.2d, v23.2d /* bs[24,25,26,27] */ + zip2 v7.2d, v22.2d, v23.2d /* bs[28,29,30,31] */ + rev64 v18.4s, v20.4s + rev64 v19.4s, v22.4s + zip1 v25.2d, v23.2d, v19.2d + zip1 v26.2d, v21.2d, v18.2d + zip2 v18.2d, v21.2d, v18.2d + zip2 v19.2d, v23.2d, v19.2d + ins v16.s[3], v31.s[0] /* bs[6,7,5,-] */ + ins v17.s[3], v31.s[0] /* bs[14,15,13,-] */ + ins v18.s[3], v31.s[0] /* bs[22,23,21,-] */ + ins v19.s[3], v31.s[0] /* bs[30,31,29,-] */ + ins v24.s[3], v31.s[0] /* bs[10,11,9,-] */ + ins v25.s[3], v31.s[0] /* bs[26,27,25,-] */ + ins v26.s[3], v31.s[0] /* bs[18,19,17,-] */ + + fadd v1.4s, v1.4s, v16.4s + fadd v3.4s, v3.4s, v17.4s + fadd v5.4s, v5.4s, v18.4s + fadd v7.4s, v7.4s, v19.4s + + fadd v2.4s, v2.4s, v3.4s + fadd v3.4s, v3.4s, v24.4s + fadd v6.4s, v6.4s, v7.4s + fadd v7.4s, v7.4s, v25.4s + + fadd v4.4s, v4.4s, v6.4s + fadd v6.4s, v6.4s, v5.4s + fadd v5.4s, v5.4s, v7.4s + fadd v7.4s, v7.4s, v26.4s + + fcvtns v0.4s, v0.4s + fcvtns v1.4s, v1.4s + fcvtns v2.4s, v2.4s + fcvtns v3.4s, v3.4s + fcvtns v4.4s, v4.4s + fcvtns v5.4s, v5.4s + fcvtns v6.4s, v6.4s + fcvtns v7.4s, v7.4s + sqxtn v0.4h, v0.4s + sqxtn v1.4h, v1.4s + sqxtn v2.4h, v2.4s + sqxtn v3.4h, v3.4s + sqxtn v4.4h, v4.4s + sqxtn v5.4h, v5.4s + sqxtn v6.4h, v6.4s + sqxtn v7.4h, v7.4s + + mov x3, #32 + st1 {v0.h}[1], [x0], x3 + st1 {v7.h}[2], [x0], x3 + st1 {v3.h}[2], [x0], x3 + st1 {v5.h}[2], [x0], x3 + st1 {v1.h}[2], [x0], x3 + st1 {v6.h}[2], [x0], x3 + st1 {v2.h}[2], [x0], x3 + st1 {v4.h}[2], [x0], x3 + st1 {v0.h}[2], [x0], x3 + st1 {v7.h}[0], [x0], x3 + st1 {v3.h}[0], [x0], x3 + st1 {v5.h}[0], [x0], x3 + st1 {v1.h}[0], [x0], x3 + st1 {v6.h}[0], [x0], x3 + st1 {v2.h}[0], [x0], x3 + st1 {v4.h}[0], [x0], x3 + st1 {v0.h}[0], [x0] + st1 {v0.h}[1], [x1], x3 + st1 {v4.h}[1], [x1], x3 + st1 {v2.h}[1], [x1], x3 + st1 {v6.h}[1], [x1], x3 + st1 {v1.h}[1], [x1], x3 + st1 {v5.h}[1], [x1], x3 + st1 {v3.h}[1], [x1], x3 + st1 {v7.h}[1], [x1], x3 + st1 {v0.h}[3], [x1], x3 + st1 {v4.h}[3], [x1], x3 + st1 {v2.h}[3], [x1], x3 + st1 {v6.h}[3], [x1], x3 + st1 {v1.h}[3], [x1], x3 + st1 {v5.h}[3], [x1], x3 + st1 {v3.h}[3], [x1], x3 + st1 {v7.h}[3], [x1] + + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_neon64_float.S b/src/libmpg123/dct64_neon64_float.S new file mode 100644 index 0000000..0e557e5 --- /dev/null +++ b/src/libmpg123/dct64_neon64_float.S @@ -0,0 +1,282 @@ +/* + dct64_neon64_float: NEON optimized dct64 for AArch64 (float output version) + + copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +costab_neon_aarch64: + .word 1056974725 + .word 1057056395 + .word 1057223771 + .word 1057485416 + .word 1057855544 + .word 1058356026 + .word 1059019886 + .word 1059897405 + .word 1061067246 + .word 1062657950 + .word 1064892987 + .word 1066774581 + .word 1069414683 + .word 1073984175 + .word 1079645762 + .word 1092815430 + .word 1057005197 + .word 1057342072 + .word 1058087743 + .word 1059427869 + .word 1061799040 + .word 1065862217 + .word 1071413542 + .word 1084439708 + .word 1057128951 + .word 1058664893 + .word 1063675095 + .word 1076102863 + .word 1057655764 + .word 1067924853 + .word 1060439283 + .word 1060439283 + .text + ALIGN4 + .globl ASM_NAME(dct64_real_neon64) +#ifdef __ELF__ + .type ASM_NAME(dct64_real_neon64), %function +#endif +ASM_NAME(dct64_real_neon64): + add x3, x2, #64 + adrp x4, AARCH64_PCREL_HI(costab_neon_aarch64) + add x4, x4, AARCH64_PCREL_LO(costab_neon_aarch64) + ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x2] + ld1 {v16.4s,v17.4s,v18.4s,v19.4s}, [x3] + ld1 {v20.4s,v21.4s,v22.4s,v23.4s}, [x4], #64 + + rev64 v19.4s, v19.4s + rev64 v18.4s, v18.4s + rev64 v17.4s, v17.4s + rev64 v16.4s, v16.4s + ext v4.16b, v19.16b, v19.16b, #8 + ext v5.16b, v18.16b, v18.16b, #8 + ext v6.16b, v17.16b, v17.16b, #8 + ext v7.16b, v16.16b, v16.16b, #8 + + fsub v16.4s, v3.4s, v7.4s + fsub v17.4s, v2.4s, v6.4s + fsub v18.4s, v1.4s, v5.4s + fsub v19.4s, v0.4s, v4.4s + fadd v0.4s, v0.4s, v4.4s /* bs[0,1,2,3] */ + fadd v1.4s, v1.4s, v5.4s /* bs[4,5,6,7] */ + fadd v2.4s, v2.4s, v6.4s /* bs[8,9,10,11] */ + fadd v3.4s, v3.4s, v7.4s /* bs[12,13,14,15] */ + fmul v16.4s, v16.4s, v23.4s /* bs[19,18,17,16] */ + fmul v17.4s, v17.4s, v22.4s /* bs[23,22,21,20] */ + fmul v18.4s, v18.4s, v21.4s /* bs[27,26,25,24] */ + fmul v19.4s, v19.4s, v20.4s /* bs[31,30,29,28] */ + + ld1 {v20.4s, v21.4s}, [x4], #32 + rev64 v22.4s, v3.4s + rev64 v23.4s, v2.4s + rev64 v24.4s, v16.4s + rev64 v25.4s, v17.4s + ext v4.16b, v22.16b, v22.16b, #8 /* bs[15,14,13,12] */ + ext v5.16b, v23.16b, v23.16b, #8 /* bs[11,10,9,8] */ + ext v6.16b, v24.16b, v24.16b, #8 /* bs[16,17,18,19] */ + ext v7.16b, v25.16b, v25.16b, #8 /* bs[20,21,22,23] */ + + fsub v26.4s, v1.4s, v5.4s + fsub v27.4s, v0.4s, v4.4s + fsub v28.4s, v18.4s, v7.4s + fsub v29.4s, v19.4s, v6.4s + fadd v4.4s, v0.4s, v4.4s /* bs[32,33,34,35] */ + fadd v5.4s, v1.4s, v5.4s /* bs[36,37,38,39] */ + fadd v6.4s, v6.4s, v19.4s /* bs[48,49,50,51] */ + fadd v7.4s, v7.4s, v18.4s /* bs[52,53,54,55] */ + fmul v26.4s, v26.4s, v21.4s /* bs[43,42,41,40] */ + fmul v27.4s, v27.4s, v20.4s /* bs[47,46,45,44] */ + fmul v28.4s, v28.4s, v21.4s /* bs[59,58,57,56] */ + fmul v29.4s, v29.4s, v20.4s /* bs[63,62,61,60] */ + + ld1 {v20.4s}, [x4], #16 + rev64 v16.4s, v5.4s + rev64 v17.4s, v26.4s + rev64 v18.4s, v7.4s + rev64 v19.4s, v28.4s + ext v0.16b, v16.16b, v16.16b, #8 /* bs[39,38,37,36] */ + ext v1.16b, v17.16b, v17.16b, #8 /* bs[40,41,42,43] */ + ext v2.16b, v18.16b, v18.16b, #8 /* bs[55,54,53,52] */ + ext v3.16b, v19.16b, v19.16b, #8 /* bs[56,57,58,59] */ + + fsub v16.4s, v4.4s, v0.4s + fsub v17.4s, v27.4s, v1.4s + fsub v18.4s, v6.4s, v2.4s + fsub v19.4s, v29.4s, v3.4s + fadd v0.4s, v4.4s, v0.4s /* bs[0,1,2,3] */ + fadd v1.4s, v1.4s, v27.4s /* bs[8,9,10,11] */ + fadd v2.4s, v6.4s, v2.4s /* bs[16,17,18,19] */ + fadd v3.4s, v3.4s, v29.4s /* bs[24,25,26,27] */ + fmul v16.4s, v16.4s, v20.4s /* bs[7,6,5,4] */ + fmul v17.4s, v17.4s, v20.4s /* bs[15,14,13,12] */ + fmul v18.4s, v18.4s, v20.4s /* bs[23,22,21,20] */ + fmul v19.4s, v19.4s, v20.4s /* bs[31,30,29,28] */ + + ld1 {v28.4s}, [x4] + zip1 v4.2d, v0.2d, v16.2d /* bs[0,1,7,6] */ + zip2 v5.2d, v0.2d, v16.2d /* bs[2,3,5,4] */ + zip1 v6.2d, v1.2d, v17.2d /* bs[8,9,15,14] */ + zip2 v7.2d, v1.2d, v17.2d /* bs[10,11,13,12] */ + zip1 v20.2d, v2.2d, v18.2d /* bs[16,17,23,22] */ + zip2 v21.2d, v2.2d, v18.2d /* bs[18,19,21,20] */ + zip1 v22.2d, v3.2d, v19.2d /* bs[24,25,31,30] */ + zip2 v23.2d, v3.2d, v19.2d /* bs[26,27,29,28] */ + rev64 v5.4s, v5.4s /* bs[3,2,4,5] */ + rev64 v7.4s, v7.4s /* bs[11,10,12,13] */ + rev64 v21.4s, v21.4s /* bs[19,18,20,21] */ + rev64 v23.4s, v23.4s /* bs[27,26,28,29] */ + AARCH64_DUP_2D(v29, v28, 0) + AARCH64_DUP_4S(v28, v28, 2) + + fsub v16.4s, v4.4s, v5.4s + fsub v17.4s, v6.4s, v7.4s + fsub v18.4s, v20.4s, v21.4s + fsub v19.4s, v22.4s, v23.4s + fadd v0.4s, v4.4s, v5.4s /* bs[32,33,36,37] */ + fadd v1.4s, v6.4s, v7.4s /* bs[40,41,44,45] */ + fadd v2.4s, v20.4s, v21.4s /* bs[48,49,52,53] */ + fadd v3.4s, v22.4s, v23.4s /* bs[56,57,60,61] */ + fmul v16.4s, v16.4s, v29.4s /* bs[35,34,39,38] */ + fmul v17.4s, v17.4s, v29.4s /* bs[43,42,47,46] */ + fmul v18.4s, v18.4s, v29.4s /* bs[51,50,55,54] */ + fmul v19.4s, v19.4s, v29.4s /* bs[59,58,63,62] */ + + uzp1 v4.4s, v0.4s, v16.4s /* bs[32,36,35,39] */ + uzp2 v5.4s, v0.4s, v16.4s /* bs[33,37,34,38] */ + uzp1 v6.4s, v1.4s, v17.4s /* bs[40,44,43,47] */ + uzp2 v7.4s, v1.4s, v17.4s /* bs[41,45,42,46] */ + uzp1 v20.4s, v2.4s, v18.4s /* bs[48,52,51,55] */ + uzp2 v21.4s, v2.4s, v18.4s /* bs[49,53,50,54] */ + uzp1 v22.4s, v3.4s, v19.4s /* bs[56,60,59,63] */ + uzp2 v23.4s, v3.4s, v19.4s /* bs[57,61,58,62] */ + + fsub v16.4s, v4.4s, v5.4s + fsub v17.4s, v6.4s, v7.4s + fsub v18.4s, v20.4s, v21.4s + fsub v19.4s, v22.4s, v23.4s + fadd v0.4s, v4.4s, v5.4s /* bs[0,4,2,6] */ + fadd v1.4s, v6.4s, v7.4s /* bs[8,12,10,14] */ + fadd v2.4s, v20.4s, v21.4s /* bs[16,20,18,22] */ + fadd v3.4s, v22.4s, v23.4s /* bs[24,28,26,30] */ + fmul v16.4s, v16.4s, v28.4s /* bs[1,5,3,7] */ + fmul v17.4s, v17.4s, v28.4s /* bs[9,13,11,15] */ + fmul v18.4s, v18.4s, v28.4s /* bs[17,21,19,23] */ + fmul v19.4s, v19.4s, v28.4s /* bs[25,29,27,31] */ + + zip2 v4.2d, v0.2d, v1.2d /* bs[2,6,10,14] */ + zip2 v5.2d, v16.2d, v17.2d /* bs[3,7,11,15] */ + zip2 v6.2d, v2.2d, v3.2d /* bs[18,22,26,30] */ + zip2 v7.2d, v18.2d, v19.2d /* bs[19,23,27,31] */ + fadd v4.4s, v4.4s, v5.4s /* bs[2,6,10,14] */ + fadd v6.4s, v6.4s, v7.4s /* bs[18,22,26,30] */ + ins v0.d[1], v4.d[0] /* bs[0,4,2,6] */ + ins v1.d[1], v4.d[1] /* bs[8,12,10,14] */ + ins v2.d[1], v6.d[0] /* bs[16,20,18,22] */ + ins v3.d[1], v6.d[1] /* bs[24,28,26,30] */ + + eor v31.16b, v31.16b, v31.16b + zip1 v4.4s, v0.4s, v16.4s /* bs[0,1,4,5] */ + zip2 v5.4s, v0.4s, v16.4s /* bs[2,3,6,7] */ + zip1 v6.4s, v1.4s, v17.4s /* bs[8,9,12,13] */ + zip2 v7.4s, v1.4s, v17.4s /* bs[10,11,14,15] */ + zip1 v20.4s, v2.4s, v18.4s /* bs[16,17,20,21] */ + zip2 v21.4s, v2.4s, v18.4s /* bs[18,19,22,23] */ + zip1 v22.4s, v3.4s, v19.4s /* bs[24,25,28,29] */ + zip2 v23.4s, v3.4s, v19.4s /* bs[26,27,30,31] */ + zip1 v0.2d, v4.2d, v5.2d /* bs[0,1,2,3] */ + zip2 v1.2d, v4.2d, v5.2d /* bs[4,5,6,7] */ + zip1 v2.2d, v6.2d, v7.2d /* bs[8,9,10,11] */ + zip2 v3.2d, v6.2d, v7.2d /* bs[12,13,14,15] */ + rev64 v16.4s, v4.4s + rev64 v17.4s, v6.4s + zip1 v24.2d, v7.2d, v17.2d + zip2 v16.2d, v5.2d, v16.2d + zip2 v17.2d, v7.2d, v17.2d + zip1 v4.2d, v20.2d, v21.2d /* bs[16,17,18,19] */ + zip2 v5.2d, v20.2d, v21.2d /* bs[20,21,22,23] */ + zip1 v6.2d, v22.2d, v23.2d /* bs[24,25,26,27] */ + zip2 v7.2d, v22.2d, v23.2d /* bs[28,29,30,31] */ + rev64 v18.4s, v20.4s + rev64 v19.4s, v22.4s + zip1 v25.2d, v23.2d, v19.2d + zip1 v26.2d, v21.2d, v18.2d + zip2 v18.2d, v21.2d, v18.2d + zip2 v19.2d, v23.2d, v19.2d + ins v16.s[3], v31.s[0] /* bs[6,7,5,-] */ + ins v17.s[3], v31.s[0] /* bs[14,15,13,-] */ + ins v18.s[3], v31.s[0] /* bs[22,23,21,-] */ + ins v19.s[3], v31.s[0] /* bs[30,31,29,-] */ + ins v24.s[3], v31.s[0] /* bs[10,11,9,-] */ + ins v25.s[3], v31.s[0] /* bs[26,27,25,-] */ + ins v26.s[3], v31.s[0] /* bs[18,19,17,-] */ + + fadd v1.4s, v1.4s, v16.4s + fadd v3.4s, v3.4s, v17.4s + fadd v5.4s, v5.4s, v18.4s + fadd v7.4s, v7.4s, v19.4s + + fadd v2.4s, v2.4s, v3.4s + fadd v3.4s, v3.4s, v24.4s + fadd v6.4s, v6.4s, v7.4s + fadd v7.4s, v7.4s, v25.4s + + fadd v4.4s, v4.4s, v6.4s + fadd v6.4s, v6.4s, v5.4s + fadd v5.4s, v5.4s, v7.4s + fadd v7.4s, v7.4s, v26.4s + + mov x3, #64 + st1 {v0.s}[1], [x0], x3 + st1 {v7.s}[2], [x0], x3 + st1 {v3.s}[2], [x0], x3 + st1 {v5.s}[2], [x0], x3 + st1 {v1.s}[2], [x0], x3 + st1 {v6.s}[2], [x0], x3 + st1 {v2.s}[2], [x0], x3 + st1 {v4.s}[2], [x0], x3 + st1 {v0.s}[2], [x0], x3 + st1 {v7.s}[0], [x0], x3 + st1 {v3.s}[0], [x0], x3 + st1 {v5.s}[0], [x0], x3 + st1 {v1.s}[0], [x0], x3 + st1 {v6.s}[0], [x0], x3 + st1 {v2.s}[0], [x0], x3 + st1 {v4.s}[0], [x0], x3 + st1 {v0.s}[0], [x0] + st1 {v0.s}[1], [x1], x3 + st1 {v4.s}[1], [x1], x3 + st1 {v2.s}[1], [x1], x3 + st1 {v6.s}[1], [x1], x3 + st1 {v1.s}[1], [x1], x3 + st1 {v5.s}[1], [x1], x3 + st1 {v3.s}[1], [x1], x3 + st1 {v7.s}[1], [x1], x3 + st1 {v0.s}[3], [x1], x3 + st1 {v4.s}[3], [x1], x3 + st1 {v2.s}[3], [x1], x3 + st1 {v6.s}[3], [x1], x3 + st1 {v1.s}[3], [x1], x3 + st1 {v5.s}[3], [x1], x3 + st1 {v3.s}[3], [x1], x3 + st1 {v7.s}[3], [x1] + + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_neon_float.S b/src/libmpg123/dct64_neon_float.S new file mode 100644 index 0000000..36d640f --- /dev/null +++ b/src/libmpg123/dct64_neon_float.S @@ -0,0 +1,283 @@ +/* + dct64_neon_float: ARM NEON optimized dct64 (float output version) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifndef _M_ARM + .code 32 +#endif +#ifndef __APPLE__ + .fpu neon +#endif + + .text + ALIGN16 +costab_arm: + .word 1056974725 + .word 1057056395 + .word 1057223771 + .word 1057485416 + .word 1057855544 + .word 1058356026 + .word 1059019886 + .word 1059897405 + .word 1061067246 + .word 1062657950 + .word 1064892987 + .word 1066774581 + .word 1069414683 + .word 1073984175 + .word 1079645762 + .word 1092815430 + .word 1057005197 + .word 1057342072 + .word 1058087743 + .word 1059427869 + .word 1061799040 + .word 1065862217 + .word 1071413542 + .word 1084439708 + .word 1057128951 + .word 1058664893 + .word 1063675095 + .word 1076102863 + .word 1057655764 + .word 1067924853 + .word 1060439283 + .word 1060439283 + ALIGN4 + GLOBAL_SYMBOL ASM_NAME(dct64_real_neon) +#ifdef __ELF__ + .type ASM_NAME(dct64_real_neon), %function +#endif +ASM_NAME(dct64_real_neon): + vpush {q4-q7} + + adr r3, costab_arm + vld1.32 {q0, q1}, [r2]! + vld1.32 {q2, q3}, [r2]! + vld1.32 {q4, q5}, [r2]! + vld1.32 {q6, q7}, [r2] + vld1.32 {q12, q13}, [r3, :128]! + vld1.32 {q14, q15}, [r3, :128]! + + vrev64.32 q4, q4 + vrev64.32 q5, q5 + vrev64.32 q6, q6 + vrev64.32 q7, q7 + vswp d8, d9 + vswp d10, d11 + vswp d12, d13 + vswp d14, d15 + + vsub.f32 q8, q0, q7 + vsub.f32 q9, q1, q6 + vsub.f32 q10, q2, q5 + vsub.f32 q11, q3, q4 + vadd.f32 q0, q0, q7 + vadd.f32 q1, q1, q6 + vadd.f32 q2, q2, q5 + vadd.f32 q3, q3, q4 + vmul.f32 q4, q8, q12 + vmul.f32 q5, q9, q13 + vmul.f32 q6, q10, q14 + vmul.f32 q7, q11, q15 + + vld1.32 {q12, q13}, [r3, :128]! + vld1.32 {q14, q15}, [r3, :128] + + vrev64.32 q2, q2 + vrev64.32 q3, q3 + vrev64.32 q6, q6 + vrev64.32 q7, q7 + vswp d4, d5 + vswp d6, d7 + vswp d12, d13 + vswp d14, d15 + + vsub.f32 q8, q0, q3 + vsub.f32 q9, q1, q2 + vsub.f32 q10, q4, q7 + vsub.f32 q11, q5, q6 + vadd.f32 q0, q0, q3 + vadd.f32 q1, q1, q2 + vadd.f32 q4, q4, q7 + vadd.f32 q5, q5, q6 + vmul.f32 q2, q8, q12 + vmul.f32 q3, q9, q13 + vmul.f32 q6, q10, q12 + vmul.f32 q7, q11, q13 + + vrev64.32 q1, q1 + vrev64.32 q3, q3 + vrev64.32 q5, q5 + vrev64.32 q7, q7 + vswp d2, d3 + vswp d6, d7 + vswp d10, d11 + vswp d14, d15 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q14 + vmul.f32 q3, q9, q14 + vmul.f32 q5, q10, q14 + vmul.f32 q7, q11, q14 + + vdup.32 q12, d31[0] + vmov d31, d30 + + vswp d1, d2 + vswp d5, d6 + vswp d9, d10 + vswp d13, d14 + vrev64.32 q1, q1 + vrev64.32 q3, q3 + vrev64.32 q5, q5 + vrev64.32 q7, q7 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q15 + vmul.f32 q3, q9, q15 + vmul.f32 q5, q10, q15 + vmul.f32 q7, q11, q15 + + vtrn.32 q0, q1 + vtrn.32 q2, q3 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q12 + vmul.f32 q3, q9, q12 + vmul.f32 q5, q10, q12 + vmul.f32 q7, q11, q12 + + vtrn.32 q0, q1 + vtrn.32 q2, q3 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + vswp d1, d2 + vswp d5, d6 + vswp d9, d10 + vswp d13, d14 + + vshr.u64 d16, d1, #32 + vshr.u64 d17, d3, #32 + vshr.u64 d18, d5, #32 + vshr.u64 d19, d7, #32 + vadd.f32 d1, d1, d16 + vadd.f32 d3, d3, d17 + vadd.f32 d5, d5, d18 + vadd.f32 d7, d7, d19 + vshr.u64 d20, d9, #32 + vshr.u64 d21, d11, #32 + vshr.u64 d22, d13, #32 + vshr.u64 d23, d15, #32 + vadd.f32 d9, d9, d20 + vadd.f32 d11, d11, d21 + vadd.f32 d13, d13, d22 + vadd.f32 d15, d15, d23 + + vshr.u64 d16, d2, #32 + vshr.u64 d18, d6, #32 + vshr.u64 d20, d10, #32 + vshr.u64 d22, d14, #32 + vext.8 q8, q1, q8, #8 + vext.8 q9, q3, q9, #8 + vext.8 q10, q5, q10, #8 + vext.8 q11, q7, q11, #8 + vadd.f32 q1, q1, q8 + vadd.f32 q3, q3, q9 + vadd.f32 q5, q5, q10 + vadd.f32 q7, q7, q11 + + vshr.u64 d16, d4, #32 + vshr.u64 d18, d12, #32 + vext.8 q8, q2, q8, #8 + vext.8 q9, q6, q9, #8 + vadd.f32 q2, q2, q3 + vadd.f32 q6, q6, q7 + vadd.f32 q3, q3, q8 + vadd.f32 q7, q7, q9 + + vrev64.32 q8, q4 + vshr.u64 d19, d9, #32 + vext.8 d17, d17, d16, #4 + vswp d9, d10 + vswp d13, d14 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + vmov d16, d9 + vmov d18, d11 + + vadd.f32 q4, q6 + vadd.f32 q5, q7 + vadd.f32 q6, q8 + vadd.f32 q7, q9 + + mov r3, #64 + vst1.32 {d0[1]}, [r0, :32], r3 + vst1.32 {d13[1]}, [r0, :32], r3 + vst1.32 {d7[0]}, [r0, :32], r3 + vst1.32 {d9[1]}, [r0, :32], r3 + vst1.32 {d3[0]}, [r0, :32], r3 + vst1.32 {d12[1]}, [r0, :32], r3 + vst1.32 {d5[0]}, [r0, :32], r3 + vst1.32 {d8[1]}, [r0, :32], r3 + vst1.32 {d1[0]}, [r0, :32], r3 + vst1.32 {d13[0]}, [r0, :32], r3 + vst1.32 {d6[0]}, [r0, :32], r3 + vst1.32 {d9[0]}, [r0, :32], r3 + vst1.32 {d2[0]}, [r0, :32], r3 + vst1.32 {d12[0]}, [r0, :32], r3 + vst1.32 {d4[0]}, [r0, :32], r3 + vst1.32 {d8[0]}, [r0, :32], r3 + vst1.32 {d0[0]}, [r0, :32] + + vst1.32 {d0[1]}, [r1, :32], r3 + vst1.32 {d10[0]}, [r1, :32], r3 + vst1.32 {d4[1]}, [r1, :32], r3 + vst1.32 {d14[0]}, [r1, :32], r3 + vst1.32 {d2[1]}, [r1, :32], r3 + vst1.32 {d11[0]}, [r1, :32], r3 + vst1.32 {d6[1]}, [r1, :32], r3 + vst1.32 {d15[0]}, [r1, :32], r3 + vst1.32 {d1[1]}, [r1, :32], r3 + vst1.32 {d10[1]}, [r1, :32], r3 + vst1.32 {d5[1]}, [r1, :32], r3 + vst1.32 {d14[1]}, [r1, :32], r3 + vst1.32 {d3[1]}, [r1, :32], r3 + vst1.32 {d11[1]}, [r1, :32], r3 + vst1.32 {d7[1]}, [r1, :32], r3 + vst1.32 {d15[1]}, [r1, :32] + + vpop {q4-q7} + bx lr + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_sse.S b/src/libmpg123/dct64_sse.S new file mode 100644 index 0000000..fdcf969 --- /dev/null +++ b/src/libmpg123/dct64_sse.S @@ -0,0 +1,472 @@ +/* + dct64_sse: MMX/SSE optimized dct64 + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#define ARG(n) (8+n*4)(%ebp) +#define TEMP(n) (4+n*16)(%esp) +#define TEMP_BYTE(n) (4+n)(%esp) + +/* + void dct64_sse(short *out0, short *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +pnpn: + .long 0 + .long -2147483648 + .long 0 + .long -2147483648 + ALIGN16 +mask: + .long -1 + .long -1 + .long -1 + .long 0 + + .text + ALIGN16 +.globl ASM_NAME(dct64_sse) +ASM_NAME(dct64_sse): + pushl %ebp + movl %esp, %ebp + + andl $-16, %esp /* align the stack at 16 bytes */ + subl $128, %esp /* reserve space for temporal store */ + pushl %ebx + + GET_GOT + + movl ARG(2), %eax + + MOVUAPS (%eax), %xmm7 + MOVUAPS 16(%eax), %xmm6 + MOVUAPS 112(%eax), %xmm0 + MOVUAPS 96(%eax), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm7, %xmm4 + movaps %xmm6, %xmm5 + addps %xmm0, %xmm4 + addps %xmm1, %xmm5 + subps %xmm0, %xmm7 + subps %xmm1, %xmm6 + movaps %xmm4, TEMP(0) + movaps %xmm5, TEMP(1) + + MOVUAPS 32(%eax), %xmm2 + MOVUAPS 48(%eax), %xmm3 + MOVUAPS 80(%eax), %xmm0 + MOVUAPS 64(%eax), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm2, %xmm5 + movaps %xmm3, %xmm4 + addps %xmm0, %xmm2 + addps %xmm1, %xmm3 + subps %xmm0, %xmm5 + subps %xmm1, %xmm4 + +#if defined(PIC) && defined(__APPLE__) + mov GLOBAL_VAR_PTR(costab_mmxsse), %ecx +#else + lea GLOBAL_VAR(costab_mmxsse), %ecx +#endif + mulps (%ecx), %xmm7 + mulps 16(%ecx), %xmm6 + mulps 32(%ecx), %xmm5 + mulps 48(%ecx), %xmm4 + + shufps $0x1b, %xmm2, %xmm2 + shufps $0x1b, %xmm3, %xmm3 + shufps $0x1b, %xmm4, %xmm4 + shufps $0x1b, %xmm5, %xmm5 + movaps TEMP(0), %xmm0 + movaps TEMP(1), %xmm1 + subps %xmm3, %xmm0 + subps %xmm2, %xmm1 + addps TEMP(0), %xmm3 + addps TEMP(1), %xmm2 + movaps %xmm3, TEMP(0) + movaps %xmm2, TEMP(1) + movaps %xmm6, %xmm2 + movaps %xmm7, %xmm3 + subps %xmm5, %xmm6 + subps %xmm4, %xmm7 + addps %xmm3, %xmm4 + addps %xmm2, %xmm5 + mulps 64(%ecx), %xmm0 + mulps 80(%ecx), %xmm1 + mulps 80(%ecx), %xmm6 + mulps 64(%ecx), %xmm7 + + movaps TEMP(0), %xmm2 + movaps TEMP(1), %xmm3 + shufps $0x1b, %xmm3, %xmm3 + shufps $0x1b, %xmm5, %xmm5 + shufps $0x1b, %xmm1, %xmm1 + shufps $0x1b, %xmm6, %xmm6 + movaps %xmm0, TEMP(1) + subps %xmm3, %xmm2 + subps %xmm1, %xmm0 + addps TEMP(0), %xmm3 + addps TEMP(1), %xmm1 + movaps %xmm3, TEMP(0) + movaps %xmm1, TEMP(2) + movaps %xmm5, %xmm1 + movaps %xmm4, %xmm5 + movaps %xmm7, %xmm3 + subps %xmm1, %xmm5 + subps %xmm6, %xmm7 + addps %xmm1, %xmm4 + addps %xmm3, %xmm6 + mulps 96(%ecx), %xmm2 + mulps 96(%ecx), %xmm0 + mulps 96(%ecx), %xmm5 + mulps 96(%ecx), %xmm7 + movaps %xmm2, TEMP(1) + movaps %xmm0, TEMP(3) + + movaps %xmm4, %xmm2 + movaps %xmm5, %xmm3 + shufps $0x44, %xmm6, %xmm2 + shufps $0xbb, %xmm7, %xmm5 + shufps $0xbb, %xmm6, %xmm4 + shufps $0x44, %xmm7, %xmm3 + movaps %xmm2, %xmm6 + movaps %xmm3, %xmm7 + subps %xmm4, %xmm2 + subps %xmm5, %xmm3 + addps %xmm6, %xmm4 + addps %xmm7, %xmm5 + movaps 112(%ecx), %xmm0 + movlhps %xmm0, %xmm0 + mulps %xmm0, %xmm2 + mulps %xmm0, %xmm3 + movaps %xmm0, TEMP(4) + movaps %xmm4, %xmm6 + movaps %xmm5, %xmm7 + shufps $0x14, %xmm2, %xmm4 + shufps $0xbe, %xmm2, %xmm6 + shufps $0x14, %xmm3, %xmm5 + shufps $0xbe, %xmm3, %xmm7 + movaps %xmm5, TEMP(5) + movaps %xmm7, TEMP(7) + + movaps TEMP(0), %xmm0 + movaps TEMP(1), %xmm1 + movaps %xmm0, %xmm2 + movaps %xmm1, %xmm3 + shufps $0x44, TEMP(2), %xmm2 + shufps $0xbb, TEMP(3), %xmm1 + shufps $0xbb, TEMP(2), %xmm0 + shufps $0x44, TEMP(3), %xmm3 + movaps %xmm2, %xmm5 + movaps %xmm3, %xmm7 + subps %xmm0, %xmm2 + subps %xmm1, %xmm3 + addps %xmm5, %xmm0 + addps %xmm7, %xmm1 + mulps TEMP(4), %xmm2 + mulps TEMP(4), %xmm3 + movaps %xmm0, %xmm5 + movaps %xmm1, %xmm7 + shufps $0x14, %xmm2, %xmm0 + shufps $0xbe, %xmm2, %xmm5 + shufps $0x14, %xmm3, %xmm1 + shufps $0xbe, %xmm3, %xmm7 + + movaps %xmm0, TEMP(0) + movaps %xmm1, TEMP(1) + movaps %xmm5, TEMP(2) + movaps %xmm7, TEMP(3) + + movss 120(%ecx), %xmm5 + shufps $0x00, %xmm5, %xmm5 + xorps LOCAL_VAR(pnpn), %xmm5 + + movaps %xmm4, %xmm0 + movaps %xmm6, %xmm1 + unpcklps TEMP(5), %xmm4 + unpckhps TEMP(5), %xmm0 + unpcklps TEMP(7), %xmm6 + unpckhps TEMP(7), %xmm1 + movaps %xmm4, %xmm2 + movaps %xmm6, %xmm3 + unpcklps %xmm0, %xmm4 + unpckhps %xmm0, %xmm2 + unpcklps %xmm1, %xmm6 + unpckhps %xmm1, %xmm3 + movaps %xmm4, %xmm0 + movaps %xmm6, %xmm1 + subps %xmm2, %xmm0 + subps %xmm3, %xmm1 + addps %xmm2, %xmm4 + addps %xmm3, %xmm6 + mulps %xmm5, %xmm0 + mulps %xmm5, %xmm1 + movaps %xmm5, TEMP(5) + movaps %xmm4, %xmm5 + movaps %xmm6, %xmm7 + unpcklps %xmm0, %xmm4 + unpckhps %xmm0, %xmm5 + unpcklps %xmm1, %xmm6 + unpckhps %xmm1, %xmm7 + + movaps TEMP(0), %xmm0 + movaps TEMP(2), %xmm2 + movaps %xmm4, TEMP(4) + movaps %xmm6, TEMP(6) + + movaps %xmm0, %xmm4 + movaps %xmm2, %xmm6 + unpcklps TEMP(1), %xmm0 + unpckhps TEMP(1), %xmm4 + unpcklps TEMP(3), %xmm2 + unpckhps TEMP(3), %xmm6 + movaps %xmm0, %xmm1 + movaps %xmm2, %xmm3 + unpcklps %xmm4, %xmm0 + unpckhps %xmm4, %xmm1 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm3 + movaps %xmm0, %xmm4 + movaps %xmm2, %xmm6 + subps %xmm1, %xmm4 + subps %xmm3, %xmm6 + addps %xmm1, %xmm0 + addps %xmm3, %xmm2 + mulps TEMP(5), %xmm4 + mulps TEMP(5), %xmm6 + movaps %xmm0, %xmm1 + movaps %xmm2, %xmm3 + unpcklps %xmm4, %xmm0 + unpckhps %xmm4, %xmm1 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm3 + + movaps %xmm0, TEMP(0) + movaps %xmm1, TEMP(1) + movaps %xmm2, TEMP(2) + movaps %xmm3, TEMP(3) + movaps %xmm5, TEMP(5) + movaps %xmm7, TEMP(7) + + movss TEMP_BYTE(12), %xmm0 + movss TEMP_BYTE(28), %xmm1 + movss TEMP_BYTE(44), %xmm2 + movss TEMP_BYTE(60), %xmm3 + addss TEMP_BYTE(8), %xmm0 + addss TEMP_BYTE(24), %xmm1 + addss TEMP_BYTE(40), %xmm2 + addss TEMP_BYTE(56), %xmm3 + movss %xmm0, TEMP_BYTE(8) + movss %xmm1, TEMP_BYTE(24) + movss %xmm2, TEMP_BYTE(40) + movss %xmm3, TEMP_BYTE(56) + movss TEMP_BYTE(76), %xmm0 + movss TEMP_BYTE(92), %xmm1 + movss TEMP_BYTE(108), %xmm2 + movss TEMP_BYTE(124), %xmm3 + addss TEMP_BYTE(72), %xmm0 + addss TEMP_BYTE(88), %xmm1 + addss TEMP_BYTE(104), %xmm2 + addss TEMP_BYTE(120), %xmm3 + movss %xmm0, TEMP_BYTE(72) + movss %xmm1, TEMP_BYTE(88) + movss %xmm2, TEMP_BYTE(104) + movss %xmm3, TEMP_BYTE(120) + + movaps TEMP_BYTE(16), %xmm1 + movaps TEMP_BYTE(48), %xmm3 + movaps TEMP_BYTE(80), %xmm5 + movaps TEMP_BYTE(112), %xmm7 + movaps %xmm1, %xmm0 + movaps %xmm3, %xmm2 + movaps %xmm5, %xmm4 + movaps %xmm7, %xmm6 + shufps $0x1e, %xmm0, %xmm0 + shufps $0x1e, %xmm2, %xmm2 + shufps $0x1e, %xmm4, %xmm4 + shufps $0x1e, %xmm6, %xmm6 + leal LOCAL_VAR(mask), %ecx + andps (%ecx), %xmm0 + andps (%ecx), %xmm2 + andps (%ecx), %xmm4 + andps (%ecx), %xmm6 + addps %xmm0, %xmm1 + addps %xmm2, %xmm3 + addps %xmm4, %xmm5 + addps %xmm6, %xmm7 + + movaps TEMP_BYTE(32), %xmm2 + movaps TEMP_BYTE(96), %xmm6 + movaps %xmm2, %xmm0 + movaps %xmm6, %xmm4 + shufps $0x1e, %xmm0, %xmm0 + shufps $0x1e, %xmm4, %xmm4 + andps (%ecx), %xmm0 + andps (%ecx), %xmm4 + addps %xmm3, %xmm2 + addps %xmm0, %xmm3 + addps %xmm7, %xmm6 + addps %xmm4, %xmm7 + + movaps TEMP_BYTE(0), %xmm0 + movaps TEMP_BYTE(64), %xmm4 + + cvtps2pi %xmm0, %mm0 + cvtps2pi %xmm1, %mm1 + movhlps %xmm0, %xmm0 + movhlps %xmm1, %xmm1 + cvtps2pi %xmm0, %mm2 + cvtps2pi %xmm1, %mm3 + packssdw %mm2, %mm0 + packssdw %mm3, %mm1 + + cvtps2pi %xmm2, %mm2 + cvtps2pi %xmm3, %mm3 + movhlps %xmm2, %xmm2 + movhlps %xmm3, %xmm3 + cvtps2pi %xmm2, %mm4 + cvtps2pi %xmm3, %mm5 + packssdw %mm4, %mm2 + packssdw %mm5, %mm3 + + mov %ecx, TEMP_BYTE(0) + movl ARG(0), %ecx + movl ARG(1), %ebx + + movd %mm0, %eax + movd %mm1, %edx + movw %ax, 512(%ecx) + movw %dx, 384(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, (%ecx) + movw %ax, (%ebx) + movw %dx, 128(%ebx) + + movd %mm2, %eax + movd %mm3, %edx + movw %ax, 448(%ecx) + movw %dx, 320(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 64(%ebx) + movw %dx, 192(%ebx) + + psrlq $32, %mm0 + psrlq $32, %mm1 + movd %mm0, %eax + movd %mm1, %edx + movw %ax, 256(%ecx) + movw %dx, 128(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 256(%ebx) + movw %dx, 384(%ebx) + + psrlq $32, %mm2 + psrlq $32, %mm3 + movd %mm2, %eax + movd %mm3, %edx + movw %ax, 192(%ecx) + movw %dx, 64(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 320(%ebx) + movw %dx, 448(%ebx) + + mov TEMP_BYTE(0), %eax + movaps %xmm4, %xmm0 + shufps $0x1e, %xmm0, %xmm0 + movaps %xmm5, %xmm1 + andps (%eax), %xmm0 + + addps %xmm6, %xmm4 + addps %xmm7, %xmm5 + addps %xmm1, %xmm6 + addps %xmm0, %xmm7 + + cvtps2pi %xmm4, %mm0 + cvtps2pi %xmm5, %mm1 + movhlps %xmm4, %xmm4 + movhlps %xmm5, %xmm5 + cvtps2pi %xmm4, %mm2 + cvtps2pi %xmm5, %mm3 + packssdw %mm2, %mm0 + packssdw %mm3, %mm1 + + cvtps2pi %xmm6, %mm2 + cvtps2pi %xmm7, %mm3 + movhlps %xmm6, %xmm6 + movhlps %xmm7, %xmm7 + cvtps2pi %xmm6, %mm4 + cvtps2pi %xmm7, %mm5 + packssdw %mm4, %mm2 + packssdw %mm5, %mm3 + + movd %mm0, %eax + movd %mm2, %edx + movw %ax, 480(%ecx) + movw %dx, 416(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 32(%ebx) + movw %dx, 96(%ebx) + + psrlq $32, %mm0 + psrlq $32, %mm2 + movd %mm0, %eax + movd %mm2, %edx + movw %ax, 224(%ecx) + movw %dx, 160(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 288(%ebx) + movw %dx, 352(%ebx) + + movd %mm1, %eax + movd %mm3, %edx + movw %ax, 352(%ecx) + movw %dx, 288(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 160(%ebx) + movw %dx, 224(%ebx) + + psrlq $32, %mm1 + psrlq $32, %mm3 + movd %mm1, %eax + movd %mm3, %edx + movw %ax, 96(%ecx) + movw %dx, 32(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 416(%ebx) + movw %dx, 480(%ebx) + + popl %ebx + movl %ebp, %esp + popl %ebp + ret + +#if defined(PIC) && defined(__APPLE__) + .section __IMPORT,__pointers,non_lazy_symbol_pointers +L_costab_mmxsse: + .indirect_symbol ASM_NAME(costab_mmxsse) + .long 0 +#endif + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_sse_float.S b/src/libmpg123/dct64_sse_float.S new file mode 100644 index 0000000..3e658e3 --- /dev/null +++ b/src/libmpg123/dct64_sse_float.S @@ -0,0 +1,417 @@ +/* + dct64_sse_float: SSE optimized dct64 (float output version) + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#define ARG(n) (8+n*4)(%ebp) +#define TEMP(n) (4+n*16)(%esp) +#define TEMP_BYTE(n) (4+n)(%esp) + +/* + void dct64_real_sse(real *out0, real *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +pnpn: + .long 0 + .long -2147483648 + .long 0 + .long -2147483648 + ALIGN16 +mask: + .long -1 + .long -1 + .long -1 + .long 0 + + .text + ALIGN16 +.globl ASM_NAME(dct64_real_sse) +ASM_NAME(dct64_real_sse): + pushl %ebp + movl %esp, %ebp + + andl $-16, %esp /* align the stack at 16 bytes */ + subl $128, %esp /* reserve space for temporal store */ + pushl %ebx + + GET_GOT + + movl ARG(2), %eax + + MOVUAPS (%eax), %xmm7 + MOVUAPS 16(%eax), %xmm6 + MOVUAPS 112(%eax), %xmm0 + MOVUAPS 96(%eax), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm7, %xmm4 + movaps %xmm6, %xmm5 + addps %xmm0, %xmm4 + addps %xmm1, %xmm5 + subps %xmm0, %xmm7 + subps %xmm1, %xmm6 + movaps %xmm4, TEMP(0) + movaps %xmm5, TEMP(1) + + MOVUAPS 32(%eax), %xmm2 + MOVUAPS 48(%eax), %xmm3 + MOVUAPS 80(%eax), %xmm0 + MOVUAPS 64(%eax), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm2, %xmm5 + movaps %xmm3, %xmm4 + addps %xmm0, %xmm2 + addps %xmm1, %xmm3 + subps %xmm0, %xmm5 + subps %xmm1, %xmm4 + +#if defined(PIC) && defined(__APPLE__) + mov GLOBAL_VAR_PTR(costab_mmxsse), %eax +#else + lea GLOBAL_VAR(costab_mmxsse), %eax +#endif + mulps (%eax), %xmm7 + mulps 16(%eax), %xmm6 + mulps 32(%eax), %xmm5 + mulps 48(%eax), %xmm4 + + shufps $0x1b, %xmm2, %xmm2 + shufps $0x1b, %xmm3, %xmm3 + shufps $0x1b, %xmm4, %xmm4 + shufps $0x1b, %xmm5, %xmm5 + movaps TEMP(0), %xmm0 + movaps TEMP(1), %xmm1 + subps %xmm3, %xmm0 + subps %xmm2, %xmm1 + addps TEMP(0), %xmm3 + addps TEMP(1), %xmm2 + movaps %xmm3, TEMP(0) + movaps %xmm2, TEMP(1) + movaps %xmm6, %xmm2 + movaps %xmm7, %xmm3 + subps %xmm5, %xmm6 + subps %xmm4, %xmm7 + addps %xmm3, %xmm4 + addps %xmm2, %xmm5 + mulps 64(%eax), %xmm0 + mulps 80(%eax), %xmm1 + mulps 80(%eax), %xmm6 + mulps 64(%eax), %xmm7 + + movaps TEMP(0), %xmm2 + movaps TEMP(1), %xmm3 + shufps $0x1b, %xmm3, %xmm3 + shufps $0x1b, %xmm5, %xmm5 + shufps $0x1b, %xmm1, %xmm1 + shufps $0x1b, %xmm6, %xmm6 + movaps %xmm0, TEMP(1) + subps %xmm3, %xmm2 + subps %xmm1, %xmm0 + addps TEMP(0), %xmm3 + addps TEMP(1), %xmm1 + movaps %xmm3, TEMP(0) + movaps %xmm1, TEMP(2) + movaps %xmm5, %xmm1 + movaps %xmm4, %xmm5 + movaps %xmm7, %xmm3 + subps %xmm1, %xmm5 + subps %xmm6, %xmm7 + addps %xmm1, %xmm4 + addps %xmm3, %xmm6 + mulps 96(%eax), %xmm2 + mulps 96(%eax), %xmm0 + mulps 96(%eax), %xmm5 + mulps 96(%eax), %xmm7 + movaps %xmm2, TEMP(1) + movaps %xmm0, TEMP(3) + + movaps %xmm4, %xmm2 + movaps %xmm5, %xmm3 + shufps $0x44, %xmm6, %xmm2 + shufps $0xbb, %xmm7, %xmm5 + shufps $0xbb, %xmm6, %xmm4 + shufps $0x44, %xmm7, %xmm3 + movaps %xmm2, %xmm6 + movaps %xmm3, %xmm7 + subps %xmm4, %xmm2 + subps %xmm5, %xmm3 + addps %xmm6, %xmm4 + addps %xmm7, %xmm5 + movaps 112(%eax), %xmm0 + movlhps %xmm0, %xmm0 + mulps %xmm0, %xmm2 + mulps %xmm0, %xmm3 + movaps %xmm0, TEMP(4) + movaps %xmm4, %xmm6 + movaps %xmm5, %xmm7 + shufps $0x14, %xmm2, %xmm4 + shufps $0xbe, %xmm2, %xmm6 + shufps $0x14, %xmm3, %xmm5 + shufps $0xbe, %xmm3, %xmm7 + movaps %xmm5, TEMP(5) + movaps %xmm7, TEMP(7) + + movaps TEMP(0), %xmm0 + movaps TEMP(1), %xmm1 + movaps %xmm0, %xmm2 + movaps %xmm1, %xmm3 + shufps $0x44, TEMP(2), %xmm2 + shufps $0xbb, TEMP(3), %xmm1 + shufps $0xbb, TEMP(2), %xmm0 + shufps $0x44, TEMP(3), %xmm3 + movaps %xmm2, %xmm5 + movaps %xmm3, %xmm7 + subps %xmm0, %xmm2 + subps %xmm1, %xmm3 + addps %xmm5, %xmm0 + addps %xmm7, %xmm1 + mulps TEMP(4), %xmm2 + mulps TEMP(4), %xmm3 + movaps %xmm0, %xmm5 + movaps %xmm1, %xmm7 + shufps $0x14, %xmm2, %xmm0 + shufps $0xbe, %xmm2, %xmm5 + shufps $0x14, %xmm3, %xmm1 + shufps $0xbe, %xmm3, %xmm7 + + movaps %xmm0, TEMP(0) + movaps %xmm1, TEMP(1) + movaps %xmm5, TEMP(2) + movaps %xmm7, TEMP(3) + + movss 120(%eax), %xmm5 + shufps $0x00, %xmm5, %xmm5 + xorps LOCAL_VAR(pnpn), %xmm5 + + movaps %xmm4, %xmm0 + movaps %xmm6, %xmm1 + unpcklps TEMP(5), %xmm4 + unpckhps TEMP(5), %xmm0 + unpcklps TEMP(7), %xmm6 + unpckhps TEMP(7), %xmm1 + movaps %xmm4, %xmm2 + movaps %xmm6, %xmm3 + unpcklps %xmm0, %xmm4 + unpckhps %xmm0, %xmm2 + unpcklps %xmm1, %xmm6 + unpckhps %xmm1, %xmm3 + movaps %xmm4, %xmm0 + movaps %xmm6, %xmm1 + subps %xmm2, %xmm0 + subps %xmm3, %xmm1 + addps %xmm2, %xmm4 + addps %xmm3, %xmm6 + mulps %xmm5, %xmm0 + mulps %xmm5, %xmm1 + movaps %xmm5, TEMP(5) + movaps %xmm4, %xmm5 + movaps %xmm6, %xmm7 + unpcklps %xmm0, %xmm4 + unpckhps %xmm0, %xmm5 + unpcklps %xmm1, %xmm6 + unpckhps %xmm1, %xmm7 + + movaps TEMP(0), %xmm0 + movaps TEMP(2), %xmm2 + movaps %xmm4, TEMP(4) + movaps %xmm6, TEMP(6) + + movaps %xmm0, %xmm4 + movaps %xmm2, %xmm6 + unpcklps TEMP(1), %xmm0 + unpckhps TEMP(1), %xmm4 + unpcklps TEMP(3), %xmm2 + unpckhps TEMP(3), %xmm6 + movaps %xmm0, %xmm1 + movaps %xmm2, %xmm3 + unpcklps %xmm4, %xmm0 + unpckhps %xmm4, %xmm1 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm3 + movaps %xmm0, %xmm4 + movaps %xmm2, %xmm6 + subps %xmm1, %xmm4 + subps %xmm3, %xmm6 + addps %xmm1, %xmm0 + addps %xmm3, %xmm2 + mulps TEMP(5), %xmm4 + mulps TEMP(5), %xmm6 + movaps %xmm0, %xmm1 + movaps %xmm2, %xmm3 + unpcklps %xmm4, %xmm0 + unpckhps %xmm4, %xmm1 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm3 + + movaps %xmm0, TEMP(0) + movaps %xmm1, TEMP(1) + movaps %xmm2, TEMP(2) + movaps %xmm3, TEMP(3) + movaps %xmm5, TEMP(5) + movaps %xmm7, TEMP(7) + + movss TEMP_BYTE(12), %xmm0 + movss TEMP_BYTE(28), %xmm1 + movss TEMP_BYTE(44), %xmm2 + movss TEMP_BYTE(60), %xmm3 + addss TEMP_BYTE(8), %xmm0 + addss TEMP_BYTE(24), %xmm1 + addss TEMP_BYTE(40), %xmm2 + addss TEMP_BYTE(56), %xmm3 + movss %xmm0, TEMP_BYTE(8) + movss %xmm1, TEMP_BYTE(24) + movss %xmm2, TEMP_BYTE(40) + movss %xmm3, TEMP_BYTE(56) + movss TEMP_BYTE(76), %xmm0 + movss TEMP_BYTE(92), %xmm1 + movss TEMP_BYTE(108), %xmm2 + movss TEMP_BYTE(124), %xmm3 + addss TEMP_BYTE(72), %xmm0 + addss TEMP_BYTE(88), %xmm1 + addss TEMP_BYTE(104), %xmm2 + addss TEMP_BYTE(120), %xmm3 + movss %xmm0, TEMP_BYTE(72) + movss %xmm1, TEMP_BYTE(88) + movss %xmm2, TEMP_BYTE(104) + movss %xmm3, TEMP_BYTE(120) + + movaps TEMP_BYTE(16), %xmm1 + movaps TEMP_BYTE(48), %xmm3 + movaps TEMP_BYTE(80), %xmm5 + movaps TEMP_BYTE(112), %xmm7 + movaps %xmm1, %xmm0 + movaps %xmm3, %xmm2 + movaps %xmm5, %xmm4 + movaps %xmm7, %xmm6 + shufps $0x1e, %xmm0, %xmm0 + shufps $0x1e, %xmm2, %xmm2 + shufps $0x1e, %xmm4, %xmm4 + shufps $0x1e, %xmm6, %xmm6 + lea LOCAL_VAR(mask), %eax + andps (%eax), %xmm0 + andps (%eax), %xmm2 + andps (%eax), %xmm4 + andps (%eax), %xmm6 + addps %xmm0, %xmm1 + addps %xmm2, %xmm3 + addps %xmm4, %xmm5 + addps %xmm6, %xmm7 + + movaps TEMP_BYTE(32), %xmm2 + movaps TEMP_BYTE(96), %xmm6 + movaps %xmm2, %xmm0 + movaps %xmm6, %xmm4 + shufps $0x1e, %xmm0, %xmm0 + shufps $0x1e, %xmm4, %xmm4 + andps (%eax), %xmm0 + andps (%eax), %xmm4 + addps %xmm3, %xmm2 + addps %xmm0, %xmm3 + addps %xmm7, %xmm6 + addps %xmm4, %xmm7 + + movaps TEMP_BYTE(0), %xmm0 + movaps TEMP_BYTE(64), %xmm4 + + movl ARG(0), %ecx + movl ARG(1), %ebx + + movss %xmm0, 1024(%ecx) + movss %xmm2, 896(%ecx) + movss %xmm1, 768(%ecx) + movss %xmm3, 640(%ecx) + + shufps $0xe1, %xmm0, %xmm0 + shufps $0xe1, %xmm2, %xmm2 + shufps $0xe1, %xmm1, %xmm1 + shufps $0xe1, %xmm3, %xmm3 + movss %xmm0, (%ecx) + movss %xmm0, (%ebx) + movss %xmm2, 128(%ebx) + movss %xmm1, 256(%ebx) + movss %xmm3, 384(%ebx) + + movhlps %xmm0, %xmm0 + movhlps %xmm2, %xmm2 + movhlps %xmm1, %xmm1 + movhlps %xmm3, %xmm3 + movss %xmm0, 512(%ecx) + movss %xmm2, 384(%ecx) + movss %xmm1, 256(%ecx) + movss %xmm3, 128(%ecx) + + shufps $0xe1, %xmm0, %xmm0 + shufps $0xe1, %xmm2, %xmm2 + shufps $0xe1, %xmm1, %xmm1 + shufps $0xe1, %xmm3, %xmm3 + movss %xmm0, 512(%ebx) + movss %xmm2, 640(%ebx) + movss %xmm1, 768(%ebx) + movss %xmm3, 896(%ebx) + + movaps %xmm4, %xmm0 + shufps $0x1e, %xmm0, %xmm0 + movaps %xmm5, %xmm1 + andps (%eax), %xmm0 + + addps %xmm6, %xmm4 + addps %xmm7, %xmm5 + addps %xmm1, %xmm6 + addps %xmm0, %xmm7 + + movss %xmm4, 960(%ecx) + movss %xmm6, 832(%ecx) + movss %xmm5, 704(%ecx) + movss %xmm7, 576(%ecx) + movhlps %xmm4, %xmm0 + movhlps %xmm6, %xmm1 + movhlps %xmm5, %xmm2 + movhlps %xmm7, %xmm3 + movss %xmm0, 448(%ecx) + movss %xmm1, 320(%ecx) + movss %xmm2, 192(%ecx) + movss %xmm3, 64(%ecx) + + shufps $0xe1, %xmm4, %xmm4 + shufps $0xe1, %xmm6, %xmm6 + shufps $0xe1, %xmm5, %xmm5 + shufps $0xe1, %xmm7, %xmm7 + movss %xmm4, 64(%ebx) + movss %xmm6, 192(%ebx) + movss %xmm5, 320(%ebx) + movss %xmm7, 448(%ebx) + + shufps $0xe1, %xmm0, %xmm0 + shufps $0xe1, %xmm1, %xmm1 + shufps $0xe1, %xmm2, %xmm2 + shufps $0xe1, %xmm3, %xmm3 + movss %xmm0, 576(%ebx) + movss %xmm1, 704(%ebx) + movss %xmm2, 832(%ebx) + movss %xmm3, 960(%ebx) + + popl %ebx + movl %ebp, %esp + popl %ebp + ret + +#if defined(PIC) && defined(__APPLE__) + .section __IMPORT,__pointers,non_lazy_symbol_pointers +L_costab_mmxsse: + .indirect_symbol ASM_NAME(costab_mmxsse) + .long 0 +#endif + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_x86_64.S b/src/libmpg123/dct64_x86_64.S new file mode 100644 index 0000000..9d85862 --- /dev/null +++ b/src/libmpg123/dct64_x86_64.S @@ -0,0 +1,464 @@ +/* + dct64_x86_64: SSE optimized dct64 for x86-64 + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifdef IS_MSABI +/* short *out0 */ +#define ARG0 %r9 +/* short *out1 */ +#define ARG1 %rdx +/* real *samples */ +#define ARG2 %r8 +#else +/* short *out0 */ +#define ARG0 %rdi +/* short *out1 */ +#define ARG1 %rsi +/* real *samples */ +#define ARG2 %rdx +#endif + +/* + void dct64_x86_64(short *out0, short *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN32 +ASM_NAME(costab_x86_64): + .long 1056974725 + .long 1057056395 + .long 1057223771 + .long 1057485416 + .long 1057855544 + .long 1058356026 + .long 1059019886 + .long 1059897405 + .long 1061067246 + .long 1062657950 + .long 1064892987 + .long 1066774581 + .long 1069414683 + .long 1073984175 + .long 1079645762 + .long 1092815430 + .long 1057005197 + .long 1057342072 + .long 1058087743 + .long 1059427869 + .long 1061799040 + .long 1065862217 + .long 1071413542 + .long 1084439708 + .long 1057128951 + .long 1058664893 + .long 1063675095 + .long 1076102863 + .long 1057655764 + .long 1067924853 + .long 1060439283 + .long 0 + .text + ALIGN16 +.globl ASM_NAME(dct64_x86_64) +ASM_NAME(dct64_x86_64): +#ifdef IS_MSABI /* should save xmm6-15 */ + movq %rcx, ARG0 + subq $168, %rsp /* stack alignment + 10 xmm registers */ + movaps %xmm6, (%rsp) + movaps %xmm7, 16(%rsp) + movaps %xmm8, 32(%rsp) + movaps %xmm9, 48(%rsp) + movaps %xmm10, 64(%rsp) + movaps %xmm11, 80(%rsp) + movaps %xmm12, 96(%rsp) + movaps %xmm13, 112(%rsp) + movaps %xmm14, 128(%rsp) + movaps %xmm15, 144(%rsp) +#endif + + leaq ASM_NAME(costab_x86_64)(%rip), %rcx + + MOVUAPS (ARG2), %xmm15 + MOVUAPS 16(ARG2), %xmm14 + MOVUAPS 112(ARG2), %xmm0 + MOVUAPS 96(ARG2), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm15, %xmm8 + movaps %xmm14, %xmm9 + addps %xmm0, %xmm8 + addps %xmm1, %xmm9 + subps %xmm0, %xmm15 + subps %xmm1, %xmm14 + + MOVUAPS 32(ARG2), %xmm13 + MOVUAPS 48(ARG2), %xmm12 + MOVUAPS 80(ARG2), %xmm0 + MOVUAPS 64(ARG2), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm13, %xmm10 + movaps %xmm12, %xmm11 + addps %xmm0, %xmm10 + addps %xmm1, %xmm11 + subps %xmm0, %xmm13 + subps %xmm1, %xmm12 + + movaps (%rcx), %xmm0 + movaps 16(%rcx), %xmm1 + movaps 32(%rcx), %xmm2 + movaps 48(%rcx), %xmm3 + mulps %xmm0, %xmm15 + mulps %xmm1, %xmm14 + mulps %xmm2, %xmm13 + mulps %xmm3, %xmm12 + + movaps 64(%rcx), %xmm0 + movaps 80(%rcx), %xmm1 + + pshufd $0x1b, %xmm11, %xmm2 + pshufd $0x1b, %xmm10, %xmm3 + shufps $0x1b, %xmm13, %xmm13 + shufps $0x1b, %xmm12, %xmm12 + movaps %xmm8, %xmm11 + movaps %xmm9, %xmm10 + movaps %xmm14, %xmm4 + movaps %xmm15, %xmm5 + subps %xmm2, %xmm11 + subps %xmm3, %xmm10 + subps %xmm13, %xmm14 + subps %xmm12, %xmm15 + addps %xmm2, %xmm8 + addps %xmm3, %xmm9 + addps %xmm5, %xmm12 + addps %xmm4, %xmm13 + mulps %xmm0, %xmm11 + mulps %xmm1, %xmm10 + mulps %xmm1, %xmm14 + mulps %xmm0, %xmm15 + + movaps 96(%rcx), %xmm0 + + pshufd $0x1b, %xmm9, %xmm1 + pshufd $0x1b, %xmm13, %xmm2 + shufps $0x1b, %xmm10, %xmm10 + shufps $0x1b, %xmm14, %xmm14 + movaps %xmm8, %xmm9 + movaps %xmm12, %xmm13 + movaps %xmm11, %xmm3 + movaps %xmm15, %xmm4 + subps %xmm1, %xmm9 + subps %xmm2, %xmm13 + subps %xmm10, %xmm11 + subps %xmm14, %xmm15 + addps %xmm1, %xmm8 + addps %xmm2, %xmm12 + addps %xmm3, %xmm10 + addps %xmm4, %xmm14 + mulps %xmm0, %xmm9 + mulps %xmm0, %xmm13 + mulps %xmm0, %xmm11 + mulps %xmm0, %xmm15 + + movaps 112(%rcx), %xmm0 + movaps %xmm0, %xmm1 + movlhps %xmm1, %xmm1 + + movaps %xmm8, %xmm2 + movaps %xmm9, %xmm3 + shufps $0x44, %xmm10, %xmm2 + shufps $0xbb, %xmm11, %xmm9 + shufps $0xbb, %xmm10, %xmm8 + shufps $0x44, %xmm11, %xmm3 + movaps %xmm2, %xmm4 + movaps %xmm3, %xmm5 + subps %xmm8, %xmm2 + subps %xmm9, %xmm3 + addps %xmm4, %xmm8 + addps %xmm5, %xmm9 + mulps %xmm1, %xmm2 + mulps %xmm1, %xmm3 + movaps %xmm8, %xmm10 + movaps %xmm9, %xmm11 + shufps $0x14, %xmm2, %xmm8 + shufps $0xbe, %xmm2, %xmm10 + shufps $0x14, %xmm3, %xmm9 + shufps $0xbe, %xmm3, %xmm11 + + movaps %xmm12, %xmm2 + movaps %xmm13, %xmm3 + shufps $0x44, %xmm14, %xmm2 + shufps $0xbb, %xmm15, %xmm13 + shufps $0xbb, %xmm14, %xmm12 + shufps $0x44, %xmm15, %xmm3 + movaps %xmm2, %xmm4 + movaps %xmm3, %xmm5 + subps %xmm12, %xmm2 + subps %xmm13, %xmm3 + addps %xmm4, %xmm12 + addps %xmm5, %xmm13 + mulps %xmm1, %xmm2 + mulps %xmm1, %xmm3 + movaps %xmm12, %xmm14 + movaps %xmm13, %xmm15 + shufps $0x14, %xmm2, %xmm12 + shufps $0xbe, %xmm2, %xmm14 + shufps $0x14, %xmm3, %xmm13 + shufps $0xbe, %xmm3, %xmm15 + + shufps $0xaa, %xmm0, %xmm0 + pcmpeqd %xmm1, %xmm1 + pslld $31, %xmm1 + psllq $32, %xmm1 + xorps %xmm1, %xmm0 + + movaps %xmm8, %xmm1 + movaps %xmm10, %xmm2 + unpcklps %xmm9, %xmm8 + unpckhps %xmm9, %xmm1 + unpcklps %xmm11, %xmm10 + unpckhps %xmm11, %xmm2 + movaps %xmm8, %xmm3 + movaps %xmm10, %xmm4 + unpcklps %xmm1, %xmm8 + unpckhps %xmm1, %xmm3 + unpcklps %xmm2, %xmm10 + unpckhps %xmm2, %xmm4 + movaps %xmm8, %xmm1 + movaps %xmm10, %xmm2 + subps %xmm3, %xmm1 + subps %xmm4, %xmm2 + addps %xmm3, %xmm8 + addps %xmm4, %xmm10 + mulps %xmm0, %xmm1 + mulps %xmm0, %xmm2 + movaps %xmm8, %xmm9 + movaps %xmm10, %xmm11 + unpcklps %xmm1, %xmm8 + unpckhps %xmm1, %xmm9 + unpcklps %xmm2, %xmm10 + unpckhps %xmm2, %xmm11 + + movaps %xmm12, %xmm1 + movaps %xmm14, %xmm2 + unpcklps %xmm13, %xmm12 + unpckhps %xmm13, %xmm1 + unpcklps %xmm15, %xmm14 + unpckhps %xmm15, %xmm2 + movaps %xmm12, %xmm3 + movaps %xmm14, %xmm4 + unpcklps %xmm1, %xmm12 + unpckhps %xmm1, %xmm3 + unpcklps %xmm2, %xmm14 + unpckhps %xmm2, %xmm4 + movaps %xmm12, %xmm1 + movaps %xmm14, %xmm2 + subps %xmm3, %xmm1 + subps %xmm4, %xmm2 + addps %xmm3, %xmm12 + addps %xmm4, %xmm14 + mulps %xmm0, %xmm1 + mulps %xmm0, %xmm2 + movaps %xmm12, %xmm13 + movaps %xmm14, %xmm15 + unpcklps %xmm1, %xmm12 + unpckhps %xmm1, %xmm13 + unpcklps %xmm2, %xmm14 + unpckhps %xmm2, %xmm15 + + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm8, %xmm0 + shufpd $0x2, %xmm9, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm8 + addps %xmm1, %xmm9 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm10, %xmm0 + shufpd $0x2, %xmm11, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm10 + addps %xmm1, %xmm11 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm12, %xmm0 + shufpd $0x2, %xmm13, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm12 + addps %xmm1, %xmm13 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm14, %xmm0 + shufpd $0x2, %xmm15, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm14 + addps %xmm1, %xmm15 + + pshufd $0x78, %xmm9, %xmm0 + pshufd $0x78, %xmm11, %xmm1 + pshufd $0x78, %xmm13, %xmm2 + pshufd $0x78, %xmm15, %xmm3 + psrldq $4, %xmm0 + psrldq $4, %xmm1 + psrldq $4, %xmm2 + psrldq $4, %xmm3 + addps %xmm0, %xmm9 + addps %xmm1, %xmm11 + addps %xmm2, %xmm13 + addps %xmm3, %xmm15 + + pshufd $0x78, %xmm10, %xmm0 + pshufd $0x78, %xmm14, %xmm1 + psrldq $4, %xmm0 + psrldq $4, %xmm1 + addps %xmm11, %xmm10 + addps %xmm15, %xmm14 + addps %xmm0, %xmm11 + addps %xmm1, %xmm15 + + cvtps2dq %xmm8, %xmm8 + cvtps2dq %xmm9, %xmm9 + cvtps2dq %xmm10, %xmm10 + cvtps2dq %xmm11, %xmm11 + packssdw %xmm10, %xmm8 + packssdw %xmm11, %xmm9 + + movd %xmm8, %eax + movd %xmm9, %ecx + movw %ax, 512(ARG0) + movw %cx, 384(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, (ARG0) + movw %ax, (ARG1) + movw %cx, 128(ARG1) + + movhlps %xmm8, %xmm0 + movhlps %xmm9, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 448(ARG0) + movw %cx, 320(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 64(ARG1) + movw %cx, 192(ARG1) + + pshuflw $0xee, %xmm8, %xmm2 + pshuflw $0xee, %xmm9, %xmm3 + movd %xmm2, %eax + movd %xmm3, %ecx + movw %ax, 256(ARG0) + movw %cx, 128(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 256(ARG1) + movw %cx, 384(ARG1) + + pshuflw $0xee, %xmm0, %xmm0 + pshuflw $0xee, %xmm1, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 192(ARG0) + movw %cx, 64(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 320(ARG1) + movw %cx, 448(ARG1) + + movaps %xmm12, %xmm0 + movaps %xmm13, %xmm1 + movaps %xmm14, %xmm2 + movaps %xmm15, %xmm3 + shufps $0x1e, %xmm0, %xmm0 + pslldq $4, %xmm0 + psrldq $4, %xmm0 + addps %xmm2, %xmm12 + addps %xmm3, %xmm13 + addps %xmm1, %xmm14 + addps %xmm0, %xmm15 + + cvtps2dq %xmm12, %xmm12 + cvtps2dq %xmm13, %xmm13 + cvtps2dq %xmm14, %xmm14 + cvtps2dq %xmm15, %xmm15 + packssdw %xmm13, %xmm12 + packssdw %xmm15, %xmm14 + + movd %xmm12, %eax + movd %xmm14, %ecx + movw %ax, 480(ARG0) + movw %cx, 416(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 32(ARG1) + movw %cx, 96(ARG1) + + pshuflw $0xee, %xmm12, %xmm0 + pshuflw $0xee, %xmm14, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 224(ARG0) + movw %cx, 160(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 288(ARG1) + movw %cx, 352(ARG1) + + movhlps %xmm12, %xmm0 + movhlps %xmm14, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 352(ARG0) + movw %cx, 288(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 160(ARG1) + movw %cx, 224(ARG1) + + pshuflw $0xee, %xmm0, %xmm0 + pshuflw $0xee, %xmm1, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 96(ARG0) + movw %cx, 32(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 416(ARG1) + movw %cx, 480(ARG1) + +#ifdef IS_MSABI + movaps (%rsp), %xmm6 + movaps 16(%rsp), %xmm7 + movaps 32(%rsp), %xmm8 + movaps 48(%rsp), %xmm9 + movaps 64(%rsp), %xmm10 + movaps 80(%rsp), %xmm11 + movaps 96(%rsp), %xmm12 + movaps 112(%rsp), %xmm13 + movaps 128(%rsp), %xmm14 + movaps 144(%rsp), %xmm15 + addq $168, %rsp +#endif + ret + +NONEXEC_STACK diff --git a/src/libmpg123/dct64_x86_64_float.S b/src/libmpg123/dct64_x86_64_float.S new file mode 100644 index 0000000..5197e4c --- /dev/null +++ b/src/libmpg123/dct64_x86_64_float.S @@ -0,0 +1,426 @@ +/* + dct64_x86_64_float: SSE optimized dct64 for x86-64 (float output version) + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifdef IS_MSABI +/* short *out0 */ +#define ARG0 %r9 +/* short *out1 */ +#define ARG1 %rdx +/* real *samples */ +#define ARG2 %r8 +#else +/* real *out0 */ +#define ARG0 %rdi +/* real *out1 */ +#define ARG1 %rsi +/* real *samples */ +#define ARG2 %rdx +#endif + +/* + void dct64_real_x86_64(real *out0, real *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN32 +ASM_NAME(costab_x86_64): + .long 1056974725 + .long 1057056395 + .long 1057223771 + .long 1057485416 + .long 1057855544 + .long 1058356026 + .long 1059019886 + .long 1059897405 + .long 1061067246 + .long 1062657950 + .long 1064892987 + .long 1066774581 + .long 1069414683 + .long 1073984175 + .long 1079645762 + .long 1092815430 + .long 1057005197 + .long 1057342072 + .long 1058087743 + .long 1059427869 + .long 1061799040 + .long 1065862217 + .long 1071413542 + .long 1084439708 + .long 1057128951 + .long 1058664893 + .long 1063675095 + .long 1076102863 + .long 1057655764 + .long 1067924853 + .long 1060439283 + .long 0 + .text + ALIGN16 +.globl ASM_NAME(dct64_real_x86_64) +ASM_NAME(dct64_real_x86_64): +#ifdef IS_MSABI /* should save xmm6-15 */ + movq %rcx, ARG0 + subq $168, %rsp /* stack alignment + 10 xmm registers */ + movaps %xmm6, (%rsp) + movaps %xmm7, 16(%rsp) + movaps %xmm8, 32(%rsp) + movaps %xmm9, 48(%rsp) + movaps %xmm10, 64(%rsp) + movaps %xmm11, 80(%rsp) + movaps %xmm12, 96(%rsp) + movaps %xmm13, 112(%rsp) + movaps %xmm14, 128(%rsp) + movaps %xmm15, 144(%rsp) +#endif + + leaq ASM_NAME(costab_x86_64)(%rip), %rcx + + MOVUAPS (ARG2), %xmm15 + MOVUAPS 16(ARG2), %xmm14 + MOVUAPS 112(ARG2), %xmm0 + MOVUAPS 96(ARG2), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm15, %xmm8 + movaps %xmm14, %xmm9 + addps %xmm0, %xmm8 + addps %xmm1, %xmm9 + subps %xmm0, %xmm15 + subps %xmm1, %xmm14 + + MOVUAPS 32(ARG2), %xmm13 + MOVUAPS 48(ARG2), %xmm12 + MOVUAPS 80(ARG2), %xmm0 + MOVUAPS 64(ARG2), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm13, %xmm10 + movaps %xmm12, %xmm11 + addps %xmm0, %xmm10 + addps %xmm1, %xmm11 + subps %xmm0, %xmm13 + subps %xmm1, %xmm12 + + movaps (%rcx), %xmm0 + movaps 16(%rcx), %xmm1 + movaps 32(%rcx), %xmm2 + movaps 48(%rcx), %xmm3 + mulps %xmm0, %xmm15 + mulps %xmm1, %xmm14 + mulps %xmm2, %xmm13 + mulps %xmm3, %xmm12 + + movaps 64(%rcx), %xmm0 + movaps 80(%rcx), %xmm1 + + pshufd $0x1b, %xmm11, %xmm2 + pshufd $0x1b, %xmm10, %xmm3 + shufps $0x1b, %xmm13, %xmm13 + shufps $0x1b, %xmm12, %xmm12 + movaps %xmm8, %xmm11 + movaps %xmm9, %xmm10 + movaps %xmm14, %xmm4 + movaps %xmm15, %xmm5 + subps %xmm2, %xmm11 + subps %xmm3, %xmm10 + subps %xmm13, %xmm14 + subps %xmm12, %xmm15 + addps %xmm2, %xmm8 + addps %xmm3, %xmm9 + addps %xmm5, %xmm12 + addps %xmm4, %xmm13 + mulps %xmm0, %xmm11 + mulps %xmm1, %xmm10 + mulps %xmm1, %xmm14 + mulps %xmm0, %xmm15 + + movaps 96(%rcx), %xmm0 + + pshufd $0x1b, %xmm9, %xmm1 + pshufd $0x1b, %xmm13, %xmm2 + shufps $0x1b, %xmm10, %xmm10 + shufps $0x1b, %xmm14, %xmm14 + movaps %xmm8, %xmm9 + movaps %xmm12, %xmm13 + movaps %xmm11, %xmm3 + movaps %xmm15, %xmm4 + subps %xmm1, %xmm9 + subps %xmm2, %xmm13 + subps %xmm10, %xmm11 + subps %xmm14, %xmm15 + addps %xmm1, %xmm8 + addps %xmm2, %xmm12 + addps %xmm3, %xmm10 + addps %xmm4, %xmm14 + mulps %xmm0, %xmm9 + mulps %xmm0, %xmm13 + mulps %xmm0, %xmm11 + mulps %xmm0, %xmm15 + + movaps 112(%rcx), %xmm0 + movaps %xmm0, %xmm1 + movlhps %xmm1, %xmm1 + + movaps %xmm8, %xmm2 + movaps %xmm9, %xmm3 + shufps $0x44, %xmm10, %xmm2 + shufps $0xbb, %xmm11, %xmm9 + shufps $0xbb, %xmm10, %xmm8 + shufps $0x44, %xmm11, %xmm3 + movaps %xmm2, %xmm4 + movaps %xmm3, %xmm5 + subps %xmm8, %xmm2 + subps %xmm9, %xmm3 + addps %xmm4, %xmm8 + addps %xmm5, %xmm9 + mulps %xmm1, %xmm2 + mulps %xmm1, %xmm3 + movaps %xmm8, %xmm10 + movaps %xmm9, %xmm11 + shufps $0x14, %xmm2, %xmm8 + shufps $0xbe, %xmm2, %xmm10 + shufps $0x14, %xmm3, %xmm9 + shufps $0xbe, %xmm3, %xmm11 + + movaps %xmm12, %xmm2 + movaps %xmm13, %xmm3 + shufps $0x44, %xmm14, %xmm2 + shufps $0xbb, %xmm15, %xmm13 + shufps $0xbb, %xmm14, %xmm12 + shufps $0x44, %xmm15, %xmm3 + movaps %xmm2, %xmm4 + movaps %xmm3, %xmm5 + subps %xmm12, %xmm2 + subps %xmm13, %xmm3 + addps %xmm4, %xmm12 + addps %xmm5, %xmm13 + mulps %xmm1, %xmm2 + mulps %xmm1, %xmm3 + movaps %xmm12, %xmm14 + movaps %xmm13, %xmm15 + shufps $0x14, %xmm2, %xmm12 + shufps $0xbe, %xmm2, %xmm14 + shufps $0x14, %xmm3, %xmm13 + shufps $0xbe, %xmm3, %xmm15 + + shufps $0xaa, %xmm0, %xmm0 + pcmpeqd %xmm1, %xmm1 + pslld $31, %xmm1 + psllq $32, %xmm1 + xorps %xmm1, %xmm0 + + movaps %xmm8, %xmm1 + movaps %xmm10, %xmm2 + unpcklps %xmm9, %xmm8 + unpckhps %xmm9, %xmm1 + unpcklps %xmm11, %xmm10 + unpckhps %xmm11, %xmm2 + movaps %xmm8, %xmm3 + movaps %xmm10, %xmm4 + unpcklps %xmm1, %xmm8 + unpckhps %xmm1, %xmm3 + unpcklps %xmm2, %xmm10 + unpckhps %xmm2, %xmm4 + movaps %xmm8, %xmm1 + movaps %xmm10, %xmm2 + subps %xmm3, %xmm1 + subps %xmm4, %xmm2 + addps %xmm3, %xmm8 + addps %xmm4, %xmm10 + mulps %xmm0, %xmm1 + mulps %xmm0, %xmm2 + movaps %xmm8, %xmm9 + movaps %xmm10, %xmm11 + unpcklps %xmm1, %xmm8 + unpckhps %xmm1, %xmm9 + unpcklps %xmm2, %xmm10 + unpckhps %xmm2, %xmm11 + + movaps %xmm12, %xmm1 + movaps %xmm14, %xmm2 + unpcklps %xmm13, %xmm12 + unpckhps %xmm13, %xmm1 + unpcklps %xmm15, %xmm14 + unpckhps %xmm15, %xmm2 + movaps %xmm12, %xmm3 + movaps %xmm14, %xmm4 + unpcklps %xmm1, %xmm12 + unpckhps %xmm1, %xmm3 + unpcklps %xmm2, %xmm14 + unpckhps %xmm2, %xmm4 + movaps %xmm12, %xmm1 + movaps %xmm14, %xmm2 + subps %xmm3, %xmm1 + subps %xmm4, %xmm2 + addps %xmm3, %xmm12 + addps %xmm4, %xmm14 + mulps %xmm0, %xmm1 + mulps %xmm0, %xmm2 + movaps %xmm12, %xmm13 + movaps %xmm14, %xmm15 + unpcklps %xmm1, %xmm12 + unpckhps %xmm1, %xmm13 + unpcklps %xmm2, %xmm14 + unpckhps %xmm2, %xmm15 + + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm8, %xmm0 + shufpd $0x2, %xmm9, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm8 + addps %xmm1, %xmm9 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm10, %xmm0 + shufpd $0x2, %xmm11, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm10 + addps %xmm1, %xmm11 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm12, %xmm0 + shufpd $0x2, %xmm13, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm12 + addps %xmm1, %xmm13 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm14, %xmm0 + shufpd $0x2, %xmm15, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm14 + addps %xmm1, %xmm15 + + pshufd $0x78, %xmm9, %xmm0 + pshufd $0x78, %xmm11, %xmm1 + pshufd $0x78, %xmm13, %xmm2 + pshufd $0x78, %xmm15, %xmm3 + psrldq $4, %xmm0 + psrldq $4, %xmm1 + psrldq $4, %xmm2 + psrldq $4, %xmm3 + addps %xmm0, %xmm9 + addps %xmm1, %xmm11 + addps %xmm2, %xmm13 + addps %xmm3, %xmm15 + + pshufd $0x78, %xmm10, %xmm0 + pshufd $0x78, %xmm14, %xmm1 + psrldq $4, %xmm0 + psrldq $4, %xmm1 + addps %xmm11, %xmm10 + addps %xmm15, %xmm14 + addps %xmm0, %xmm11 + addps %xmm1, %xmm15 + + + movss %xmm8, 1024(ARG0) + movss %xmm10, 896(ARG0) + movss %xmm9, 768(ARG0) + movss %xmm11, 640(ARG0) + movhlps %xmm8, %xmm0 + movhlps %xmm10, %xmm1 + movhlps %xmm9, %xmm2 + movhlps %xmm11, %xmm3 + movss %xmm0, 512(ARG0) + movss %xmm1, 384(ARG0) + movss %xmm2, 256(ARG0) + movss %xmm3, 128(ARG0) + + pshuflw $0xee, %xmm8, %xmm4 + pshuflw $0xee, %xmm10, %xmm5 + pshuflw $0xee, %xmm9, %xmm6 + pshuflw $0xee, %xmm11, %xmm7 + movss %xmm4, (ARG0) + movss %xmm4, (ARG1) + movss %xmm5, 128(ARG1) + movss %xmm6, 256(ARG1) + movss %xmm7, 384(ARG1) + + pshuflw $0xee, %xmm0, %xmm0 + pshuflw $0xee, %xmm1, %xmm1 + pshuflw $0xee, %xmm2, %xmm2 + pshuflw $0xee, %xmm3, %xmm3 + movss %xmm0, 512(ARG1) + movss %xmm1, 640(ARG1) + movss %xmm2, 768(ARG1) + movss %xmm3, 896(ARG1) + + pshufd $0x78, %xmm12, %xmm0 + movaps %xmm13, %xmm1 + psrldq $4, %xmm0 + + addps %xmm14, %xmm12 + addps %xmm15, %xmm13 + addps %xmm1, %xmm14 + addps %xmm0, %xmm15 + + movss %xmm12, 960(ARG0) + movss %xmm14, 832(ARG0) + movss %xmm13, 704(ARG0) + movss %xmm15, 576(ARG0) + movhlps %xmm12, %xmm0 + movhlps %xmm14, %xmm1 + movhlps %xmm13, %xmm2 + movhlps %xmm15, %xmm3 + movss %xmm0, 448(ARG0) + movss %xmm1, 320(ARG0) + movss %xmm2, 192(ARG0) + movss %xmm3, 64(ARG0) + + pshuflw $0xee, %xmm12, %xmm4 + pshuflw $0xee, %xmm14, %xmm5 + pshuflw $0xee, %xmm13, %xmm6 + pshuflw $0xee, %xmm15, %xmm7 + movss %xmm4, 64(ARG1) + movss %xmm5, 192(ARG1) + movss %xmm6, 320(ARG1) + movss %xmm7, 448(ARG1) + + pshuflw $0xee, %xmm0, %xmm0 + pshuflw $0xee, %xmm1, %xmm1 + pshuflw $0xee, %xmm2, %xmm2 + pshuflw $0xee, %xmm3, %xmm3 + movss %xmm0, 576(ARG1) + movss %xmm1, 704(ARG1) + movss %xmm2, 832(ARG1) + movss %xmm3, 960(ARG1) + +#ifdef IS_MSABI + movaps (%rsp), %xmm6 + movaps 16(%rsp), %xmm7 + movaps 32(%rsp), %xmm8 + movaps 48(%rsp), %xmm9 + movaps 64(%rsp), %xmm10 + movaps 80(%rsp), %xmm11 + movaps 96(%rsp), %xmm12 + movaps 112(%rsp), %xmm13 + movaps 128(%rsp), %xmm14 + movaps 144(%rsp), %xmm15 + addq $168, %rsp +#endif + ret + +NONEXEC_STACK diff --git a/src/libmpg123/debug.h b/src/libmpg123/debug.h new file mode 100644 index 0000000..0d3cf70 --- /dev/null +++ b/src/libmpg123/debug.h @@ -0,0 +1,178 @@ +/* + debug.h: + if DEBUG defined: debugging macro fprintf wrappers + else: macros defined to do nothing + That saves typing #ifdef DEBUG all the time and still preserves + lean code without debugging. + + public domain (or LGPL / GPL, if you like that more;-) + generated by debugdef.pl, what was + trivially written by Thomas Orgis +*/ + +#include "config.h" + +/* + I could do that with variadic macros available: + #define sdebug(me, s) fprintf(stderr, "[location] " s "\n") + #define debug(me, s, ...) fprintf(stderr, "[location] " s "}n", __VA_ARGS__) + + Variadic macros are a C99 feature... + Now just predefining stuff non-variadic for up to 15 arguments. + It's cumbersome to have them all with different names, though... +*/ + +#ifdef ME +#define DBGPRFX ME": " +#else +#define DBGPRFX "" +#endif + +#ifdef DEBUG + +#include +#define debug(s) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__) +#define debug1(s, a) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a) +#define debug2(s, a, b) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b) +#define debug3(s, a, b, c) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c) +#define debug4(s, a, b, c, d) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d) +#define debug5(s, a, b, c, d, e) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e) +#define debug6(s, a, b, c, d, e, f) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f) +#define debug7(s, a, b, c, d, e, f, g) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g) +#define debug8(s, a, b, c, d, e, f, g, h) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h) +#define debug9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i) +#define debug10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j) +#define debug11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k) +#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l) +#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#else +#define debug(s) +#define debug1(s, a) +#define debug2(s, a, b) +#define debug3(s, a, b, c) +#define debug4(s, a, b, c, d) +#define debug5(s, a, b, c, d, e) +#define debug6(s, a, b, c, d, e, f) +#define debug7(s, a, b, c, d, e, f, g) +#define debug8(s, a, b, c, d, e, f, g, h) +#define debug9(s, a, b, c, d, e, f, g, h, i) +#define debug10(s, a, b, c, d, e, f, g, h, i, j) +#define debug11(s, a, b, c, d, e, f, g, h, i, j, k) +#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l) +#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#endif + +/* warning macros also here... */ +#ifndef NO_WARNING +#define warning(s) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__) +#define warning1(s, a) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a) +#define warning2(s, a, b) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b) +#define warning3(s, a, b, c) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c) +#define warning4(s, a, b, c, d) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d) +#define warning5(s, a, b, c, d, e) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e) +#define warning6(s, a, b, c, d, e, f) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f) +#define warning7(s, a, b, c, d, e, f, g) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g) +#define warning8(s, a, b, c, d, e, f, g, h) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h) +#define warning9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i) +#define warning10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j) +#define warning11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k) +#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l) +#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#else +#define warning(s) +#define warning1(s, a) +#define warning2(s, a, b) +#define warning3(s, a, b, c) +#define warning4(s, a, b, c, d) +#define warning5(s, a, b, c, d, e) +#define warning6(s, a, b, c, d, e, f) +#define warning7(s, a, b, c, d, e, f, g) +#define warning8(s, a, b, c, d, e, f, g, h) +#define warning9(s, a, b, c, d, e, f, g, h, i) +#define warning10(s, a, b, c, d, e, f, g, h, i, j) +#define warning11(s, a, b, c, d, e, f, g, h, i, j, k) +#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l) +#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#endif + +/* error macros also here... */ +#ifndef NO_ERROR +#define error(s) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__) +#define error1(s, a) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a) +#define error2(s, a, b) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b) +#define error3(s, a, b, c) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c) +#define error4(s, a, b, c, d) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d) +#define error5(s, a, b, c, d, e) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e) +#define error6(s, a, b, c, d, e, f) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f) +#define error7(s, a, b, c, d, e, f, g) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g) +#define error8(s, a, b, c, d, e, f, g, h) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h) +#define error9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i) +#define error10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j) +#define error11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k) +#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l) +#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#else +#define error(s) +#define error1(s, a) +#define error2(s, a, b) +#define error3(s, a, b, c) +#define error4(s, a, b, c, d) +#define error5(s, a, b, c, d, e) +#define error6(s, a, b, c, d, e, f) +#define error7(s, a, b, c, d, e, f, g) +#define error8(s, a, b, c, d, e, f, g, h) +#define error9(s, a, b, c, d, e, f, g, h, i) +#define error10(s, a, b, c, d, e, f, g, h, i, j) +#define error11(s, a, b, c, d, e, f, g, h, i, j, k) +#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l) +#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#endif + +/* ereturn macros also here... */ +#ifndef NO_ERETURN +#define ereturn(rv, s) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__); return rv; }while(0) +#define ereturn1(rv, s, a) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a); return rv; }while(0) +#define ereturn2(rv, s, a, b) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b); return rv; }while(0) +#define ereturn3(rv, s, a, b, c) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c); return rv; }while(0) +#define ereturn4(rv, s, a, b, c, d) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d); return rv; }while(0) +#define ereturn5(rv, s, a, b, c, d, e) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e); return rv; }while(0) +#define ereturn6(rv, s, a, b, c, d, e, f) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f); return rv; }while(0) +#define ereturn7(rv, s, a, b, c, d, e, f, g) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g); return rv; }while(0) +#define ereturn8(rv, s, a, b, c, d, e, f, g, h) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h); return rv; }while(0) +#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i); return rv; }while(0) +#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j); return rv; }while(0) +#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k); return rv; }while(0) +#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l); return rv; }while(0) +#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m); return rv; }while(0) +#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n); return rv; }while(0) +#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) do{ fprintf(stderr, DBGPRFX"[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); return rv; }while(0) +#else +#define ereturn(rv, s) return rv +#define ereturn1(rv, s, a) return rv +#define ereturn2(rv, s, a, b) return rv +#define ereturn3(rv, s, a, b, c) return rv +#define ereturn4(rv, s, a, b, c, d) return rv +#define ereturn5(rv, s, a, b, c, d, e) return rv +#define ereturn6(rv, s, a, b, c, d, e, f) return rv +#define ereturn7(rv, s, a, b, c, d, e, f, g) return rv +#define ereturn8(rv, s, a, b, c, d, e, f, g, h) return rv +#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) return rv +#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) return rv +#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) return rv +#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) return rv +#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) return rv +#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) return rv +#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) return rv +#endif diff --git a/src/libmpg123/decode.h b/src/libmpg123/decode.h new file mode 100644 index 0000000..9ad9a69 --- /dev/null +++ b/src/libmpg123/decode.h @@ -0,0 +1,285 @@ +/* + decode.h: common definitions for decode functions + + This file is strongly tied with optimize.h concerning the synth functions. + Perhaps one should restructure that a bit. + + copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c +*/ +#ifndef MPG123_DECODE_H +#define MPG123_DECODE_H + +/* Selection of class of output routines for basic format. */ +#ifndef REAL_IS_FIXED +#define OUT_FORMATS 4 /* Basic output formats: 16bit, 8bit, real and s32 */ +#else +#define OUT_FORMATS 2 /* Only up to 16bit */ +#endif + +#define OUT_16 0 +#define OUT_8 1 +/* Those are defined but not supported for fixed point decoding! */ +#define OUT_REAL 2 /* Write a floating point sample (that is, one matching the internal real type). */ +#define OUT_S32 3 + +#ifdef NO_NTOM +#define NTOM_MAX 1 +#else +#define NTOM_MAX 8 /* maximum allowed factor for upsampling */ +#define NTOM_MAX_FREQ 96000 /* maximum frequency to upsample to / downsample from */ +#define NTOM_MUL (32768) +void ntom_set_ntom(mpg123_handle *fr, off_t num); +#endif + +/* Let's collect all possible synth functions here, for an overview. + If they are actually defined and used depends on preprocessor machinery. + See synth.c and optimize.h for that, also some special C and assembler files. */ + +#ifndef NO_16BIT +/* The signed-16bit-producing variants. */ +int synth_1to1 (real*, int, mpg123_handle*, int); +int synth_1to1_dither (real*, int, mpg123_handle*, int); +int synth_1to1_i386 (real*, int, mpg123_handle*, int); +int synth_1to1_i586 (real*, int, mpg123_handle*, int); +int synth_1to1_i586_dither(real*, int, mpg123_handle*, int); +int synth_1to1_mmx (real*, int, mpg123_handle*, int); +int synth_1to1_3dnow (real*, int, mpg123_handle*, int); +int synth_1to1_sse (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_sse (real*, real*, mpg123_handle*); +int synth_1to1_3dnowext (real*, int, mpg123_handle*, int); +int synth_1to1_altivec (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_altivec(real*, real*, mpg123_handle*); +int synth_1to1_x86_64 (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_x86_64(real*, real*, mpg123_handle*); +int synth_1to1_avx (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_avx (real*, real*, mpg123_handle*); +int synth_1to1_arm (real*, int, mpg123_handle*, int); +int synth_1to1_neon (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_neon(real*, real*, mpg123_handle*); +int synth_1to1_neon64 (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_neon64(real*, real*, mpg123_handle*); +/* This is different, special usage in layer3.c only. + Hence, the name... and now forget about it. + Never use it outside that special portion of code inside layer3.c! */ +int absynth_1to1_i486(real*, int, mpg123_handle*, int); +/* These mono/stereo converters use one of the above for the grunt work. */ +int synth_1to1_mono (real*, mpg123_handle*); +int synth_1to1_m2s(real*, mpg123_handle*); + +/* Sample rate decimation comes in less flavours. */ +#ifndef NO_DOWNSAMPLE +int synth_2to1 (real*, int, mpg123_handle*, int); +int synth_2to1_dither (real*, int, mpg123_handle*, int); +int synth_2to1_i386 (real*, int, mpg123_handle*, int); +int synth_2to1_mono (real*, mpg123_handle*); +int synth_2to1_m2s(real*, mpg123_handle*); +int synth_4to1 (real *,int, mpg123_handle*, int); +int synth_4to1_dither (real *,int, mpg123_handle*, int); +int synth_4to1_i386 (real*, int, mpg123_handle*, int); +int synth_4to1_mono (real*, mpg123_handle*); +int synth_4to1_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_NTOM +/* NtoM is really just one implementation. */ +int synth_ntom (real *,int, mpg123_handle*, int); +int synth_ntom_mono (real *, mpg123_handle *); +int synth_ntom_m2s (real *, mpg123_handle *); +#endif +#endif + +#ifndef NO_8BIT +/* The 8bit-producing variants. */ +/* There are direct 8-bit synths and wrappers over a possibly optimized 16bit one. */ +int synth_1to1_8bit (real*, int, mpg123_handle*, int); +int synth_1to1_8bit_i386 (real*, int, mpg123_handle*, int); +#ifndef NO_16BIT +int synth_1to1_8bit_wrap (real*, int, mpg123_handle*, int); +int synth_1to1_8bit_mono (real*, mpg123_handle*); +#endif +int synth_1to1_8bit_m2s(real*, mpg123_handle*); +#ifndef NO_16BIT +int synth_1to1_8bit_wrap_mono (real*, mpg123_handle*); +int synth_1to1_8bit_wrap_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_DOWNSAMPLE +int synth_2to1_8bit (real*, int, mpg123_handle*, int); +int synth_2to1_8bit_i386 (real*, int, mpg123_handle*, int); +int synth_2to1_8bit_mono (real*, mpg123_handle*); +int synth_2to1_8bit_m2s(real*, mpg123_handle*); +int synth_4to1_8bit (real*, int, mpg123_handle*, int); +int synth_4to1_8bit_i386 (real*, int, mpg123_handle*, int); +int synth_4to1_8bit_mono (real*, mpg123_handle*); +int synth_4to1_8bit_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_NTOM +int synth_ntom_8bit (real*, int, mpg123_handle*, int); +int synth_ntom_8bit_mono (real*, mpg123_handle*); +int synth_ntom_8bit_m2s(real*, mpg123_handle*); +#endif +#endif + +#ifndef REAL_IS_FIXED + +#ifndef NO_REAL +/* The real-producing variants. */ +int synth_1to1_real (real*, int, mpg123_handle*, int); +int synth_1to1_real_i386 (real*, int, mpg123_handle*, int); +int synth_1to1_real_sse (real*, int, mpg123_handle*, int); +int synth_1to1_real_stereo_sse (real*, real*, mpg123_handle*); +int synth_1to1_real_x86_64 (real*, int, mpg123_handle*, int); +int synth_1to1_real_stereo_x86_64(real*, real*, mpg123_handle*); +int synth_1to1_real_avx (real*, int, mpg123_handle*, int); +int synth_1to1_fltst_avx (real*, real*, mpg123_handle*); +int synth_1to1_real_altivec (real*, int, mpg123_handle*, int); +int synth_1to1_fltst_altivec(real*, real*, mpg123_handle*); +int synth_1to1_real_neon (real*, int, mpg123_handle*, int); +int synth_1to1_real_stereo_neon(real*, real*, mpg123_handle*); +int synth_1to1_real_neon64 (real*, int, mpg123_handle*, int); +int synth_1to1_fltst_neon64(real*, real*, mpg123_handle*); +int synth_1to1_real_mono (real*, mpg123_handle*); +int synth_1to1_real_m2s(real*, mpg123_handle*); +#ifndef NO_DOWNSAMPLE +int synth_2to1_real (real*, int, mpg123_handle*, int); +int synth_2to1_real_i386 (real*, int, mpg123_handle*, int); +int synth_2to1_real_mono (real*, mpg123_handle*); +int synth_2to1_real_m2s(real*, mpg123_handle*); +int synth_4to1_real (real*, int, mpg123_handle*, int); +int synth_4to1_real_i386 (real*, int, mpg123_handle*, int); +int synth_4to1_real_mono (real*, mpg123_handle*); +int synth_4to1_real_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_NTOM +int synth_ntom_real (real*, int, mpg123_handle*, int); +int synth_ntom_real_mono (real*, mpg123_handle*); +int synth_ntom_real_m2s(real*, mpg123_handle*); +#endif +#endif + +#ifndef NO_32BIT +/* 32bit integer */ +int synth_1to1_s32 (real*, int, mpg123_handle*, int); +int synth_1to1_s32_i386 (real*, int, mpg123_handle*, int); +int synth_1to1_s32_sse (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_sse (real*, real*, mpg123_handle*); +int synth_1to1_s32_x86_64 (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_x86_64(real*, real*, mpg123_handle*); +int synth_1to1_s32_avx (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_avx (real*, real*, mpg123_handle*); +int synth_1to1_s32_altivec (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_altivec(real*, real*, mpg123_handle*); +int synth_1to1_s32_neon (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_neon(real*, real*, mpg123_handle*); +int synth_1to1_s32_neon64 (real*, int, mpg123_handle*, int); +int synth_1to1_s32st_neon64(real*, real*, mpg123_handle*); +int synth_1to1_s32_mono (real*, mpg123_handle*); +int synth_1to1_s32_m2s(real*, mpg123_handle*); +#ifndef NO_DOWNSAMPLE +int synth_2to1_s32 (real*, int, mpg123_handle*, int); +int synth_2to1_s32_i386 (real*, int, mpg123_handle*, int); +int synth_2to1_s32_mono (real*, mpg123_handle*); +int synth_2to1_s32_m2s(real*, mpg123_handle*); +int synth_4to1_s32 (real*, int, mpg123_handle*, int); +int synth_4to1_s32_i386 (real*, int, mpg123_handle*, int); +int synth_4to1_s32_mono (real*, mpg123_handle*); +int synth_4to1_s32_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_NTOM +int synth_ntom_s32 (real*, int, mpg123_handle*, int); +int synth_ntom_s32_mono (real*, mpg123_handle*); +int synth_ntom_s32_m2s(real*, mpg123_handle*); +#endif +#endif + +#endif /* FIXED */ + + +/* Inside these synth functions, some dct64 variants may be used. + The special optimized ones that only appear in assembler code are not mentioned here. + And, generally, these functions are only employed in a matching synth function. */ +void dct64 (real *,real *,real *); +void dct64_i386 (real *,real *,real *); +void dct64_altivec(real *,real *,real *); +void dct64_i486(int*, int* , real*); /* Yeah, of no use outside of synth_i486.c .*/ + +/* This is used by the layer 3 decoder, one generic function and 3DNow variants. */ +void dct36 (real *,real *,real *,real *,real *); +void dct36_3dnow (real *,real *,real *,real *,real *); +void dct36_3dnowext(real *,real *,real *,real *,real *); +void dct36_x86_64 (real *,real *,real *,real *,real *); +void dct36_sse (real *,real *,real *,real *,real *); +void dct36_avx (real *,real *,real *,real *,real *); +void dct36_neon (real *,real *,real *,real *,real *); +void dct36_neon64 (real *,real *,real *,real *,real *); + +/* Tools for NtoM resampling synth, defined in ntom.c . */ +int synth_ntom_set_step(mpg123_handle *fr); /* prepare ntom decoding */ +unsigned long ntom_val(mpg123_handle *fr, off_t frame); /* compute ntom_val for frame offset */ +/* Frame and sample offsets. */ +#ifndef NO_NTOM +/* + Outsamples of _this_ frame. + To be exact: The samples to be expected from the next frame decode (using the current ntom_val). When you already decoded _this_ frame, this is the number of samples to be expected from the next one. +*/ +off_t ntom_frame_outsamples(mpg123_handle *fr); +/* Total out/insample offset. */ +off_t ntom_frmouts(mpg123_handle *fr, off_t frame); +off_t ntom_ins2outs(mpg123_handle *fr, off_t ins); +off_t ntom_frameoff(mpg123_handle *fr, off_t soff); +#endif + +/* Initialization of any static data that majy be needed at runtime. + Make sure you call these once before it is too late. */ +#ifndef NO_LAYER3 +void init_layer3(void); +real init_layer3_gainpow2(mpg123_handle *fr, int i); +void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i)); +#endif +#ifndef NO_LAYER12 +void init_layer12(void); +real* init_layer12_table(mpg123_handle *fr, real *table, int m); +void init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m)); +#endif + +void prepare_decode_tables(void); + +extern real *pnts[5]; /* tabinit provides, dct64 needs */ + +/* Runtime (re)init functions; needed more often. */ +void make_decode_tables(mpg123_handle *fr); /* For every volume change. */ +/* Stuff needed after updating synth setup (see set_synth_functions()). */ + +#ifdef OPT_MMXORSSE +/* Special treatment for mmx-like decoders, these functions go into the slots below. */ +void make_decode_tables_mmx(mpg123_handle *fr); +#ifndef NO_LAYER3 +real init_layer3_gainpow2_mmx(mpg123_handle *fr, int i); +#endif +#ifndef NO_LAYER12 +real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m); +#endif +#endif + +#ifndef NO_8BIT +/* Needed when switching to 8bit output. */ +int make_conv16to8_table(mpg123_handle *fr); +#endif + +/* These are the actual workers. + They operate on the parsed frame data and handle decompression to audio samples. + The synth functions defined above are called from inside the layer handlers. */ + +#ifndef NO_LAYER3 +int do_layer3(mpg123_handle *fr); +#endif +#ifndef NO_LAYER2 +int do_layer2(mpg123_handle *fr); +#endif +#ifndef NO_LAYER1 +int do_layer1(mpg123_handle *fr); +#endif +/* There's an 3DNow counterpart in asm. */ +void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]); + +#endif diff --git a/src/libmpg123/dither.c b/src/libmpg123/dither.c new file mode 100644 index 0000000..329a4de --- /dev/null +++ b/src/libmpg123/dither.c @@ -0,0 +1,3 @@ +/* Hack to allow building the same code with and without libtool. */ +#include "intsym.h" +#include "dither_impl.h" diff --git a/src/libmpg123/dither.h b/src/libmpg123/dither.h new file mode 100644 index 0000000..6a6cb3e --- /dev/null +++ b/src/libmpg123/dither.h @@ -0,0 +1,23 @@ +/* + dither: Generate noise for dithering / noise shaping. + + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#ifndef MPG123_DITHER_H +#define MPG123_DITHER_H + +#define DITHERSIZE 65536 +enum mpg123_noise_type +{ + mpg123_white_noise = 0 + ,mpg123_tpdf_noise + ,mpg123_highpass_tpdf_noise +}; + +void mpg123_noise(float* table, size_t count, enum mpg123_noise_type noisetype); +void dither_table_init(float *dithertable); + +#endif diff --git a/src/libmpg123/dither_impl.h b/src/libmpg123/dither_impl.h new file mode 100644 index 0000000..30dbdd1 --- /dev/null +++ b/src/libmpg123/dither_impl.h @@ -0,0 +1,119 @@ +/* + dither: Generate shaped noise for dithering + + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "config.h" +#include "compat.h" +#include "dither.h" + +static const uint32_t init_seed = 2463534242UL; + +#define LAP 100 + +/* + xorshift random number generator, with output scaling to [-0.5, 0.5] + This is the white noise... + See http://www.jstatsoft.org/v08/i14/paper on XOR shift random number generators. +*/ +static float rand_xorshift32(uint32_t *seed) +{ + union + { + uint32_t i; + float f; + } fi; + + fi.i = *seed; + fi.i ^= (fi.i<<13); + fi.i ^= (fi.i>>17); + fi.i ^= (fi.i<<5); + *seed = fi.i; + + /* scale the number to [-0.5, 0.5] */ +#ifdef IEEE_FLOAT + fi.i = (fi.i>>9)|0x3f800000; + fi.f -= 1.5f; +#else + fi.f = (double)fi.i / 4294967295.0; + fi.f -= 0.5f; +#endif + return fi.f; +} + +static void white_noise(float *table, size_t count) +{ + size_t i; + uint32_t seed = init_seed; + + for(i=0; i 2*LAP ? LAP : count/2; + + float input_noise; + float xv[9], yv[9]; + + for(i=0;i<9;i++) + { + xv[i] = yv[i] = 0.0f; + } + + for(i=0;i=lap) table[i-lap] = yv[8] * 3.0f; + } +} + +void mpg123_noise(float* table, size_t count, enum mpg123_noise_type noisetype) +{ + switch(noisetype) + { + case mpg123_white_noise: white_noise(table, count); break; + case mpg123_tpdf_noise: tpdf_noise(table, count); break; + case mpg123_highpass_tpdf_noise: + highpass_tpdf_noise(table, count); + break; + } +} + +/* Generate white noise and shape it with a high pass filter. */ +void dither_table_init(float *dithertable) +{ + highpass_tpdf_noise(dithertable, DITHERSIZE); +} diff --git a/src/libmpg123/equalizer.c b/src/libmpg123/equalizer.c new file mode 100644 index 0000000..bc5d5d9 --- /dev/null +++ b/src/libmpg123/equalizer.c @@ -0,0 +1,17 @@ +/* + equalizer.c: equalizer settings + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + + +#include "mpg123lib_intern.h" + +void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]) +{ + int i; + for(i=0;i<32;i++) + bandPtr[i] = REAL_MUL(bandPtr[i], equalizer[channel][i]); +} diff --git a/src/libmpg123/equalizer_3dnow.S b/src/libmpg123/equalizer_3dnow.S new file mode 100644 index 0000000..471a0ed --- /dev/null +++ b/src/libmpg123/equalizer_3dnow.S @@ -0,0 +1,70 @@ +/* + equalizer_3dnow: 3DNow! optimized do_equalizer() + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by KIMURA Takuhiro +*/ + +#include "mangle.h" + +.text + ALIGN4 +.globl ASM_NAME(do_equalizer_3dnow) +/* .type ASM_NAME(do_equalizer_3dnow),@function */ +/* void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]); */ +ASM_NAME(do_equalizer_3dnow): + pushl %esi + pushl %ebx + /* bandPtr */ + movl 12(%esp),%ebx + /* channel */ + movl 16(%esp),%ecx + xorl %edx,%edx + /* equalizer */ + movl 20(%esp),%esi + sall $7,%ecx + ALIGN4 +.L9: + movq (%ebx,%edx),%mm0 + pfmul (%esi,%ecx),%mm0 + + movq 8(%ebx,%edx),%mm1 + pfmul 8(%esi,%ecx),%mm1 + movq %mm0,(%ebx,%edx) + + movq 16(%ebx,%edx),%mm0 + pfmul 16(%esi,%ecx),%mm0 + movq %mm1,8(%ebx,%edx) + + movq 24(%ebx,%edx),%mm1 + pfmul 24(%esi,%ecx),%mm1 + movq %mm0,16(%ebx,%edx) + + movq 32(%ebx,%edx),%mm0 + pfmul 32(%esi,%ecx),%mm0 + movq %mm1,24(%ebx,%edx) + + movq 40(%ebx,%edx),%mm1 + pfmul 40(%esi,%ecx),%mm1 + movq %mm0,32(%ebx,%edx) + + movq 48(%ebx,%edx),%mm0 + pfmul 48(%esi,%ecx),%mm0 + movq %mm1,40(%ebx,%edx) + + movq 56(%ebx,%edx),%mm1 + pfmul 56(%esi,%ecx),%mm1 + movq %mm0,48(%ebx,%edx) + movq %mm1,56(%ebx,%edx) + + addl $64,%edx + addl $32,%ecx + cmpl $124,%edx + jle .L9 + ALIGN4 + popl %ebx + popl %esi + ret + +NONEXEC_STACK diff --git a/src/libmpg123/feature.c b/src/libmpg123/feature.c new file mode 100644 index 0000000..03ec676 --- /dev/null +++ b/src/libmpg123/feature.c @@ -0,0 +1,112 @@ +#include "mpg123lib_intern.h" + +int mpg123_feature(const enum mpg123_feature_set key) +{ + switch(key) + { + case MPG123_FEATURE_ABI_UTF8OPEN: +#ifdef WANT_WIN32_UNICODE + return 1; +#else + return 0; +#endif /* WANT_WIN32_UNICODE */ + + case MPG123_FEATURE_OUTPUT_8BIT: +#ifdef NO_8BIT + return 0; +#else + return 1; +#endif /* mpg123_output_8bit */ + + case MPG123_FEATURE_OUTPUT_16BIT: +#ifdef NO_16BIT + return 0; +#else + return 1; +#endif /* mpg123_output_16bit */ + + case MPG123_FEATURE_OUTPUT_32BIT: +#ifdef NO_32BIT + return 0; +#else + return 1; +#endif /* mpg123_output_32bit */ + + case MPG123_FEATURE_PARSE_ID3V2: +#ifdef NO_ID3V2 + return 0; +#else + return 1; +#endif /* NO_ID3V2 */ + + case MPG123_FEATURE_DECODE_LAYER1: +#ifdef NO_LAYER1 + return 0; +#else + return 1; +#endif /* NO_LAYER1 */ + + case MPG123_FEATURE_DECODE_LAYER2: +#ifdef NO_LAYER2 + return 0; +#else + return 1; +#endif /* NO_LAYER2 */ + + case MPG123_FEATURE_DECODE_LAYER3: +#ifdef NO_LAYER3 + return 0; +#else + return 1; +#endif /* NO_LAYER3 */ + + case MPG123_FEATURE_DECODE_ACCURATE: +#ifdef ACCURATE_ROUNDING + return 1; +#else + return 0; +#endif /* ACCURATE_ROUNDING */ + + case MPG123_FEATURE_DECODE_DOWNSAMPLE: +#ifdef NO_DOWNSAMPLE + return 0; +#else + return 1; +#endif /* NO_DOWNSAMPLE */ + + case MPG123_FEATURE_DECODE_NTOM: +#ifdef NO_NTOM + return 0; +#else + return 1; +#endif /* NO_NTOM */ + + case MPG123_FEATURE_PARSE_ICY: +#ifdef NO_ICY + return 0; +#else + return 1; +#endif /* NO_ICY */ + + case MPG123_FEATURE_INDEX: +#ifdef FRAME_INDEX + return 1; +#else + return 0; +#endif /* FRAME_INDEX */ + case MPG123_FEATURE_TIMEOUT_READ: +#ifdef TIMEOUT_READ + return 1; +#else + return 0; +#endif + case MPG123_FEATURE_EQUALIZER: +#ifndef NO_EQUALIZER + return 1; +#else + return 0; +#endif + + default: return 0; + } +} diff --git a/src/libmpg123/fmt123.h b/src/libmpg123/fmt123.h new file mode 100644 index 0000000..cc30a06 --- /dev/null +++ b/src/libmpg123/fmt123.h @@ -0,0 +1,135 @@ +/* + libmpg123: MPEG Audio Decoder library + + separate header just for audio format definitions not tied to + library code + + copyright 1995-2015 by the mpg123 project + free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_ENC_H +#define MPG123_ENC_H + +/** \file fmt123.h Audio format definitions. */ + +/** \defgroup mpg123_enc mpg123 PCM sample encodings + * These are definitions for audio formats used by libmpg123 and + * libout123. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding + * families. + * This is also why the enum is not used as type for actual encoding variables, + * plain integers (at least 16 bit, 15 bit being used) cover the possible + * combinations of these flags. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be + * absent for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything + * else). The macro MPG123_SAMPLESIZE() can be helpful there. + */ +enum mpg123_enc_enum +{ +/* 0000 0000 0000 1111 Some 8 bit integer encoding. */ + MPG123_ENC_8 = 0x00f +/* 0000 0000 0100 0000 Some 16 bit integer encoding. */ +, MPG123_ENC_16 = 0x040 +/* 0100 0000 0000 0000 Some 24 bit integer encoding. */ +, MPG123_ENC_24 = 0x4000 +/* 0000 0001 0000 0000 Some 32 bit integer encoding. */ +, MPG123_ENC_32 = 0x100 +/* 0000 0000 1000 0000 Some signed integer encoding. */ +, MPG123_ENC_SIGNED = 0x080 +/* 0000 1110 0000 0000 Some float encoding. */ +, MPG123_ENC_FLOAT = 0xe00 +/* 0000 0000 1101 0000 signed 16 bit */ +, MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) +/* 0000 0000 0110 0000 unsigned 16 bit */ +, MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) +/* 0000 0000 0000 0001 unsigned 8 bit */ +, MPG123_ENC_UNSIGNED_8 = 0x01 +/* 0000 0000 1000 0010 signed 8 bit */ +, MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) +/* 0000 0000 0000 0100 ulaw 8 bit */ +, MPG123_ENC_ULAW_8 = 0x04 +/* 0000 0000 0000 1000 alaw 8 bit */ +, MPG123_ENC_ALAW_8 = 0x08 +/* 0001 0001 1000 0000 signed 32 bit */ +, MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 +/* 0010 0001 0000 0000 unsigned 32 bit */ +, MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 +/* 0101 0000 1000 0000 signed 24 bit */ +, MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 +/* 0110 0000 0000 0000 unsigned 24 bit */ +, MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 +/* 0000 0010 0000 0000 32bit float */ +, MPG123_ENC_FLOAT_32 = 0x200 +/* 0000 0100 0000 0000 64bit float */ +, MPG123_ENC_FLOAT_64 = 0x400 +/* Any possibly known encoding from the list above. */ +, MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 + | MPG123_ENC_UNSIGNED_8 | MPG123_ENC_SIGNED_8 + | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) +}; + +/** Get size of one PCM sample with given encoding. + * This is included both in libmpg123 and libout123. Both offer + * an API function to provide the macro results from library + * compile-time, not that of you application. This most likely + * does not matter as I do not expect any fresh PCM sample + * encoding to appear. But who knows? Perhaps the encoding type + * will be abused for funny things in future, not even plain PCM. + * And, by the way: Thomas really likes the ?: operator. + * \param enc the encoding (mpg123_enc_enum value) + * \return size of one sample in bytes + */ +#define MPG123_SAMPLESIZE(enc) ( \ + (enc) & MPG123_ENC_8 \ + ? 1 \ + : ( (enc) & MPG123_ENC_16 \ + ? 2 \ + : ( (enc) & MPG123_ENC_24 \ + ? 3 \ + : ( ( (enc) & MPG123_ENC_32 \ + || (enc) == MPG123_ENC_FLOAT_32 ) \ + ? 4 \ + : ( (enc) == MPG123_ENC_FLOAT_64 \ + ? 8 \ + : 0 \ +) ) ) ) ) + +/** Structure defining an audio format. + * Providing the members as individual function arguments to define a certain + * output format is easy enough. This struct makes is more comfortable to deal + * with a list of formats. + * Negative values for the members might be used to communicate use of default + * values. + */ +struct mpg123_fmt +{ + long rate; /**< sampling rate in Hz */ + int channels; /**< channel count */ + /** encoding code, can be single value or bitwise or of members of + * mpg123_enc_enum */ + int encoding; +}; + +/* @} */ + +#endif + diff --git a/src/libmpg123/format.c b/src/libmpg123/format.c new file mode 100644 index 0000000..6a17ce1 --- /dev/null +++ b/src/libmpg123/format.c @@ -0,0 +1,683 @@ +/* + format:routines to deal with audio (output) format + + copyright 2008-14 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis, starting with parts of the old audio.c, with only faintly manage to show now + + A Major change from mpg123 <= 1.18 is that all encodings are only really + disabled when done so via specific build configuration. Otherwise, the + missing support of decoders to produce a certain format is augmented by + postprocessing that converts the samples. This means happily creating + data with higher resolution from less accurate decoder output. + + The main point is to still offer float encoding when the decoding core uses + a fixed point representation that has only 16 bit output. Actually, that's + the only point: A fixed-point build needs to create float from 16 bit, also + 32 or 24 bit from the same source. That's all there is to it: Everything else + is covered by fallback synth functions. It may be a further step to check if + there are cases where conversion in postprocessing works well enough to omit + a certain specialized decoder ... but usually, they are justified by some + special way to get from float to integer to begin with. + + I won't cover the case of faking double output with float/s16 decoders here. + Double precision output is a thing for experimental builds anyway. Mostly + theoretical and without a point. +*/ + +#include "mpg123lib_intern.h" +#include "debug.h" + +/* static int chans[NUM_CHANNELS] = { 1 , 2 }; */ +static const long my_rates[MPG123_RATES] = /* only the standard rates */ +{ + 8000, 11025, 12000, + 16000, 22050, 24000, + 32000, 44100, 48000, +}; + +static const int my_encodings[MPG123_ENCODINGS] = +{ + MPG123_ENC_SIGNED_16, + MPG123_ENC_UNSIGNED_16, + MPG123_ENC_SIGNED_32, + MPG123_ENC_UNSIGNED_32, + MPG123_ENC_SIGNED_24, + MPG123_ENC_UNSIGNED_24, + /* Floating point range, see below. */ + MPG123_ENC_FLOAT_32, + MPG123_ENC_FLOAT_64, + /* 8 bit range, see below. */ + MPG123_ENC_SIGNED_8, + MPG123_ENC_UNSIGNED_8, + MPG123_ENC_ULAW_8, + MPG123_ENC_ALAW_8 +}; + +/* Make that match the above table. + And yes, I still don't like this kludgy stuff. */ +/* range[0] <= i < range[1] for forced floating point */ +static const int enc_float_range[2] = { 6, 8 }; +/* same for 8 bit encodings */ +static const int enc_8bit_range[2] = { 8, 12 }; + +/* + Only one type of float is supported. + Actually, double is a very special experimental case not occuring in normal + builds. Might actually get rid of it. + + Remember here: Also with REAL_IS_FIXED, I want to be able to produce float + output (f32) via post-processing. +*/ +# ifdef REAL_IS_DOUBLE +# define MPG123_FLOAT_ENC MPG123_ENC_FLOAT_64 +# else +# define MPG123_FLOAT_ENC MPG123_ENC_FLOAT_32 +# endif + +/* The list of actually possible encodings. */ +static const int good_encodings[] = +{ +#ifndef NO_16BIT + MPG123_ENC_SIGNED_16, + MPG123_ENC_UNSIGNED_16, +#endif +#ifndef NO_32BIT + MPG123_ENC_SIGNED_32, + MPG123_ENC_UNSIGNED_32, + MPG123_ENC_SIGNED_24, + MPG123_ENC_UNSIGNED_24, +#endif +#ifndef NO_REAL + MPG123_FLOAT_ENC, +#endif +#ifndef NO_8BIT + MPG123_ENC_SIGNED_8, + MPG123_ENC_UNSIGNED_8, + MPG123_ENC_ULAW_8, + MPG123_ENC_ALAW_8 +#endif +}; + +/* Check if encoding is a valid one in this build. + ...lazy programming: linear search. */ +static int good_enc(const int enc) +{ + size_t i; + for(i=0; iforce_rate != 0 && mp->force_rate == r) return MPG123_RATES; +#endif + + return -1; +} + +static int enc2num(int encoding) +{ + int i; + for(i=0;ichannels-1; + int rn = rate2num(&fr->p, nf->rate); + if(rn >= 0) for(i=f0;ip.audio_caps[c][rn][i]) + { + nf->encoding = my_encodings[i]; + return 1; + } + } + return 0; +} + +static int freq_fit(mpg123_handle *fr, struct audioformat *nf, int f0, int f2) +{ + nf->rate = frame_freq(fr)>>fr->p.down_sample; + if(cap_fit(fr,nf,f0,f2)) return 1; + if(fr->p.flags & MPG123_AUTO_RESAMPLE) + { + nf->rate>>=1; + if(cap_fit(fr,nf,f0,f2)) return 1; + nf->rate>>=1; + if(cap_fit(fr,nf,f0,f2)) return 1; + } +#ifndef NO_NTOM + /* If nothing worked, try the other rates, only without constrains from user. + In case you didn't guess: We enable flexible resampling if we find a working rate. */ + if( fr->p.flags & MPG123_AUTO_RESAMPLE && + !fr->p.force_rate && fr->p.down_sample == 0) + { + int i; + int c = nf->channels-1; + int rn = rate2num(&fr->p, frame_freq(fr)); + int rrn; + if(rn < 0) return 0; + /* Try higher rates first. */ + for(i=f0;ip.audio_caps[c][rrn][i]) + { + nf->rate = my_rates[rrn]; + nf->encoding = my_encodings[i]; + return 1; + } + /* Then lower rates. */ + for(i=f0;i=0; --rrn) + if(fr->p.audio_caps[c][rrn][i]) + { + nf->rate = my_rates[rrn]; + nf->encoding = my_encodings[i]; + return 1; + } + } +#endif + + return 0; +} + +/* match constraints against supported audio formats, store possible setup in frame + return: -1: error; 0: no format change; 1: format change */ +int frame_output_format(mpg123_handle *fr) +{ + struct audioformat nf; + int f0=0; + int f2=MPG123_ENCODINGS; /* Omit the 32bit and float encodings. */ + mpg123_pars *p = &fr->p; + /* initialize new format, encoding comes later */ + nf.channels = fr->stereo; + + /* All this forcing should be removed in favour of the capabilities table... */ + if(p->flags & MPG123_FORCE_8BIT) + { + f0 = enc_8bit_range[0]; + f2 = enc_8bit_range[1]; + } + if(p->flags & MPG123_FORCE_FLOAT) + { + f0 = enc_float_range[0]; + f2 = enc_float_range[1]; + } + + /* force stereo is stronger */ + if(p->flags & MPG123_FORCE_MONO) nf.channels = 1; + if(p->flags & MPG123_FORCE_STEREO) nf.channels = 2; + +#ifndef NO_NTOM + if(p->force_rate) + { + nf.rate = p->force_rate; + if(cap_fit(fr,&nf,f0,2)) goto end; /* 16bit encodings */ + if(cap_fit(fr,&nf,f0<=2 ? 2 : f0,f2)) goto end; /* 8bit encodings */ + + /* try again with different stereoness */ + if(nf.channels == 2 && !(p->flags & MPG123_FORCE_STEREO)) nf.channels = 1; + else if(nf.channels == 1 && !(p->flags & MPG123_FORCE_MONO)) nf.channels = 2; + + if(cap_fit(fr,&nf,f0,2)) goto end; /* 16bit encodings */ + if(cap_fit(fr,&nf,f0<=2 ? 2 : f0,f2)) goto end; /* 8bit encodings */ + + if(NOQUIET) + error3( "Unable to set up output format! Constraints: %s%s%liHz.", + ( p->flags & MPG123_FORCE_STEREO ? "stereo, " : + (p->flags & MPG123_FORCE_MONO ? "mono, " : "") ), + (p->flags & MPG123_FORCE_8BIT ? "8bit, " : ""), + p->force_rate ); +/* if(NOQUIET && p->verbose <= 1) print_capabilities(fr); */ + + fr->err = MPG123_BAD_OUTFORMAT; + return -1; + } +#endif + + if(freq_fit(fr, &nf, f0, 2)) goto end; /* try rates with 16bit */ + if(freq_fit(fr, &nf, f0<=2 ? 2 : f0, f2)) goto end; /* ... 8bit */ + + /* try again with different stereoness */ + if(nf.channels == 2 && !(p->flags & MPG123_FORCE_STEREO)) nf.channels = 1; + else if(nf.channels == 1 && !(p->flags & MPG123_FORCE_MONO)) nf.channels = 2; + + if(freq_fit(fr, &nf, f0, 2)) goto end; /* try rates with 16bit */ + if(freq_fit(fr, &nf, f0<=2 ? 2 : f0, f2)) goto end; /* ... 8bit */ + + /* Here is the _bad_ end. */ + if(NOQUIET) + { + error5( "Unable to set up output format! Constraints: %s%s%li, %li or %liHz.", + ( p->flags & MPG123_FORCE_STEREO ? "stereo, " : + (p->flags & MPG123_FORCE_MONO ? "mono, " : "") ), + (p->flags & MPG123_FORCE_8BIT ? "8bit, " : ""), + frame_freq(fr), frame_freq(fr)>>1, frame_freq(fr)>>2 ); + } +/* if(NOQUIET && p->verbose <= 1) print_capabilities(fr); */ + + fr->err = MPG123_BAD_OUTFORMAT; + return -1; + +end: /* Here is the _good_ end. */ + /* we had a successful match, now see if there's a change */ + if(nf.rate == fr->af.rate && nf.channels == fr->af.channels && nf.encoding == fr->af.encoding) + { + debug2("Old format with %i channels, and FORCE_MONO=%li", nf.channels, p->flags & MPG123_FORCE_MONO); + return 0; /* the same format as before */ + } + else /* a new format */ + { + debug1("New format with %i channels!", nf.channels); + fr->af.rate = nf.rate; + fr->af.channels = nf.channels; + fr->af.encoding = nf.encoding; + /* Cache the size of one sample in bytes, for ease of use. */ + fr->af.encsize = mpg123_encsize(fr->af.encoding); + if(fr->af.encsize < 1) + { + if(NOQUIET) error1("Some unknown encoding??? (%i)", fr->af.encoding); + + fr->err = MPG123_BAD_OUTFORMAT; + return -1; + } + /* Set up the decoder synth format. Might differ. */ +#ifdef NO_SYNTH32 + /* Without high-precision synths, 16 bit signed is the basis for + everything higher than 8 bit. */ + if(fr->af.encsize > 2) + fr->af.dec_enc = MPG123_ENC_SIGNED_16; + else + { +#endif + switch(fr->af.encoding) + { +#ifndef NO_32BIT + case MPG123_ENC_SIGNED_24: + case MPG123_ENC_UNSIGNED_24: + case MPG123_ENC_UNSIGNED_32: + fr->af.dec_enc = MPG123_ENC_SIGNED_32; + break; +#endif +#ifndef NO_16BIT + case MPG123_ENC_UNSIGNED_16: + fr->af.dec_enc = MPG123_ENC_SIGNED_16; + break; +#endif + default: + fr->af.dec_enc = fr->af.encoding; + } +#ifdef NO_SYNTH32 + } +#endif + fr->af.dec_encsize = mpg123_encsize(fr->af.dec_enc); + return 1; + } +} + +int attribute_align_arg mpg123_format_none(mpg123_handle *mh) +{ + int r; + if(mh == NULL) return MPG123_BAD_HANDLE; + + r = mpg123_fmt_none(&mh->p); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + + return r; +} + +int attribute_align_arg mpg123_fmt_none(mpg123_pars *mp) +{ + if(mp == NULL) return MPG123_BAD_PARS; + + if(PVERB(mp,3)) fprintf(stderr, "Note: Disabling all formats.\n"); + + memset(mp->audio_caps,0,sizeof(mp->audio_caps)); + return MPG123_OK; +} + +int attribute_align_arg mpg123_format_all(mpg123_handle *mh) +{ + int r; + if(mh == NULL) return MPG123_BAD_HANDLE; + + r = mpg123_fmt_all(&mh->p); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + + return r; +} + +int attribute_align_arg mpg123_fmt_all(mpg123_pars *mp) +{ + size_t rate, ch, enc; + if(mp == NULL) return MPG123_BAD_PARS; + + if(PVERB(mp,3)) fprintf(stderr, "Note: Enabling all formats.\n"); + + for(ch=0; ch < NUM_CHANNELS; ++ch) + for(rate=0; rate < MPG123_RATES+1; ++rate) + for(enc=0; enc < MPG123_ENCODINGS; ++enc) + mp->audio_caps[ch][rate][enc] = good_enc(my_encodings[enc]) ? 1 : 0; + + return MPG123_OK; +} + +int attribute_align_arg mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings) +{ + int r; + if(mh == NULL) return MPG123_BAD_HANDLE; + r = mpg123_fmt(&mh->p, rate, channels, encodings); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + + return r; +} + +int attribute_align_arg mpg123_fmt(mpg123_pars *mp, long rate, int channels, int encodings) +{ + int ie, ic, ratei; + int ch[2] = {0, 1}; + if(mp == NULL) return MPG123_BAD_PARS; + if(!(channels & (MPG123_MONO|MPG123_STEREO))) return MPG123_BAD_CHANNEL; + + if(PVERB(mp,3)) fprintf(stderr, "Note: Want to enable format %li/%i for encodings 0x%x.\n", rate, channels, encodings); + + if(!(channels & MPG123_STEREO)) ch[1] = 0; /* {0,0} */ + else if(!(channels & MPG123_MONO)) ch[0] = 1; /* {1,1} */ + ratei = rate2num(mp, rate); + if(ratei < 0) return MPG123_BAD_RATE; + + /* now match the encodings */ + for(ic = 0; ic < 2; ++ic) + { + for(ie = 0; ie < MPG123_ENCODINGS; ++ie) + if(good_enc(my_encodings[ie]) && ((my_encodings[ie] & encodings) == my_encodings[ie])) + mp->audio_caps[ch[ic]][ratei][ie] = 1; + + if(ch[0] == ch[1]) break; /* no need to do it again */ + } + + return MPG123_OK; +} + +int attribute_align_arg mpg123_format_support(mpg123_handle *mh, long rate, int encoding) +{ + if(mh == NULL) return 0; + else return mpg123_fmt_support(&mh->p, rate, encoding); +} + +int attribute_align_arg mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding) +{ + int ch = 0; + int ratei, enci; + ratei = rate2num(mp, rate); + enci = enc2num(encoding); + if(mp == NULL || ratei < 0 || enci < 0) return 0; + if(mp->audio_caps[0][ratei][enci]) ch |= MPG123_MONO; + if(mp->audio_caps[1][ratei][enci]) ch |= MPG123_STEREO; + return ch; +} + +/* Call this one to ensure that any valid format will be something different than this. */ +void invalidate_format(struct audioformat *af) +{ + af->encoding = 0; + af->rate = 0; + af->channels = 0; +} + +/* Number of bytes the decoder produces. */ +off_t decoder_synth_bytes(mpg123_handle *fr, off_t s) +{ + return s * fr->af.dec_encsize * fr->af.channels; +} + +/* Samples/bytes for output buffer after post-processing. */ +/* take into account: channels, bytes per sample -- NOT resampling!*/ +off_t samples_to_bytes(mpg123_handle *fr , off_t s) +{ + return s * fr->af.encsize * fr->af.channels; +} + +off_t bytes_to_samples(mpg123_handle *fr , off_t b) +{ + return b / fr->af.encsize / fr->af.channels; +} + +/* Number of bytes needed for decoding _and_ post-processing. */ +off_t outblock_bytes(mpg123_handle *fr, off_t s) +{ + int encsize = (fr->af.encoding & MPG123_ENC_24) + ? 4 /* Intermediate 32 bit. */ + : (fr->af.encsize > fr->af.dec_encsize + ? fr->af.encsize + : fr->af.dec_encsize); + return s * encsize * fr->af.channels; +} + +#ifndef NO_32BIT +/* Remove every fourth byte, facilitating conversion from 32 bit to 24 bit integers. + This has to be aware of endianness, of course. */ +static void chop_fourth_byte(struct outbuffer *buf) +{ + unsigned char *wpos = buf->data; + unsigned char *rpos = buf->data; +#ifdef WORDS_BIGENDIAN + while((size_t) (rpos - buf->data + 4) <= buf->fill) + { + /* Really stupid: Copy, increment. Byte per byte. */ + *wpos = *rpos; + wpos++; rpos++; + *wpos = *rpos; + wpos++; rpos++; + *wpos = *rpos; + wpos++; rpos++; + rpos++; /* Skip the lowest byte (last). */ + } +#else + while((size_t) (rpos - buf->data + 4) <= buf->fill) + { + /* Really stupid: Copy, increment. Byte per byte. */ + rpos++; /* Skip the lowest byte (first). */ + *wpos = *rpos; + wpos++; rpos++; + *wpos = *rpos; + wpos++; rpos++; + *wpos = *rpos; + wpos++; rpos++; + } +#endif + buf->fill = wpos-buf->data; +} + +static void conv_s32_to_u32(struct outbuffer *buf) +{ + size_t i; + int32_t *ssamples = (int32_t*) buf->data; + uint32_t *usamples = (uint32_t*) buf->data; + size_t count = buf->fill/sizeof(int32_t); + + for(i=0; i= 0) + usamples[i] = (uint32_t)ssamples[i] + 2147483647+1; + /* The smallest value goes zero. */ + else if(ssamples[i] == ((int32_t)-2147483647-1)) + usamples[i] = 0; + /* Now -value is in the positive range of signed int ... so it's a possible value at all. */ + else + usamples[i] = (uint32_t)2147483647+1 - (uint32_t)(-ssamples[i]); + } +} + +#endif + + +/* We always assume that whole numbers are written! + partials will be cut out. */ + +static const char *bufsizeerr = "Fatal: Buffer too small for postprocessing!"; + + +#ifndef NO_16BIT + +static void conv_s16_to_u16(struct outbuffer *buf) +{ + size_t i; + int16_t *ssamples = (int16_t*) buf->data; + uint16_t *usamples = (uint16_t*)buf->data; + size_t count = buf->fill/sizeof(int16_t); + + for(i=0; idata; + float *out = (float*) buf->data; + size_t count = buf->fill/sizeof(int16_t); + /* Does that make any sense? In x86, there is an actual instruction to divide + float by integer ... but then, if we have that FPU, we don't really need + fixed point decoder hacks ...? */ + float scale = 1./SHORT_SCALE; + + if(buf->size < count*sizeof(float)) + { + error1("%s", bufsizeerr); + return; + } + + /* Work from the back since output is bigger. */ + for(i=count-1; i>=0; --i) + out[i] = (float)in[i] * scale; + + buf->fill = count*sizeof(float); +} +#endif + +#ifndef NO_32BIT +static void conv_s16_to_s32(struct outbuffer *buf) +{ + ssize_t i; + int16_t *in = (int16_t*) buf->data; + int32_t *out = (int32_t*) buf->data; + size_t count = buf->fill/sizeof(int16_t); + + if(buf->size < count*sizeof(int32_t)) + { + error1("%s", bufsizeerr); + return; + } + + /* Work from the back since output is bigger. */ + for(i=count-1; i>=0; --i) + { + out[i] = in[i]; + /* Could just shift bytes, but would have to mess with sign bit. */ + out[i] *= S32_RESCALE; + } + + buf->fill = count*sizeof(int32_t); +} +#endif +#endif + + +void postprocess_buffer(mpg123_handle *fr) +{ + /* + This caters for the final output formats that are never produced by + decoder synth directly (wide unsigned and 24 bit formats) or that are + missing because of limited decoder precision (16 bit synth but 32 or + 24 bit output). + */ + switch(fr->af.dec_enc) + { +#ifndef NO_32BIT + case MPG123_ENC_SIGNED_32: + switch(fr->af.encoding) + { + case MPG123_ENC_UNSIGNED_32: + conv_s32_to_u32(&fr->buffer); + break; + case MPG123_ENC_UNSIGNED_24: + conv_s32_to_u32(&fr->buffer); + chop_fourth_byte(&fr->buffer); + break; + case MPG123_ENC_SIGNED_24: + chop_fourth_byte(&fr->buffer); + break; + } + break; +#endif +#ifndef NO_16BIT + case MPG123_ENC_SIGNED_16: + switch(fr->af.encoding) + { + case MPG123_ENC_UNSIGNED_16: + conv_s16_to_u16(&fr->buffer); + break; +#ifndef NO_REAL + case MPG123_ENC_FLOAT_32: + conv_s16_to_f32(&fr->buffer); + break; +#endif +#ifndef NO_32BIT + case MPG123_ENC_SIGNED_32: + conv_s16_to_s32(&fr->buffer); + break; + case MPG123_ENC_UNSIGNED_32: + conv_s16_to_s32(&fr->buffer); + conv_s32_to_u32(&fr->buffer); + break; + case MPG123_ENC_UNSIGNED_24: + conv_s16_to_s32(&fr->buffer); + conv_s32_to_u32(&fr->buffer); + chop_fourth_byte(&fr->buffer); + break; + case MPG123_ENC_SIGNED_24: + conv_s16_to_s32(&fr->buffer); + chop_fourth_byte(&fr->buffer); + break; +#endif + } + break; +#endif + } +} diff --git a/src/libmpg123/frame.c b/src/libmpg123/frame.c new file mode 100644 index 0000000..f714fb0 --- /dev/null +++ b/src/libmpg123/frame.c @@ -0,0 +1,1025 @@ +/* + frame: Heap of routines dealing with the core mpg123 data structure. + + copyright 2008-2014 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "mpg123lib_intern.h" +#include "getcpuflags.h" +#include "debug.h" + +static void frame_fixed_reset(mpg123_handle *fr); + +/* that's doubled in decode_ntom.c */ +#define NTOM_MUL (32768) + +#define aligned_pointer(p, type, alignment) align_the_pointer(p, alignment) +static void *align_the_pointer(void *base, unsigned int alignment) +{ + /* + Work in unsigned integer realm, explicitly. + Tricking the compiler into integer operations like % by invoking base-NULL is dangerous: It results into ptrdiff_t, which gets negative on big addresses. Big screw up, that. + I try to do it "properly" here: Casting only to uintptr_t and no artihmethic with void*. + */ + uintptr_t baseval = (uintptr_t)(char*)base; + uintptr_t aoff = baseval % alignment; + + debug3("align_the_pointer: pointer %p is off by %u from %u", + base, (unsigned int)aoff, alignment); + + if(aoff) return (char*)base+alignment-aoff; + else return base; +} + +static void frame_default_pars(mpg123_pars *mp) +{ + mp->outscale = 1.0; + mp->flags = 0; +#ifdef GAPLESS + mp->flags |= MPG123_GAPLESS; +#endif + mp->flags |= MPG123_AUTO_RESAMPLE; +#ifndef NO_NTOM + mp->force_rate = 0; +#endif + mp->down_sample = 0; + mp->rva = 0; + mp->halfspeed = 0; + mp->doublespeed = 0; + mp->verbose = 0; +#ifndef NO_ICY + mp->icy_interval = 0; +#endif + mp->timeout = 0; + mp->resync_limit = 1024; +#ifdef FRAME_INDEX + mp->index_size = INDEX_SIZE; +#endif + mp->preframes = 4; /* That's good for layer 3 ISO compliance bitstream. */ + mpg123_fmt_all(mp); + /* Default of keeping some 4K buffers at hand, should cover the "usual" use case (using 16K pipe buffers as role model). */ +#ifndef NO_FEEDER + mp->feedpool = 5; + mp->feedbuffer = 4096; +#endif +} + +void frame_init(mpg123_handle *fr) +{ + frame_init_par(fr, NULL); +} + +void frame_init_par(mpg123_handle *fr, mpg123_pars *mp) +{ + fr->own_buffer = TRUE; + fr->buffer.data = NULL; + fr->buffer.rdata = NULL; + fr->buffer.fill = 0; + fr->buffer.size = 0; + fr->rawbuffs = NULL; + fr->rawbuffss = 0; + fr->rawdecwin = NULL; + fr->rawdecwins = 0; +#ifndef NO_8BIT + fr->conv16to8_buf = NULL; +#endif +#ifdef OPT_DITHER + fr->dithernoise = NULL; +#endif + fr->layerscratch = NULL; + fr->xing_toc = NULL; + fr->cpu_opts.type = defdec(); + fr->cpu_opts.class = decclass(fr->cpu_opts.type); +#ifndef NO_NTOM + /* these two look unnecessary, check guarantee for synth_ntom_set_step (in control_generic, even)! */ + fr->ntom_val[0] = NTOM_MUL>>1; + fr->ntom_val[1] = NTOM_MUL>>1; + fr->ntom_step = NTOM_MUL; +#endif + /* unnecessary: fr->buffer.size = fr->buffer.fill = 0; */ + mpg123_reset_eq(fr); + init_icy(&fr->icy); + init_id3(fr); + /* frame_outbuffer is missing... */ + /* frame_buffers is missing... that one needs cpu opt setting! */ + /* after these... frame_reset is needed before starting full decode */ + invalidate_format(&fr->af); + fr->rdat.r_read = NULL; + fr->rdat.r_lseek = NULL; + fr->rdat.iohandle = NULL; + fr->rdat.r_read_handle = NULL; + fr->rdat.r_lseek_handle = NULL; + fr->rdat.cleanup_handle = NULL; + fr->wrapperdata = NULL; + fr->wrapperclean = NULL; + fr->decoder_change = 1; + fr->err = MPG123_OK; + if(mp == NULL) frame_default_pars(&fr->p); + else memcpy(&fr->p, mp, sizeof(struct mpg123_pars_struct)); + +#ifndef NO_FEEDER + bc_prepare(&fr->rdat.buffer, fr->p.feedpool, fr->p.feedbuffer); +#endif + + fr->down_sample = 0; /* Initialize to silence harmless errors when debugging. */ + frame_fixed_reset(fr); /* Reset only the fixed data, dynamic buffers are not there yet! */ + fr->synth = NULL; + fr->synth_mono = NULL; + fr->make_decode_tables = NULL; +#ifdef FRAME_INDEX + fi_init(&fr->index); + frame_index_setup(fr); /* Apply the size setting. */ +#endif +} + +#ifdef OPT_DITHER +/* Also, only allocate the memory for the table on demand. + In future, one could create special noise for different sampling frequencies(?). */ +int frame_dither_init(mpg123_handle *fr) +{ + /* run-time dither noise table generation */ + if(fr->dithernoise == NULL) + { + fr->dithernoise = malloc(sizeof(float)*DITHERSIZE); + if(fr->dithernoise == NULL) return 0; + + dither_table_init(fr->dithernoise); + } + return 1; +} +#endif + +mpg123_pars attribute_align_arg *mpg123_new_pars(int *error) +{ + mpg123_pars *mp = malloc(sizeof(struct mpg123_pars_struct)); + if(mp != NULL){ frame_default_pars(mp); if(error != NULL) *error = MPG123_OK; } + else if(error != NULL) *error = MPG123_OUT_OF_MEM; + return mp; +} + +void attribute_align_arg mpg123_delete_pars(mpg123_pars* mp) +{ + if(mp != NULL) free(mp); +} + +int attribute_align_arg mpg123_reset_eq(mpg123_handle *mh) +{ + int i; + if(mh == NULL) return MPG123_BAD_HANDLE; +#ifndef NO_EQUALIZER + mh->have_eq_settings = 0; + for(i=0; i < 32; ++i) mh->equalizer[0][i] = mh->equalizer[1][i] = DOUBLE_TO_REAL(1.0); +#endif + return MPG123_OK; +} + +int frame_outbuffer(mpg123_handle *fr) +{ + size_t size = fr->outblock; + if(!fr->own_buffer) + { + if(fr->buffer.size < size) + { + fr->err = MPG123_BAD_BUFFER; + if(NOQUIET) error2("have external buffer of size %"SIZE_P", need %"SIZE_P, (size_p)fr->buffer.size, (size_p)size); + + return MPG123_ERR; + } + } + + debug1("need frame buffer of %"SIZE_P, (size_p)size); + if(fr->buffer.rdata != NULL && fr->buffer.size != size) + { + free(fr->buffer.rdata); + fr->buffer.rdata = NULL; + } + fr->buffer.size = size; + fr->buffer.data = NULL; + /* be generous: use 16 byte alignment */ + if(fr->buffer.rdata == NULL) fr->buffer.rdata = (unsigned char*) malloc(fr->buffer.size+15); + if(fr->buffer.rdata == NULL) + { + fr->err = MPG123_OUT_OF_MEM; + return MPG123_ERR; + } + fr->buffer.data = aligned_pointer(fr->buffer.rdata, unsigned char*, 16); + fr->own_buffer = TRUE; + fr->buffer.fill = 0; + return MPG123_OK; +} + +int attribute_align_arg mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size) +{ + debug2("replace buffer with %p size %"SIZE_P, data, (size_p)size); + if(mh == NULL) return MPG123_BAD_HANDLE; + /* Will accept any size, the error comes later... */ + if(data == NULL) + { + mh->err = MPG123_BAD_BUFFER; + return MPG123_ERR; + } + if(mh->buffer.rdata != NULL) free(mh->buffer.rdata); + mh->own_buffer = FALSE; + mh->buffer.rdata = NULL; + mh->buffer.data = data; + mh->buffer.size = size; + mh->buffer.fill = 0; + return MPG123_OK; +} + +#ifdef FRAME_INDEX +int frame_index_setup(mpg123_handle *fr) +{ + int ret = MPG123_ERR; + if(fr->p.index_size >= 0) + { /* Simple fixed index. */ + fr->index.grow_size = 0; + debug1("resizing index to %li", fr->p.index_size); + ret = fi_resize(&fr->index, (size_t)fr->p.index_size); + debug2("index resized... %lu at %p", (unsigned long)fr->index.size, (void*)fr->index.data); + } + else + { /* A growing index. We give it a start, though. */ + fr->index.grow_size = (size_t)(- fr->p.index_size); + if(fr->index.size < fr->index.grow_size) + ret = fi_resize(&fr->index, fr->index.grow_size); + else + ret = MPG123_OK; /* We have minimal size already... and since growing is OK... */ + } + debug2("set up frame index of size %lu (ret=%i)", (unsigned long)fr->index.size, ret); + + return ret; +} +#endif + +static void frame_decode_buffers_reset(mpg123_handle *fr) +{ + if(fr->rawbuffs) /* memset(NULL, 0, 0) not desired */ + memset(fr->rawbuffs, 0, fr->rawbuffss); +} + +int frame_buffers(mpg123_handle *fr) +{ + int buffssize = 0; + debug1("frame %p buffer", (void*)fr); +/* + the used-to-be-static buffer of the synth functions, has some subtly different types/sizes + + 2to1, 4to1, ntom, generic, i386: real[2][2][0x110] + mmx, sse: short[2][2][0x110] + i586(_dither): 4352 bytes; int/long[2][2][0x110] + i486: int[2][2][17*FIR_BUFFER_SIZE] + altivec: static real __attribute__ ((aligned (16))) buffs[4][4][0x110] + + Huh, altivec looks like fun. Well, let it be large... then, the 16 byte alignment seems to be implicit on MacOSX malloc anyway. + Let's make a reasonable attempt to allocate enough memory... + Keep in mind: biggest ones are i486 and altivec (mutually exclusive!), then follows i586 and normal real. + mmx/sse use short but also real for resampling. + Thus, minimum is 2*2*0x110*sizeof(real). +*/ + if(fr->cpu_opts.type == altivec) buffssize = 4*4*0x110*sizeof(real); +#ifdef OPT_I486 + else if(fr->cpu_opts.type == ivier) buffssize = 2*2*17*FIR_BUFFER_SIZE*sizeof(int); +#endif + else if(fr->cpu_opts.type == ifuenf || fr->cpu_opts.type == ifuenf_dither || fr->cpu_opts.type == dreidnow) + buffssize = 2*2*0x110*4; /* don't rely on type real, we need 4352 bytes */ + + if(2*2*0x110*sizeof(real) > buffssize) + buffssize = 2*2*0x110*sizeof(real); + buffssize += 15; /* For 16-byte alignment (SSE likes that). */ + + if(fr->rawbuffs != NULL && fr->rawbuffss != buffssize) + { + free(fr->rawbuffs); + fr->rawbuffs = NULL; + } + + if(fr->rawbuffs == NULL) fr->rawbuffs = (unsigned char*) malloc(buffssize); + if(fr->rawbuffs == NULL) return -1; + fr->rawbuffss = buffssize; + fr->short_buffs[0][0] = aligned_pointer(fr->rawbuffs,short,16); + fr->short_buffs[0][1] = fr->short_buffs[0][0] + 0x110; + fr->short_buffs[1][0] = fr->short_buffs[0][1] + 0x110; + fr->short_buffs[1][1] = fr->short_buffs[1][0] + 0x110; + fr->real_buffs[0][0] = aligned_pointer(fr->rawbuffs,real,16); + fr->real_buffs[0][1] = fr->real_buffs[0][0] + 0x110; + fr->real_buffs[1][0] = fr->real_buffs[0][1] + 0x110; + fr->real_buffs[1][1] = fr->real_buffs[1][0] + 0x110; +#ifdef OPT_I486 + if(fr->cpu_opts.type == ivier) + { + fr->int_buffs[0][0] = (int*) fr->rawbuffs; + fr->int_buffs[0][1] = fr->int_buffs[0][0] + 17*FIR_BUFFER_SIZE; + fr->int_buffs[1][0] = fr->int_buffs[0][1] + 17*FIR_BUFFER_SIZE; + fr->int_buffs[1][1] = fr->int_buffs[1][0] + 17*FIR_BUFFER_SIZE; + } +#endif +#ifdef OPT_ALTIVEC + if(fr->cpu_opts.type == altivec) + { + int i,j; + fr->areal_buffs[0][0] = (real*) fr->rawbuffs; + for(i=0; i<4; ++i) for(j=0; j<4; ++j) + fr->areal_buffs[i][j] = fr->areal_buffs[0][0] + (i*4+j)*0x110; + } +#endif + /* now the different decwins... all of the same size, actually */ + /* The MMX ones want 32byte alignment, which I'll try to ensure manually */ + { + int decwin_size = (512+32)*sizeof(real); +#ifdef OPT_MMXORSSE +#ifdef OPT_MULTI + if(fr->cpu_opts.class == mmxsse) + { +#endif + /* decwin_mmx will share, decwins will be appended ... sizeof(float)==4 */ + if(decwin_size < (512+32)*4) decwin_size = (512+32)*4; + + /* the second window + alignment zone -- we align for 32 bytes for SSE as + requirement, 64 byte for matching cache line size (that matters!) */ + decwin_size += (512+32)*4 + 63; + /* (512+32)*4/32 == 2176/32 == 68, so one decwin block retains alignment for 32 or 64 bytes */ +#ifdef OPT_MULTI + } +#endif +#endif +#if defined(OPT_ALTIVEC) || defined(OPT_ARM) + /* sizeof(real) >= 4 ... yes, it could be 8, for example. + We got it intialized to at least (512+32)*sizeof(real).*/ + decwin_size += 512*sizeof(real); +#endif + /* Hm, that's basically realloc() ... */ + if(fr->rawdecwin != NULL && fr->rawdecwins != decwin_size) + { + free(fr->rawdecwin); + fr->rawdecwin = NULL; + } + + if(fr->rawdecwin == NULL) + fr->rawdecwin = (unsigned char*) malloc(decwin_size); + + if(fr->rawdecwin == NULL) return -1; + + fr->rawdecwins = decwin_size; + fr->decwin = (real*) fr->rawdecwin; +#ifdef OPT_MMXORSSE +#ifdef OPT_MULTI + if(fr->cpu_opts.class == mmxsse) + { +#endif + /* align decwin, assign that to decwin_mmx, append decwins */ + /* I need to add to decwin what is missing to the next full 64 byte -- also I want to make gcc -pedantic happy... */ + fr->decwin = aligned_pointer(fr->rawdecwin,real,64); + debug1("aligned decwin: %p", (void*)fr->decwin); + fr->decwin_mmx = (float*)fr->decwin; + fr->decwins = fr->decwin_mmx+512+32; +#ifdef OPT_MULTI + } + else debug("no decwins/decwin_mmx for that class"); +#endif +#endif + } + + /* Layer scratch buffers are of compile-time fixed size, so allocate only once. */ + if(fr->layerscratch == NULL) + { + /* Allocate specific layer1/2/3 buffers, so that we know they'll work for SSE. */ + size_t scratchsize = 0; + real *scratcher; +#ifndef NO_LAYER1 + scratchsize += sizeof(real) * 2 * SBLIMIT; +#endif +#ifndef NO_LAYER2 + scratchsize += sizeof(real) * 2 * 4 * SBLIMIT; +#endif +#ifndef NO_LAYER3 + scratchsize += sizeof(real) * 2 * SBLIMIT * SSLIMIT; /* hybrid_in */ + scratchsize += sizeof(real) * 2 * SSLIMIT * SBLIMIT; /* hybrid_out */ +#endif + /* + Now figure out correct alignment: + We need 16 byte minimum, smallest unit of the blocks is 2*SBLIMIT*sizeof(real), which is 64*4=256. Let's do 64bytes as heuristic for cache line (as proven useful in buffs above). + */ + fr->layerscratch = malloc(scratchsize+63); + if(fr->layerscratch == NULL) return -1; + + /* Get aligned part of the memory, then divide it up. */ + scratcher = aligned_pointer(fr->layerscratch,real,64); + /* Those funky pointer casts silence compilers... + One might change the code at hand to really just use 1D arrays, but in practice, that would not make a (positive) difference. */ +#ifndef NO_LAYER1 + fr->layer1.fraction = (real(*)[SBLIMIT])scratcher; + scratcher += 2 * SBLIMIT; +#endif +#ifndef NO_LAYER2 + fr->layer2.fraction = (real(*)[4][SBLIMIT])scratcher; + scratcher += 2 * 4 * SBLIMIT; +#endif +#ifndef NO_LAYER3 + fr->layer3.hybrid_in = (real(*)[SBLIMIT][SSLIMIT])scratcher; + scratcher += 2 * SBLIMIT * SSLIMIT; + fr->layer3.hybrid_out = (real(*)[SSLIMIT][SBLIMIT])scratcher; + scratcher += 2 * SSLIMIT * SBLIMIT; +#endif + /* Note: These buffers don't need resetting here. */ + } + + /* Only reset the buffers we created just now. */ + frame_decode_buffers_reset(fr); + + debug1("frame %p buffer done", (void*)fr); + return 0; +} + +int frame_buffers_reset(mpg123_handle *fr) +{ + fr->buffer.fill = 0; /* hm, reset buffer fill... did we do a flush? */ + fr->bsnum = 0; + /* Wondering: could it be actually _wanted_ to retain buffer contents over different files? (special gapless / cut stuff) */ + fr->bsbuf = fr->bsspace[1]; + fr->bsbufold = fr->bsbuf; + fr->bitreservoir = 0; + frame_decode_buffers_reset(fr); + memset(fr->bsspace, 0, 2*(MAXFRAMESIZE+512)); + memset(fr->ssave, 0, 34); + fr->hybrid_blc[0] = fr->hybrid_blc[1] = 0; + memset(fr->hybrid_block, 0, sizeof(real)*2*2*SBLIMIT*SSLIMIT); + return 0; +} + +static void frame_icy_reset(mpg123_handle* fr) +{ +#ifndef NO_ICY + if(fr->icy.data != NULL) free(fr->icy.data); + fr->icy.data = NULL; + fr->icy.interval = 0; + fr->icy.next = 0; +#endif +} + +static void frame_free_toc(mpg123_handle *fr) +{ + if(fr->xing_toc != NULL){ free(fr->xing_toc); fr->xing_toc = NULL; } +} + +/* Just copy the Xing TOC over... */ +int frame_fill_toc(mpg123_handle *fr, unsigned char* in) +{ + if(fr->xing_toc == NULL) fr->xing_toc = malloc(100); + if(fr->xing_toc != NULL) + { + memcpy(fr->xing_toc, in, 100); +#ifdef DEBUG + debug("Got a TOC! Showing the values..."); + { + int i; + for(i=0; i<100; ++i) + debug2("entry %i = %i", i, fr->xing_toc[i]); + } +#endif + return TRUE; + } + return FALSE; +} + +/* Prepare the handle for a new track. + Reset variables, buffers... */ +int frame_reset(mpg123_handle* fr) +{ + frame_buffers_reset(fr); + frame_fixed_reset(fr); + frame_free_toc(fr); +#ifdef FRAME_INDEX + fi_reset(&fr->index); +#endif + + return 0; +} + +/* Reset everythign except dynamic memory. */ +static void frame_fixed_reset(mpg123_handle *fr) +{ + frame_icy_reset(fr); + open_bad(fr); + fr->to_decode = FALSE; + fr->to_ignore = FALSE; + fr->metaflags = 0; + fr->outblock = 0; /* This will be set before decoding! */ + fr->num = -1; + fr->input_offset = -1; + fr->playnum = -1; + fr->state_flags = FRAME_ACCURATE; + fr->silent_resync = 0; + fr->audio_start = 0; + fr->clip = 0; + fr->oldhead = 0; + fr->firsthead = 0; + fr->lay = 0; + fr->vbr = MPG123_CBR; + fr->abr_rate = 0; + fr->track_frames = 0; + fr->track_samples = -1; + fr->framesize=0; + fr->mean_frames = 0; + fr->mean_framesize = 0; + fr->freesize = 0; + fr->lastscale = -1; + fr->rva.level[0] = -1; + fr->rva.level[1] = -1; + fr->rva.gain[0] = 0; + fr->rva.gain[1] = 0; + fr->rva.peak[0] = 0; + fr->rva.peak[1] = 0; + fr->fsizeold = 0; + fr->firstframe = 0; + fr->ignoreframe = fr->firstframe-fr->p.preframes; + fr->header_change = 0; + fr->lastframe = -1; + fr->fresh = 1; + fr->new_format = 0; +#ifdef GAPLESS + frame_gapless_init(fr,-1,0,0); + fr->lastoff = 0; + fr->firstoff = 0; +#endif +#ifdef OPT_I486 + fr->i486bo[0] = fr->i486bo[1] = FIR_SIZE-1; +#endif + fr->bo = 1; /* the usual bo */ +#ifdef OPT_DITHER + fr->ditherindex = 0; +#endif + reset_id3(fr); + reset_icy(&fr->icy); + /* ICY stuff should go into icy.c, eh? */ +#ifndef NO_ICY + fr->icy.interval = 0; + fr->icy.next = 0; +#endif + fr->halfphase = 0; /* here or indeed only on first-time init? */ + fr->error_protection = 0; + fr->freeformat_framesize = -1; +} + +static void frame_free_buffers(mpg123_handle *fr) +{ + if(fr->rawbuffs != NULL) free(fr->rawbuffs); + fr->rawbuffs = NULL; + fr->rawbuffss = 0; + if(fr->rawdecwin != NULL) free(fr->rawdecwin); + fr->rawdecwin = NULL; + fr->rawdecwins = 0; +#ifndef NO_8BIT + if(fr->conv16to8_buf != NULL) free(fr->conv16to8_buf); + fr->conv16to8_buf = NULL; +#endif + if(fr->layerscratch != NULL) free(fr->layerscratch); +} + +void frame_exit(mpg123_handle *fr) +{ + if(fr->buffer.rdata != NULL) + { + debug1("freeing buffer at %p", (void*)fr->buffer.rdata); + free(fr->buffer.rdata); + } + fr->buffer.rdata = NULL; + frame_free_buffers(fr); + frame_free_toc(fr); +#ifdef FRAME_INDEX + fi_exit(&fr->index); +#endif +#ifdef OPT_DITHER + if(fr->dithernoise != NULL) + { + free(fr->dithernoise); + fr->dithernoise = NULL; + } +#endif + exit_id3(fr); + clear_icy(&fr->icy); + /* Clean up possible mess from LFS wrapper. */ + if(fr->wrapperclean != NULL) + { + fr->wrapperclean(fr->wrapperdata); + fr->wrapperdata = NULL; + } +#ifndef NO_FEEDER + bc_cleanup(&fr->rdat.buffer); +#endif +} + +int attribute_align_arg mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + if(!mh->to_decode) return MPG123_ERR; + + if(header != NULL) *header = mh->oldhead; + if(bodydata != NULL) *bodydata = mh->bsbuf; + if(bodybytes != NULL) *bodybytes = mh->framesize; + + return MPG123_OK; +} + +/* + Fuzzy frame offset searching (guessing). + When we don't have an accurate position, we may use an inaccurate one. + Possibilities: + - use approximate positions from Xing TOC (not yet parsed) + - guess wildly from mean framesize and offset of first frame / beginning of file. +*/ + +static off_t frame_fuzzy_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame) +{ + /* Default is to go to the beginning. */ + off_t ret = fr->audio_start; + *get_frame = 0; + + /* But we try to find something better. */ + /* Xing VBR TOC works with relative positions, both in terms of audio frames and stream bytes. + Thus, it only works when whe know the length of things. + Oh... I assume the offsets are relative to the _total_ file length. */ + if(fr->xing_toc != NULL && fr->track_frames > 0 && fr->rdat.filelen > 0) + { + /* One could round... */ + int toc_entry = (int) ((double)want_frame*100./fr->track_frames); + /* It is an index in the 100-entry table. */ + if(toc_entry < 0) toc_entry = 0; + if(toc_entry > 99) toc_entry = 99; + + /* Now estimate back what frame we get. */ + *get_frame = (off_t) ((double)toc_entry/100. * fr->track_frames); + fr->state_flags &= ~FRAME_ACCURATE; + fr->silent_resync = 1; + /* Question: Is the TOC for whole file size (with/without ID3) or the "real" audio data only? + ID3v1 info could also matter. */ + ret = (off_t) ((double)fr->xing_toc[toc_entry]/256.* fr->rdat.filelen); + } + else if(fr->mean_framesize > 0) + { /* Just guess with mean framesize (may be exact with CBR files). */ + /* Query filelen here or not? */ + fr->state_flags &= ~FRAME_ACCURATE; /* Fuzzy! */ + fr->silent_resync = 1; + *get_frame = want_frame; + ret = (off_t) (fr->audio_start+fr->mean_framesize*want_frame); + } + debug5("fuzzy: want %li of %li, get %li at %li B of %li B", + (long)want_frame, (long)fr->track_frames, (long)*get_frame, (long)ret, (long)(fr->rdat.filelen-fr->audio_start)); + return ret; +} + +/* + find the best frame in index just before the wanted one, seek to there + then step to just before wanted one with read_frame + do not care tabout the stuff that was in buffer but not played back + everything that left the decoder is counted as played + + Decide if you want low latency reaction and accurate timing info or stable long-time playback with buffer! +*/ + +off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame) +{ + /* default is file start if no index position */ + off_t gopos = 0; + *get_frame = 0; +#ifdef FRAME_INDEX + /* Possibly use VBRI index, too? I'd need an example for this... */ + if(fr->index.fill) + { + /* find in index */ + size_t fi; + /* at index fi there is frame step*fi... */ + fi = want_frame/fr->index.step; + if(fi >= fr->index.fill) /* If we are beyond the end of frame index...*/ + { + /* When fuzzy seek is allowed, we have some limited tolerance for the frames we want to read rather then jump over. */ + if(fr->p.flags & MPG123_FUZZY && want_frame - (fr->index.fill-1)*fr->index.step > 10) + { + gopos = frame_fuzzy_find(fr, want_frame, get_frame); + if(gopos > fr->audio_start) return gopos; /* Only in that case, we have a useful guess. */ + /* Else... just continue, fuzzyness didn't help. */ + } + /* Use the last available position, slowly advancing from that one. */ + fi = fr->index.fill - 1; + } + /* We have index position, that yields frame and byte offsets. */ + *get_frame = fi*fr->index.step; + gopos = fr->index.data[fi]; + fr->state_flags |= FRAME_ACCURATE; /* When using the frame index, we are accurate. */ + } + else + { +#endif + if(fr->p.flags & MPG123_FUZZY) + return frame_fuzzy_find(fr, want_frame, get_frame); + /* A bit hackish here... but we need to be fresh when looking for the first header again. */ + fr->firsthead = 0; + fr->oldhead = 0; +#ifdef FRAME_INDEX + } +#endif + debug2("index: 0x%lx for frame %li", (unsigned long)gopos, (long) *get_frame); + return gopos; +} + +off_t frame_ins2outs(mpg123_handle *fr, off_t ins) +{ + off_t outs = 0; + switch(fr->down_sample) + { + case 0: +# ifndef NO_DOWNSAMPLE + case 1: + case 2: +# endif + outs = ins>>fr->down_sample; + break; +# ifndef NO_NTOM + case 3: outs = ntom_ins2outs(fr, ins); break; +# endif + default: error1("Bad down_sample (%i) ... should not be possible!!", fr->down_sample); + } + return outs; +} + +off_t frame_outs(mpg123_handle *fr, off_t num) +{ + off_t outs = 0; + switch(fr->down_sample) + { + case 0: +# ifndef NO_DOWNSAMPLE + case 1: + case 2: +# endif + outs = (fr->spf>>fr->down_sample)*num; + break; +#ifndef NO_NTOM + case 3: outs = ntom_frmouts(fr, num); break; +#endif + default: error1("Bad down_sample (%i) ... should not be possible!!", fr->down_sample); + } + return outs; +} + +/* Compute the number of output samples we expect from this frame. + This is either simple spf() or a tad more elaborate for ntom. */ +off_t frame_expect_outsamples(mpg123_handle *fr) +{ + off_t outs = 0; + switch(fr->down_sample) + { + case 0: +# ifndef NO_DOWNSAMPLE + case 1: + case 2: +# endif + outs = fr->spf>>fr->down_sample; + break; +#ifndef NO_NTOM + case 3: outs = ntom_frame_outsamples(fr); break; +#endif + default: error1("Bad down_sample (%i) ... should not be possible!!", fr->down_sample); + } + return outs; +} + +off_t frame_offset(mpg123_handle *fr, off_t outs) +{ + off_t num = 0; + switch(fr->down_sample) + { + case 0: +# ifndef NO_DOWNSAMPLE + case 1: + case 2: +# endif + num = outs/(fr->spf>>fr->down_sample); + break; +#ifndef NO_NTOM + case 3: num = ntom_frameoff(fr, outs); break; +#endif + default: error("Bad down_sample ... should not be possible!!"); + } + return num; +} + +#ifdef GAPLESS +/* input in _input_ samples */ +void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip) +{ + debug3("frame_gapless_init: given %"OFF_P" frames, skip %"OFF_P" and %"OFF_P, (off_p)framecount, (off_p)bskip, (off_p)eskip); + fr->gapless_frames = framecount; + if(fr->gapless_frames > 0 && bskip >=0 && eskip >= 0) + { + fr->begin_s = bskip+GAPLESS_DELAY; + fr->end_s = framecount*fr->spf-eskip+GAPLESS_DELAY; + } + else fr->begin_s = fr->end_s = 0; + /* These will get proper values later, from above plus resampling info. */ + fr->begin_os = 0; + fr->end_os = 0; + fr->fullend_os = 0; + debug2("frame_gapless_init: from %"OFF_P" to %"OFF_P" samples", (off_p)fr->begin_s, (off_p)fr->end_s); +} + +void frame_gapless_realinit(mpg123_handle *fr) +{ + fr->begin_os = frame_ins2outs(fr, fr->begin_s); + fr->end_os = frame_ins2outs(fr, fr->end_s); + if(fr->gapless_frames > 0) + fr->fullend_os = frame_ins2outs(fr, fr->gapless_frames*fr->spf); + else fr->fullend_os = 0; + + debug4("frame_gapless_realinit: from %"OFF_P" to %"OFF_P" samples (%"OFF_P", %"OFF_P")", (off_p)fr->begin_os, (off_p)fr->end_os, (off_p)fr->fullend_os, (off_p)fr->gapless_frames); +} + +/* At least note when there is trouble... */ +void frame_gapless_update(mpg123_handle *fr, off_t total_samples) +{ + off_t gapless_samples = fr->gapless_frames*fr->spf; + if(fr->gapless_frames < 1) return; + + debug2("gapless update with new sample count %"OFF_P" as opposed to known %"OFF_P, total_samples, gapless_samples); + if(NOQUIET && total_samples != gapless_samples) + fprintf(stderr, "\nWarning: Real sample count %"OFF_P" differs from given gapless sample count %"OFF_P". Frankenstein stream?\n" + , total_samples, gapless_samples); + + if(gapless_samples > total_samples) + { + if(NOQUIET) error2("End sample count smaller than gapless end! (%"OFF_P" < %"OFF_P"). Disabling gapless mode from now on.", (off_p)total_samples, (off_p)fr->end_s); + /* This invalidates the current position... but what should I do? */ + frame_gapless_init(fr, -1, 0, 0); + frame_gapless_realinit(fr); + fr->lastframe = -1; + fr->lastoff = 0; + } +} + +#endif + +/* Compute the needed frame to ignore from, for getting accurate/consistent output for intended firstframe. */ +static off_t ignoreframe(mpg123_handle *fr) +{ + off_t preshift = fr->p.preframes; + /* Layer 3 _really_ needs at least one frame before. */ + if(fr->lay==3 && preshift < 1) preshift = 1; + /* Layer 1 & 2 reall do not need more than 2. */ + if(fr->lay!=3 && preshift > 2) preshift = 2; + + return fr->firstframe - preshift; +} + +/* The frame seek... This is not simply the seek to fe*fr->spf samples in output because we think of _input_ frames here. + Seek to frame offset 1 may be just seek to 200 samples offset in output since the beginning of first frame is delay/padding. + Hm, is that right? OK for the padding stuff, but actually, should the decoder delay be better totally hidden or not? + With gapless, even the whole frame position could be advanced further than requested (since Homey don't play dat). */ +void frame_set_frameseek(mpg123_handle *fr, off_t fe) +{ + fr->firstframe = fe; +#ifdef GAPLESS + if(fr->p.flags & MPG123_GAPLESS && fr->gapless_frames > 0) + { + /* Take care of the beginning... */ + off_t beg_f = frame_offset(fr, fr->begin_os); + if(fe <= beg_f) + { + fr->firstframe = beg_f; + fr->firstoff = fr->begin_os - frame_outs(fr, beg_f); + } + else fr->firstoff = 0; + /* The end is set once for a track at least, on the frame_set_frameseek called in get_next_frame() */ + if(fr->end_os > 0) + { + fr->lastframe = frame_offset(fr,fr->end_os); + fr->lastoff = fr->end_os - frame_outs(fr, fr->lastframe); + } else {fr->lastframe = -1; fr->lastoff = 0; } + } else { fr->firstoff = fr->lastoff = 0; fr->lastframe = -1; } +#endif + fr->ignoreframe = ignoreframe(fr); +#ifdef GAPLESS + debug5("frame_set_frameseek: begin at %li frames and %li samples, end at %li and %li; ignore from %li", + (long) fr->firstframe, (long) fr->firstoff, + (long) fr->lastframe, (long) fr->lastoff, (long) fr->ignoreframe); +#else + debug3("frame_set_frameseek: begin at %li frames, end at %li; ignore from %li", + (long) fr->firstframe, (long) fr->lastframe, (long) fr->ignoreframe); +#endif +} + +void frame_skip(mpg123_handle *fr) +{ +#ifndef NO_LAYER3 + if(fr->lay == 3) set_pointer(fr, 512); +#endif +} + +/* Sample accurate seek prepare for decoder. */ +/* This gets unadjusted output samples and takes resampling into account */ +void frame_set_seek(mpg123_handle *fr, off_t sp) +{ + fr->firstframe = frame_offset(fr, sp); + debug1("frame_set_seek: from %"OFF_P, fr->num); +#ifndef NO_NTOM + if(fr->down_sample == 3) ntom_set_ntom(fr, fr->firstframe); +#endif + fr->ignoreframe = ignoreframe(fr); +#ifdef GAPLESS /* The sample offset is used for non-gapless mode, too! */ + fr->firstoff = sp - frame_outs(fr, fr->firstframe); + debug5("frame_set_seek: begin at %li frames and %li samples, end at %li and %li; ignore from %li", + (long) fr->firstframe, (long) fr->firstoff, + (long) fr->lastframe, (long) fr->lastoff, (long) fr->ignoreframe); +#else + debug3("frame_set_seek: begin at %li frames, end at %li; ignore from %li", + (long) fr->firstframe, (long) fr->lastframe, (long) fr->ignoreframe); +#endif +} + +int attribute_align_arg mpg123_volume_change(mpg123_handle *mh, double change) +{ + if(mh == NULL) return MPG123_ERR; + return mpg123_volume(mh, change + (double) mh->p.outscale); +} + +int attribute_align_arg mpg123_volume(mpg123_handle *mh, double vol) +{ + if(mh == NULL) return MPG123_ERR; + + if(vol >= 0) mh->p.outscale = vol; + else mh->p.outscale = 0.; + + do_rva(mh); + return MPG123_OK; +} + +static int get_rva(mpg123_handle *fr, double *peak, double *gain) +{ + double p = -1; + double g = 0; + int ret = 0; + if(fr->p.rva) + { + int rt = 0; + /* Should one assume a zero RVA as no RVA? */ + if(fr->p.rva == 2 && fr->rva.level[1] != -1) rt = 1; + if(fr->rva.level[rt] != -1) + { + p = fr->rva.peak[rt]; + g = fr->rva.gain[rt]; + ret = 1; /* Success. */ + } + } + if(peak != NULL) *peak = p; + if(gain != NULL) *gain = g; + return ret; +} + +/* adjust the volume, taking both fr->outscale and rva values into account */ +void do_rva(mpg123_handle *fr) +{ + double peak = 0; + double gain = 0; + double newscale; + double rvafact = 1; + if(get_rva(fr, &peak, &gain)) + { + if(NOQUIET && fr->p.verbose > 1) fprintf(stderr, "Note: doing RVA with gain %f\n", gain); + rvafact = pow(10,gain/20); + } + + newscale = fr->p.outscale*rvafact; + + /* if peak is unknown (== 0) this check won't hurt */ + if((peak*newscale) > 1.0) + { + newscale = 1.0/peak; + warning2("limiting scale value to %f to prevent clipping with indicated peak factor of %f", newscale, peak); + } + /* first rva setting is forced with fr->lastscale < 0 */ + if(newscale != fr->lastscale || fr->decoder_change) + { + debug3("changing scale value from %f to %f (peak estimated to %f)", fr->lastscale != -1 ? fr->lastscale : fr->p.outscale, newscale, (double) (newscale*peak)); + fr->lastscale = newscale; + /* It may be too early, actually. */ + if(fr->make_decode_tables != NULL) fr->make_decode_tables(fr); /* the actual work */ + } +} + + +int attribute_align_arg mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db) +{ + if(mh == NULL) return MPG123_ERR; + if(base) *base = mh->p.outscale; + if(really) *really = mh->lastscale; + get_rva(mh, NULL, rva_db); + return MPG123_OK; +} + +off_t attribute_align_arg mpg123_framepos(mpg123_handle *mh) +{ + if(mh == NULL) return MPG123_ERR; + + return mh->input_offset; +} diff --git a/src/libmpg123/frame.h b/src/libmpg123/frame.h new file mode 100644 index 0000000..1087090 --- /dev/null +++ b/src/libmpg123/frame.h @@ -0,0 +1,414 @@ +/* + frame: Central data structures and opmitization hooks. + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#ifndef MPG123_FRAME_H +#define MPG123_FRAME_H + +#include +#include "config.h" +#include "mpg123.h" +#include "optimize.h" +#include "id3.h" +#include "icy.h" +#include "reader.h" +#ifdef FRAME_INDEX +#include "index.h" +#endif +#include "synths.h" + +#ifdef OPT_DITHER +#include "dither.h" +int frame_dither_init(mpg123_handle *fr); +#endif + +/* max = 1728 */ +#define MAXFRAMESIZE 3456 + +struct al_table +{ + short bits; + short d; +}; + +/* the output buffer, used to be pcm_sample, pcm_point and audiobufsize */ +struct outbuffer +{ + unsigned char *data; /* main data pointer, aligned */ + unsigned char *p; /* read pointer */ + size_t fill; /* fill from read pointer */ + size_t size; + unsigned char *rdata; /* unaligned base pointer */ +}; + +struct audioformat +{ + int encoding; /* Final encoding, after post-processing. */ + int encsize; /* Size of one sample in bytes, plain int should be fine here... */ + int dec_enc; /* Encoding of decoder synth. */ + int dec_encsize; /* Size of one decoder sample. */ + int channels; + long rate; +}; + +void invalidate_format(struct audioformat *af); + +struct mpg123_pars_struct +{ + int verbose; /* verbose level */ + long flags; /* combination of above */ +#ifndef NO_NTOM + long force_rate; +#endif + int down_sample; + int rva; /* (which) rva to do: 0: nothing, 1: radio/mix/track 2: album/audiophile */ + long halfspeed; + long doublespeed; + long timeout; +#define NUM_CHANNELS 2 + char audio_caps[NUM_CHANNELS][MPG123_RATES+1][MPG123_ENCODINGS]; +/* long start_frame; */ /* frame offset to begin with */ +/* long frame_number;*/ /* number of frames to decode */ +#ifndef NO_ICY + long icy_interval; +#endif + double outscale; + long resync_limit; + long index_size; /* Long, because: negative values have a meaning. */ + long preframes; +#ifndef NO_FEEDER + long feedpool; + long feedbuffer; +#endif +}; + +enum frame_state_flags +{ + FRAME_ACCURATE = 0x1 /**< 0001 Positions are considered accurate. */ + ,FRAME_FRANKENSTEIN = 0x2 /**< 0010 This stream is concatenated. */ + ,FRAME_FRESH_DECODER = 0x4 /**< 0100 Decoder is fleshly initialized. */ +}; + +/* There is a lot to condense here... many ints can be merged as flags; though the main space is still consumed by buffers. */ +struct mpg123_handle_struct +{ + int fresh; /* to be moved into flags */ + int new_format; + real hybrid_block[2][2][SBLIMIT*SSLIMIT]; + int hybrid_blc[2]; + /* the scratch vars for the decoders, sometimes real, sometimes short... sometimes int/long */ + short *short_buffs[2][2]; + real *real_buffs[2][2]; + unsigned char *rawbuffs; + int rawbuffss; +#ifdef OPT_I486 + int i486bo[2]; +#endif + int bo; /* Just have it always here. */ +#ifdef OPT_DITHER + int ditherindex; + float *dithernoise; +#endif + unsigned char* rawdecwin; /* the block with all decwins */ + int rawdecwins; /* size of rawdecwin memory */ + real *decwin; /* _the_ decode table */ +#ifdef OPT_MMXORSSE + /* I am not really sure that I need both of them... used in assembler */ + float *decwin_mmx; + float *decwins; +#endif +#ifndef NO_EQUALIZER + int have_eq_settings; + real equalizer[2][32]; +#endif + /* for halfspeed mode */ + unsigned char ssave[34]; + int halfphase; +#ifndef NO_8BIT + /* a raw buffer and a pointer into the middle for signed short conversion, only allocated on demand */ + unsigned char *conv16to8_buf; + unsigned char *conv16to8; +#endif + /* There's some possible memory saving for stuff that is not _really_ dynamic. */ + + /* layer3 */ + int longLimit[9][23]; + int shortLimit[9][14]; + real gainpow2[256+118+4]; /* not really dynamic, just different for mmx */ + + /* layer2 */ + real muls[27][64]; /* also used by layer 1 */ + +#ifndef NO_NTOM + /* decode_ntom */ + unsigned long ntom_val[2]; + unsigned long ntom_step; +#endif + /* special i486 fun */ +#ifdef OPT_I486 + int *int_buffs[2][2]; +#endif + /* special altivec... */ +#ifdef OPT_ALTIVEC + real *areal_buffs[4][4]; +#endif + struct synth_s synths; + struct + { +#ifdef OPT_MULTI + +#ifndef NO_LAYER3 +#if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX || defined OPT_NEON || defined OPT_NEON64) + void (*the_dct36)(real *,real *,real *,real *,real *); +#endif +#endif + +#endif + enum optdec type; + enum optcla class; + } cpu_opts; + + int verbose; /* 0: nothing, 1: just print chosen decoder, 2: be verbose */ + + const struct al_table *alloc; + /* The runtime-chosen decoding, based on input and output format. */ + func_synth synth; + func_synth_stereo synth_stereo; + func_synth_mono synth_mono; + /* Yes, this function is runtime-switched, too. */ + void (*make_decode_tables)(mpg123_handle *fr); /* That is the volume control. */ + + int stereo; /* I _think_ 1 for mono and 2 for stereo */ + int jsbound; +#define SINGLE_STEREO -1 +#define SINGLE_LEFT 0 +#define SINGLE_RIGHT 1 +#define SINGLE_MIX 3 + int single; + int II_sblimit; + int down_sample_sblimit; + int lsf; /* 0: MPEG 1.0; 1: MPEG 2.0/2.5 -- both used as bool and array index! */ + /* Many flags in disguise as integers... wasting bytes. */ + int mpeg25; + int down_sample; + int header_change; + int lay; + long spf; /* cached count of samples per frame */ + int (*do_layer)(mpg123_handle *); + int error_protection; + int bitrate_index; + int sampling_frequency; + int padding; + int extension; + int mode; + int mode_ext; + int copyright; + int original; + int emphasis; + int framesize; /* computed framesize */ + int freesize; /* free format frame size */ + enum mpg123_vbr vbr; /* 1 if variable bitrate was detected */ + off_t num; /* frame offset ... */ + off_t input_offset; /* byte offset of this frame in input stream */ + off_t playnum; /* playback offset... includes repetitions, reset at seeks */ + off_t audio_start; /* The byte offset in the file where audio data begins. */ + int state_flags; + char silent_resync; /* Do not complain for the next n resyncs. */ + unsigned char* xing_toc; /* The seek TOC from Xing header. */ + int freeformat; + long freeformat_framesize; + + /* bitstream info; bsi */ + int bitindex; + unsigned char *wordpointer; + /* temporary storage for getbits stuff */ + unsigned long ultmp; + unsigned char uctmp; + + /* rva data, used in common.c, set in id3.c */ + + double maxoutburst; /* The maximum amplitude in current sample represenation. */ + double lastscale; + struct + { + int level[2]; + float gain[2]; + float peak[2]; + } rva; + + /* input data */ + off_t track_frames; + off_t track_samples; + double mean_framesize; + off_t mean_frames; + int fsizeold; + int ssize; + unsigned int bitreservoir; + unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */ + unsigned char *bsbuf; + unsigned char *bsbufold; + int bsnum; + /* That is the header matching the last read frame body. */ + unsigned long oldhead; + /* That is the header that is supposedly the first of the stream. */ + unsigned long firsthead; + int abr_rate; +#ifdef FRAME_INDEX + struct frame_index index; +#endif + + /* output data */ + struct outbuffer buffer; + struct audioformat af; + int own_buffer; + size_t outblock; /* number of bytes that this frame produces (upper bound) */ + int to_decode; /* this frame holds data to be decoded */ + int to_ignore; /* the same, somehow */ + off_t firstframe; /* start decoding from here */ + off_t lastframe; /* last frame to decode (for gapless or num_frames limit) */ + off_t ignoreframe; /* frames to decode but discard before firstframe */ +#ifdef GAPLESS + off_t gapless_frames; /* frame count for the gapless part */ + off_t firstoff; /* number of samples to ignore from firstframe */ + off_t lastoff; /* number of samples to use from lastframe */ + off_t begin_s; /* overall begin offset in samples */ + off_t begin_os; + off_t end_s; /* overall end offset in samples */ + off_t end_os; + off_t fullend_os; /* gapless_frames translated to output samples */ +#endif + unsigned int crc; /* Well, I need a safe 16bit type, actually. But wider doesn't hurt. */ + struct reader *rd; /* pointer to the reading functions */ + struct reader_data rdat; /* reader data and state info */ + struct mpg123_pars_struct p; + int err; + int decoder_change; + int delayed_change; + long clip; + /* the meta crap */ + int metaflags; + unsigned char id3buf[128]; +#ifndef NO_ID3V2 + mpg123_id3v2 id3v2; +#endif +#ifndef NO_ICY + struct icy_meta icy; +#endif + /* + More variables needed for decoders, layerX.c. + This time it is not about static variables but about the need for alignment which cannot be guaranteed on the stack by certain compilers (Sun Studio). + We do not require the compiler to align stuff for our hand-written assembly. We only hope that it's able to align stuff for SSE and similar ops it generates itself. + */ + /* + Those layer-specific structs could actually share memory, as they are not in use simultaneously. One might allocate on decoder switch, too. + They all reside in one lump of memory (after each other), allocated to layerscratch. + */ + real *layerscratch; +#ifndef NO_LAYER1 + struct + { + real (*fraction)[SBLIMIT]; /* ALIGNED(16) real fraction[2][SBLIMIT]; */ + } layer1; +#endif +#ifndef NO_LAYER2 + struct + { + real (*fraction)[4][SBLIMIT]; /* ALIGNED(16) real fraction[2][4][SBLIMIT] */ + } layer2; +#endif +#ifndef NO_LAYER3 + /* These are significant chunks of memory already... */ + struct + { + real (*hybrid_in)[SBLIMIT][SSLIMIT]; /* ALIGNED(16) real hybridIn[2][SBLIMIT][SSLIMIT]; */ + real (*hybrid_out)[SSLIMIT][SBLIMIT]; /* ALIGNED(16) real hybridOut[2][SSLIMIT][SBLIMIT]; */ + } layer3; +#endif + /* A place for storing additional data for the large file wrapper. + This is cruft! */ + void *wrapperdata; + /* A callback used to properly destruct the wrapper data. */ + void (*wrapperclean)(void*); +}; + +/* generic init, does not include dynamic buffers */ +void frame_init(mpg123_handle *fr); +void frame_init_par(mpg123_handle *fr, mpg123_pars *mp); +/* output buffer and format */ +int frame_outbuffer(mpg123_handle *fr); +int frame_output_format(mpg123_handle *fr); + +int frame_buffers(mpg123_handle *fr); /* various decoder buffers, needed once */ +int frame_reset(mpg123_handle* fr); /* reset for next track */ +int frame_buffers_reset(mpg123_handle *fr); +void frame_exit(mpg123_handle *fr); /* end, free all buffers */ + +/* Index functions... */ +/* Well... print it... */ +int mpg123_print_index(mpg123_handle *fr, FILE* out); +/* Find a seek position in index. */ +off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame); +/* Apply index_size setting. */ +int frame_index_setup(mpg123_handle *fr); + +void do_volume(mpg123_handle *fr, double factor); +void do_rva(mpg123_handle *fr); + +/* samples per frame ... +Layer I +Layer II +Layer III +MPEG-1 +384 +1152 +1152 +MPEG-2 LSF +384 +1152 +576 +MPEG 2.5 +384 +1152 +576 +*/ + +#ifdef GAPLESS +/* well, I take that one for granted... at least layer3 */ +#define GAPLESS_DELAY 529 +void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip); +void frame_gapless_realinit(mpg123_handle *fr); +void frame_gapless_update(mpg123_handle *mh, off_t total_samples); +/*void frame_gapless_position(mpg123_handle* fr); +void frame_gapless_bytify(mpg123_handle *fr); +void frame_gapless_ignore(mpg123_handle *fr, off_t frames);*/ +/* void frame_gapless_buffercheck(mpg123_handle *fr); */ +#endif + +/* Number of samples the decoding of the current frame should yield. */ +off_t frame_expect_outsamples(mpg123_handle *fr); + +/* Skip this frame... do some fake action to get away without actually decoding it. */ +void frame_skip(mpg123_handle *fr); + +/* + Seeking core functions: + - convert input sample offset to output sample offset + - convert frame offset to output sample offset + - get leading frame offset for output sample offset + The offsets are "unadjusted"/internal; resampling is being taken care of. +*/ +off_t frame_ins2outs(mpg123_handle *fr, off_t ins); +off_t frame_outs(mpg123_handle *fr, off_t num); +/* This one just computes the expected sample count for _this_ frame. */ +off_t frame_expect_outsampels(mpg123_handle *fr); +off_t frame_offset(mpg123_handle *fr, off_t outs); +void frame_set_frameseek(mpg123_handle *fr, off_t fe); +void frame_set_seek(mpg123_handle *fr, off_t sp); +off_t frame_tell_seek(mpg123_handle *fr); +/* Take a copy of the Xing VBR TOC for fuzzy seeking. */ +int frame_fill_toc(mpg123_handle *fr, unsigned char* in); +#endif diff --git a/src/libmpg123/gapless.h b/src/libmpg123/gapless.h new file mode 100644 index 0000000..a98b86b --- /dev/null +++ b/src/libmpg123/gapless.h @@ -0,0 +1,119 @@ +/* + sampleadjust: gapless sample offset math + + copyright 1995-2012 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + This is no stand-alone header, precisely to be able to fool it into using fake handle types for testing the math. +*/ + +#include "debug.h" + +#ifdef GAPLESS +/* From internal sample number to external. */ +static off_t sample_adjust(mpg123_handle *mh, off_t x) +{ + off_t s; + if(mh->p.flags & MPG123_GAPLESS) + { + /* It's a bit tricky to do this computation for the padding samples. + They are not there on the outside. */ + if(x > mh->end_os) + { + if(x < mh->fullend_os) + s = mh->end_os - mh->begin_os; + else + s = x - (mh->fullend_os - mh->end_os + mh->begin_os); + } + else + s = x - mh->begin_os; + } + else + s = x; + + return s; +} + +/* from external samples to internal */ +static off_t sample_unadjust(mpg123_handle *mh, off_t x) +{ + off_t s; + if(mh->p.flags & MPG123_GAPLESS) + { + s = x + mh->begin_os; + /* There is a hole; we don't create sample positions in there. + Jump from the end of the gapless track directly to after the padding. */ + if(s >= mh->end_os) + s += mh->fullend_os - mh->end_os; + } + else s = x; + + return s; +} + +/* + Take the buffer after a frame decode (strictly: it is the data from frame fr->num!) and cut samples out. + fr->buffer.fill may then be smaller than before... +*/ +static void frame_buffercheck(mpg123_handle *fr) +{ + /* When we have no accurate position, gapless code does not make sense. */ + if(!(fr->state_flags & FRAME_ACCURATE)) return; + + /* Get a grip on dirty streams that start with a gapless header. + Simply accept all data from frames that are too much, + they are supposedly attached to the stream after the fact. */ + if(fr->gapless_frames > 0 && fr->num >= fr->gapless_frames) return; + + /* Important: We first cut samples from the end, then cut from beginning (including left-shift of the buffer). + This order works also for the case where firstframe == lastframe. */ + + /* The last interesting (planned) frame: Only use some leading samples. + Note a difference from the below: The last frame and offset are unchanges by seeks. + The lastoff keeps being valid. */ + if(fr->lastframe > -1 && fr->num >= fr->lastframe) + { + /* There can be more than one frame of padding at the end, so we ignore the whole frame if we are beyond lastframe. */ + off_t byteoff = (fr->num == fr->lastframe) ? samples_to_bytes(fr, fr->lastoff) : 0; + if((off_t)fr->buffer.fill > byteoff) + { + fr->buffer.fill = byteoff; + } + if(VERBOSE3) fprintf(stderr, "\nNote: Cut frame %"OFF_P" buffer on end of stream to %"OFF_P" samples, fill now %"SIZE_P" bytes.\n", (off_p)fr->num, (off_p)(fr->num == fr->lastframe ? fr->lastoff : 0), (size_p)fr->buffer.fill); + } + + /* The first interesting frame: Skip some leading samples. */ + if(fr->firstoff && fr->num == fr->firstframe) + { + off_t byteoff = samples_to_bytes(fr, fr->firstoff); + if((off_t)fr->buffer.fill > byteoff) + { + fr->buffer.fill -= byteoff; + /* buffer.p != buffer.data only for own buffer */ + debug6("cutting %li samples/%li bytes on begin, own_buffer=%i at %p=%p, buf[1]=%i", + (long)fr->firstoff, (long)byteoff, fr->own_buffer, (void*)fr->buffer.p, (void*)fr->buffer.data, ((short*)fr->buffer.p)[2]); + if(fr->own_buffer) fr->buffer.p = fr->buffer.data + byteoff; + else memmove(fr->buffer.data, fr->buffer.data + byteoff, fr->buffer.fill); + debug3("done cutting, buffer at %p =? %p, buf[1]=%i", + (void*)fr->buffer.p, (void*)fr->buffer.data, ((short*)fr->buffer.p)[2]); + } + else fr->buffer.fill = 0; + + if(VERBOSE3) fprintf(stderr, "\nNote: Cut frame %"OFF_P" buffer on beginning of stream by %"OFF_P" samples, fill now %"SIZE_P" bytes.\n", (off_p)fr->num, (off_p)fr->firstoff, (size_p)fr->buffer.fill); + /* We can only reach this frame again by seeking. And on seeking, firstoff will be recomputed. + So it is safe to null it here (and it makes the if() decision abort earlier). */ + fr->firstoff = 0; + } +} + +#define SAMPLE_ADJUST(mh,x) sample_adjust(mh,x) +#define SAMPLE_UNADJUST(mh,x) sample_unadjust(mh,x) +#define FRAME_BUFFERCHECK(mh) frame_buffercheck(mh) + +#else /* no gapless code included */ + +#define SAMPLE_ADJUST(mh,x) (x) +#define SAMPLE_UNADJUST(mh,x) (x) +#define FRAME_BUFFERCHECK(mh) + +#endif diff --git a/src/libmpg123/getbits.h b/src/libmpg123/getbits.h new file mode 100644 index 0000000..4b452f9 --- /dev/null +++ b/src/libmpg123/getbits.h @@ -0,0 +1,104 @@ +/* + getbits + + copyright ?-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + All code is in the header to suggest/force inlining of these small often-used functions. + This indeed has some impact on performance. +*/ + +#ifndef _MPG123_GETBITS_H_ +#define _MPG123_GETBITS_H_ + +#include "mpg123lib_intern.h" + +#define backbits(fr,nob) ((void)( \ + fr->bitindex -= nob, \ + fr->wordpointer += (fr->bitindex>>3), \ + fr->bitindex &= 0x7 )) + +#define getbitoffset(fr) ((-fr->bitindex)&0x7) +#define getbyte(fr) (*fr->wordpointer++) + +/* There is something wrong with that macro... the function below works also for the layer1 test case. */ +#define macro_getbits(fr, nob) ( \ + fr->ultmp = fr->wordpointer[0],\ + fr->ultmp <<= 8, \ + fr->ultmp |= fr->wordpointer[1], \ + fr->ultmp <<= 8, \ + fr->ultmp |= fr->wordpointer[2], \ + fr->ultmp <<= fr->bitindex, \ + fr->ultmp &= 0xffffff, \ + fr->bitindex += nob, \ + fr->ultmp >>= (24-nob), \ + fr->wordpointer += (fr->bitindex>>3), \ + fr->bitindex &= 7, \ + fr->ultmp) + +static unsigned int getbits(mpg123_handle *fr, int number_of_bits) +{ + unsigned long rval; + +#ifdef DEBUG_GETBITS +fprintf(stderr,"g%d",number_of_bits); +#endif + /* Safety catch until we got the nasty code fully figured out. */ + /* No, that catch stays here, even if we think we got it figured out! */ + if( (long)(fr->wordpointer-fr->bsbuf)*8 + + fr->bitindex+number_of_bits > (long)fr->framesize*8 ) + return 0; +/* This is actually slow: if(!number_of_bits) + return 0; */ + +#if 0 + check_buffer_range(number_of_bits+fr->bitindex); +#endif + + { + rval = fr->wordpointer[0]; + rval <<= 8; + rval |= fr->wordpointer[1]; + rval <<= 8; + rval |= fr->wordpointer[2]; + + rval <<= fr->bitindex; + rval &= 0xffffff; + + fr->bitindex += number_of_bits; + + rval >>= (24-number_of_bits); + + fr->wordpointer += (fr->bitindex>>3); + fr->bitindex &= 7; + } + +#ifdef DEBUG_GETBITS +fprintf(stderr,":%lx\n",rval); +#endif + + return rval; +} + + +#define skipbits(fr, nob) fr->ultmp = ( \ + fr->ultmp = fr->wordpointer[0], fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[1], \ + fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[2], fr->ultmp <<= fr->bitindex, \ + fr->ultmp &= 0xffffff, fr->bitindex += nob, \ + fr->ultmp >>= (24-nob), fr->wordpointer += (fr->bitindex>>3), \ + fr->bitindex &= 7 ) + +#define getbits_fast(fr, nob) ( \ + fr->ultmp = (unsigned char) (fr->wordpointer[0] << fr->bitindex), \ + fr->ultmp |= ((unsigned long) fr->wordpointer[1]<bitindex)>>8, \ + fr->ultmp <<= nob, fr->ultmp >>= 8, \ + fr->bitindex += nob, fr->wordpointer += (fr->bitindex>>3), \ + fr->bitindex &= 7, fr->ultmp ) + +#define get1bit(fr) ( \ + fr->uctmp = *fr->wordpointer << fr->bitindex, fr->bitindex++, \ + fr->wordpointer += (fr->bitindex>>3), fr->bitindex &= 7, fr->uctmp>>7 ) + + +#endif diff --git a/src/libmpg123/getcpuflags.S b/src/libmpg123/getcpuflags.S new file mode 100644 index 0000000..50a9d00 --- /dev/null +++ b/src/libmpg123/getcpuflags.S @@ -0,0 +1,102 @@ +/* + getcpucpuflags: get cpuflags for ia32 + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http:#mpg123.org + initially written by KIMURA Takuhiro (for 3DNow!) + extended for general use by Thomas Orgis + + extern int getcpuid(struct cpuflags*) + or just + extern int getcpuid(unsigned int*) + where there is memory for 4 ints + -> the first set of idflags (basic cpu family info) + and the idflags, stdflags, std2flags, extflags written to the parameter + -> 0x00000000 (CPUID instruction not supported) +*/ + +#include "mangle.h" + +.text + ALIGN4 + +.globl ASM_NAME(getcpuflags) +/* .type ASM_NAME(getcpuflags),@function */ +ASM_NAME(getcpuflags): + pushl %ebp + movl %esp,%ebp + pushl %edx + pushl %ecx + pushl %ebx + pushl %esi +/* get the int pointer for storing the flags */ + movl 8(%ebp), %esi +/* does that one make sense? */ + movl $0x80000000,%eax +/* now save the flags and do a check for cpuid availability */ + pushfl + pushfl + popl %eax + movl %eax,%ebx +/* set that bit... */ + xorl $0x00200000,%eax + pushl %eax + popfl +/* ...and read back the flags to see if it is understood */ + pushfl + popl %eax + popfl + cmpl %ebx,%eax + je .Lnocpuid +/* In principle, I would have to check the CPU's identify first to be sure how to interpret the extended flags. */ +/* now get the info, first extended */ + movl $0x0, 12(%esi) /* clear value */ + movl $0x0, 16(%esi) /* clear value */ +/* only if supported... */ + movl $0x80000000, %eax + cpuid +/* IDT CPUs should not change EAX, generally I hope that non-3DNow cpus do not set a bogus support level here. */ + cmpl $0x80000001, %eax + jb .Lnoextended /* Skip ext check without minimal support level. */ +/* is supported, get flags value */ + movl $0x80000001,%eax + cpuid + movl %edx,12(%esi) +.Lnoextended: +/* then the other ones, called last to get the id flags in %eax for ret */ + movl $0x00000001,%eax + cpuid + movl %eax, (%esi) + movl %ecx, 4(%esi) + movl %edx, 8(%esi) +/* check if xgetbv instruction is available */ + test $0x04000000, %ecx + jz .Lend + test $0x08000000, %ecx + jz .Lend + xor %ecx, %ecx + .byte 0x0f, 0x01, 0xd0 /* xgetbv instruction */ + movl %eax, 16(%esi) + movl (%esi), %eax + jmp .Lend + ALIGN4 +.Lnocpuid: +/* error: set everything to zero */ + movl $0, %eax + movl $0, (%esi) + movl $0, 4(%esi) + movl $0, 8(%esi) + movl $0, 12(%esi) + movl $0, 16(%esi) + ALIGN4 +.Lend: +/* return value are the id flags, still stored in %eax */ + popl %esi + popl %ebx + popl %ecx + popl %edx + movl %ebp,%esp + popl %ebp + ret + +NONEXEC_STACK diff --git a/src/libmpg123/getcpuflags.h b/src/libmpg123/getcpuflags.h new file mode 100644 index 0000000..4bcdfca --- /dev/null +++ b/src/libmpg123/getcpuflags.h @@ -0,0 +1,60 @@ +/* + getcpucpuflags: get cpuflags for ia32 + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http:#mpg123.org + initially written by KIMURA Takuhiro (for 3DNow!) + extended for general use by Thomas Orgis +*/ + +#ifndef MPG123_H_GETCPUFLAGS +#define MPG123_H_GETCPUFLAGS + +/* standard level flags part 1 (ECX)*/ +#define FLAG_SSE3 0x00000001 +#define FLAG_SSSE3 0x00000200 +#define FLAG_AVX 0x1C000000 +/* standard level flags part 2 (EDX) */ +#define FLAG2_MMX 0x00800000 +#define FLAG2_SSE 0x02000000 +#define FLAG2_SSE2 0x04000000 +#define FLAG2_FPU 0x00000001 +/* cpuid extended level 1 (AMD) */ +#define XFLAG_MMX 0x00800000 +#define XFLAG_3DNOW 0x80000000 +#define XFLAG_3DNOWEXT 0x40000000 +/* eXtended Control Register 0 */ +#define XCR0FLAG_AVX 0x00000006 + + +struct cpuflags +{ +#if defined(OPT_ARM) || defined(OPT_NEON) || defined(OPT_NEON64) + unsigned int has_neon; +#else + unsigned int id; + unsigned int std; + unsigned int std2; + unsigned int ext; + unsigned int xcr0_lo; +#endif +}; + +unsigned int getcpuflags(struct cpuflags* cf); + +/* checks the family */ +#define cpu_i586(s) ( ((s.id & 0xf00)>>8) == 0 || ((s.id & 0xf00)>>8) > 4 ) +/* checking some flags... */ +#define cpu_fpu(s) (FLAG2_FPU & s.std2) +#define cpu_mmx(s) (FLAG2_MMX & s.std2 || XFLAG_MMX & s.ext) +#define cpu_3dnow(s) (XFLAG_3DNOW & s.ext) +#define cpu_3dnowext(s) (XFLAG_3DNOWEXT & s.ext) +#define cpu_sse(s) (FLAG2_SSE & s.std2) +#define cpu_sse2(s) (FLAG2_SSE2 & s.std2) +#define cpu_sse3(s) (FLAG_SSE3 & s.std) +#define cpu_avx(s) ((FLAG_AVX & s.std) == FLAG_AVX && (XCR0FLAG_AVX & s.xcr0_lo) == XCR0FLAG_AVX) +#define cpu_fast_sse(s) ((((s.id & 0xf00)>>8) == 6 && FLAG_SSSE3 & s.std) /* for Intel/VIA; family 6 CPUs with SSSE3 */ || \ + (((s.id & 0xf00)>>8) == 0xf && (((s.id & 0x0ff00000)>>20) > 0 && ((s.id & 0x0ff00000)>>20) != 5))) /* for AMD; family > 0xF CPUs except Bobcat */ +#define cpu_neon(s) (s.has_neon) + +#endif diff --git a/src/libmpg123/getcpuflags_arm.c b/src/libmpg123/getcpuflags_arm.c new file mode 100644 index 0000000..a0bbf43 --- /dev/null +++ b/src/libmpg123/getcpuflags_arm.c @@ -0,0 +1,61 @@ +/* + getcpuflags_arm: get cpuflags for ARM + + copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Momma +*/ + +#include +#include +#include "mpg123lib_intern.h" +#include "getcpuflags.h" + +extern void check_neon(void); + +#ifndef _M_ARM +static sigjmp_buf jmpbuf; +#else +static jmp_buf jmpbuf; +#endif + +static void mpg123_arm_catch_sigill(int sig) +{ +#ifndef _M_ARM + siglongjmp(jmpbuf, 1); +#else + longjmp(jmpbuf, 1); +#endif +} + +unsigned int getcpuflags(struct cpuflags* cf) +{ +#ifndef _M_ARM + struct sigaction act, act_old; + act.sa_handler = mpg123_arm_catch_sigill; + act.sa_flags = SA_RESTART; + sigemptyset(&act.sa_mask); + sigaction(SIGILL, &act, &act_old); + + cf->has_neon = 0; + + if(!sigsetjmp(jmpbuf, 1)) { + check_neon(); + cf->has_neon = 1; + } + + sigaction(SIGILL, &act_old, NULL); +#else + cf->has_neon = 0; + + if (!setjmp(jmpbuf)) { + signal(SIGILL, mpg123_arm_catch_sigill); + check_neon(); + cf->has_neon = 1; + } + + signal(SIGILL, SIG_DFL); +#endif + + return 0; +} diff --git a/src/libmpg123/getcpuflags_x86_64.S b/src/libmpg123/getcpuflags_x86_64.S new file mode 100644 index 0000000..92fb765 --- /dev/null +++ b/src/libmpg123/getcpuflags_x86_64.S @@ -0,0 +1,57 @@ +/* + getcpuflags_x86_64: get cpuflags for x86-64 + + copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + + .text + ALIGN4 + .globl ASM_NAME(getcpuflags) +ASM_NAME(getcpuflags): + push %rbp + mov %rsp, %rbp + push %rbx + +#ifdef IS_MSABI + push %rdi + mov %rcx, %rdi +#endif + + movl $0, 12(%rdi) + movl $0, 16(%rdi) + + mov $0x80000000, %eax + cpuid + cmp $0x80000001, %eax + jb 1f + mov $0x80000001, %eax + cpuid + movl %edx, 12(%rdi) +1: + mov $0x00000001, %eax + cpuid + movl %eax, (%rdi) + movl %ecx, 4(%rdi) + movl %edx, 8(%rdi) + test $0x04000000, %ecx + jz 2f + test $0x08000000, %ecx + jz 2f + xor %ecx, %ecx + .byte 0x0f, 0x01, 0xd0 /* xgetbv instruction */ + movl %eax, 16(%rdi) + movl (%rdi), %eax +2: +#ifdef IS_MSABI + pop %rdi +#endif + pop %rbx + mov %rbp, %rsp + pop %rbp + ret + +NONEXEC_STACK diff --git a/src/libmpg123/huffman.h b/src/libmpg123/huffman.h new file mode 100644 index 0000000..576fbd8 --- /dev/null +++ b/src/libmpg123/huffman.h @@ -0,0 +1,340 @@ +/* + huffman.h: huffman tables ... recalcualted to work with optimized decoder scheme (MH) + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + probably we could save a few bytes of memory, because the + smaller tables are often the part of a bigger table +*/ + + +#ifndef _MPG123_HUFFMAN_H_ +#define _MPG123_HUFFMAN_H_ + +struct newhuff +{ + unsigned int linbits; + const short *table; +}; + +static const short tab0[] = +{ + 0 +}; + +static const short tab1[] = +{ + -5, -3, -1, 17, 1, 16, 0 +}; + +static const short tab2[] = +{ + -15, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 17, -1, 1, + 16, 0 +}; + +static const short tab3[] = +{ + -13, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 16, 17, -1, + 1, 0 +}; + +static const short tab5[] = +{ + -29, -25, -23, -15, -7, -5, -3, -1, 51, 35, 50, 49, -3, -1, 19, + 3, -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, 17, -1, 1, 16, + 0 +}; + +static const short tab6[] = +{ + -25, -19, -13, -9, -5, -3, -1, 51, 3, 35, -1, 50, 48, -1, 19, + 49, -3, -1, 34, 2, 18, -3, -1, 33, 32, 1, -1, 17, -1, 16, + 0 +}; + +static const short tab7[] = +{ + -69, -65, -57, -39, -29, -17, -11, -7, -3, -1, 85, 69, -1, 84, 83, + -1, 53, 68, -3, -1, 37, 82, 21, -5, -1, 81, -1, 5, 52, -1, + 80, -1, 67, 51, -5, -3, -1, 36, 66, 20, -1, 65, 64, -11, -7, + -3, -1, 4, 35, -1, 50, 3, -1, 19, 49, -3, -1, 48, 34, 18, + -5, -1, 33, -1, 2, 32, 17, -1, 1, 16, 0 +}; + +static const short tab8[] = +{ + -65, -63, -59, -45, -31, -19, -13, -7, -5, -3, -1, 85, 84, 69, 83, + -3, -1, 53, 68, 37, -3, -1, 82, 5, 21, -5, -1, 81, -1, 52, + 67, -3, -1, 80, 51, 36, -5, -3, -1, 66, 20, 65, -3, -1, 4, + 64, -1, 35, 50, -9, -7, -3, -1, 19, 49, -1, 3, 48, 34, -1, + 2, 32, -1, 18, 33, 17, -3, -1, 1, 16, 0 +}; + +static const short tab9[] = +{ + -63, -53, -41, -29, -19, -11, -5, -3, -1, 85, 69, 53, -1, 83, -1, + 84, 5, -3, -1, 68, 37, -1, 82, 21, -3, -1, 81, 52, -1, 67, + -1, 80, 4, -7, -3, -1, 36, 66, -1, 51, 64, -1, 20, 65, -5, + -3, -1, 35, 50, 19, -1, 49, -1, 3, 48, -5, -3, -1, 34, 2, + 18, -1, 33, 32, -3, -1, 17, 1, -1, 16, 0 +}; + +static const short tab10[] = +{ +-125,-121,-111, -83, -55, -35, -21, -13, -7, -3, -1, 119, 103, -1, 118, + 87, -3, -1, 117, 102, 71, -3, -1, 116, 86, -1, 101, 55, -9, -3, + -1, 115, 70, -3, -1, 85, 84, 99, -1, 39, 114, -11, -5, -3, -1, + 100, 7, 112, -1, 98, -1, 69, 53, -5, -1, 6, -1, 83, 68, 23, + -17, -5, -1, 113, -1, 54, 38, -5, -3, -1, 37, 82, 21, -1, 81, + -1, 52, 67, -3, -1, 22, 97, -1, 96, -1, 5, 80, -19, -11, -7, + -3, -1, 36, 66, -1, 51, 4, -1, 20, 65, -3, -1, 64, 35, -1, + 50, 3, -3, -1, 19, 49, -1, 48, 34, -7, -3, -1, 18, 33, -1, + 2, 32, 17, -1, 1, 16, 0 +}; + +static const short tab11[] = +{ +-121,-113, -89, -59, -43, -27, -17, -7, -3, -1, 119, 103, -1, 118, 117, + -3, -1, 102, 71, -1, 116, -1, 87, 85, -5, -3, -1, 86, 101, 55, + -1, 115, 70, -9, -7, -3, -1, 69, 84, -1, 53, 83, 39, -1, 114, + -1, 100, 7, -5, -1, 113, -1, 23, 112, -3, -1, 54, 99, -1, 96, + -1, 68, 37, -13, -7, -5, -3, -1, 82, 5, 21, 98, -3, -1, 38, + 6, 22, -5, -1, 97, -1, 81, 52, -5, -1, 80, -1, 67, 51, -1, + 36, 66, -15, -11, -7, -3, -1, 20, 65, -1, 4, 64, -1, 35, 50, + -1, 19, 49, -5, -3, -1, 3, 48, 34, 33, -5, -1, 18, -1, 2, + 32, 17, -3, -1, 1, 16, 0 +}; + +static const short tab12[] = +{ +-115, -99, -73, -45, -27, -17, -9, -5, -3, -1, 119, 103, 118, -1, 87, + 117, -3, -1, 102, 71, -1, 116, 101, -3, -1, 86, 55, -3, -1, 115, + 85, 39, -7, -3, -1, 114, 70, -1, 100, 23, -5, -1, 113, -1, 7, + 112, -1, 54, 99, -13, -9, -3, -1, 69, 84, -1, 68, -1, 6, 5, + -1, 38, 98, -5, -1, 97, -1, 22, 96, -3, -1, 53, 83, -1, 37, + 82, -17, -7, -3, -1, 21, 81, -1, 52, 67, -5, -3, -1, 80, 4, + 36, -1, 66, 20, -3, -1, 51, 65, -1, 35, 50, -11, -7, -5, -3, + -1, 64, 3, 48, 19, -1, 49, 34, -1, 18, 33, -7, -5, -3, -1, + 2, 32, 0, 17, -1, 1, 16 +}; + +static const short tab13[] = +{ +-509,-503,-475,-405,-333,-265,-205,-153,-115, -83, -53, -35, -21, -13, -9, + -7, -5, -3, -1, 254, 252, 253, 237, 255, -1, 239, 223, -3, -1, 238, + 207, -1, 222, 191, -9, -3, -1, 251, 206, -1, 220, -1, 175, 233, -1, + 236, 221, -9, -5, -3, -1, 250, 205, 190, -1, 235, 159, -3, -1, 249, + 234, -1, 189, 219, -17, -9, -3, -1, 143, 248, -1, 204, -1, 174, 158, + -5, -1, 142, -1, 127, 126, 247, -5, -1, 218, -1, 173, 188, -3, -1, + 203, 246, 111, -15, -7, -3, -1, 232, 95, -1, 157, 217, -3, -1, 245, + 231, -1, 172, 187, -9, -3, -1, 79, 244, -3, -1, 202, 230, 243, -1, + 63, -1, 141, 216, -21, -9, -3, -1, 47, 242, -3, -1, 110, 156, 15, + -5, -3, -1, 201, 94, 171, -3, -1, 125, 215, 78, -11, -5, -3, -1, + 200, 214, 62, -1, 185, -1, 155, 170, -1, 31, 241, -23, -13, -5, -1, + 240, -1, 186, 229, -3, -1, 228, 140, -1, 109, 227, -5, -1, 226, -1, + 46, 14, -1, 30, 225, -15, -7, -3, -1, 224, 93, -1, 213, 124, -3, + -1, 199, 77, -1, 139, 184, -7, -3, -1, 212, 154, -1, 169, 108, -1, + 198, 61, -37, -21, -9, -5, -3, -1, 211, 123, 45, -1, 210, 29, -5, + -1, 183, -1, 92, 197, -3, -1, 153, 122, 195, -7, -5, -3, -1, 167, + 151, 75, 209, -3, -1, 13, 208, -1, 138, 168, -11, -7, -3, -1, 76, + 196, -1, 107, 182, -1, 60, 44, -3, -1, 194, 91, -3, -1, 181, 137, + 28, -43, -23, -11, -5, -1, 193, -1, 152, 12, -1, 192, -1, 180, 106, + -5, -3, -1, 166, 121, 59, -1, 179, -1, 136, 90, -11, -5, -1, 43, + -1, 165, 105, -1, 164, -1, 120, 135, -5, -1, 148, -1, 119, 118, 178, + -11, -3, -1, 27, 177, -3, -1, 11, 176, -1, 150, 74, -7, -3, -1, + 58, 163, -1, 89, 149, -1, 42, 162, -47, -23, -9, -3, -1, 26, 161, + -3, -1, 10, 104, 160, -5, -3, -1, 134, 73, 147, -3, -1, 57, 88, + -1, 133, 103, -9, -3, -1, 41, 146, -3, -1, 87, 117, 56, -5, -1, + 131, -1, 102, 71, -3, -1, 116, 86, -1, 101, 115, -11, -3, -1, 25, + 145, -3, -1, 9, 144, -1, 72, 132, -7, -5, -1, 114, -1, 70, 100, + 40, -1, 130, 24, -41, -27, -11, -5, -3, -1, 55, 39, 23, -1, 113, + -1, 85, 7, -7, -3, -1, 112, 54, -1, 99, 69, -3, -1, 84, 38, + -1, 98, 53, -5, -1, 129, -1, 8, 128, -3, -1, 22, 97, -1, 6, + 96, -13, -9, -5, -3, -1, 83, 68, 37, -1, 82, 5, -1, 21, 81, + -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, -19, -11, + -5, -1, 65, -1, 4, 64, -3, -1, 35, 50, 19, -3, -1, 49, 3, + -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16, + 0 +}; + +static const short tab15[] = +{ +-495,-445,-355,-263,-183,-115, -77, -43, -27, -13, -7, -3, -1, 255, 239, + -1, 254, 223, -1, 238, -1, 253, 207, -7, -3, -1, 252, 222, -1, 237, + 191, -1, 251, -1, 206, 236, -7, -3, -1, 221, 175, -1, 250, 190, -3, + -1, 235, 205, -1, 220, 159, -15, -7, -3, -1, 249, 234, -1, 189, 219, + -3, -1, 143, 248, -1, 204, 158, -7, -3, -1, 233, 127, -1, 247, 173, + -3, -1, 218, 188, -1, 111, -1, 174, 15, -19, -11, -3, -1, 203, 246, + -3, -1, 142, 232, -1, 95, 157, -3, -1, 245, 126, -1, 231, 172, -9, + -3, -1, 202, 187, -3, -1, 217, 141, 79, -3, -1, 244, 63, -1, 243, + 216, -33, -17, -9, -3, -1, 230, 47, -1, 242, -1, 110, 240, -3, -1, + 31, 241, -1, 156, 201, -7, -3, -1, 94, 171, -1, 186, 229, -3, -1, + 125, 215, -1, 78, 228, -15, -7, -3, -1, 140, 200, -1, 62, 109, -3, + -1, 214, 227, -1, 155, 185, -7, -3, -1, 46, 170, -1, 226, 30, -5, + -1, 225, -1, 14, 224, -1, 93, 213, -45, -25, -13, -7, -3, -1, 124, + 199, -1, 77, 139, -1, 212, -1, 184, 154, -7, -3, -1, 169, 108, -1, + 198, 61, -1, 211, 210, -9, -5, -3, -1, 45, 13, 29, -1, 123, 183, + -5, -1, 209, -1, 92, 208, -1, 197, 138, -17, -7, -3, -1, 168, 76, + -1, 196, 107, -5, -1, 182, -1, 153, 12, -1, 60, 195, -9, -3, -1, + 122, 167, -1, 166, -1, 192, 11, -1, 194, -1, 44, 91, -55, -29, -15, + -7, -3, -1, 181, 28, -1, 137, 152, -3, -1, 193, 75, -1, 180, 106, + -5, -3, -1, 59, 121, 179, -3, -1, 151, 136, -1, 43, 90, -11, -5, + -1, 178, -1, 165, 27, -1, 177, -1, 176, 105, -7, -3, -1, 150, 74, + -1, 164, 120, -3, -1, 135, 58, 163, -17, -7, -3, -1, 89, 149, -1, + 42, 162, -3, -1, 26, 161, -3, -1, 10, 160, 104, -7, -3, -1, 134, + 73, -1, 148, 57, -5, -1, 147, -1, 119, 9, -1, 88, 133, -53, -29, + -13, -7, -3, -1, 41, 103, -1, 118, 146, -1, 145, -1, 25, 144, -7, + -3, -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 71, -7, + -3, -1, 40, 130, -1, 24, 129, -7, -3, -1, 116, 8, -1, 128, 86, + -3, -1, 101, 55, -1, 115, 70, -17, -7, -3, -1, 39, 114, -1, 100, + 23, -3, -1, 85, 113, -3, -1, 7, 112, 54, -7, -3, -1, 99, 69, + -1, 84, 38, -3, -1, 98, 22, -3, -1, 6, 96, 53, -33, -19, -9, + -5, -1, 97, -1, 83, 68, -1, 37, 82, -3, -1, 21, 81, -3, -1, + 5, 80, 52, -7, -3, -1, 67, 36, -1, 66, 51, -1, 65, -1, 20, + 4, -9, -3, -1, 35, 50, -3, -1, 64, 3, 19, -3, -1, 49, 48, + 34, -9, -7, -3, -1, 18, 33, -1, 2, 32, 17, -3, -1, 1, 16, + 0 +}; + +static const short tab16[] = +{ +-509,-503,-461,-323,-103, -37, -27, -15, -7, -3, -1, 239, 254, -1, 223, + 253, -3, -1, 207, 252, -1, 191, 251, -5, -1, 175, -1, 250, 159, -3, + -1, 249, 248, 143, -7, -3, -1, 127, 247, -1, 111, 246, 255, -9, -5, + -3, -1, 95, 245, 79, -1, 244, 243, -53, -1, 240, -1, 63, -29, -19, + -13, -7, -5, -1, 206, -1, 236, 221, 222, -1, 233, -1, 234, 217, -1, + 238, -1, 237, 235, -3, -1, 190, 205, -3, -1, 220, 219, 174, -11, -5, + -1, 204, -1, 173, 218, -3, -1, 126, 172, 202, -5, -3, -1, 201, 125, + 94, 189, 242, -93, -5, -3, -1, 47, 15, 31, -1, 241, -49, -25, -13, + -5, -1, 158, -1, 188, 203, -3, -1, 142, 232, -1, 157, 231, -7, -3, + -1, 187, 141, -1, 216, 110, -1, 230, 156, -13, -7, -3, -1, 171, 186, + -1, 229, 215, -1, 78, -1, 228, 140, -3, -1, 200, 62, -1, 109, -1, + 214, 155, -19, -11, -5, -3, -1, 185, 170, 225, -1, 212, -1, 184, 169, + -5, -1, 123, -1, 183, 208, 227, -7, -3, -1, 14, 224, -1, 93, 213, + -3, -1, 124, 199, -1, 77, 139, -75, -45, -27, -13, -7, -3, -1, 154, + 108, -1, 198, 61, -3, -1, 92, 197, 13, -7, -3, -1, 138, 168, -1, + 153, 76, -3, -1, 182, 122, 60, -11, -5, -3, -1, 91, 137, 28, -1, + 192, -1, 152, 121, -1, 226, -1, 46, 30, -15, -7, -3, -1, 211, 45, + -1, 210, 209, -5, -1, 59, -1, 151, 136, 29, -7, -3, -1, 196, 107, + -1, 195, 167, -1, 44, -1, 194, 181, -23, -13, -7, -3, -1, 193, 12, + -1, 75, 180, -3, -1, 106, 166, 179, -5, -3, -1, 90, 165, 43, -1, + 178, 27, -13, -5, -1, 177, -1, 11, 176, -3, -1, 105, 150, -1, 74, + 164, -5, -3, -1, 120, 135, 163, -3, -1, 58, 89, 42, -97, -57, -33, + -19, -11, -5, -3, -1, 149, 104, 161, -3, -1, 134, 119, 148, -5, -3, + -1, 73, 87, 103, 162, -5, -1, 26, -1, 10, 160, -3, -1, 57, 147, + -1, 88, 133, -9, -3, -1, 41, 146, -3, -1, 118, 9, 25, -5, -1, + 145, -1, 144, 72, -3, -1, 132, 117, -1, 56, 131, -21, -11, -5, -3, + -1, 102, 40, 130, -3, -1, 71, 116, 24, -3, -1, 129, 128, -3, -1, + 8, 86, 55, -9, -5, -1, 115, -1, 101, 70, -1, 39, 114, -5, -3, + -1, 100, 85, 7, 23, -23, -13, -5, -1, 113, -1, 112, 54, -3, -1, + 99, 69, -1, 84, 38, -3, -1, 98, 22, -1, 97, -1, 6, 96, -9, + -5, -1, 83, -1, 53, 68, -1, 37, 82, -1, 81, -1, 21, 5, -33, + -23, -13, -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, + -5, -1, 65, -1, 4, 64, -1, 35, 50, -3, -1, 19, 49, -3, -1, + 3, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16, + 0 +}; + +static const short tab24[] = +{ +-451,-117, -43, -25, -15, -7, -3, -1, 239, 254, -1, 223, 253, -3, -1, + 207, 252, -1, 191, 251, -5, -1, 250, -1, 175, 159, -1, 249, 248, -9, + -5, -3, -1, 143, 127, 247, -1, 111, 246, -3, -1, 95, 245, -1, 79, + 244, -71, -7, -3, -1, 63, 243, -1, 47, 242, -5, -1, 241, -1, 31, + 240, -25, -9, -1, 15, -3, -1, 238, 222, -1, 237, 206, -7, -3, -1, + 236, 221, -1, 190, 235, -3, -1, 205, 220, -1, 174, 234, -15, -7, -3, + -1, 189, 219, -1, 204, 158, -3, -1, 233, 173, -1, 218, 188, -7, -3, + -1, 203, 142, -1, 232, 157, -3, -1, 217, 126, -1, 231, 172, 255,-235, +-143, -77, -45, -25, -15, -7, -3, -1, 202, 187, -1, 141, 216, -5, -3, + -1, 14, 224, 13, 230, -5, -3, -1, 110, 156, 201, -1, 94, 186, -9, + -5, -1, 229, -1, 171, 125, -1, 215, 228, -3, -1, 140, 200, -3, -1, + 78, 46, 62, -15, -7, -3, -1, 109, 214, -1, 227, 155, -3, -1, 185, + 170, -1, 226, 30, -7, -3, -1, 225, 93, -1, 213, 124, -3, -1, 199, + 77, -1, 139, 184, -31, -15, -7, -3, -1, 212, 154, -1, 169, 108, -3, + -1, 198, 61, -1, 211, 45, -7, -3, -1, 210, 29, -1, 123, 183, -3, + -1, 209, 92, -1, 197, 138, -17, -7, -3, -1, 168, 153, -1, 76, 196, + -3, -1, 107, 182, -3, -1, 208, 12, 60, -7, -3, -1, 195, 122, -1, + 167, 44, -3, -1, 194, 91, -1, 181, 28, -57, -35, -19, -7, -3, -1, + 137, 152, -1, 193, 75, -5, -3, -1, 192, 11, 59, -3, -1, 176, 10, + 26, -5, -1, 180, -1, 106, 166, -3, -1, 121, 151, -3, -1, 160, 9, + 144, -9, -3, -1, 179, 136, -3, -1, 43, 90, 178, -7, -3, -1, 165, + 27, -1, 177, 105, -1, 150, 164, -17, -9, -5, -3, -1, 74, 120, 135, + -1, 58, 163, -3, -1, 89, 149, -1, 42, 162, -7, -3, -1, 161, 104, + -1, 134, 119, -3, -1, 73, 148, -1, 57, 147, -63, -31, -15, -7, -3, + -1, 88, 133, -1, 41, 103, -3, -1, 118, 146, -1, 25, 145, -7, -3, + -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 40, -17, -7, + -3, -1, 130, 24, -1, 71, 116, -5, -1, 129, -1, 8, 128, -1, 86, + 101, -7, -5, -1, 23, -1, 7, 112, 115, -3, -1, 55, 39, 114, -15, + -7, -3, -1, 70, 100, -1, 85, 113, -3, -1, 54, 99, -1, 69, 84, + -7, -3, -1, 38, 98, -1, 22, 97, -5, -3, -1, 6, 96, 53, -1, + 83, 68, -51, -37, -23, -15, -9, -3, -1, 37, 82, -1, 21, -1, 5, + 80, -1, 81, -1, 52, 67, -3, -1, 36, 66, -1, 51, 20, -9, -5, + -1, 65, -1, 4, 64, -1, 35, 50, -1, 19, 49, -7, -5, -3, -1, + 3, 48, 34, 18, -1, 33, -1, 2, 32, -3, -1, 17, 1, -1, 16, + 0 +}; + +static const short tab_c0[] = +{ + -29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5, + 9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8, + 0 +}; + +static const short tab_c1[] = +{ + -15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9, + 8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1, + 0 +}; + + + +static const struct newhuff ht[] = +{ + { /* 0 */ 0 , tab0 } , + { /* 2 */ 0 , tab1 } , + { /* 3 */ 0 , tab2 } , + { /* 3 */ 0 , tab3 } , + { /* 0 */ 0 , tab0 } , + { /* 4 */ 0 , tab5 } , + { /* 4 */ 0 , tab6 } , + { /* 6 */ 0 , tab7 } , + { /* 6 */ 0 , tab8 } , + { /* 6 */ 0 , tab9 } , + { /* 8 */ 0 , tab10 } , + { /* 8 */ 0 , tab11 } , + { /* 8 */ 0 , tab12 } , + { /* 16 */ 0 , tab13 } , + { /* 0 */ 0 , tab0 } , + { /* 16 */ 0 , tab15 } , + + { /* 16 */ 1 , tab16 } , + { /* 16 */ 2 , tab16 } , + { /* 16 */ 3 , tab16 } , + { /* 16 */ 4 , tab16 } , + { /* 16 */ 6 , tab16 } , + { /* 16 */ 8 , tab16 } , + { /* 16 */ 10, tab16 } , + { /* 16 */ 13, tab16 } , + { /* 16 */ 4 , tab24 } , + { /* 16 */ 5 , tab24 } , + { /* 16 */ 6 , tab24 } , + { /* 16 */ 7 , tab24 } , + { /* 16 */ 8 , tab24 } , + { /* 16 */ 9 , tab24 } , + { /* 16 */ 11, tab24 } , + { /* 16 */ 13, tab24 } +}; + +static const struct newhuff htc[] = +{ + { /* 1 , 1 , */ 0 , tab_c0 } , + { /* 1 , 1 , */ 0 , tab_c1 } +}; + + +#endif diff --git a/src/libmpg123/icy.c b/src/libmpg123/icy.c new file mode 100644 index 0000000..1c287e7 --- /dev/null +++ b/src/libmpg123/icy.c @@ -0,0 +1,34 @@ +/* + icy: Puny code to pretend for a serious ICY data structure. + + copyright 2007-2015 by the mpg123 project + -= free software under the terms of the LGPL 2.1 =- + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "intsym.h" +#include "icy.h" + +void init_icy(struct icy_meta *icy) +{ + icy->data = NULL; +} + +void clear_icy(struct icy_meta *icy) +{ + if(icy->data != NULL) free(icy->data); + init_icy(icy); +} + +void reset_icy(struct icy_meta *icy) +{ + clear_icy(icy); + init_icy(icy); +} +/*void set_icy(struct icy_meta *icy, char* new_data) +{ + if(icy->data) free(icy->data); + icy->data = new_data; + icy->changed = 1; +}*/ diff --git a/src/libmpg123/icy.h b/src/libmpg123/icy.h new file mode 100644 index 0000000..a5fd64e --- /dev/null +++ b/src/libmpg123/icy.h @@ -0,0 +1,38 @@ +/* + icy: support for SHOUTcast ICY meta info, an attempt to keep it organized + + copyright 2006-7 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis and modelled after patch by Honza +*/ +#ifndef MPG123_ICY_H +#define MPG123_ICY_H + +#ifndef NO_ICY + +#include "compat.h" +#include "mpg123.h" + +struct icy_meta +{ + char* data; + off_t interval; + off_t next; +}; + +void init_icy(struct icy_meta *); +void clear_icy(struct icy_meta *); +void reset_icy(struct icy_meta *); + +#else + +#undef init_icy +#define init_icy(a) +#undef clear_icy +#define clear_icy(a) +#undef reset_icy +#define reset_icy(a) + +#endif /* NO_ICY */ + +#endif diff --git a/src/libmpg123/icy2utf8.c b/src/libmpg123/icy2utf8.c new file mode 100644 index 0000000..71605d2 --- /dev/null +++ b/src/libmpg123/icy2utf8.c @@ -0,0 +1,440 @@ +/* mpg123 note: This is BSD-licensed code that is no problem for mpg123 usage under LGPL. + It's Free, understood? ;-) */ + +/* Another note: This code is basically written by Thorsten Glaser, + Thomas Orgis did just some rearrangements and comments. */ + +/*- + * Copyright (c) 2008 + * Thorsten Glaser + * + * Provided that these terms and disclaimer and all copyright notices + * are retained or reproduced in an accompanying document, permission + * is granted to deal in this work without restriction, including un- + * limited rights to use, publicly perform, distribute, sell, modify, + * merge, give away, or sublicence. + * + * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to + * the utmost extent permitted by applicable law, neither express nor + * implied; without malicious intent or gross negligence. In no event + * may a licensor, author or contributor be held liable for indirect, + * direct, other damage, loss, or other issues arising in any way out + * of dealing in the work, even if advised of the possibility of such + * damage or existence of a defect, except proven that it results out + * of said person's immediate fault when using the work as intended. + *- + * Convert from ICY encoding (windows-1252 codepage) to UTF-8 + */ + +#include "config.h" +#include "intsym.h" +/* Includes string and stdlib headers... */ +#include "compat.h" + +/* ThOr: too lazy for this type check; also we use char/short all around anyway. + Of cource, it would be the proper way to use _these_ kind of types all around. */ +#define uint8_t unsigned char +#define uint16_t unsigned short + +static const uint8_t cp1252_utf8[] = { + /* 0x00 @ 0 */ 0x00, + /* 0x01 @ 1 */ 0x01, + /* 0x02 @ 2 */ 0x02, + /* 0x03 @ 3 */ 0x03, + /* 0x04 @ 4 */ 0x04, + /* 0x05 @ 5 */ 0x05, + /* 0x06 @ 6 */ 0x06, + /* 0x07 @ 7 */ 0x07, + /* 0x08 @ 8 */ 0x08, + /* 0x09 @ 9 */ 0x09, + /* 0x0A @ 10 */ 0x0A, + /* 0x0B @ 11 */ 0x0B, + /* 0x0C @ 12 */ 0x0C, + /* 0x0D @ 13 */ 0x0D, + /* 0x0E @ 14 */ 0x0E, + /* 0x0F @ 15 */ 0x0F, + /* 0x10 @ 16 */ 0x10, + /* 0x11 @ 17 */ 0x11, + /* 0x12 @ 18 */ 0x12, + /* 0x13 @ 19 */ 0x13, + /* 0x14 @ 20 */ 0x14, + /* 0x15 @ 21 */ 0x15, + /* 0x16 @ 22 */ 0x16, + /* 0x17 @ 23 */ 0x17, + /* 0x18 @ 24 */ 0x18, + /* 0x19 @ 25 */ 0x19, + /* 0x1A @ 26 */ 0x1A, + /* 0x1B @ 27 */ 0x1B, + /* 0x1C @ 28 */ 0x1C, + /* 0x1D @ 29 */ 0x1D, + /* 0x1E @ 30 */ 0x1E, + /* 0x1F @ 31 */ 0x1F, + /* 0x20 @ 32 */ 0x20, + /* 0x21 @ 33 */ 0x21, + /* 0x22 @ 34 */ 0x22, + /* 0x23 @ 35 */ 0x23, + /* 0x24 @ 36 */ 0x24, + /* 0x25 @ 37 */ 0x25, + /* 0x26 @ 38 */ 0x26, + /* 0x27 @ 39 */ 0x27, + /* 0x28 @ 40 */ 0x28, + /* 0x29 @ 41 */ 0x29, + /* 0x2A @ 42 */ 0x2A, + /* 0x2B @ 43 */ 0x2B, + /* 0x2C @ 44 */ 0x2C, + /* 0x2D @ 45 */ 0x2D, + /* 0x2E @ 46 */ 0x2E, + /* 0x2F @ 47 */ 0x2F, + /* 0x30 @ 48 */ 0x30, + /* 0x31 @ 49 */ 0x31, + /* 0x32 @ 50 */ 0x32, + /* 0x33 @ 51 */ 0x33, + /* 0x34 @ 52 */ 0x34, + /* 0x35 @ 53 */ 0x35, + /* 0x36 @ 54 */ 0x36, + /* 0x37 @ 55 */ 0x37, + /* 0x38 @ 56 */ 0x38, + /* 0x39 @ 57 */ 0x39, + /* 0x3A @ 58 */ 0x3A, + /* 0x3B @ 59 */ 0x3B, + /* 0x3C @ 60 */ 0x3C, + /* 0x3D @ 61 */ 0x3D, + /* 0x3E @ 62 */ 0x3E, + /* 0x3F @ 63 */ 0x3F, + /* 0x40 @ 64 */ 0x40, + /* 0x41 @ 65 */ 0x41, + /* 0x42 @ 66 */ 0x42, + /* 0x43 @ 67 */ 0x43, + /* 0x44 @ 68 */ 0x44, + /* 0x45 @ 69 */ 0x45, + /* 0x46 @ 70 */ 0x46, + /* 0x47 @ 71 */ 0x47, + /* 0x48 @ 72 */ 0x48, + /* 0x49 @ 73 */ 0x49, + /* 0x4A @ 74 */ 0x4A, + /* 0x4B @ 75 */ 0x4B, + /* 0x4C @ 76 */ 0x4C, + /* 0x4D @ 77 */ 0x4D, + /* 0x4E @ 78 */ 0x4E, + /* 0x4F @ 79 */ 0x4F, + /* 0x50 @ 80 */ 0x50, + /* 0x51 @ 81 */ 0x51, + /* 0x52 @ 82 */ 0x52, + /* 0x53 @ 83 */ 0x53, + /* 0x54 @ 84 */ 0x54, + /* 0x55 @ 85 */ 0x55, + /* 0x56 @ 86 */ 0x56, + /* 0x57 @ 87 */ 0x57, + /* 0x58 @ 88 */ 0x58, + /* 0x59 @ 89 */ 0x59, + /* 0x5A @ 90 */ 0x5A, + /* 0x5B @ 91 */ 0x5B, + /* 0x5C @ 92 */ 0x5C, + /* 0x5D @ 93 */ 0x5D, + /* 0x5E @ 94 */ 0x5E, + /* 0x5F @ 95 */ 0x5F, + /* 0x60 @ 96 */ 0x60, + /* 0x61 @ 97 */ 0x61, + /* 0x62 @ 98 */ 0x62, + /* 0x63 @ 99 */ 0x63, + /* 0x64 @ 100 */ 0x64, + /* 0x65 @ 101 */ 0x65, + /* 0x66 @ 102 */ 0x66, + /* 0x67 @ 103 */ 0x67, + /* 0x68 @ 104 */ 0x68, + /* 0x69 @ 105 */ 0x69, + /* 0x6A @ 106 */ 0x6A, + /* 0x6B @ 107 */ 0x6B, + /* 0x6C @ 108 */ 0x6C, + /* 0x6D @ 109 */ 0x6D, + /* 0x6E @ 110 */ 0x6E, + /* 0x6F @ 111 */ 0x6F, + /* 0x70 @ 112 */ 0x70, + /* 0x71 @ 113 */ 0x71, + /* 0x72 @ 114 */ 0x72, + /* 0x73 @ 115 */ 0x73, + /* 0x74 @ 116 */ 0x74, + /* 0x75 @ 117 */ 0x75, + /* 0x76 @ 118 */ 0x76, + /* 0x77 @ 119 */ 0x77, + /* 0x78 @ 120 */ 0x78, + /* 0x79 @ 121 */ 0x79, + /* 0x7A @ 122 */ 0x7A, + /* 0x7B @ 123 */ 0x7B, + /* 0x7C @ 124 */ 0x7C, + /* 0x7D @ 125 */ 0x7D, + /* 0x7E @ 126 */ 0x7E, + /* 0x7F @ 127 */ 0x7F, + /* 0x80 @ 128 */ 0xE2, 0x82, 0xAC, + /* 0x81 @ 131 */ 0xEF, 0xBF, 0xBD, + /* 0x82 @ 134 */ 0xE2, 0x80, 0x9A, + /* 0x83 @ 137 */ 0xC6, 0x92, + /* 0x84 @ 139 */ 0xE2, 0x80, 0x9E, + /* 0x85 @ 142 */ 0xE2, 0x80, 0xA6, + /* 0x86 @ 145 */ 0xE2, 0x80, 0xA0, + /* 0x87 @ 148 */ 0xE2, 0x80, 0xA1, + /* 0x88 @ 151 */ 0xCB, 0x86, + /* 0x89 @ 153 */ 0xE2, 0x80, 0xB0, + /* 0x8A @ 156 */ 0xC5, 0xA0, + /* 0x8B @ 158 */ 0xE2, 0x80, 0xB9, + /* 0x8C @ 161 */ 0xC5, 0x92, + /* 0x8D @ 163 */ 0xEF, 0xBF, 0xBD, + /* 0x8E @ 166 */ 0xC5, 0xBD, + /* 0x8F @ 168 */ 0xEF, 0xBF, 0xBD, + /* 0x90 @ 171 */ 0xEF, 0xBF, 0xBD, + /* 0x91 @ 174 */ 0xE2, 0x80, 0x98, + /* 0x92 @ 177 */ 0xE2, 0x80, 0x99, + /* 0x93 @ 180 */ 0xE2, 0x80, 0x9C, + /* 0x94 @ 183 */ 0xE2, 0x80, 0x9D, + /* 0x95 @ 186 */ 0xE2, 0x80, 0xA2, + /* 0x96 @ 189 */ 0xE2, 0x80, 0x93, + /* 0x97 @ 192 */ 0xE2, 0x80, 0x94, + /* 0x98 @ 195 */ 0xCB, 0x9C, + /* 0x99 @ 197 */ 0xE2, 0x84, 0xA2, + /* 0x9A @ 200 */ 0xC5, 0xA1, + /* 0x9B @ 202 */ 0xE2, 0x80, 0xBA, + /* 0x9C @ 205 */ 0xC5, 0x93, + /* 0x9D @ 207 */ 0xEF, 0xBF, 0xBD, + /* 0x9E @ 210 */ 0xC5, 0xBE, + /* 0x9F @ 212 */ 0xC5, 0xB8, + /* 0xA0 @ 214 */ 0xC2, 0xA0, + /* 0xA1 @ 216 */ 0xC2, 0xA1, + /* 0xA2 @ 218 */ 0xC2, 0xA2, + /* 0xA3 @ 220 */ 0xC2, 0xA3, + /* 0xA4 @ 222 */ 0xC2, 0xA4, + /* 0xA5 @ 224 */ 0xC2, 0xA5, + /* 0xA6 @ 226 */ 0xC2, 0xA6, + /* 0xA7 @ 228 */ 0xC2, 0xA7, + /* 0xA8 @ 230 */ 0xC2, 0xA8, + /* 0xA9 @ 232 */ 0xC2, 0xA9, + /* 0xAA @ 234 */ 0xC2, 0xAA, + /* 0xAB @ 236 */ 0xC2, 0xAB, + /* 0xAC @ 238 */ 0xC2, 0xAC, + /* 0xAD @ 240 */ 0xC2, 0xAD, + /* 0xAE @ 242 */ 0xC2, 0xAE, + /* 0xAF @ 244 */ 0xC2, 0xAF, + /* 0xB0 @ 246 */ 0xC2, 0xB0, + /* 0xB1 @ 248 */ 0xC2, 0xB1, + /* 0xB2 @ 250 */ 0xC2, 0xB2, + /* 0xB3 @ 252 */ 0xC2, 0xB3, + /* 0xB4 @ 254 */ 0xC2, 0xB4, + /* 0xB5 @ 256 */ 0xC2, 0xB5, + /* 0xB6 @ 258 */ 0xC2, 0xB6, + /* 0xB7 @ 260 */ 0xC2, 0xB7, + /* 0xB8 @ 262 */ 0xC2, 0xB8, + /* 0xB9 @ 264 */ 0xC2, 0xB9, + /* 0xBA @ 266 */ 0xC2, 0xBA, + /* 0xBB @ 268 */ 0xC2, 0xBB, + /* 0xBC @ 270 */ 0xC2, 0xBC, + /* 0xBD @ 272 */ 0xC2, 0xBD, + /* 0xBE @ 274 */ 0xC2, 0xBE, + /* 0xBF @ 276 */ 0xC2, 0xBF, + /* 0xC0 @ 278 */ 0xC3, 0x80, + /* 0xC1 @ 280 */ 0xC3, 0x81, + /* 0xC2 @ 282 */ 0xC3, 0x82, + /* 0xC3 @ 284 */ 0xC3, 0x83, + /* 0xC4 @ 286 */ 0xC3, 0x84, + /* 0xC5 @ 288 */ 0xC3, 0x85, + /* 0xC6 @ 290 */ 0xC3, 0x86, + /* 0xC7 @ 292 */ 0xC3, 0x87, + /* 0xC8 @ 294 */ 0xC3, 0x88, + /* 0xC9 @ 296 */ 0xC3, 0x89, + /* 0xCA @ 298 */ 0xC3, 0x8A, + /* 0xCB @ 300 */ 0xC3, 0x8B, + /* 0xCC @ 302 */ 0xC3, 0x8C, + /* 0xCD @ 304 */ 0xC3, 0x8D, + /* 0xCE @ 306 */ 0xC3, 0x8E, + /* 0xCF @ 308 */ 0xC3, 0x8F, + /* 0xD0 @ 310 */ 0xC3, 0x90, + /* 0xD1 @ 312 */ 0xC3, 0x91, + /* 0xD2 @ 314 */ 0xC3, 0x92, + /* 0xD3 @ 316 */ 0xC3, 0x93, + /* 0xD4 @ 318 */ 0xC3, 0x94, + /* 0xD5 @ 320 */ 0xC3, 0x95, + /* 0xD6 @ 322 */ 0xC3, 0x96, + /* 0xD7 @ 324 */ 0xC3, 0x97, + /* 0xD8 @ 326 */ 0xC3, 0x98, + /* 0xD9 @ 328 */ 0xC3, 0x99, + /* 0xDA @ 330 */ 0xC3, 0x9A, + /* 0xDB @ 332 */ 0xC3, 0x9B, + /* 0xDC @ 334 */ 0xC3, 0x9C, + /* 0xDD @ 336 */ 0xC3, 0x9D, + /* 0xDE @ 338 */ 0xC3, 0x9E, + /* 0xDF @ 340 */ 0xC3, 0x9F, + /* 0xE0 @ 342 */ 0xC3, 0xA0, + /* 0xE1 @ 344 */ 0xC3, 0xA1, + /* 0xE2 @ 346 */ 0xC3, 0xA2, + /* 0xE3 @ 348 */ 0xC3, 0xA3, + /* 0xE4 @ 350 */ 0xC3, 0xA4, + /* 0xE5 @ 352 */ 0xC3, 0xA5, + /* 0xE6 @ 354 */ 0xC3, 0xA6, + /* 0xE7 @ 356 */ 0xC3, 0xA7, + /* 0xE8 @ 358 */ 0xC3, 0xA8, + /* 0xE9 @ 360 */ 0xC3, 0xA9, + /* 0xEA @ 362 */ 0xC3, 0xAA, + /* 0xEB @ 364 */ 0xC3, 0xAB, + /* 0xEC @ 366 */ 0xC3, 0xAC, + /* 0xED @ 368 */ 0xC3, 0xAD, + /* 0xEE @ 370 */ 0xC3, 0xAE, + /* 0xEF @ 372 */ 0xC3, 0xAF, + /* 0xF0 @ 374 */ 0xC3, 0xB0, + /* 0xF1 @ 376 */ 0xC3, 0xB1, + /* 0xF2 @ 378 */ 0xC3, 0xB2, + /* 0xF3 @ 380 */ 0xC3, 0xB3, + /* 0xF4 @ 382 */ 0xC3, 0xB4, + /* 0xF5 @ 384 */ 0xC3, 0xB5, + /* 0xF6 @ 386 */ 0xC3, 0xB6, + /* 0xF7 @ 388 */ 0xC3, 0xB7, + /* 0xF8 @ 390 */ 0xC3, 0xB8, + /* 0xF9 @ 392 */ 0xC3, 0xB9, + /* 0xFA @ 394 */ 0xC3, 0xBA, + /* 0xFB @ 396 */ 0xC3, 0xBB, + /* 0xFC @ 398 */ 0xC3, 0xBC, + /* 0xFD @ 400 */ 0xC3, 0xBD, + /* 0xFE @ 402 */ 0xC3, 0xBE, + /* 0xFF @ 404 */ 0xC3, 0xBF, +}; + +static const uint16_t tblofs[257] = { + /* 0x00 */ 0, 1, 2, 3, 4, 5, 6, 7, + /* 0x08 */ 8, 9, 10, 11, 12, 13, 14, 15, + /* 0x10 */ 16, 17, 18, 19, 20, 21, 22, 23, + /* 0x18 */ 24, 25, 26, 27, 28, 29, 30, 31, + /* 0x20 */ 32, 33, 34, 35, 36, 37, 38, 39, + /* 0x28 */ 40, 41, 42, 43, 44, 45, 46, 47, + /* 0x30 */ 48, 49, 50, 51, 52, 53, 54, 55, + /* 0x38 */ 56, 57, 58, 59, 60, 61, 62, 63, + /* 0x40 */ 64, 65, 66, 67, 68, 69, 70, 71, + /* 0x48 */ 72, 73, 74, 75, 76, 77, 78, 79, + /* 0x50 */ 80, 81, 82, 83, 84, 85, 86, 87, + /* 0x58 */ 88, 89, 90, 91, 92, 93, 94, 95, + /* 0x60 */ 96, 97, 98, 99, 100, 101, 102, 103, + /* 0x68 */ 104, 105, 106, 107, 108, 109, 110, 111, + /* 0x70 */ 112, 113, 114, 115, 116, 117, 118, 119, + /* 0x78 */ 120, 121, 122, 123, 124, 125, 126, 127, + /* 0x80 */ 128, 131, 134, 137, 139, 142, 145, 148, + /* 0x88 */ 151, 153, 156, 158, 161, 163, 166, 168, + /* 0x90 */ 171, 174, 177, 180, 183, 186, 189, 192, + /* 0x98 */ 195, 197, 200, 202, 205, 207, 210, 212, + /* 0xA0 */ 214, 216, 218, 220, 222, 224, 226, 228, + /* 0xA8 */ 230, 232, 234, 236, 238, 240, 242, 244, + /* 0xB0 */ 246, 248, 250, 252, 254, 256, 258, 260, + /* 0xB8 */ 262, 264, 266, 268, 270, 272, 274, 276, + /* 0xC0 */ 278, 280, 282, 284, 286, 288, 290, 292, + /* 0xC8 */ 294, 296, 298, 300, 302, 304, 306, 308, + /* 0xD0 */ 310, 312, 314, 316, 318, 320, 322, 324, + /* 0xD8 */ 326, 328, 330, 332, 334, 336, 338, 340, + /* 0xE0 */ 342, 344, 346, 348, 350, 352, 354, 356, + /* 0xE8 */ 358, 360, 362, 364, 366, 368, 370, 372, + /* 0xF0 */ 374, 376, 378, 380, 382, 384, 386, 388, + /* 0xF8 */ 390, 392, 394, 396, 398, 400, 402, 404, + /* sizeof (cp1252_utf8) */ 406 +}; + +/* Check if a string qualifies as UTF-8. */ +static int +is_utf8(const char* src) +{ + uint8_t ch; + size_t i; + const uint8_t* s = (const uint8_t*) src; + + /* We make a loop over every character, until we find a null one. + Remember: The string is supposed to end with a NUL, so ahead checks are safe. */ + while ((ch = *s++)) { + /* Ye olde 7bit ASCII chars 'rr fine for anything */ + if(ch < 0x80) continue; + + /* Now, we watch out for non-UTF conform sequences. */ + else if ((ch < 0xC2) || (ch > 0xFD)) + return 0; + /* check for some misformed sequences */ + if (((ch == 0xC2) && (s[0] < 0xA0)) || + ((ch == 0xEF) && (s[0] == 0xBF) && (s[1] > 0xBD))) + /* XXX add more for outside the BMP */ + return 0; + + /* Check the continuation bytes. */ + if (ch < 0xE0) i = 1; + else if (ch < 0xF0) i = 2; + else if (ch < 0xF8) i = 3; + else if (ch < 0xFC) i = 4; + else + i = 5; + + while (i--) + if ((*s++ & 0xC0) != 0x80) + return 0; + } + + /* If no check failed, the string indeed looks like valid UTF-8. */ + return 1; +} + +/* The main conversion routine. + ICY in CP-1252 (or UTF-8 alreay) to UTF-8 encoded string. + If force is applied, it will always encode to UTF-8, without checking. */ +char * +icy2utf8(const char *src, int force) +{ + const uint8_t *s = (const uint8_t *)src; + size_t srclen, dstlen, i, k; + uint8_t ch, *d; + char *dst; + + /* Some funny streams from Apple/iTunes give ICY info in UTF-8 already. + So, be prepared and don't try to re-encode such. Unless forced. */ + if(!force && is_utf8(src)) return (compat_strdup(src)); + + srclen = strlen(src) + 1; + /* allocate conservatively */ + if ((d = malloc(srclen * 3)) == NULL) + return (NULL); + + i = 0; + dstlen = 0; + while (i < srclen) { + ch = s[i++]; + k = tblofs[ch]; + while (k < tblofs[ch + 1]) + d[dstlen++] = cp1252_utf8[k++]; + } + + /* dstlen includes trailing NUL since srclen also does */ + if ((dst = realloc(d, dstlen)) == NULL) { + free(d); + return (NULL); + } + return (dst); +} + +/* This stuff is for testing only. */ +#ifdef TEST +static const char intext[] = "\225 Gr\374\337e kosten 0,55 \200\205"; + +#include + +int +main(void) +{ + char *t, *t2; + + if ((t = icy2utf8(intext, 0)) == NULL) { + fprintf(stderr, "out of memory\n"); + return (1); + } + + /* make sure it won't be converted twice */ + if ((t2 = icy2utf8(t), 0) == NULL) { + fprintf(stderr, "out of memory\n"); + return (1); + } + + printf("Result is:\t\343\200\214%s\343\200\215\n" + "\t\t\343\200\214%s\343\200\215\n", t, t2); + + free(t); + free(t2); + return (0); +} +#endif diff --git a/src/libmpg123/icy2utf8.h b/src/libmpg123/icy2utf8.h new file mode 100644 index 0000000..aeec012 --- /dev/null +++ b/src/libmpg123/icy2utf8.h @@ -0,0 +1,10 @@ +/* You expect a license plate for _this_ file? */ +#ifndef MPG123_ICY2UTF_H +#define MPG123_ICY2UTF_H + +#ifndef NO_ICY +/* (string, force conversion) */ +char *icy2utf8(const char *, int); +#endif + +#endif diff --git a/src/libmpg123/id3.c b/src/libmpg123/id3.c new file mode 100644 index 0000000..eafe004 --- /dev/null +++ b/src/libmpg123/id3.c @@ -0,0 +1,1178 @@ +/* + id3: ID3v2.3 and ID3v2.4 parsing (a relevant subset) + + copyright 2006-2013 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "mpg123lib_intern.h" +#include "id3.h" +#include "debug.h" + +#ifndef NO_ID3V2 /* Only the main parsing routine will always be there. */ + +/* We know the usual text frames plus some specifics. */ +#define KNOWN_FRAMES 5 +static const char frame_type[KNOWN_FRAMES][5] = { "COMM", "TXXX", "RVA2", "USLT", "APIC" }; +enum frame_types { unknown = -2, text = -1, comment, extra, rva2, uslt, picture }; + +/* UTF support definitions */ + +typedef void (*text_converter)(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet); + +static void convert_latin1 (mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet); +static void convert_utf16bom(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet); +static void convert_utf8 (mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet); + +static const text_converter text_converters[4] = +{ + convert_latin1, + /* We always check for (multiple) BOM in 16bit unicode. Without BOM, UTF16 BE is the default. + Errors in encoding are detected anyway. */ + convert_utf16bom, + convert_utf16bom, + convert_utf8 +}; + +static const unsigned int encoding_widths[4] = { 1, 2, 2, 1 }; + +/* the code starts here... */ + +static void null_id3_links(mpg123_handle *fr) +{ + fr->id3v2.title = NULL; + fr->id3v2.artist = NULL; + fr->id3v2.album = NULL; + fr->id3v2.year = NULL; + fr->id3v2.genre = NULL; + fr->id3v2.comment = NULL; +} + +void init_id3(mpg123_handle *fr) +{ + fr->id3v2.version = 0; /* nothing there */ + null_id3_links(fr); + fr->id3v2.comments = 0; + fr->id3v2.comment_list = NULL; + fr->id3v2.texts = 0; + fr->id3v2.text = NULL; + fr->id3v2.extras = 0; + fr->id3v2.extra = NULL; + fr->id3v2.pictures = 0; + fr->id3v2.picture = NULL; +} + +/* Managing of the text, comment and extra lists. */ + +/* Initialize one element. */ +static void init_mpg123_text(mpg123_text *txt) +{ + mpg123_init_string(&txt->text); + mpg123_init_string(&txt->description); + txt->id[0] = 0; + txt->id[1] = 0; + txt->id[2] = 0; + txt->id[3] = 0; + txt->lang[0] = 0; + txt->lang[1] = 0; + txt->lang[2] = 0; +} + +static void init_mpg123_picture(mpg123_picture *pic) +{ + mpg123_init_string(&pic->mime_type); + mpg123_init_string(&pic->description); + pic->type = 0; + pic->size = 0; + pic->data = NULL; +} + +/* Free memory of one element. */ +static void free_mpg123_text(mpg123_text *txt) +{ + mpg123_free_string(&txt->text); + mpg123_free_string(&txt->description); +} + +static void free_mpg123_picture(mpg123_picture * pic) +{ + mpg123_free_string(&pic->mime_type); + mpg123_free_string(&pic->description); + if (pic->data != NULL) + free(pic->data); +} + +/* Free memory of whole list. */ +#define free_comment(mh) free_id3_text(&((mh)->id3v2.comment_list), &((mh)->id3v2.comments)) +#define free_text(mh) free_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts)) +#define free_extra(mh) free_id3_text(&((mh)->id3v2.extra), &((mh)->id3v2.extras)) +#define free_picture(mh) free_id3_picture(&((mh)->id3v2.picture), &((mh)->id3v2.pictures)) +static void free_id3_text(mpg123_text **list, size_t *size) +{ + size_t i; + for(i=0; i<*size; ++i) free_mpg123_text(&((*list)[i])); + + free(*list); + *list = NULL; + *size = 0; +} +static void free_id3_picture(mpg123_picture **list, size_t *size) +{ + size_t i; + for(i=0; i<*size; ++i) free_mpg123_picture(&((*list)[i])); + + free(*list); + *list = NULL; + *size = 0; +} + +/* Add items to the list. */ +#define add_comment(mh) add_id3_text(&((mh)->id3v2.comment_list), &((mh)->id3v2.comments)) +#define add_text(mh) add_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts)) +#define add_extra(mh) add_id3_text(&((mh)->id3v2.extra), &((mh)->id3v2.extras)) +#define add_picture(mh) add_id3_picture(&((mh)->id3v2.picture), &((mh)->id3v2.pictures)) +static mpg123_text *add_id3_text(mpg123_text **list, size_t *size) +{ + mpg123_text *x = safe_realloc(*list, sizeof(mpg123_text)*(*size+1)); + if(x == NULL) return NULL; /* bad */ + + *list = x; + *size += 1; + init_mpg123_text(&((*list)[*size-1])); + + return &((*list)[*size-1]); /* Return pointer to the added text. */ +} +static mpg123_picture *add_id3_picture(mpg123_picture **list, size_t *size) +{ + mpg123_picture *x = safe_realloc(*list, sizeof(mpg123_picture)*(*size+1)); + if(x == NULL) return NULL; /* bad */ + + *list = x; + *size += 1; + init_mpg123_picture(&((*list)[*size-1])); + + return &((*list)[*size-1]); /* Return pointer to the added picture. */ +} + + +/* Remove the last item. */ +#define pop_comment(mh) pop_id3_text(&((mh)->id3v2.comment_list), &((mh)->id3v2.comments)) +#define pop_text(mh) pop_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts)) +#define pop_extra(mh) pop_id3_text(&((mh)->id3v2.extra), &((mh)->id3v2.extras)) +#define pop_picture(mh) pop_id3_picture(&((mh)->id3v2.picture), &((mh)->id3v2.pictures)) +static void pop_id3_text(mpg123_text **list, size_t *size) +{ + mpg123_text *x; + if(*size < 1) return; + + free_mpg123_text(&((*list)[*size-1])); + if(*size > 1) + { + x = safe_realloc(*list, sizeof(mpg123_text)*(*size-1)); + if(x != NULL){ *list = x; *size -= 1; } + } + else + { + free(*list); + *list = NULL; + *size = 0; + } +} +static void pop_id3_picture(mpg123_picture **list, size_t *size) +{ + mpg123_picture *x; + if(*size < 1) return; + + free_mpg123_picture(&((*list)[*size-1])); + if(*size > 1) + { + x = safe_realloc(*list, sizeof(mpg123_picture)*(*size-1)); + if(x != NULL){ *list = x; *size -= 1; } + } + else + { + free(*list); + *list = NULL; + *size = 0; + } +} + +/* OK, back to the higher level functions. */ + +void exit_id3(mpg123_handle *fr) +{ + free_picture(fr); + free_comment(fr); + free_extra(fr); + free_text(fr); +} + +void reset_id3(mpg123_handle *fr) +{ + exit_id3(fr); + init_id3(fr); +} + +/* Set the id3v2.artist id3v2.title ... links to elements of the array. */ +void id3_link(mpg123_handle *fr) +{ + size_t i; + mpg123_id3v2 *v2 = &fr->id3v2; + debug("linking ID3v2"); + null_id3_links(fr); + for(i=0; itexts; ++i) + { + mpg123_text *entry = &v2->text[i]; + if (!strncmp("TIT2", entry->id, 4)) v2->title = &entry->text; + else if(!strncmp("TALB", entry->id, 4)) v2->album = &entry->text; + else if(!strncmp("TPE1", entry->id, 4)) v2->artist = &entry->text; + else if(!strncmp("TYER", entry->id, 4)) v2->year = &entry->text; + else if(!strncmp("TCON", entry->id, 4)) v2->genre = &entry->text; + } + for(i=0; icomments; ++i) + { + mpg123_text *entry = &v2->comment_list[i]; + if(entry->description.fill == 0 || entry->description.p[0] == 0) + v2->comment = &entry->text; + } + /* When no generic comment found, use the last non-generic one. */ + if(v2->comment == NULL && v2->comments > 0) + v2->comment = &v2->comment_list[v2->comments-1].text; +} + +/* + Store ID3 text data in an mpg123_string; either verbatim copy or everything translated to UTF-8 encoding. + Preserve the zero string separator (I don't need strlen for the total size). + + ID3v2 standard says that there should be one text frame of specific type per tag, and subsequent tags overwrite old values. + So, I always replace the text that may be stored already (perhaps with a list of zero-separated strings, though). +*/ +static void store_id3_text(mpg123_string *sb, unsigned char *source, size_t source_size, const int noquiet, const int notranslate) +{ + unsigned char encoding; + if(!source_size) + { + debug("Empty id3 data!"); + return; + } + + /* We shall just copy the data. Client wants to decode itself. */ + if(notranslate) + { + /* Future: Add a path for ID3 errors. */ + if(!mpg123_resize_string(sb, source_size)) + { + if(noquiet) error("Cannot resize target string, out of memory?"); + return; + } + memcpy(sb->p, source, source_size); + sb->fill = source_size; + debug1("stored undecoded ID3 text of size %"SIZE_P, (size_p)source_size); + return; + } + + encoding = source[0]; + if(encoding > mpg123_id3_enc_max) + { + if(noquiet) + error1("Unknown text encoding %u, I take no chances, sorry!", encoding); + + mpg123_free_string(sb); + return; + } + id3_to_utf8(sb, encoding, source+1, source_size-1, noquiet); + + if(sb->fill) debug1("UTF-8 string (the first one): %s", sb->p); + else if(noquiet) error("unable to convert string to UTF-8 (out of memory, junk input?)!"); +} + +/* On error, sb->size is 0. */ +/* Also, encoding has been checked already! */ +void id3_to_utf8(mpg123_string *sb, unsigned char encoding, const unsigned char *source, size_t source_size, int noquiet) +{ + unsigned int bwidth; + debug1("encoding: %u", encoding); + /* A note: ID3v2.3 uses UCS-2 non-variable 16bit encoding, v2.4 uses UTF16. + UTF-16 uses a reserved/private range in UCS-2 to add the magic, so we just always treat it as UTF. */ + bwidth = encoding_widths[encoding]; + /* Hack! I've seen a stray zero byte before BOM. Is that supposed to happen? */ + if(encoding != mpg123_id3_utf16be) /* UTF16be _can_ beging with a null byte! */ + while(source_size > bwidth && source[0] == 0) + { + --source_size; + ++source; + debug("skipped leading zero"); + } + if(source_size % bwidth) + { + /* When we need two bytes for a character, it's strange to have an uneven bytestream length. */ + if(noquiet) warning2("Weird tag size %d for encoding %u - I will probably trim too early or something but I think the MP3 is broken.", (int)source_size, encoding); + source_size -= source_size % bwidth; + } + text_converters[encoding](sb, source, source_size, noquiet); +} + +/* You have checked encoding to be in the range already. */ +static unsigned char *next_text(unsigned char* prev, unsigned char encoding, size_t limit) +{ + unsigned char *text = prev; + size_t width = encoding_widths[encoding]; + + /* So I go lengths to find zero or double zero... + Remember bug 2834636: Only check for aligned NULLs! */ + while(text-prev < (ssize_t)limit) + { + if(text[0] == 0) + { + if(width <= limit-(text-prev)) + { + size_t i = 1; + for(; i= limit) text = NULL; + + return text; +} + +static const char *enc_name(unsigned char enc) +{ + switch(enc) + { + case 0: return "Latin 1"; + case 1: return "UTF-16 BOM"; + case 2: return "UTF-16 BE"; + case 3: return "UTF-8"; + default: return "unknown!"; + } +} + +static void process_text(mpg123_handle *fr, unsigned char *realdata, size_t realsize, char *id) +{ + /* Text encoding $xx */ + /* The text (encoded) ... */ + mpg123_text *t = add_text(fr); + if(VERBOSE4) fprintf(stderr, "Note: Storing text from %s encoding\n", enc_name(realdata[0])); + if(t == NULL) + { + if(NOQUIET) error("Unable to attach new text!"); + return; + } + memcpy(t->id, id, 4); + store_id3_text(&t->text, realdata, realsize, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + if(VERBOSE4) fprintf(stderr, "Note: ID3v2 %c%c%c%c text frame: %s\n", id[0], id[1], id[2], id[3], t->text.p); +} + +static void process_picture(mpg123_handle *fr, unsigned char *realdata, size_t realsize) +{ + unsigned char encoding = realdata[0]; + mpg123_picture *i = NULL; + unsigned char* workpoint; + if(realsize == 0) + { + debug("Empty id3 data!"); + return; + } + if(encoding > mpg123_id3_enc_max) + { + if(NOQUIET) + error1("Unknown text encoding %u, I take no chances, sorry!", encoding); + return; + } + if(VERBOSE4) fprintf(stderr, "Note: Storing picture from APIC frame.\n"); + /* decompose realdata accordingly */ + i = add_picture(fr); + if(i == NULL) + { + if(NOQUIET) error("Unable to attach new picture!"); + return; + } + realdata++; realsize--; + /* get mime type (encoding is always latin-1) */ + workpoint = next_text(realdata, 0, realsize); + if (workpoint == NULL) { + pop_picture(fr); + if (NOQUIET) error("Unable to get mime type for picture; skipping picture."); + return; + } + id3_to_utf8(&i->mime_type, 0, realdata, workpoint - realdata, NOQUIET); + realsize -= workpoint - realdata; + realdata = workpoint; + /* get picture type */ + i->type = realdata[0]; + realdata++; realsize--; + /* get description (encoding is encoding) */ + workpoint = next_text(realdata, encoding, realsize); + if (workpoint == NULL) { + if (NOQUIET) error("Unable to get description for picture; skipping picture."); + pop_picture(fr); + return; + } + id3_to_utf8(&i->description, encoding, realdata, workpoint - realdata, NOQUIET); + realsize -= workpoint - realdata; + if (realsize == 0) { + if (NOQUIET) error("No picture data defined; skipping picture."); + pop_picture(fr); + return; + } + /* store_id3_picture(i, picture, realsize, NOQUIET)) */ + i->data = (unsigned char*)malloc(realsize); + if (i->data == NULL) { + if (NOQUIET) error("Unable to allocate memory for picture; skipping picture"); + pop_picture(fr); + return; + } + memcpy(i->data, workpoint, realsize); + i->size = realsize; + if(VERBOSE4) fprintf(stderr, "Note: ID3v2 APIC picture frame of type: %d\n", i->type); +} + +/* Store a new comment that perhaps is a RVA / RVA_ALBUM/AUDIOPHILE / RVA_MIX/RADIO one + Special gimmik: It also stores USLT to the texts. Stucture is the same as for comments. */ +static void process_comment(mpg123_handle *fr, enum frame_types tt, unsigned char *realdata, size_t realsize, int rva_level, char *id) +{ + /* Text encoding $xx */ + /* Language $xx xx xx */ + /* Short description (encoded!) $00 (00) */ + /* Then the comment text (encoded) ... */ + unsigned char encoding = realdata[0]; + unsigned char *lang = realdata+1; /* I'll only use the 3 bytes! */ + unsigned char *descr = realdata+4; + unsigned char *text = NULL; + mpg123_text *xcom = NULL; + mpg123_text localcom; /* UTF-8 variant for local processing. */ + + if(realsize < (size_t)(descr-realdata)) + { + if(NOQUIET) error1("Invalid frame size of %"SIZE_P" (too small for anything).", (size_p)realsize); + return; + } + if(encoding > mpg123_id3_enc_max) + { + if(NOQUIET) + error1("Unknown text encoding %u, I take no chances, sorry!", encoding); + return; + } + xcom = (tt == uslt ? add_text(fr) : add_comment(fr)); + if(VERBOSE4) fprintf(stderr, "Note: Storing comment from %s encoding\n", enc_name(realdata[0])); + if(xcom == NULL) + { + if(NOQUIET) error("Unable to attach new comment!"); + return; + } + memcpy(xcom->lang, lang, 3); + memcpy(xcom->id, id, 4); + /* Now I can abuse a byte from lang for the encoding. */ + descr[-1] = encoding; + /* Be careful with finding the end of description, I have to honor encoding here. */ + text = next_text(descr, encoding, realsize-(descr-realdata)); + if(text == NULL) + { + if(NOQUIET) error("No comment text / valid description?"); + pop_comment(fr); + return; + } + + init_mpg123_text(&localcom); + /* Store the text, without translation to UTF-8, but for comments always a local copy in UTF-8. + Reminder: No bailing out from here on without freeing the local comment data! */ + store_id3_text(&xcom->description, descr-1, text-descr+1, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + if(tt == comment) + store_id3_text(&localcom.description, descr-1, text-descr+1, NOQUIET, 0); + + text[-1] = encoding; /* Byte abusal for encoding... */ + store_id3_text(&xcom->text, text-1, realsize+1-(text-realdata), NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + /* Remember: I will probably decode the above (again) for rva comment checking. So no messing around, please. */ + + if(VERBOSE4) /* Do _not_ print the verbatim text: The encoding might be funny! */ + { + fprintf(stderr, "Note: ID3 comm/uslt desc of length %"SIZE_P".\n", (size_p)xcom->description.fill); + fprintf(stderr, "Note: ID3 comm/uslt text of length %"SIZE_P".\n", (size_p)xcom->text.fill); + } + /* Look out for RVA info only when we really deal with a straight comment. */ + if(tt == comment && localcom.description.fill > 0) + { + int rva_mode = -1; /* mix / album */ + if( !strcasecmp(localcom.description.p, "rva") + || !strcasecmp(localcom.description.p, "rva_mix") + || !strcasecmp(localcom.description.p, "rva_track") + || !strcasecmp(localcom.description.p, "rva_radio") ) + rva_mode = 0; + else if( !strcasecmp(localcom.description.p, "rva_album") + || !strcasecmp(localcom.description.p, "rva_audiophile") + || !strcasecmp(localcom.description.p, "rva_user") ) + rva_mode = 1; + if((rva_mode > -1) && (fr->rva.level[rva_mode] <= rva_level)) + { + /* Only translate the contents in here where we really need them. */ + store_id3_text(&localcom.text, text-1, realsize+1-(text-realdata), NOQUIET, 0); + if(localcom.text.fill > 0) + { + fr->rva.gain[rva_mode] = (float) atof(localcom.text.p); + if(VERBOSE3) fprintf(stderr, "Note: RVA value %fdB\n", fr->rva.gain[rva_mode]); + fr->rva.peak[rva_mode] = 0; + fr->rva.level[rva_mode] = rva_level; + } + } + } + /* Make sure to free the local memory... */ + free_mpg123_text(&localcom); +} + +static void process_extra(mpg123_handle *fr, unsigned char* realdata, size_t realsize, int rva_level, char *id) +{ + /* Text encoding $xx */ + /* Description ... $00 (00) */ + /* Text ... */ + unsigned char encoding = realdata[0]; + unsigned char *descr = realdata+1; /* remember, the encoding is descr[-1] */ + unsigned char *text; + mpg123_text *xex; + mpg123_text localex; + + if((int)realsize < descr-realdata) + { + if(NOQUIET) error1("Invalid frame size of %lu (too small for anything).", (unsigned long)realsize); + return; + } + if(encoding > mpg123_id3_enc_max) + { + if(NOQUIET) + error1("Unknown text encoding %u, I take no chances, sorry!", encoding); + return; + } + text = next_text(descr, encoding, realsize-(descr-realdata)); + if(VERBOSE4) fprintf(stderr, "Note: Storing extra from %s encoding\n", enc_name(realdata[0])); + if(text == NULL) + { + if(NOQUIET) error("No extra frame text / valid description?"); + return; + } + xex = add_extra(fr); + if(xex == NULL) + { + if(NOQUIET) error("Unable to attach new extra text!"); + return; + } + memcpy(xex->id, id, 4); + init_mpg123_text(&localex); /* For our local copy. */ + + /* The outside storage gets reencoded to UTF-8 only if not requested otherwise. + Remember that we really need the -1 here to hand in the encoding byte!*/ + store_id3_text(&xex->description, descr-1, text-descr+1, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + /* Our local copy is always stored in UTF-8! */ + store_id3_text(&localex.description, descr-1, text-descr+1, NOQUIET, 0); + /* At first, only store the outside copy of the payload. We may not need the local copy. */ + text[-1] = encoding; + store_id3_text(&xex->text, text-1, realsize-(text-realdata)+1, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + + /* Now check if we would like to interpret this extra info for RVA. */ + if(localex.description.fill > 0) + { + int is_peak = 0; + int rva_mode = -1; /* mix / album */ + + if(!strncasecmp(localex.description.p, "replaygain_track_",17)) + { + if(VERBOSE3) fprintf(stderr, "Note: RVA ReplayGain track gain/peak\n"); + + rva_mode = 0; + if(!strcasecmp(localex.description.p, "replaygain_track_peak")) is_peak = 1; + else if(strcasecmp(localex.description.p, "replaygain_track_gain")) rva_mode = -1; + } + else + if(!strncasecmp(localex.description.p, "replaygain_album_",17)) + { + if(VERBOSE3) fprintf(stderr, "Note: RVA ReplayGain album gain/peak\n"); + + rva_mode = 1; + if(!strcasecmp(localex.description.p, "replaygain_album_peak")) is_peak = 1; + else if(strcasecmp(localex.description.p, "replaygain_album_gain")) rva_mode = -1; + } + if((rva_mode > -1) && (fr->rva.level[rva_mode] <= rva_level)) + { + /* Now we need the translated copy of the data. */ + store_id3_text(&localex.text, text-1, realsize-(text-realdata)+1, NOQUIET, 0); + if(localex.text.fill > 0) + { + if(is_peak) + { + fr->rva.peak[rva_mode] = (float) atof(localex.text.p); + if(VERBOSE3) fprintf(stderr, "Note: RVA peak %f\n", fr->rva.peak[rva_mode]); + } + else + { + fr->rva.gain[rva_mode] = (float) atof(localex.text.p); + if(VERBOSE3) fprintf(stderr, "Note: RVA gain %fdB\n", fr->rva.gain[rva_mode]); + } + fr->rva.level[rva_mode] = rva_level; + } + } + } + + free_mpg123_text(&localex); +} + +/* Make a ID3v2.3+ 4-byte ID from a ID3v2.2 3-byte ID + Note that not all frames survived to 2.4; the mapping goes to 2.3 . + A notable miss is the old RVA frame, which is very unspecific anyway. + This function returns -1 when a not known 3 char ID was encountered, 0 otherwise. */ +static int promote_framename(mpg123_handle *fr, char *id) /* fr because of VERBOSE macros */ +{ + size_t i; + char *old[] = + { + "COM", "TAL", "TBP", "TCM", "TCO", "TCR", "TDA", "TDY", "TEN", "TFT", + "TIM", "TKE", "TLA", "TLE", "TMT", "TOA", "TOF", "TOL", "TOR", "TOT", + "TP1", "TP2", "TP3", "TP4", "TPA", "TPB", "TRC", "TDA", "TRK", "TSI", + "TSS", "TT1", "TT2", "TT3", "TXT", "TXX", "TYE" + }; + char *new[] = + { + "COMM", "TALB", "TBPM", "TCOM", "TCON", "TCOP", "TDAT", "TDLY", "TENC", "TFLT", + "TIME", "TKEY", "TLAN", "TLEN", "TMED", "TOPE", "TOFN", "TOLY", "TORY", "TOAL", + "TPE1", "TPE2", "TPE3", "TPE4", "TPOS", "TPUB", "TSRC", "TRDA", "TRCK", "TSIZ", + "TSSE", "TIT1", "TIT2", "TIT3", "TEXT", "TXXX", "TYER" + }; + for(i=0; ird->read_frame_body(fr, buf, 6)) < 0) /* read more header information */ + return ret2; + + if(buf[0] == 0xff) return 0; /* Revision, will never be 0xff. */ + + /* second new byte are some nice flags, if these are invalid skip the whole thing */ + flags = buf[1]; + debug1("ID3v2: flags 0x%08x", flags); + /* use 4 bytes from buf to construct 28bit uint value and return 1; return 0 if bytes are not synchsafe */ + #define synchsafe_to_long(buf,res) \ + ( \ + (((buf)[0]|(buf)[1]|(buf)[2]|(buf)[3]) & 0x80) ? 0 : \ + (res = (((unsigned long) (buf)[0]) << 21) \ + | (((unsigned long) (buf)[1]) << 14) \ + | (((unsigned long) (buf)[2]) << 7) \ + | ((unsigned long) (buf)[3]) \ + ,1) \ + ) + /* id3v2.3 does not store synchsafe frame sizes, but synchsafe tag size - doh! */ + /* Remember: bytes_to_long() can yield ULONG_MAX on 32 bit platforms! */ + #define bytes_to_long(buf,res) \ + ( \ + major == 3 ? \ + (res = (((unsigned long) (buf)[0]) << 24) \ + | (((unsigned long) (buf)[1]) << 16) \ + | (((unsigned long) (buf)[2]) << 8) \ + | ((unsigned long) (buf)[3]) \ + ,1) : synchsafe_to_long(buf,res) \ + ) + /* for id3v2.2 only */ + #define threebytes_to_long(buf,res) \ + ( \ + res = (((unsigned long) (buf)[0]) << 16) \ + | (((unsigned long) (buf)[1]) << 8) \ + | ((unsigned long) (buf)[2]) \ + ) + + /* length-10 or length-20 (footer present); 4 synchsafe integers == 28 bit number */ + /* we have already read 10 bytes, so left are length or length+10 bytes belonging to tag */ + /* Note: This is an 28 bit value in 32 bit storage, plenty of space for */ + /* length+x for reasonable x. */ + if(!synchsafe_to_long(buf+2,length)) + { + if(NOQUIET) error4("Bad tag length (not synchsafe): 0x%02x%02x%02x%02x; You got a bad ID3 tag here.", buf[2],buf[3],buf[4],buf[5]); + return 0; + } + debug1("ID3v2: tag data length %lu", length); +#ifndef NO_ID3V2 + if(VERBOSE2) fprintf(stderr,"Note: ID3v2.%i rev %i tag of %lu bytes\n", major, buf[0], length); + /* skip if unknown version/scary flags, parse otherwise */ + if(fr->p.flags & MPG123_SKIP_ID3V2) + { + if(VERBOSE3) + fprintf(stderr, "Note: Skipping ID3v2 tag per user request.\n"); + skiptag = 1; + } + if((flags & UNKNOWN_FLAGS) || (major > 4) || (major < 2)) + { + if(NOQUIET) + warning2( "ID3v2: Won't parse the ID3v2 tag with major version" + " %u and flags 0x%xu - some extra code may be needed" + , major, flags ); + skiptag = 1; + } + if(length < 10) + { + if(NOQUIET) + warning1("ID3v2: unrealistic small tag lengh %lu, skipping", length); + skiptag = 1; + } + if(skiptag) + { +#endif + if((ret2 = fr->rd->skip_bytes(fr,length)) < 0) /* will not store data in backbuff! */ + ret = ret2; +#ifndef NO_ID3V2 + } + else + { + unsigned char* tagdata = NULL; + fr->id3v2.version = major; + /* try to interpret that beast */ + if((tagdata = (unsigned char*) malloc(length+1)) != NULL) + { + debug("ID3v2: analysing frames..."); + if((ret2 = fr->rd->read_frame_body(fr,tagdata,length)) > 0) + { + unsigned long tagpos = 0; + /* bytes of frame title and of framesize value */ + unsigned int head_part = fr->id3v2.version > 2 ? 4 : 3; + unsigned int flag_part = fr->id3v2.version > 2 ? 2 : 0; + /* The amount of bytes that are unconditionally read for each frame: */ + /* ID, size, flags. */ + unsigned int framebegin = head_part+head_part+flag_part; + debug1("ID3v2: have read at all %lu bytes for the tag now", (unsigned long)length+6); + /* going to apply strlen for strings inside frames, make sure that it doesn't overflow! */ + tagdata[length] = 0; + if(flags & EXTHEAD_FLAG) + { + debug("ID3v2: skipping extended header"); + if(!bytes_to_long(tagdata, tagpos) || tagpos >= length) + { + ret = 0; + if(NOQUIET) + error4( "Bad (non-synchsafe/too large) tag offset:" + "0x%02x%02x%02x%02x" + , tagdata[0], tagdata[1], tagdata[2], tagdata[3] ); + } + } + if(ret > 0) + { + char id[5]; + unsigned long framesize; + unsigned long fflags; /* need 16 bits, actually */ + id[4] = 0; + /* Pos now advanced after ext head, now a frame has to follow. */ + /* Note: tagpos <= length, which is 28 bit integer, so both */ + /* far away from overflow for adding known small values. */ + /* I want to read at least one full header now. */ + while(length >= tagpos+framebegin) + { + int i = 0; + unsigned long pos = tagpos; + /* level 1,2,3 - 0 is info from lame/info tag! */ + /* rva tags with ascending significance, then general frames */ + enum frame_types tt = unknown; + /* we may have entered the padding zone or any other strangeness: check if we have valid frame id characters */ + for(i=0; i< head_part; ++i) + if( !( ((tagdata[tagpos+i] > 47) && (tagdata[tagpos+i] < 58)) + || ((tagdata[tagpos+i] > 64) && (tagdata[tagpos+i] < 91)) ) ) + { + debug5("ID3v2: real tag data apparently ended after %lu bytes with 0x%02x%02x%02x%02x", tagpos, tagdata[tagpos], tagdata[tagpos+1], tagdata[tagpos+2], tagdata[tagpos+3]); + /* This is no hard error... let's just hope that we got something meaningful already (ret==1 in that case). */ + goto tagparse_cleanup; /* Need to escape two loops here. */ + } + if(ret > 0) + { + /* 4 or 3 bytes id */ + strncpy(id, (char*) tagdata+pos, head_part); + id[head_part] = 0; /* terminate for 3 or 4 bytes */ + pos += head_part; + tagpos += head_part; + /* size as 32 bits or 28 bits */ + if(fr->id3v2.version == 2) threebytes_to_long(tagdata+pos, framesize); + else + if(!bytes_to_long(tagdata+pos, framesize)) + { + /* Just assume that up to now there was some good data. */ + if(NOQUIET) error1("ID3v2: non-syncsafe size of %s frame, skipping the remainder of tag", id); + break; + } + if(VERBOSE3) fprintf(stderr, "Note: ID3v2 %s frame of size %lu\n", id, framesize); + tagpos += head_part; + pos += head_part; + if(fr->id3v2.version > 2) + { + fflags = (((unsigned long) tagdata[pos]) << 8) | ((unsigned long) tagdata[pos+1]); + pos += 2; + tagpos += 2; + } + else fflags = 0; + + if(length - tagpos < framesize) + { + if(NOQUIET) error("Whoa! ID3v2 frame claims to be larger than the whole rest of the tag."); + break; + } + tagpos += framesize; /* the important advancement in whole tag */ + /* for sanity, after full parsing tagpos should be == pos */ + /* debug4("ID3v2: found %s frame, size %lu (as bytes: 0x%08lx), flags 0x%016lx", id, framesize, framesize, fflags); */ + /* %0abc0000 %0h00kmnp */ + #define BAD_FFLAGS (unsigned long) 36784 + #define PRES_TAG_FFLAG 16384 + #define PRES_FILE_FFLAG 8192 + #define READ_ONLY_FFLAG 4096 + #define GROUP_FFLAG 64 + #define COMPR_FFLAG 8 + #define ENCR_FFLAG 4 + #define UNSYNC_FFLAG 2 + #define DATLEN_FFLAG 1 + if(head_part < 4 && promote_framename(fr, id) != 0) continue; + + /* shall not or want not handle these */ + if(fflags & (BAD_FFLAGS | COMPR_FFLAG | ENCR_FFLAG)) + { + if(NOQUIET) warning("ID3v2: skipping invalid/unsupported frame"); + continue; + } + + for(i = 0; i < KNOWN_FRAMES; ++i) + if(!strncmp(frame_type[i], id, 4)){ tt = i; break; } + + if(id[0] == 'T' && tt != extra) tt = text; + + if(tt != unknown) + { + int rva_mode = -1; /* mix / album */ + unsigned long realsize = framesize; + unsigned char* realdata = tagdata+pos; + if((flags & UNSYNC_FLAG) || (fflags & UNSYNC_FFLAG)) + { + unsigned long ipos = 0; + unsigned long opos = 0; + debug("Id3v2: going to de-unsync the frame data"); + /* de-unsync: FF00 -> FF; real FF00 is simply represented as FF0000 ... */ + /* damn, that means I have to delete bytes from withing the data block... thus need temporal storage */ + /* standard mandates that de-unsync should always be safe if flag is set */ + realdata = (unsigned char*) malloc(framesize); /* will need <= bytes */ + if(realdata == NULL) + { + if(NOQUIET) error("ID3v2: unable to allocate working buffer for de-unsync"); + continue; + } + /* now going byte per byte through the data... */ + realdata[0] = tagdata[pos]; + opos = 1; + for(ipos = pos+1; ipos < pos+framesize; ++ipos) + { + if(!((tagdata[ipos] == 0) && (tagdata[ipos-1] == 0xff))) + { + realdata[opos++] = tagdata[ipos]; + } + } + realsize = opos; + debug2("ID3v2: de-unsync made %lu out of %lu bytes", realsize, framesize); + } + pos = 0; /* now at the beginning again... */ + /* Avoid reading over boundary, even if there is a */ + /* zero byte of padding for safety. */ + if(realsize) switch(tt) + { + case comment: + case uslt: + process_comment(fr, tt, realdata, realsize, comment+1, id); + break; + case extra: /* perhaps foobar2000's work */ + process_extra(fr, realdata, realsize, extra+1, id); + break; + case rva2: /* "the" RVA tag */ + { + /* starts with null-terminated identification */ + if(VERBOSE3) fprintf(stderr, "Note: RVA2 identification \"%s\"\n", realdata); + /* default: some individual value, mix mode */ + rva_mode = 0; + if( !strncasecmp((char*)realdata, "album", 5) + || !strncasecmp((char*)realdata, "audiophile", 10) + || !strncasecmp((char*)realdata, "user", 4)) + rva_mode = 1; + if(fr->rva.level[rva_mode] <= rva2+1) + { + pos += strlen((char*) realdata) + 1; + if(realdata[pos] == 1) + { + ++pos; + /* only handle master channel */ + debug("ID3v2: it is for the master channel"); + /* two bytes adjustment, one byte for bits representing peak - n bytes, eh bits, for peak */ + /* 16 bit signed integer = dB * 512 ... the double cast is needed to preserve the sign of negative values! */ + fr->rva.gain[rva_mode] = (float) ( (((short)((signed char)realdata[pos])) << 8) | realdata[pos+1] ) / 512; + pos += 2; + if(VERBOSE3) fprintf(stderr, "Note: RVA value %fdB\n", fr->rva.gain[rva_mode]); + /* heh, the peak value is represented by a number of bits - but in what manner? Skipping that part */ + fr->rva.peak[rva_mode] = 0; + fr->rva.level[rva_mode] = rva2+1; + } + } + } + break; + /* non-rva metainfo, simply store... */ + case text: + process_text(fr, realdata, realsize, id); + break; + case picture: + if (fr->p.flags & MPG123_PICTURE) + process_picture(fr, realdata, realsize); + + break; + default: if(NOQUIET) error1("ID3v2: unknown frame type %i", tt); + } + if((flags & UNSYNC_FLAG) || (fflags & UNSYNC_FFLAG)) free(realdata); + } + #undef BAD_FFLAGS + #undef PRES_TAG_FFLAG + #undef PRES_FILE_FFLAG + #undef READ_ONLY_FFLAG + #undef GROUP_FFLAG + #undef COMPR_FFLAG + #undef ENCR_FFLAG + #undef UNSYNC_FFLAG + #undef DATLEN_FFLAG + } + else break; + #undef KNOWN_FRAMES + } + } + } + else + { + /* There are tags with zero length. Strictly not an error, then. */ + if(length > 0 && NOQUIET && ret2 != MPG123_NEED_MORE) error("ID3v2: Duh, not able to read ID3v2 tag data."); + ret = ret2; + } +tagparse_cleanup: + free(tagdata); + } + else + { + if(NOQUIET) error1("ID3v2: Arrg! Unable to allocate %lu bytes for interpreting ID3v2 data - trying to skip instead.", length); + if((ret2 = fr->rd->skip_bytes(fr,length)) < 0) ret = ret2; /* will not store data in backbuff! */ + else ret = 0; + } + } +#endif /* NO_ID3V2 */ + /* skip footer if present */ + if((ret > 0) && (flags & FOOTER_FLAG) && ((ret2 = fr->rd->skip_bytes(fr,length)) < 0)) ret = ret2; + + return ret; + #undef UNSYNC_FLAG + #undef EXTHEAD_FLAG + #undef EXP_FLAG + #undef FOOTER_FLAG + #undef UNKOWN_FLAGS +} + +#ifndef NO_ID3V2 /* Disabling all the rest... */ + +static void convert_latin1(mpg123_string *sb, const unsigned char* s, size_t l, const int noquiet) +{ + size_t length = l; + size_t i; + unsigned char *p; + /* determine real length, a latin1 character can at most take 2 in UTF8 */ + for(i=0; i= 0x80) ++length; + + debug1("UTF-8 length: %lu", (unsigned long)length); + /* one extra zero byte for paranoia */ + if(!mpg123_resize_string(sb, length+1)){ mpg123_free_string(sb); return ; } + + p = (unsigned char*) sb->p; /* Signedness doesn't matter but it shows I thought about the non-issue */ + for(i=0; i>6); + *(p+1) = 0x80 | (s[i] & 0x3f); + p+=2; + } + + sb->p[length] = 0; + sb->fill = length+1; +} + +/* + Check if we have a byte oder mark(s) there, return: + -1: little endian + 0: no BOM + 1: big endian + + This modifies source and len to indicate the data _after_ the BOM(s). + Note on nasty data: The last encountered BOM determines the endianness. + I have seen data with multiple BOMS, namely from "the" id3v2 program. + Not nice, but what should I do? +*/ +static int check_bom(const unsigned char** source, size_t *len) +{ + int this_bom = 0; + int further_bom = 0; + + if(*len < 2) return 0; + + if((*source)[0] == 0xff && (*source)[1] == 0xfe) + this_bom = -1; + + if((*source)[0] == 0xfe && (*source)[1] == 0xff) + this_bom = 1; + + /* Skip the detected BOM. */ + if(this_bom != 0) + { + *source += 2; + *len -= 2; + /* Check for following BOMs. The last one wins! */ + further_bom = check_bom(source, len); + if(further_bom == 0) return this_bom; /* End of the recursion. */ + else return further_bom; + } + else return 0; +} + +#define FULLPOINT(f,s) ( (((f)&0x3ff)<<10) + ((s)&0x3ff) + 0x10000 ) +/* Remember: There's a limit at 0x1ffff. */ +#define UTF8LEN(x) ( (x)<0x80 ? 1 : ((x)<0x800 ? 2 : ((x)<0x10000 ? 3 : 4))) +static void convert_utf16bom(mpg123_string *sb, const unsigned char* s, size_t l, const int noquiet) +{ + size_t i; + size_t n; /* number bytes that make up full pairs */ + unsigned char *p; + size_t length = 0; /* the resulting UTF-8 length */ + /* Determine real length... extreme case can be more than utf-16 length. */ + size_t high = 0; + size_t low = 1; + int bom_endian; + + debug1("convert_utf16 with length %lu", (unsigned long)l); + + bom_endian = check_bom(&s, &l); + debug1("UTF16 endianness check: %i", bom_endian); + + if(bom_endian == -1) /* little-endian */ + { + high = 1; /* The second byte is the high byte. */ + low = 0; /* The first byte is the low byte. */ + } + + n = (l/2)*2; /* number bytes that make up full pairs */ + + /* first: get length, check for errors -- stop at first one */ + for(i=0; i < n; i+=2) + { + unsigned long point = ((unsigned long) s[i+high]<<8) + s[i+low]; + if((point & 0xfc00) == 0xd800) /* lead surrogate */ + { + unsigned short second = (i+3 < l) ? (s[i+2+high]<<8) + s[i+2+low] : 0; + if((second & 0xfc00) == 0xdc00) /* good... */ + { + point = FULLPOINT(point,second); + length += UTF8LEN(point); /* possibly 4 bytes */ + i+=2; /* We overstepped one word. */ + } + else /* if no valid pair, break here */ + { + if(noquiet) error2("Invalid UTF16 surrogate pair at %li (0x%04lx).", (unsigned long)i, point); + n = i; /* Forget the half pair, END! */ + break; + } + } + else length += UTF8LEN(point); /* 1,2 or 3 bytes */ + } + + if(!mpg123_resize_string(sb, length+1)){ mpg123_free_string(sb); return ; } + + /* Now really convert, skip checks as these have been done just before. */ + p = (unsigned char*) sb->p; /* Signedness doesn't matter but it shows I thought about the non-issue */ + for(i=0; i < n; i+=2) + { + unsigned long codepoint = ((unsigned long) s[i+high]<<8) + s[i+low]; + if((codepoint & 0xfc00) == 0xd800) /* lead surrogate */ + { + unsigned short second = (s[i+2+high]<<8) + s[i+2+low]; + codepoint = FULLPOINT(codepoint,second); + i+=2; /* We overstepped one word. */ + } + if(codepoint < 0x80) *p++ = (unsigned char) codepoint; + else if(codepoint < 0x800) + { + *p++ = (unsigned char) (0xc0 | (codepoint>>6)); + *p++ = (unsigned char) (0x80 | (codepoint & 0x3f)); + } + else if(codepoint < 0x10000) + { + *p++ = (unsigned char) (0xe0 | (codepoint>>12)); + *p++ = 0x80 | ((codepoint>>6) & 0x3f); + *p++ = 0x80 | (codepoint & 0x3f); + } + else if (codepoint < 0x200000) + { + *p++ = (unsigned char) (0xf0 | codepoint>>18); + *p++ = (unsigned char) (0x80 | ((codepoint>>12) & 0x3f)); + *p++ = (unsigned char) (0x80 | ((codepoint>>6) & 0x3f)); + *p++ = (unsigned char) (0x80 | (codepoint & 0x3f)); + } /* ignore bigger ones (that are not possible here anyway) */ + } + sb->p[sb->size-1] = 0; /* paranoia... */ + sb->fill = sb->size; +} +#undef UTF8LEN +#undef FULLPOINT + +static void convert_utf8(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet) +{ + if(mpg123_resize_string(sb, len+1)) + { + memcpy(sb->p, source, len); + sb->p[len] = 0; + sb->fill = len+1; + } + else mpg123_free_string(sb); +} + +#endif diff --git a/src/libmpg123/id3.h b/src/libmpg123/id3.h new file mode 100644 index 0000000..3a56694 --- /dev/null +++ b/src/libmpg123/id3.h @@ -0,0 +1,43 @@ +/* + id3: ID3v2.3 and ID3v2.4 parsing (a relevant subset) + + copyright 2006-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#ifndef MPG123_ID3_H +#define MPG123_ID3_H + +/* really need it _here_! */ +#include "frame.h" + +#ifdef NO_ID3V2 +# ifdef init_id3 +# undef init_id3 +# endif +# define init_id3(fr) +# ifdef exit_id3 +# undef exit_id3 +# endif +# define exit_id3(fr) +# ifdef reset_id3 +# undef reset_id3 +# endif +# define reset_id3(fr) +# ifdef id3_link +# undef id3_link +# endif +# define id3_link(fr) +#else +void init_id3(mpg123_handle *fr); +void exit_id3(mpg123_handle *fr); +void reset_id3(mpg123_handle *fr); +void id3_link(mpg123_handle *fr); +#endif +int parse_new_id3(mpg123_handle *fr, unsigned long first4bytes); +/* Convert text from some ID3 encoding to UTf-8. + On error, sb->fill is 0. The noquiet flag enables warning/error messages. */ +void id3_to_utf8(mpg123_string *sb, unsigned char encoding, const unsigned char *source, size_t source_size, int noquiet); + +#endif diff --git a/src/libmpg123/index.c b/src/libmpg123/index.c new file mode 100644 index 0000000..162237a --- /dev/null +++ b/src/libmpg123/index.c @@ -0,0 +1,136 @@ +/* + index: frame index data structure and functions + + copyright 2007-2015 by the mpg123 project + -= free software under the terms of the LGPL 2.1 =- + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "intsym.h" +#include "index.h" +#include "debug.h" + +/* The next expected frame offset, one step ahead. */ +static off_t fi_next(struct frame_index *fi) +{ + return (off_t)fi->fill*fi->step; +} + +/* Shrink down the used index to the half. + Be careful with size = 1 ... there's no shrinking possible there. */ +static void fi_shrink(struct frame_index *fi) +{ + if(fi->fill < 2) return; /* Won't shrink below 1. */ + else + { /* Double the step, half the fill. Should work as well for fill%2 = 1 */ + size_t c; + debug2("shrink index with fill %lu and step %lu", (unsigned long)fi->fill, (unsigned long)fi->step); + fi->step *= 2; + fi->fill /= 2; + /* Move the data down. */ + for(c = 0; c < fi->fill; ++c) + fi->data[c] = fi->data[2*c]; + } + + fi->next = fi_next(fi); +} + +void fi_init(struct frame_index *fi) +{ + fi->data = NULL; + fi->step = 1; + fi->fill = 0; + fi->size = 0; + fi->grow_size = 0; + fi->next = fi_next(fi); +} + +void fi_exit(struct frame_index *fi) +{ + debug2("fi_exit: %p and %lu", (void*)fi->data, (unsigned long)fi->size); + if(fi->size && fi->data != NULL) free(fi->data); + + fi_init(fi); /* Be prepared for further fun, still. */ +} + +int fi_resize(struct frame_index *fi, size_t newsize) +{ + off_t *newdata = NULL; + if(newsize == fi->size) return 0; + + if(newsize > 0 && newsize < fi->size) + { /* When we reduce buffer size a bit, shrink stuff. */ + while(fi->fill > newsize){ fi_shrink(fi); } + } + + newdata = safe_realloc(fi->data, newsize*sizeof(off_t)); + if(newsize == 0 || newdata != NULL) + { + fi->data = newdata; + fi->size = newsize; + if(fi->fill > fi->size) fi->fill = fi->size; + + fi->next = fi_next(fi); + debug2("new index of size %lu at %p", (unsigned long)fi->size, (void*)fi->data); + return 0; + } + else + { + error("failed to resize index!"); + return -1; + } +} + +void fi_add(struct frame_index *fi, off_t pos) +{ + debug3("wanting to add to fill %lu, step %lu, size %lu", (unsigned long)fi->fill, (unsigned long)fi->step, (unsigned long)fi->size); + if(fi->fill == fi->size) + { /* Index is full, we need to shrink... or grow. */ + /* Store the current frame number to check later if we still want it. */ + off_t framenum = fi->fill*fi->step; + /* If we want not / cannot grow, we shrink. */ + if( !(fi->grow_size && fi_resize(fi, fi->size+fi->grow_size)==0) ) + fi_shrink(fi); + + /* Now check if we still want to add this frame (could be that not, because of changed step). */ + if(fi->next != framenum) return; + } + /* When we are here, we want that frame. */ + if(fi->fill < fi->size) /* safeguard for size=1, or just generally */ + { + debug1("adding to index at %p", (void*)(fi->data+fi->fill)); + fi->data[fi->fill] = pos; + ++fi->fill; + fi->next = fi_next(fi); + debug3("added pos %li to index with fill %lu and step %lu", (long) pos, (unsigned long)fi->fill, (unsigned long)fi->step); + } +} + +int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill) +{ + if(fi_resize(fi, fill) == -1) return -1; + fi->step = step; + if(offsets != NULL) + { + memcpy(fi->data, offsets, fill*sizeof(off_t)); + fi->fill = fill; + } + else + { + /* allocation only, no entries in index yet */ + fi->fill = 0; + } + fi->next = fi_next(fi); + debug3("set new index of fill %lu, size %lu at %p", + (unsigned long)fi->fill, (unsigned long)fi->size, (void*)fi->data); + return 0; +} + +void fi_reset(struct frame_index *fi) +{ + debug1("reset with size %"SIZE_P, (size_p)fi->size); + fi->fill = 0; + fi->step = 1; + fi->next = fi_next(fi); +} diff --git a/src/libmpg123/index.h b/src/libmpg123/index.h new file mode 100644 index 0000000..3e1ca64 --- /dev/null +++ b/src/libmpg123/index.h @@ -0,0 +1,59 @@ +#ifndef MPG123_H_INDEX +#define MPG123_H_INDEX + +/* + index: frame index data structure and functions + + This is for keeping track of frame positions for accurate seeking. + Now in it's own file, with initial code from frame.c and parse.c . + + The idea of the index with a certain amount of entries is to cover + all yet-encountered frame positions with minimal coarseness. + Meaning: At first every frame position is recorded, then, when + the index is full, every second position is trown away to make + space. Next time it is full, the same happens. And so on. + In this manner we maintain a good resolution with the given + maximum index size while covering the whole stream. + + copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "config.h" +#include "compat.h" + +struct frame_index +{ + off_t *data; /* actual data, the frame positions */ + off_t step; /* advancement in frame number per index point */ + off_t next; /* frame offset supposed to come next into the index */ + size_t size; /* total number of possible entries */ + size_t fill; /* number of used entries */ + size_t grow_size; /* if > 0: index allowed to grow on need with these steps, instead of lowering resolution */ +}; + +/* The condition for a framenum to be appended to the index. + if(FI_NEXT(fr->index, fr->num)) fi_add(offset); */ +#define FI_NEXT(fi, framenum) ((fi).size && framenum == (fi).next) + +/* Initialize stuff, set things to zero and NULL... */ +void fi_init(struct frame_index *fi); +/* Deallocate/zero things. */ +void fi_exit(struct frame_index *fi); + +/* Prepare a given size, preserving current fill, if possible. + If the new size is smaller than fill, the entry density is reduced. + Return 0 on success. */ +int fi_resize(struct frame_index *fi, size_t newsize); + +/* Append a frame position, reducing index density if needed. */ +void fi_add(struct frame_index *fi, off_t pos); + +/* Replace the frame index */ +int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill); + +/* Empty the index (setting fill=0 and step=1), but keep current size. */ +void fi_reset(struct frame_index *fi); + +#endif diff --git a/src/libmpg123/l12_integer_tables.h b/src/libmpg123/l12_integer_tables.h new file mode 100644 index 0000000..ad8a956 --- /dev/null +++ b/src/libmpg123/l12_integer_tables.h @@ -0,0 +1,282 @@ +/* + l12_integer_tables.h: Layer1/2 Constant tables for integer decoders + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#ifndef MPG123_L12_INTEGER_TABLES_H +#define MPG123_L12_INTEGER_TABLES_H + +static const real layer12_table[27][64] = +{ + { /* C90 does not like empty initializer. Fill with junk. */ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + , 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 + , 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 + , 57, 58, 59, 60, 61, 62, 63, 64 + }, + { + -1431655765,-1136305934,-901886617,-715827883,-568152967,-450943309,-357913941,-284076483, + -225471654,-178956971,-142038242,-112735827,-89478485,-71019121,-56367914,-44739243, + -35509560,-28183957,-22369621,-17754780,-14091978,-11184811,-8877390,-7045989, + -5592405,-4438695,-3522995,-2796203,-2219348,-1761497,-1398101,-1109674, + -880749,-699051,-554837,-440374,-349525,-277418,-220187,-174763, + -138709,-110094,-87381,-69355,-55047,-43691,-34677,-27523, + -21845,-17339,-13762,-10923,-8669,-6881,-5461,-4335, + -3440,-2731,-2167,-1720,-1365,-1084,-860,0 + }, + { + 1431655765,1136305934,901886617,715827883,568152967,450943309,357913941,284076483, + 225471654,178956971,142038242,112735827,89478485,71019121,56367914,44739243, + 35509560,28183957,22369621,17754780,14091978,11184811,8877390,7045989, + 5592405,4438695,3522995,2796203,2219348,1761497,1398101,1109674, + 880749,699051,554837,440374,349525,277418,220187,174763, + 138709,110094,87381,69355,55047,43691,34677,27523, + 21845,17339,13762,10923,8669,6881,5461,4335, + 3440,2731,2167,1720,1365,1084,860,0 + }, + { + 613566757,486988257,386522836,306783378,243494129,193261418,153391689,121747064, + 96630709,76695845,60873532,48315355,38347922,30436766,24157677,19173961, + 15218383,12078839,9586981,7609192,6039419,4793490,3804596,3019710, + 2396745,1902298,1509855,1198373,951149,754927,599186,475574, + 377464,299593,237787,188732,149797,118894,94366,74898, + 59447,47183,37449,29723,23591,18725,14862,11796, + 9362,7431,5898,4681,3715,2949,2341,1858, + 1474,1170,929,737,585,464,369,0 + }, + { + 286331153,227261187,180377323,143165577,113630593,90188662,71582788,56815297, + 45094331,35791394,28407648,22547165,17895697,14203824,11273583,8947849, + 7101912,5636791,4473924,3550956,2818396,2236962,1775478,1409198, + 1118481,887739,704599,559241,443870,352299,279620,221935, + 176150,139810,110967,88075,69905,55484,44037,34953, + 27742,22019,17476,13871,11009,8738,6935,5505, + 4369,3468,2752,2185,1734,1376,1092,867, + 688,546,433,344,273,217,172,0 + }, + { + 138547332,109965090,87279350,69273666,54982545,43639675,34636833,27491273, + 21819838,17318417,13745636,10909919,8659208,6872818,5454959,4329604, + 3436409,2727480,2164802,1718205,1363740,1082401,859102,681870, + 541201,429551,340935,270600,214776,170467,135300,107388, + 85234,67650,53694,42617,33825,26847,21308,16913, + 13423,10654,8456,6712,5327,4228,3356,2664, + 2114,1678,1332,1057,839,666,529,419, + 333,264,210,166,132,105,83,0 + }, + { + 68174084,54109806,42946982,34087042,27054903,21473491,17043521,13527452, + 10736745,8521761,6763726,5368373,4260880,3381863,2684186,2130440, + 1690931,1342093,1065220,845466,671047,532610,422733,335523, + 266305,211366,167762,133153,105683,83881,66576,52842, + 41940,33288,26421,20970,16644,13210,10485,8322, + 6605,5243,4161,3303,2621,2081,1651,1311, + 1040,826,655,520,413,328,260,206, + 164,130,103,82,65,52,41,0 + }, + { + 33818640,26841872,21304408,16909320,13420936,10652204,8454660,6710468, + 5326102,4227330,3355234,2663051,2113665,1677617,1331526,1056833, + 838809,665763,528416,419404,332881,264208,209702,166441, + 132104,104851,83220,66052,52426,41610,33026,26213, + 20805,16513,13106,10403,8257,6553,5201,4128, + 3277,2601,2064,1638,1300,1032,819,650, + 516,410,325,258,205,163,129,102, + 81,65,51,41,32,26,20,0 + }, + { + 16843009,13368305,10610431,8421505,6684153,5305215,4210752,3342076, + 2652608,2105376,1671038,1326304,1052688,835519,663152,526344, + 417760,331576,263172,208880,165788,131586,104440,82894, + 65793,52220,41447,32897,26110,20723,16448,13055, + 10362,8224,6527,5181,4112,3264,2590,2056, + 1632,1295,1028,816,648,514,408,324, + 257,204,162,129,102,81,64,51, + 40,32,25,20,16,13,10,0 + }, + { + 8405024,6671072,5294833,4202512,3335536,2647417,2101256,1667768, + 1323708,1050628,833884,661854,525314,416942,330927,262657, + 208471,165464,131329,104236,82732,65664,52118,41366, + 32832,26059,20683,16416,13029,10341,8208,6515, + 5171,4104,3257,2585,2052,1629,1293,1026, + 814,646,513,407,323,257,204,162, + 128,102,81,64,51,40,32,25, + 20,16,13,10,8,6,5,0 + }, + { + 4198404,3332275,2644829,2099202,1666138,1322414,1049601,833069, + 661207,524801,416534,330604,262400,208267,165302,131200, + 104134,82651,65600,52067,41325,32800,26033,20663, + 16400,13017,10331,8200,6508,5166,4100,3254, + 2583,2050,1627,1291,1025,814,646,513, + 407,323,256,203,161,128,102,81, + 64,51,40,32,25,20,16,13, + 10,8,6,5,4,3,3,0 + }, + { + 2098177,1665324,1321768,1049088,832662,660884,524544,416331, + 330442,262272,208165,165221,131136,104083,82611,65568, + 52041,41305,32784,26021,20653,16392,13010,10326, + 8196,6505,5163,4098,3253,2582,2049,1626, + 1291,1025,813,645,512,407,323,256, + 203,161,128,102,81,64,51,40, + 32,25,20,16,13,10,8,6, + 5,4,3,3,2,2,1,0 + }, + { + 1048832,832459,660723,524416,416229,330361,262208,208115, + 165181,131104,104057,82590,65552,52029,41295,32776, + 26014,20648,16388,13007,10324,8194,6504,5162, + 4097,3252,2581,2049,1626,1290,1024,813, + 645,512,406,323,256,203,161,128, + 102,81,64,51,40,32,25,20, + 16,13,10,8,6,5,4,3, + 3,2,2,1,1,1,1,0 + }, + { + 524352,416178,330321,262176,208089,165161,131088,104045, + 82580,65544,52022,41290,32772,26011,20645,16386, + 13006,10323,8193,6503,5161,4097,3251,2581, + 2048,1626,1290,1024,813,645,512,406, + 323,256,203,161,128,102,81,64, + 51,40,32,25,20,16,13,10, + 8,6,5,4,3,3,2,2, + 1,1,1,1,1,0,0,0 + }, + { + 262160,208077,165150,131080,104038,82575,65540,52019, + 41288,32770,26010,20644,16385,13005,10322,8193, + 6502,5161,4096,3251,2580,2048,1626,1290, + 1024,813,645,512,406,323,256,203, + 161,128,102,81,64,51,40,32, + 25,20,16,13,10,8,6,5, + 4,3,3,2,2,1,1,1, + 1,1,0,0,0,0,0,0 + }, + { + 131076,104035,82573,65538,52018,41286,32769,26009, + 20643,16385,13004,10322,8192,6502,5161,4096, + 3251,2580,2048,1626,1290,1024,813,645, + 512,406,323,256,203,161,128,102, + 81,64,51,40,32,25,20,16, + 13,10,8,6,5,4,3,3, + 2,2,1,1,1,1,1,0, + 0,0,0,0,0,0,0,0 + }, + { + 65537,52017,41286,32769,26008,20643,16384,13004, + 10321,8192,6502,5161,4096,3251,2580,2048, + 1626,1290,1024,813,645,512,406,323, + 256,203,161,128,102,81,64,51, + 40,32,25,20,16,13,10,8, + 6,5,4,3,3,2,2,1, + 1,1,1,1,0,0,0,0, + 0,0,0,0,0,0,0,0 + }, + { + -1717986918,-1363567121,-1082263941,-858993459,-681783560,-541131970,-429496730,-340891780, + -270565985,-214748365,-170445890,-135282993,-107374182,-85222945,-67641496,-53687091, + -42611473,-33820748,-26843546,-21305736,-16910374,-13421773,-10652868,-8455187, + -6710886,-5326434,-4227594,-3355443,-2663217,-2113797,-1677722,-1331609, + -1056898,-838861,-665804,-528449,-419430,-332902,-264225,-209715, + -166451,-132112,-104858,-83226,-66056,-52429,-41613,-33028, + -26214,-20806,-16514,-13107,-10403,-8257,-6554,-5202, + -4129,-3277,-2601,-2064,-1638,-1300,-1032,0 + }, + { + -858993459,-681783560,-541131970,-429496730,-340891780,-270565985,-214748365,-170445890, + -135282993,-107374182,-85222945,-67641496,-53687091,-42611473,-33820748,-26843546, + -21305736,-16910374,-13421773,-10652868,-8455187,-6710886,-5326434,-4227594, + -3355443,-2663217,-2113797,-1677722,-1331609,-1056898,-838861,-665804, + -528449,-419430,-332902,-264225,-209715,-166451,-132112,-104858, + -83226,-66056,-52429,-41613,-33028,-26214,-20806,-16514, + -13107,-10403,-8257,-6554,-5202,-4129,-3277,-2601, + -2064,-1638,-1300,-1032,-819,-650,-516,0 + }, + { + 858993459,681783560,541131970,429496730,340891780,270565985,214748365,170445890, + 135282993,107374182,85222945,67641496,53687091,42611473,33820748,26843546, + 21305736,16910374,13421773,10652868,8455187,6710886,5326434,4227594, + 3355443,2663217,2113797,1677722,1331609,1056898,838861,665804, + 528449,419430,332902,264225,209715,166451,132112,104858, + 83226,66056,52429,41613,33028,26214,20806,16514, + 13107,10403,8257,6554,5202,4129,3277,2601, + 2064,1638,1300,1032,819,650,516,0 + }, + { + 1717986918,1363567121,1082263941,858993459,681783560,541131970,429496730,340891780, + 270565985,214748365,170445890,135282993,107374182,85222945,67641496,53687091, + 42611473,33820748,26843546,21305736,16910374,13421773,10652868,8455187, + 6710886,5326434,4227594,3355443,2663217,2113797,1677722,1331609, + 1056898,838861,665804,528449,419430,332902,264225,209715, + 166451,132112,104858,83226,66056,52429,41613,33028, + 26214,20806,16514,13107,10403,8257,6554,5202, + 4129,3277,2601,2064,1638,1300,1032,0 + }, + { + -1908874354,-1515074579,-1202515490,-954437177,-757537289,-601257745,-477218588,-378768645, + -300628872,-238609294,-189384322,-150314436,-119304647,-94692161,-75157218,-59652324, + -47346081,-37578609,-29826162,-23673040,-18789305,-14913081,-11836520,-9394652, + -7456540,-5918260,-4697326,-3728270,-2959130,-2348663,-1864135,-1479565, + -1174332,-932068,-739783,-587166,-466034,-369891,-293583,-233017, + -184946,-146791,-116508,-92473,-73396,-58254,-46236,-36698, + -29127,-23118,-18349,-14564,-11559,-9174,-7282,-5780, + -4587,-3641,-2890,-2294,-1820,-1445,-1147,0 + }, + { + -954437177,-757537289,-601257745,-477218588,-378768645,-300628872,-238609294,-189384322, + -150314436,-119304647,-94692161,-75157218,-59652324,-47346081,-37578609,-29826162, + -23673040,-18789305,-14913081,-11836520,-9394652,-7456540,-5918260,-4697326, + -3728270,-2959130,-2348663,-1864135,-1479565,-1174332,-932068,-739783, + -587166,-466034,-369891,-293583,-233017,-184946,-146791,-116508, + -92473,-73396,-58254,-46236,-36698,-29127,-23118,-18349, + -14564,-11559,-9174,-7282,-5780,-4587,-3641,-2890, + -2294,-1820,-1445,-1147,-910,-722,-573,0 + }, + { + -477218588,-378768645,-300628872,-238609294,-189384322,-150314436,-119304647,-94692161, + -75157218,-59652324,-47346081,-37578609,-29826162,-23673040,-18789305,-14913081, + -11836520,-9394652,-7456540,-5918260,-4697326,-3728270,-2959130,-2348663, + -1864135,-1479565,-1174332,-932068,-739783,-587166,-466034,-369891, + -293583,-233017,-184946,-146791,-116508,-92473,-73396,-58254, + -46236,-36698,-29127,-23118,-18349,-14564,-11559,-9174, + -7282,-5780,-4587,-3641,-2890,-2294,-1820,-1445, + -1147,-910,-722,-573,-455,-361,-287,0 + }, + { + 477218588,378768645,300628872,238609294,189384322,150314436,119304647,94692161, + 75157218,59652324,47346081,37578609,29826162,23673040,18789305,14913081, + 11836520,9394652,7456540,5918260,4697326,3728270,2959130,2348663, + 1864135,1479565,1174332,932068,739783,587166,466034,369891, + 293583,233017,184946,146791,116508,92473,73396,58254, + 46236,36698,29127,23118,18349,14564,11559,9174, + 7282,5780,4587,3641,2890,2294,1820,1445, + 1147,910,722,573,455,361,287,0 + }, + { + 954437177,757537289,601257745,477218588,378768645,300628872,238609294,189384322, + 150314436,119304647,94692161,75157218,59652324,47346081,37578609,29826162, + 23673040,18789305,14913081,11836520,9394652,7456540,5918260,4697326, + 3728270,2959130,2348663,1864135,1479565,1174332,932068,739783, + 587166,466034,369891,293583,233017,184946,146791,116508, + 92473,73396,58254,46236,36698,29127,23118,18349, + 14564,11559,9174,7282,5780,4587,3641,2890, + 2294,1820,1445,1147,910,722,573,0 + }, + { + 1908874354,1515074579,1202515490,954437177,757537289,601257745,477218588,378768645, + 300628872,238609294,189384322,150314436,119304647,94692161,75157218,59652324, + 47346081,37578609,29826162,23673040,18789305,14913081,11836520,9394652, + 7456540,5918260,4697326,3728270,2959130,2348663,1864135,1479565, + 1174332,932068,739783,587166,466034,369891,293583,233017, + 184946,146791,116508,92473,73396,58254,46236,36698, + 29127,23118,18349,14564,11559,9174,7282,5780, + 4587,3641,2890,2294,1820,1445,1147,0 + }, +}; + +#endif diff --git a/src/libmpg123/l2tables.h b/src/libmpg123/l2tables.h new file mode 100644 index 0000000..23ed2ab --- /dev/null +++ b/src/libmpg123/l2tables.h @@ -0,0 +1,164 @@ +/* + l2tables.h: Layer 2 Alloc tables + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + most other tables are calculated on program start (which is (of course) not ISO-conform) + Layer-3 huffman table is in huffman.h +*/ + + +#ifndef _MPG123_L2TABLES_H_ +#define _MPG123_L2TABLES_H_ + +static const struct al_table alloc_0[] = { + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767} }; + +static const struct al_table alloc_1[] = { + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767} }; + +static const struct al_table alloc_2[] = { + {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255}, + {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383}, + {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255}, + {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} }; + +static const struct al_table alloc_3[] = { + {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255}, + {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383}, + {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255}, + {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} }; + +static const struct al_table alloc_4[] = { + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9} }; + +#endif + diff --git a/src/libmpg123/l3_integer_tables.h b/src/libmpg123/l3_integer_tables.h new file mode 100644 index 0000000..f600c31 --- /dev/null +++ b/src/libmpg123/l3_integer_tables.h @@ -0,0 +1,1002 @@ +/* + l3_integer_tables.h: Layer3 Constant tables for integer decoders + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#ifndef MPG123_L3_INTEGER_TABLES_H +#define MPG123_L3_INTEGER_TABLES_H + +#ifdef PRECALC_TABLES +static const real ispow[8207] = +{ + 0,8192,20643,35445,52016,70041,89315,109695,131072,153360, + 176491,200407,225060,250408,276414,303048,330281,358087,386444,415331, + 444730,474623,504995,535830,567116,598839,630988,663552,696521,729884, + 763633,797760,832255,867112,902323,937880,973778,1010010,1046569,1083451, + 1120650,1158160,1195976,1234093,1272507,1311213,1350207,1389485,1429042,1468875, + 1508979,1549352,1589990,1630889,1672046,1713458,1755122,1797035,1839193,1881594, + 1924236,1967115,2010229,2053576,2097152,2140956,2184985,2229238,2273710,2318402, + 2363310,2408432,2453767,2499312,2545065,2591025,2637190,2683558,2730126,2776895, + 2823861,2871023,2918379,2965929,3013670,3061600,3109719,3158025,3206517,3255192, + 3304050,3353089,3402309,3451707,3501282,3551033,3600960,3651060,3701332,3751776, + 3802390,3853172,3904123,3955241,4006524,4057972,4109583,4161357,4213293,4265389, + 4317644,4370058,4422630,4475359,4528243,4581282,4634476,4687822,4741320,4794970, + 4848770,4902720,4956819,5011066,5065460,5120000,5174686,5229517,5284492,5339610, + 5394871,5450274,5505818,5561502,5617327,5673290,5729391,5785631,5842007,5898519, + 5955168,6011951,6068869,6125920,6183105,6240422,6297871,6355451,6413162,6471004, + 6528974,6587074,6645302,6703658,6762141,6820751,6879487,6938349,6997336,7056447, + 7115683,7175042,7234524,7294129,7353855,7413703,7473672,7533762,7593972,7654301, + 7714750,7775317,7836002,7896805,7957725,8018762,8079916,8141185,8202570,8264070, + 8325685,8387413,8449256,8511212,8573281,8635462,8697756,8760161,8822678,8885305, + 8948043,9010892,9073850,9136917,9200094,9263379,9326772,9390274,9453882,9517598, + 9581421,9645351,9709386,9773527,9837774,9902125,9966582,10031143,10095807,10160576, + 10225448,10290423,10355500,10420681,10485963,10551347,10616832,10682419,10748106,10813894, + 10879782,10945770,11011857,11078044,11144330,11210715,11277198,11343779,11410458,11477234, + 11544108,11611079,11678147,11745311,11812571,11879927,11947378,12014925,12082567,12150304, + 12218135,12286061,12354081,12422194,12490401,12558701,12627094,12695580,12764158,12832829, + 12901592,12970446,13039392,13108429,13177557,13246776,13316085,13385485,13454975,13524554, + 13594224,13663982,13733830,13803767,13873792,13943906,14014108,14084398,14154776,14225242, + 14295794,14366435,14437162,14507975,14578876,14649862,14720935,14792093,14863337,14934667, + 15006082,15077582,15149167,15220837,15292591,15364429,15436351,15508358,15580448,15652621, + 15724878,15797217,15869640,15942146,16014734,16087404,16160156,16232991,16305907,16378905, + 16451984,16525145,16598386,16671709,16745112,16818596,16892160,16965804,17039528,17113332, + 17187216,17261179,17335222,17409343,17483544,17557824,17632182,17706618,17781133,17855726, + 17930397,18005146,18079973,18154877,18229858,18304917,18380052,18455265,18530554,18605920, + 18681362,18756880,18832475,18908145,18983891,19059713,19135610,19211583,19287630,19363753, + 19439951,19516223,19592571,19668992,19745488,19822058,19898702,19975420,20052211,20129076, + 20206015,20283027,20360112,20437270,20514501,20591805,20669181,20746630,20824151,20901745, + 20979410,21057148,21134957,21212838,21290791,21368815,21446910,21525076,21603314,21681622, + 21760001,21838451,21916971,21995561,22074222,22152953,22231754,22310625,22389566,22468576, + 22547656,22626806,22706024,22785312,22864669,22944094,23023589,23103152,23182783,23262484, + 23342252,23422089,23501993,23581966,23662007,23742115,23822291,23902534,23982845,24063223, + 24143669,24224181,24304761,24385407,24466120,24546899,24627745,24708658,24789637,24870682, + 24951793,25032970,25114213,25195521,25276895,25358335,25439841,25521411,25603047,25684748, + 25766514,25848345,25930241,26012201,26094226,26176316,26258469,26340688,26422970,26505317, + 26587727,26670202,26752740,26835342,26918008,27000737,27083530,27166386,27249305,27332287, + 27415332,27498440,27581611,27664845,27748142,27831501,27914922,27998406,28081952,28165561, + 28249231,28332963,28416758,28500614,28584532,28668511,28752552,28836655,28920819,29005044, + 29089330,29173677,29258086,29342555,29427085,29511676,29596328,29681040,29765813,29850646, + 29935539,30020493,30105507,30190581,30275714,30360908,30446162,30531475,30616848,30702280, + 30787772,30873323,30958934,31044604,31130332,31216120,31301967,31387873,31473838,31559862, + 31645944,31732084,31818284,31904541,31990857,32077231,32163664,32250154,32336703,32423309, + 32509974,32596696,32683476,32770313,32857208,32944161,33031171,33118238,33205363,33292544, + 33379783,33467079,33554432,33641842,33729308,33816832,33904412,33992048,34079741,34167491, + 34255297,34343159,34431078,34519052,34607083,34695170,34783312,34871511,34959765,35048075, + 35136441,35224862,35313339,35401872,35490459,35579102,35667801,35756554,35845363,35934226, + 36023145,36112118,36201147,36290230,36379367,36468560,36557807,36647108,36736464,36825875, + 36915339,37004858,37094431,37184058,37273739,37363474,37453263,37543106,37633003,37722953, + 37812957,37903015,37993126,38083291,38173509,38263780,38354105,38444483,38534914,38625398, + 38715935,38806525,38897168,38987864,39078612,39169414,39260268,39351174,39442133,39533145, + 39624209,39715325,39806494,39897714,39988987,40080312,40171690,40263119,40354600,40446133, + 40537718,40629354,40721042,40812782,40904574,40996417,41088311,41180257,41272254,41364303, + 41456402,41548553,41640755,41733008,41825313,41917668,42010074,42102530,42195038,42287596, + 42380205,42472865,42565575,42658336,42751147,42844009,42936921,43029883,43122895,43215958, + 43309070,43402233,43495446,43588709,43682022,43775384,43868797,43962259,44055771,44149332, + 44242943,44336604,44430314,44524073,44617882,44711741,44805648,44899605,44993611,45087666, + 45181770,45275923,45370126,45464377,45558677,45653025,45747423,45841869,45936364,46030908, + 46125500,46220141,46314830,46409567,46504353,46599187,46694070,46789001,46883980,46979007, + 47074082,47169205,47264376,47359595,47454862,47550177,47645540,47740950,47836408,47931914, + 48027467,48123068,48218716,48314412,48410155,48505945,48601783,48697668,48793601,48889580, + 48985607,49081681,49177802,49273969,49370184,49466446,49562754,49659109,49755511,49851960, + 49948456,50044998,50141586,50238222,50334903,50431631,50528406,50625227,50722094,50819007, + 50915967,51012973,51110025,51207123,51304267,51401457,51498694,51595976,51693304,51790677, + 51888097,51985562,52083073,52180630,52278232,52375880,52473573,52571312,52669097,52766926, + 52864801,52962722,53060688,53158699,53256755,53354856,53453002,53551194,53649430,53747712, + 53846038,53944410,54042826,54141287,54239793,54338344,54436939,54535579,54634263,54732993, + 54831766,54930585,55029447,55128354,55227306,55326302,55425342,55524426,55623555,55722728, + 55821945,55921206,56020511,56119860,56219253,56318690,56418171,56517696,56617265,56716877, + 56816534,56916234,57015977,57115764,57215595,57315470,57415388,57515349,57615354,57715403, + 57815494,57915629,58015808,58116029,58216294,58316602,58416954,58517348,58617785,58718266, + 58818789,58919356,59019965,59120617,59221312,59322050,59422831,59523654,59624521,59725429, + 59826381,59927375,60028412,60129491,60230613,60331777,60432983,60534232,60635524,60736857, + 60838233,60939651,61041112,61142614,61244159,61345746,61447375,61549046,61650759,61752513, + 61854310,61956149,62058030,62159952,62261916,62363922,62465970,62568059,62670191,62772363, + 62874578,62976833,63079131,63181470,63283850,63386272,63488735,63591239,63693785,63796372, + 63899001,64001670,64104381,64207133,64309926,64412760,64515636,64618552,64721509,64824507, + 64927546,65030627,65133747,65236909,65340112,65443355,65546639,65649964,65753329,65856735, + 65960182,66063669,66167197,66270765,66374374,66478023,66581713,66685443,66789213,66893024, + 66996875,67100766,67204698,67308669,67412681,67516733,67620825,67724957,67829130,67933342, + 68037594,68141886,68246218,68350590,68455002,68559454,68663945,68768476,68873047,68977658, + 69082308,69186998,69291728,69396497,69501306,69606154,69711042,69815969,69920936,70025942, + 70130987,70236072,70341196,70446360,70551562,70656804,70762085,70867406,70972765,71078164, + 71183601,71289078,71394594,71500149,71605742,71711375,71817046,71922757,72028506,72134294, + 72240121,72345987,72451891,72557835,72663817,72769837,72875896,72981994,73088130,73194305, + 73300519,73406770,73513061,73619389,73725757,73832162,73938606,74045088,74151609,74258168, + 74364765,74471400,74578073,74684785,74791535,74898323,75005149,75112012,75218914,75325854, + 75432832,75539848,75646902,75753994,75861123,75968291,76075496,76182739,76290020,76397338, + 76504694,76612088,76719520,76826989,76934495,77042040,77149622,77257241,77364898,77472592, + 77580324,77688093,77795899,77903743,78011625,78119543,78227499,78335492,78443522,78551590, + 78659695,78767836,78876015,78984232,79092485,79200775,79309102,79417467,79525868,79634306, + 79742781,79851293,79959842,80068428,80177050,80285710,80394406,80503139,80611908,80720715, + 80829558,80938438,81047354,81156307,81265296,81374322,81483385,81592484,81701620,81810792, + 81920000,82029245,82138526,82247844,82357198,82466588,82576014,82685477,82794976,82904512, + 83014083,83123691,83233334,83343014,83452730,83562482,83672271,83782095,83891955,84001851, + 84111783,84221751,84331755,84441795,84551870,84661982,84772129,84882312,84992531,85102786, + 85213076,85323402,85433764,85544161,85654594,85765063,85875567,85986107,86096682,86207293, + 86317939,86428621,86539338,86650091,86760879,86871702,86982561,87093455,87204384,87315349, + 87426349,87537384,87648455,87759560,87870701,87981877,88093088,88204334,88315616,88426932, + 88538283,88649670,88761091,88872548,88984039,89095565,89207126,89318723,89430353,89542019, + 89653720,89765455,89877226,89989030,90100870,90212745,90324654,90436598,90548576,90660589, + 90772637,90884719,90996836,91108987,91221173,91333394,91445648,91557938,91670262,91782620, + 91895012,92007439,92119901,92232396,92344926,92457491,92570089,92682722,92795389,92908090, + 93020826,93133595,93246399,93359237,93472109,93585015,93697955,93810929,93923937,94036980, + 94150056,94263166,94376310,94489488,94602700,94715946,94829225,94942539,95055886,95169267, + 95282682,95396131,95509613,95623129,95736679,95850263,95963880,96077530,96191215,96304933, + 96418684,96532470,96646288,96760140,96874026,96987945,97101898,97215884,97329904,97443956, + 97558043,97672162,97786315,97900502,98014721,98128974,98243260,98357580,98471933,98586318, + 98700737,98815190,98929675,99044194,99158745,99273330,99387948,99502598,99617282,99731999, + 99846749,99961532,100076348,100191197,100306078,100420993,100535940,100650921,100765934,100880980, + 100996059,101111170,101226315,101341492,101456702,101571944,101687220,101802528,101917868,102033241, + 102148647,102264086,102379557,102495061,102610597,102726166,102841767,102957401,103073067,103188765, + 103304497,103420260,103536056,103651884,103767745,103883638,103999563,104115521,104231511,104347533, + 104463588,104579675,104695794,104811945,104928128,105044344,105160592,105276871,105393183,105509527, + 105625904,105742312,105858752,105975224,106091729,106208265,106324833,106441433,106558066,106674730, + 106791426,106908154,107024913,107141705,107258528,107375384,107492271,107609190,107726140,107843123, + 107960137,108077182,108194260,108311369,108428510,108545683,108662887,108780122,108897390,109014689, + 109132019,109249381,109366775,109484200,109601656,109719144,109836664,109954215,110071797,110189411, + 110307056,110424733,110542441,110660180,110777950,110895752,111013585,111131450,111249346,111367273, + 111485231,111603220,111721241,111839292,111957375,112075489,112193635,112311811,112430018,112548257, + 112666526,112784827,112903159,113021521,113139915,113258339,113376795,113495282,113613799,113732347, + 113850927,113969537,114088178,114206850,114325552,114444286,114563050,114681845,114800671,114919528, + 115038415,115157333,115276282,115395262,115514272,115633313,115752384,115871486,115990619,116109783, + 116228976,116348201,116467456,116586742,116706058,116825404,116944781,117064189,117183627,117303095, + 117422594,117542124,117661683,117781273,117900894,118020545,118140226,118259937,118379679,118499451, + 118619253,118739086,118858948,118978842,119098765,119218718,119338702,119458716,119578759,119698834, + 119818938,119939072,120059236,120179431,120299655,120419910,120540194,120660509,120780854,120901228, + 121021633,121142067,121262532,121383026,121503550,121624105,121744689,121865303,121985946,122106620, + 122227323,122348057,122468820,122589613,122710435,122831287,122952170,123073081,123194023,123314994, + 123435995,123557025,123678085,123799175,123920295,124041444,124162622,124283830,124405068,124526335, + 124647632,124768959,124890314,125011700,125133114,125254559,125376032,125497536,125619068,125740630, + 125862221,125983842,126105492,126227171,126348880,126470618,126592386,126714182,126836008,126957863, + 127079748,127201661,127323604,127445576,127567578,127689608,127811668,127933756,128055874,128178021, + 128300197,128422403,128544637,128666900,128789193,128911514,129033865,129156244,129278652,129401090, + 129523556,129646052,129768576,129891129,130013711,130136323,130258963,130381631,130504329,130627056, + 130749811,130872595,130995408,131118250,131241120,131364020,131486948,131609905,131732890,131855904, + 131978947,132102019,132225119,132348248,132471406,132594592,132717807,132841050,132964323,133087623, + 133210952,133334310,133457696,133581111,133704554,133828026,133951527,134075055,134198613,134322198, + 134445812,134569455,134693126,134816825,134940553,135064309,135188094,135311906,135435747,135559617, + 135683515,135807441,135931395,136055378,136179388,136303427,136427495,136551590,136675714,136799866, + 136924046,137048254,137172490,137296755,137421048,137545368,137669717,137794094,137918499,138042932, + 138167393,138291882,138416400,138540945,138665518,138790119,138914748,139039405,139164090,139288803, + 139413544,139538313,139663110,139787934,139912787,140037667,140162575,140287511,140412475,140537467, + 140662486,140787533,140912608,141037711,141162842,141288000,141413186,141538399,141663641,141788910, + 141914207,142039531,142164883,142290263,142415670,142541105,142666567,142792057,142917575,143043120, + 143168693,143294294,143419921,143545577,143671260,143796970,143922708,144048473,144174266,144300086, + 144425934,144551809,144677712,144803641,144929599,145055583,145181595,145307635,145433701,145559795, + 145685917,145812065,145938241,146064445,146190675,146316933,146443218,146569530,146695869,146822236, + 146948630,147075051,147201499,147327974,147454477,147581007,147707563,147834147,147960758,148087396, + 148214061,148340754,148467473,148594219,148720993,148847793,148974620,149101475,149228356,149355264, + 149482200,149609162,149736151,149863167,149990210,150117280,150244377,150371501,150498652,150625829, + 150753033,150880265,151007523,151134807,151262119,151389457,151516823,151644215,151771633,151899079, + 152026551,152154050,152281576,152409128,152536707,152664313,152791945,152919604,153047290,153175002, + 153302741,153430507,153558299,153686118,153813963,153941835,154069734,154197659,154325610,154453588, + 154581593,154709624,154837682,154965766,155093876,155222013,155350177,155478367,155606583,155734826, + 155863095,155991391,156119713,156248061,156376436,156504837,156633264,156761718,156890198,157018704, + 157147237,157275796,157404381,157532993,157661630,157790294,157918985,158047701,158176444,158305212, + 158434008,158562829,158691676,158820550,158949449,159078375,159207327,159336305,159465310,159594340, + 159723396,159852479,159981587,160110722,160239882,160369069,160498282,160627520,160756785,160886076, + 161015392,161144735,161274103,161403498,161532918,161662365,161791837,161921335,162050859,162180409, + 162309985,162439587,162569215,162698868,162828547,162958252,163087983,163217740,163347523,163477331, + 163607165,163737025,163866910,163996822,164126759,164256722,164386710,164516724,164646764,164776830, + 164906921,165037038,165167181,165297349,165427543,165557762,165688007,165818278,165948574,166078896, + 166209243,166339616,166470015,166600439,166730888,166861363,166991864,167122390,167252942,167383519, + 167514122,167644750,167775403,167906082,168036786,168167516,168298271,168429052,168559858,168690689, + 168821546,168952428,169083335,169214268,169345226,169476210,169607219,169738253,169869312,170000397, + 170131507,170262642,170393802,170524988,170656199,170787435,170918696,171049983,171181295,171312632, + 171443994,171575381,171706793,171838231,171969694,172101182,172232695,172364233,172495796,172627384, + 172758997,172890636,173022299,173153988,173285702,173417440,173549204,173680993,173812806,173944645, + 174076509,174208397,174340311,174472249,174604213,174736201,174868215,175000253,175132316,175264404, + 175396517,175528655,175660818,175793005,175925218,176057455,176189717,176322004,176454316,176586653, + 176719014,176851400,176983811,177116247,177248708,177381193,177513703,177646237,177778797,177911381, + 178043990,178176624,178309282,178441965,178574672,178707405,178840162,178972943,179105749,179238580, + 179371435,179504316,179637220,179770149,179903103,180036082,180169084,180302112,180435164,180568240, + 180701342,180834467,180967617,181100792,181233991,181367214,181500462,181633735,181767032,181900353, + 182033699,182167069,182300464,182433883,182567326,182700794,182834286,182967803,183101344,183234909, + 183368499,183502113,183635751,183769414,183903101,184036812,184170548,184304307,184438092,184571900, + 184705732,184839589,184973470,185107376,185241305,185375259,185509237,185643239,185777266,185911316, + 186045391,186179490,186313613,186447760,186581931,186716126,186850346,186984590,187118857,187253149, + 187387465,187521805,187656169,187790557,187924969,188059405,188193866,188328350,188462858,188597390, + 188731946,188866527,189001131,189135759,189270411,189405087,189539787,189674511,189809259,189944031, + 190078827,190213646,190348490,190483357,190618249,190753164,190888103,191023066,191158052,191293063, + 191428097,191563155,191698237,191833343,191968473,192103626,192238803,192374004,192509229,192644477, + 192779749,192915045,193050365,193185708,193321075,193456466,193591881,193727319,193862781,193998266, + 194133775,194269308,194404864,194540444,194676048,194811675,194947326,195083001,195218699,195354421, + 195490166,195625935,195761727,195897543,196033383,196169246,196305132,196441042,196576976,196712933, + 196848914,196984918,197120945,197256996,197393071,197529169,197665290,197801435,197937603,198073795, + 198210010,198346249,198482510,198618796,198755104,198891437,199027792,199164171,199300573,199436998, + 199573447,199709919,199846415,199982934,200119476,200256041,200392630,200529242,200665877,200802535, + 200939217,201075922,201212650,201349402,201486176,201622974,201759795,201896639,202033507,202170398, + 202307311,202444248,202581209,202718192,202855198,202992228,203129281,203266357,203403456,203540578, + 203677723,203814891,203952082,204089297,204226534,204363795,204501078,204638385,204775715,204913067, + 205050443,205187842,205325264,205462708,205600176,205737667,205875180,206012717,206150277,206287859, + 206425465,206563093,206700745,206838419,206976116,207113836,207251579,207389345,207527134,207664946, + 207802780,207940638,208078518,208216421,208354347,208492295,208630267,208768261,208906279,209044319, + 209182381,209320467,209458575,209596706,209734860,209873037,210011236,210149458,210287703,210425971, + 210564261,210702574,210840910,210979268,211117649,211256053,211394480,211532929,211671400,211809895, + 211948412,212086952,212225514,212364099,212502706,212641337,212779989,212918665,213057363,213196083, + 213334826,213473592,213612380,213751191,213890024,214028880,214167758,214306659,214445582,214584528, + 214723497,214862488,215001501,215140537,215279595,215418676,215557779,215696904,215836053,215975223, + 216114416,216253631,216392869,216532129,216671412,216810717,216950044,217089394,217228766,217368160, + 217507577,217647016,217786477,217925961,218065467,218204996,218344546,218484119,218623715,218763332, + 218902972,219042634,219182319,219322026,219461754,219601506,219741279,219881075,220020893,220160733, + 220300595,220440479,220580386,220720315,220860266,221000239,221140235,221280252,221420292,221560354, + 221700438,221840544,221980672,222120823,222260995,222401190,222541406,222681645,222821906,222962189, + 223102494,223242821,223383170,223523541,223663934,223804350,223944787,224085246,224225728,224366231, + 224506756,224647303,224787873,224928464,225069077,225209712,225350370,225491049,225631750,225772473, + 225913218,226053985,226194773,226335584,226476417,226617271,226758148,226899046,227039966,227180908, + 227321872,227462858,227603865,227744895,227885946,228027019,228168114,228309231,228450369,228591529, + 228732712,228873916,229015141,229156389,229297658,229438949,229580262,229721596,229862953,230004331, + 230145730,230287152,230428595,230570060,230711546,230853055,230994585,231136136,231277709,231419304, + 231560921,231702559,231844219,231985901,232127604,232269329,232411076,232552844,232694633,232836445, + 232978278,233120132,233262008,233403906,233545825,233687766,233829728,233971712,234113717,234255744, + 234397793,234539863,234681954,234824068,234966202,235108358,235250536,235392735,235534955,235677197, + 235819461,235961746,236104052,236246380,236388729,236531100,236673492,236815905,236958340,237100797, + 237243274,237385774,237528294,237670836,237813399,237955984,238098590,238241217,238383866,238526536, + 238669228,238811940,238954674,239097430,239240207,239383005,239525824,239668664,239811526,239954409, + 240097314,240240240,240383187,240526155,240669144,240812155,240955187,241098240,241241314,241384410, + 241527527,241670665,241813824,241957005,242100206,242243429,242386673,242529938,242673224,242816532, + 242959860,243103210,243246581,243389973,243533386,243676820,243820276,243963752,244107249,244250768, + 244394308,244537869,244681450,244825053,244968677,245112322,245255989,245399676,245543384,245687113, + 245830863,245974635,246118427,246262240,246406074,246549930,246693806,246837703,246981621,247125560, + 247269521,247413502,247557504,247701527,247845571,247989635,248133721,248277828,248421956,248566104, + 248710273,248854464,248998675,249142907,249287160,249431434,249575729,249720044,249864381,250008738, + 250153116,250297515,250441935,250586375,250730837,250875319,251019822,251164346,251308890,251453456, + 251598042,251742649,251887277,252031925,252176594,252321284,252465995,252610727,252755479,252900252, + 253045045,253189860,253334695,253479551,253624427,253769324,253914242,254059181,254204140,254349120, + 254494121,254639142,254784184,254929246,255074329,255219433,255364558,255509703,255654868,255800054, + 255945261,256090489,256235737,256381006,256526295,256671605,256816935,256962286,257107657,257253049, + 257398462,257543895,257689349,257834823,257980318,258125833,258271369,258416925,258562502,258708099, + 258853717,258999355,259145014,259290693,259436392,259582112,259727853,259873614,260019395,260165197, + 260311019,260456862,260602725,260748609,260894513,261040437,261186382,261332347,261478333,261624339, + 261770365,261916411,262062478,262208566,262354674,262500802,262646950,262793119,262939308,263085517, + 263231747,263377997,263524267,263670558,263816869,263963200,264109551,264255923,264402315,264548728, + 264695160,264841613,264988086,265134579,265281093,265427627,265574181,265720755,265867349,266013964, + 266160599,266307254,266453929,266600625,266747340,266894076,267040832,267187608,267334404,267481221, + 267628057,267774914,267921791,268068688,268215605,268362542,268509500,268656477,268803475,268950493, + 269097530,269244588,269391666,269538764,269685882,269833021,269980179,270127357,270274555,270421774, + 270569012,270716271,270863549,271010848,271158166,271305505,271452863,271600242,271747640,271895059, + 272042497,272189956,272337434,272484933,272632451,272779990,272927548,273075126,273222724,273370342, + 273517981,273665639,273813316,273961014,274108732,274256470,274404227,274552005,274699802,274847619, + 274995456,275143313,275291190,275439087,275587003,275734940,275882896,276030872,276178868,276326884, + 276474919,276622975,276771050,276919145,277067260,277215394,277363549,277511723,277659917,277808130, + 277956364,278104617,278252890,278401183,278549496,278697828,278846180,278994552,279142943,279291354, + 279439785,279588236,279736706,279885196,280033706,280182236,280330785,280479353,280627942,280776550, + 280925178,281073825,281222493,281371179,281519886,281668612,281817358,281966123,282114908,282263713, + 282412537,282561381,282710244,282859127,283008030,283156952,283305894,283454855,283603836,283752836, + 283901856,284050896,284199955,284349034,284498132,284647250,284796387,284945544,285094721,285243917, + 285393132,285542367,285691621,285840895,285990189,286139502,286288834,286438186,286587557,286736948, + 286886358,287035788,287185237,287334706,287484194,287633701,287783228,287932774,288082340,288231925, + 288381530,288531154,288680797,288830460,288980142,289129844,289279565,289429305,289579065,289728844, + 289878642,290028460,290178297,290328153,290478029,290627924,290777839,290927773,291077726,291227698, + 291377690,291527701,291677731,291827781,291977850,292127938,292278045,292428172,292578318,292728484, + 292878668,293028872,293179095,293329337,293479599,293629880,293780180,293930499,294080837,294231195, + 294381572,294531968,294682383,294832818,294983272,295133744,295284237,295434748,295585278,295735828, + 295886396,296036984,296187591,296338218,296488863,296639527,296790211,296940914,297091636,297242377, + 297393137,297543916,297694714,297845532,297996368,298147224,298298098,298448992,298599905,298750837, + 298901788,299052758,299203747,299354755,299505782,299656829,299807894,299958978,300110081,300261204, + 300412345,300563505,300714685,300865883,301017101,301168337,301319592,301470867,301622160,301773472, + 301924804,302076154,302227523,302378911,302530318,302681744,302833189,302984653,303136136,303287638, + 303439159,303590698,303742257,303893834,304045431,304197046,304348680,304500333,304652005,304803696, + 304955405,305107134,305258881,305410648,305562433,305714237,305866060,306017901,306169762,306321641, + 306473539,306625456,306777392,306929347,307081320,307233312,307385323,307537353,307689402,307841469, + 307993555,308145660,308297784,308449927,308602088,308754268,308906467,309058684,309210921,309363176, + 309515449,309667742,309820053,309972383,310124732,310277099,310429485,310581890,310734313,310886755, + 311039216,311191696,311344194,311496711,311649247,311801801,311954374,312106965,312259575,312412204, + 312564852,312717518,312870203,313022906,313175628,313328369,313481128,313633906,313786703,313939518, + 314092351,314245204,314398074,314550964,314703872,314856799,315009744,315162708,315315690,315468691, + 315621710,315774748,315927805,316080880,316233973,316387086,316540216,316693365,316846533,316999719, + 317152924,317306147,317459389,317612649,317765928,317919225,318072541,318225875,318379228,318532599, + 318685988,318839396,318992823,319146268,319299731,319453213,319606713,319760232,319913769,320067324, + 320220898,320374491,320528101,320681731,320835378,320989044,321142729,321296431,321450153,321603892, + 321757650,321911426,322065221,322219034,322372865,322526715,322680583,322834470,322988374,323142297, + 323296239,323450199,323604177,323758173,323912188,324066221,324220272,324374342,324528430,324682536, + 324836660,324990803,325144964,325299144,325453341,325607557,325761791,325916044,326070314,326224603, + 326378910,326533236,326687579,326841941,326996321,327150720,327305136,327459571,327614024,327768495, + 327922984,328077492,328232018,328386562,328541124,328695704,328850302,329004919,329159554,329314207, + 329468878,329623567,329778275,329933000,330087744,330242506,330397286,330552084,330706900,330861735, + 331016587,331171458,331326347,331481254,331636178,331791121,331946083,332101062,332256059,332411074, + 332566108,332721159,332876229,333031317,333186422,333341546,333496688,333651848,333807026,333962221, + 334117435,334272667,334427917,334583185,334738471,334893776,335049098,335204438,335359796,335515172, + 335670566,335825978,335981408,336136856,336292322,336447806,336603308,336758828,336914365,337069921, + 337225495,337381087,337536696,337692324,337847969,338003633,338159314,338315013,338470730,338626465, + 338782218,338937989,339093778,339249585,339405409,339561252,339717112,339872990,340028886,340184800, + 340340732,340496682,340652650,340808635,340964638,341120659,341276698,341432755,341588830,341744922, + 341901032,342057161,342213306,342369470,342525652,342681851,342838068,342994303,343150556,343306826, + 343463115,343619421,343775745,343932086,344088446,344244823,344401218,344557631,344714061,344870509, + 345026975,345183459,345339960,345496480,345653016,345809571,345966143,346122733,346279341,346435967, + 346592610,346749271,346905949,347062646,347219359,347376091,347532840,347689607,347846392,348003194, + 348160014,348316852,348473707,348630580,348787471,348944379,349101305,349258249,349415210,349572189, + 349729185,349886199,350043231,350200280,350357347,350514432,350671534,350828653,350985791,351142946, + 351300118,351457308,351614516,351771741,351928984,352086244,352243522,352400817,352558130,352715461, + 352872809,353030175,353187558,353344959,353502377,353659813,353817266,353974737,354132225,354289731, + 354447254,354604795,354762354,354919929,355077523,355235134,355392762,355550408,355708071,355865752, + 356023450,356181166,356338899,356496649,356654418,356812203,356970006,357127826,357285664,357443520, + 357601392,357759282,357917190,358075115,358233057,358391017,358548994,358706989,358865001,359023030, + 359181077,359339141,359497223,359655322,359813438,359971572,360129723,360287891,360446077,360604280, + 360762501,360920738,361078994,361237266,361395556,361553863,361712188,361870530,362028889,362187265, + 362345659,362504070,362662499,362820944,362979407,363137888,363296385,363454900,363613432,363771982, + 363930549,364089133,364247734,364406353,364564988,364723642,364882312,365041000,365199704,365358426, + 365517166,365675922,365834696,365993487,366152296,366311121,366469964,366628824,366787701,366946595, + 367105507,367264435,367423381,367582344,367741325,367900322,368059337,368218369,368377418,368536484, + 368695567,368854668,369013785,369172920,369332072,369491241,369650428,369809631,369968852,370128089, + 370287344,370446616,370605905,370765211,370924535,371083875,371243232,371402607,371561999,371721408, + 371880833,372040276,372199737,372359214,372518708,372678219,372837748,372997293,373156856,373316435, + 373476032,373635645,373795276,373954924,374114589,374274270,374433969,374593685,374753418,374913168, + 375072935,375232719,375392520,375552338,375712173,375872025,376031894,376191780,376351683,376511603, + 376671540,376831494,376991465,377151453,377311458,377471479,377631518,377791574,377951647,378111736, + 378271843,378431966,378592107,378752264,378912439,379072630,379232838,379393063,379553305,379713564, + 379873840,380034133,380194443,380354769,380515113,380675473,380835850,380996244,381156655,381317083, + 381477528,381637990,381798468,381958964,382119476,382280005,382440551,382601114,382761694,382922290, + 383082903,383243534,383404181,383564844,383725525,383886223,384046937,384207668,384368416,384529181, + 384689962,384850761,385011576,385172408,385333256,385494122,385655004,385815903,385976819,386137752, + 386298701,386459667,386620650,386781650,386942667,387103700,387264750,387425816,387586900,387748000, + 387909117,388070251,388231401,388392568,388553752,388714952,388876170,389037404,389198654,389359922, + 389521206,389682507,389843824,390005158,390166509,390327877,390489261,390650662,390812079,390973513, + 391134964,391296432,391457916,391619417,391780934,391942469,392104019,392265587,392427171,392588772, + 392750389,392912023,393073674,393235341,393397025,393558725,393720442,393882176,394043926,394205693, + 394367477,394529277,394691093,394852927,395014776,395176643,395338526,395500425,395662342,395824274, + 395986224,396148189,396310172,396472171,396634186,396796218,396958267,397120332,397282414,397444512, + 397606627,397768758,397930906,398093070,398255251,398417448,398579662,398741892,398904139,399066402, + 399228682,399390979,399553291,399715621,399877966,400040329,400202707,400365103,400527514,400689943, + 400852387,401014848,401177326,401339820,401502330,401664857,401827400,401989960,402152536,402315129, + 402477738,402640363,402803005,402965664,403128338,403291030,403453737,403616461,403779201,403941958, + 404104731,404267521,404430327,404593149,404755988,404918843,405081715,405244602,405407507,405570427, + 405733364,405896317,406059287,406222273,406385275,406548294,406711329,406874381,407037448,407200532, + 407363633,407526750,407689883,407853032,408016198,408179380,408342578,408505793,408669024,408832271, + 408995534,409158814,409322110,409485423,409648751,409812096,409975457,410138835,410302229,410465639, + 410629065,410792508,410955967,411119442,411282933,411446441,411609964,411773505,411937061,412100633, + 412264222,412427827,412591449,412755086,412918740,413082410,413246096,413409798,413573517,413737251, + 413901002,414064769,414228553,414392352,414556168,414720000,414883848,415047712,415211593,415375489, + 415539402,415703331,415867276,416031238,416195215,416359209,416523218,416687244,416851286,417015344, + 417179419,417343509,417507616,417671738,417835877,418000032,418164203,418328390,418492594,418656813, + 418821048,418985300,419149568,419313852,419478151,419642467,419806800,419971148,420135512,420299892, + 420464289,420628701,420793130,420957574,421122035,421286511,421451004,421615513,421780038,421944579, + 422109136,422273709,422438298,422602903,422767524,422932161,423096814,423261483,423426168,423590870, + 423755587,423920320,424085069,424249834,424414616,424579413,424744226,424909055,425073900,425238762, + 425403639,425568532,425733441,425898366,426063307,426228264,426393237,426558226,426723231,426888252, + 427053288,427218341,427383410,427548494,427713595,427878711,428043844,428208992,428374156,428539337, + 428704533,428869745,429034973,429200217,429365476,429530752,429696043,429861351,430026674,430192013, + 430357369,430522740,430688126,430853529,431018948,431184382,431349833,431515299,431680781,431846279, + 432011793,432177323,432342868,432508430,432674007,432839600,433005209,433170834,433336474,433502131, + 433667803,433833491,433999195,434164914,434330650,434496401,434662168,434827951,434993750,435159565, + 435325395,435491241,435657103,435822981,435988874,436154784,436320709,436486650,436652606,436818579, + 436984567,437150571,437316590,437482626,437648677,437814744,437980827,438146925,438313039,438479169, + 438645315,438811476,438977653,439143846,439310055,439476279,439642519,439808775,439975046,440141333, + 440307636,440473955,440640289,440806639,440973005,441139386,441305783,441472196,441638624,441805068, + 441971528,442138004,442304495,442471002,442637524,442804062,442970616,443137185,443303770,443470371, + 443636988,443803620,443970267,444136931,444303610,444470304,444637014,444803740,444970482,445137239, + 445304012,445470800,445637604,445804423,445971259,446138109,446304976,446471858,446638755,446805668, + 446972597,447139542,447306501,447473477,447640468,447807475,447974497,448141535,448308588,448475657, + 448642742,448809842,448976957,449144088,449311235,449478397,449645575,449812768,449979977,450147202, + 450314442,450481697,450648968,450816255,450983557,451150874,451318207,451485556,451652920,451820300, + 451987695,452155105,452322531,452489973,452657430,452824903,452992391,453159894,453327413,453494948, + 453662498,453830063,453997644,454165240,454332852,454500480,454668122,454835781,455003454,455171143, + 455338848,455506568,455674303,455842054,456009821,456177602,456345399,456513212,456681040,456848884, + 457016742,457184617,457352506,457520411,457688332,457856268,458024219,458192186,458360168,458528165, + 458696178,458864207,459032250,459200309,459368384,459536474,459704579,459872699,460040835,460208986, + 460377153,460545335,460713532,460881745,461049973,461218216,461386475,461554749,461723039,461891343, + 462059663,462227999,462396350,462564716,462733097,462901494,463069906,463238333,463406776,463575234, + 463743707,463912196,464080699,464249219,464417753,464586303,464754868,464923448,465092044,465260655, + 465429281,465597922,465766579,465935251,466103938,466272641,466441358,466610091,466778840,466947603, + 467116382,467285176,467453985,467622810,467791650,467960505,468129375,468298260,468467161,468636077, + 468805008,468973954,469142916,469311893,469480885,469649892,469818914,469987952,470157005,470326073, + 470495156,470664254,470833368,471002497,471171641,471340800,471509974,471679164,471848368,472017588, + 472186823,472356073,472525339,472694619,472863915,473033226,473202552,473371893,473541249,473710620, + 473880007,474049409,474218825,474388257,474557704,474727167,474896644,475066136,475235644,475405167, + 475574704,475744257,475913825,476083408,476253007,476422620,476592248,476761892,476931550,477101224, + 477270913,477440617,477610336,477780070,477949819,478119583,478289362,478459157,478628966,478798790, + 478968630,479138484,479308354,479478239,479648138,479818053,479987983,480157928,480327888,480497863, + 480667853,480837858,481007878,481177913,481347963,481518028,481688108,481858203,482028313,482198438, + 482368578,482538734,482708904,482879089,483049289,483219504,483389734,483559979,483730240,483900515, + 484070805,484241110,484411430,484581765,484752115,484922480,485092860,485263254,485433664,485604089, + 485774529,485944983,486115453,486285938,486456437,486626952,486797481,486968025,487138585,487309159, + 487479748,487650352,487820971,487991605,488162254,488332917,488503596,488674290,488844998,489015721, + 489186460,489357213,489527981,489698764,489869562,490040374,490211202,490382044,490552902,490723774, + 490894661,491065563,491236480,491407412,491578358,491749320,491920296,492091287,492262294,492433314, + 492604350,492775401,492946466,493117547,493288642,493459752,493630876,493802016,493973171,494144340, + 494315524,494486723,494657937,494829165,495000409,495171667,495342940,495514228,495685530,495856848, + 496028180,496199527,496370889,496542265,496713657,496885063,497056484,497227919,497399370,497570835, + 497742315,497913810,498085320,498256844,498428383,498599937,498771506,498943089,499114687,499286300, + 499457928,499629570,499801227,499972899,500144586,500316287,500488003,500659734,500831480,501003240, + 501175015,501346805,501518609,501690428,501862262,502034111,502205974,502377852,502549745,502721652, + 502893574,503065511,503237462,503409429,503581409,503753405,503925415,504097440,504269480,504441534, + 504613603,504785686,504957785,505129897,505302025,505474167,505646324,505818496,505990682,506162883, + 506335098,506507328,506679573,506851833,507024107,507196395,507368699,507541017,507713349,507885697, + 508058058,508230435,508402826,508575232,508747652,508920087,509092536,509265000,509437479,509609972, + 509782480,509955003,510127540,510300092,510472658,510645239,510817834,510990444,511163069,511335708, + 511508362,511681030,511853713,512026411,512199123,512371849,512544590,512717346,512890116,513062901, + 513235701,513408514,513581343,513754186,513927043,514099916,514272802,514445703,514618619,514791549, + 514964494,515137453,515310427,515483415,515656418,515829435,516002467,516175513,516348574,516521649, + 516694739,516867844,517040962,517214096,517387243,517560406,517733582,517906774,518079979,518253200, + 518426434,518599683,518772947,518946225,519119518,519292825,519466146,519639482,519812833,519986197, + 520159577,520332970,520506379,520679801,520853238,521026690,521200156,521373636,521547131,521720640, + 521894164,522067702,522241255,522414822,522588403,522761999,522935609,523109234,523282873,523456526, + 523630194,523803876,523977573,524151284,524325009,524498749,524672503,524846272,525020055,525193852, + 525367664,525541490,525715330,525889185,526063054,526236938,526410836,526584748,526758675,526932616, + 527106571,527280541,527454525,527628524,527802536,527976563,528150605,528324661,528498731,528672815, + 528846914,529021027,529195155,529369297,529543453,529717623,529891808,530066007,530240220,530414448, + 530588690,530762946,530937217,531111502,531285801,531460115,531634442,531808785,531983141,532157512, + 532331897,532506296,532680709,532855137,533029579,533204036,533378506,533552991,533727490,533902004, + 534076531,534251073,534425630,534600200,534774785,534949384,535123997,535298624,535473266,535647922, + 535822592,535997276,536171975,536346688,536521415,536696156,536870912,537045682,537220466,537395264, + 537570076,537744903,537919744,538094599,538269468,538444352,538619249,538794161,538969087,539144028, + 539318982,539493951,539668934,539843931,540018942,540193967,540369007,540544060,540719128,540894210, + 541069307,541244417,541419542,541594680,541769833,541945000,542120182,542295377,542470587,542645810, + 542821048,542996300,543171566,543346846,543522141,543697449,543872772,544048109,544223460,544398825, + 544574204,544749597,544925004,545100426,545275862,545451311,545626775,545802253,545977745,546153251, + 546328772,546504306,546679854,546855417,547030994,547206584,547382189,547557808,547733441,547909088, + 548084749,548260425,548436114,548611817,548787535,548963266,549139012,549314771,549490545,549666333, + 549842135,550017950,550193780,550369624,550545482,550721354,550897241,551073141,551249055,551424983, + 551600925,551776882,551952852,552128836,552304835,552480847,552656873,552832914,553008968,553185037, + 553361119,553537215,553713326,553889450,554065589,554241741,554417908,554594088,554770283,554946491, + 555122714,555298950,555475201,555651465,555827743,556004036,556180342,556356662,556532997,556709345, + 556885707,557062083,557238473,557414877,557591295,557767727,557944173,558120633,558297107,558473595, + 558650097,558826612,559003142,559179686,559356243,559532814,559709400,559885999,560062612,560239240, + 560415881,560592536,560769205,560945887,561122584,561299295,561476019,561652758,561829510,562006276, + 562183057,562359851,562536659,562713480,562890316,563067166,563244029,563420907,563597798,563774703, + 563951622,564128555,564305502,564482463,564659437,564836426,565013428,565190444,565367474,565544518, + 565721576,565898647,566075733,566252832,566429945,566607072,566784213,566961368,567138536,567315719, + 567492915,567670125,567847349,568024586,568201838,568379103,568556382,568733675,568910982,569088303, + 569265637,569442985,569620347,569797723,569975113,570152516,570329933,570507365,570684809,570862268, + 571039740,571217227,571394727,571572240,571749768,571927309,572104865,572282433,572460016,572637613, + 572815223,572992847,573170485,573348136,573525802,573703481,573881173,574058880,574236600,574414334, + 574592082,574769844,574947619,575125408,575303211,575481028,575658858,575836702,576014560,576192431, + 576370316,576548215,576726128,576904054,577081994,577259948,577437916,577615897,577793892,577971901, + 578149923,578327959,578506009,578684072,578862149,579040240,579218345,579396463,579574595,579752741, + 579930900,580109073,580287260,580465460,580643674,580821902,581000143,581178399,581356667,581534950, + 581713246,581891555,582069879,582248216,582426567,582604931,582783309,582961701,583140106,583318525, + 583496958,583675404,583853864,584032337,584210825,584389325,584567840,584746368,584924910,585103465, + 585282034,585460616,585639213,585817822,585996446,586175083,586353733,586532398,586711076,586889767, + 587068472,587247191,587425923,587604669,587783428,587962201,588140988,588319788,588498602,588677429, + 588856270,589035125,589213993,589392875,589571770,589750679,589929601,590108537,590287487,590466450, + 590645427,590824417,591003421,591182438,591361469,591540513,591719571,591898643,592077728,592256827, + 592435939,592615065,592794204,592973357,593152523,593331703,593510896,593690103,593869324,594048558, + 594227805,594407066,594586341,594765629,594944930,595124245,595303574,595482916,595662271,595841640, + 596021023,596200419,596379829,596559252,596738688,596918138,597097602,597277079,597456569,597636073, + 597815591,597995122,598174666,598354224,598533795,598713380,598892979,599072590,599252216,599431854, + 599611506,599791172,599970851,600150544,600330250,600509969,600689702,600869448,601049208,601228981, + 601408768,601588568,601768381,601948208,602128049,602307902,602487770,602667650,602847544,603027452, + 603207373,603387307,603567255,603747216,603927191,604107179,604287180,604467195,604647223,604827265, + 605007320,605187388,605367470,605547565,605727674,605907796,606087931,606268080,606448242,606628417, + 606808606,606988808,607169024,607349253,607529496,607709751,607890020,608070303,608250599,608430908, + 608611231,608791566,608971916,609152278,609332654,609513044,609693446,609873862,610054292,610234735, + 610415191,610595660,610776143,610956639,611137148,611317671,611498207,611678756,611859319,612039895, + 612220484,612401087,612581703,612762332,612942975,613123631,613304300,613484983,613665679,613846388, + 614027110,614207846,614388595,614569357,614750133,614930922,615111724,615292540,615473368,615654210, + 615835066,616015934,616196816,616377712,616558620,616739542,616920477,617101425,617282386,617463361, + 617644349,617825351,618006365,618187393,618368434,618549488,618730556,618911637,619092731,619273838, + 619454959,619636093,619817240,619998400,620179573,620360760,620541960,620723173,620904400,621085639, + 621266892,621448158,621629438,621810730,621992036,622173355,622354687,622536032,622717391,622898763, + 623080148,623261546,623442957,623624382,623805820,623987271,624168735,624350212,624531703,624713207, + 624894724,625076254,625257797,625439354,625620923,625802506,625984102,626165711,626347334,626528969, + 626710618,626892280,627073955,627255643,627437344,627619058,627800786,627982527,628164281,628346048, + 628527828,628709621,628891428,629073248,629255080,629436926,629618785,629800658,629982543,630164441, + 630346353,630528278,630710215,630892166,631074130,631256108,631438098,631620101,631802118,631984147, + 632166190,632348246,632530315,632712397,632894492,633076600,633258722,633440856,633623004,633805164, + 633987338,634169525,634351725,634533938,634716164,634898403,635080655,635262921,635445199,635627490, + 635809795,635992113,636174443,636356787,636539144,636721514,636903896,637086292,637268701,637451123, + 637633559,637816007,637998468,638180942,638363430,638545930,638728443,638910970,639093509,639276062, + 639458627,639641206,639823797,640006402,640189020,640371650,640554294,640736951,640919621,641102303, + 641284999,641467708,641650430,641833165,642015912,642198673,642381447,642564234,642747034,642929846, + 643112672,643295511,643478363,643661228,643844105,644026996,644209900,644392817,644575746,644758689, + 644941645,645124613,645307595,645490590,645673597,645856618,646039651,646222698,646405757,646588830, + 646771915,646955013,647138125,647321249,647504386,647687536,647870699,648053875,648237064,648420266, + 648603481,648786709,648969949,649153203,649336470,649519749,649703042,649886347,650069665,650252997, + 650436341,650619698,650803068,650986451,651169847,651353255,651536677,651720112,651903559,652087020, + 652270493,652453979,652637478,652820990,653004515,653188053,653371604,653555167,653738744,653922333, + 654105935,654289550,654473178,654656819,654840473,655024140,655207819,655391512,655575217,655758935, + 655942666,656126410,656310167,656493936,656677719,656861514,657045322,657229143,657412977,657596824, + 657780683,657964556,658148441,658332339,658516250,658700174,658884111,659068060,659252023,659435998, + 659619986,659803987,659988000,660172027,660356066,660540118,660724183,660908261,661092351,661276455, + 661460571,661644700,661828842,662012997,662197164,662381344,662565538,662749743,662933962,663118194, + 663302438,663486695,663670965,663855247,664039543,664223851,664408172,664592506,664776853,664961212, + 665145584,665329969,665514367,665698777,665883200,666067636,666252085,666436547,666621021,666805508, + 666990008,667174521,667359046,667543584,667728135,667912699,668097275,668281864,668466466,668651081, + 668835708,669020348,669205001,669389667,669574345,669759036,669943740,670128456,670313185,670497927, + 670682682,670867450,671052230,671237023,671421828,671606647,671791478,671976321,672161178,672346047, + 672530929,672715823,672900731,673085651,673270583,673455529,673640487,673825458,674010441,674195437, + 674380446,674565468,674750502,674935549,675120609,675305681,675490766,675675863,675860974,676046097, + 676231232,676416381,676601542,676786716,676971902,677157101,677342313,677527537,677712774,677898024, + 678083286,678268561,678453849,678639149,678824462,679009787,679195126,679380477,679565840,679751216, + 679936605,680122006,680307421,680492847,680678287,680863739,681049203,681234680,681420170,681605673, + 681791188,681976716,682162256,682347809,682533374,682718953,682904543,683090147,683275763,683461391, + 683647033,683832687,684018353,684204032,684389724,684575428,684761145,684946874,685132616,685318371, + 685504138,685689918,685875710,686061515,686247332,686433163,686619005,686804861,686990728,687176609, + 687362502,687548407,687734325,687920256,688106199,688292155,688478123,688664104,688850098,689036104, + 689222122,689408154,689594197,689780254,689966322,690152404,690338498,690524604,690710723,690896854, + 691082998,691269155,691455324,691641506,691827700,692013907,692200126,692386358,692572602,692758859, + 692945128,693131410,693317704,693504011,693690330,693876662,694063007,694249364,694435733,694622115, + 694808509,694994916,695181336,695367768,695554212,695740669,695927138,696113620,696300115,696486621, + 696673141,696859673,697046217,697232774,697419343,697605925,697792519,697979126,698165745,698352377, + 698539021,698725677,698912347,699099028,699285722,699472429,699659147,699845879,700032623,700219379, + 700406148,700592929,700779723,700966529,701153347,701340178,701527022,701713878,701900746,702087627, + 702274520,702461425,702648343,702835274,703022217,703209172,703396140,703583120,703770113,703957118, + 704144135,704331165,704518208,704705262,704892329,705079409,705266501,705453605,705640722,705827851, + 706014993,706202147,706389313,706576492,706763683,706950887,707138103,707325331,707512572,707699825, + 707887090,708074368,708261659,708448961,708636276,708823604,709010944,709198296,709385660,709573037, + 709760427,709947828,710135242,710322669,710510107,710697559,710885022,711072498,711259986,711447487, + 711635000,711822525,712010063,712197613,712385175,712572750,712760337,712947936,713135548,713323172, + 713510808,713698457,713886118,714073791,714261477,714449175,714636885,714824608,715012343,715200090, + 715387850,715575622,715763406,715951203,716139012,716326833,716514667,716702513,716890371,717078242, + 717266124,717454019,717641927,717829847,718017779,718205723,718393680,718581648,718769630,718957623, + 719145629,719333647,719521677,719709720,719897775,720085842,720273922,720462013,720650117,720838234, + 721026362,721214503,721402656,721590822,721778999,721967189,722155392,722343606,722531833,722720072, + 722908323,723096587,723284862,723473150,723661451,723849763,724038088,724226425,724414774,724603136, + 724791509,724979895,725168294,725356704,725545127,725733562,725922009,726110468,726298940,726487424, + 726675920,726864428,727052949,727241481,727430026,727618583,727807153,727995734,728184328,728372934, + 728561553,728750183,728938826,729127480,729316148,729504827,729693518,729882222,730070938,730259666, + 730448406,730637159,730825923,731014700,731203489,731392290,731581104,731769929,731958767,732147617, + 732336479,732525353,732714240,732903139,733092049,733280972,733469908,733658855,733847814,734036786, + 734225770,734414766,734603774,734792794,734981827,735170871,735359928,735548997,735738078,735927171, + 736116277,736305394,736494524,736683666,736872820,737061986,737251164,737440354,737629557,737818771, + 738007998,738197237,738386488,738575751,738765026,738954314,739143613,739332925,739522249,739711585, + 739900933,740090293,740279665,740469049,740658446,740847854,741037275,741226708,741416152,741605609, + 741795078,741984560,742174053,742363558,742553076,742742605,742932147,743121701,743311266,743500844, + 743690434,743880036,744069651,744259277,744448915,744638566,744828228,745017903,745207589,745397288, + 745586999,745776721,745966456,746156203,746345962,746535733,746725517,746915312,747105119,747294938, + 747484770,747674613,747864469,748054336,748244216,748434107,748624011,748813927,749003855,749193794, + 749383746,749573710,749763686,749953674,750143674,750333686,750523710,750713746,750903794,751093854, + 751283926,751474011,751664107,751854215,752044335,752234467,752424612,752614768,752804936,752995117, + 753185309,753375513,753565729,753755958,753946198,754136450,754326715,754516991,754707279,754897580, + 755087892,755278216,755468553,755658901,755849261,756039633,756230018,756420414,756610822,756801242, + 756991675,757182119,757372575,757563043,757753523,757944015,758134519,758325035,758515563,758706103, + 758896655,759087219,759277794,759468382,759658982,759849593,760040217,760230853,760421500,760612160, + 760802831,760993514,761184210,761374917,761565636,761756367,761947110,762137866,762328632,762519411, + 762710202,762901005,763091820,763282646,763473485,763664335,763855198,764046072,764236958,764427856, + 764618767,764809689,765000622,765191568,765382526,765573496,765764477,765955471,766146476,766337493, + 766528523,766719564,766910617,767101682,767292758,767483847,767674948,767866060,768057185,768248321, + 768439469,768630629,768821801,769012985,769204180,769395388,769586607,769777839,769969082,770160337, + 770351604,770542883,770734174,770925476,771116791,771308117,771499455,771690805,771882167,772073541, + 772264926,772456324,772647733,772839155,773030588,773222032,773413489,773604958,773796438,773987931, + 774179435,774370951,774562479,774754018,774945570,775137133,775328708,775520295,775711894,775903505, + 776095127,776286762,776478408,776670066,776861736,777053417,777245111,777436816,777628533,777820262, + 778012003,778203755,778395520,778587296,778779084,778970884,779162695,779354519,779546354,779738201, + 779930060,780121930,780313813,780505707,780697613,780889531,781081460,781273402,781465355,781657320, + 781849297,782041285,782233285,782425297,782617321,782809357,783001404,783193464,783385535,783577617, + 783769712,783961818,784153936,784346066,784538208,784730361,784922526,785114703,785306892,785499092, + 785691304,785883528,786075764,786268012,786460271,786652542,786844824,787037119,787229425,787421743, + 787614073,787806414,787998767,788191132,788383509,788575897,788768297,788960709,789153133,789345568, + 789538015,789730474,789922944,790115426,790307920,790500426,790692943,790885472,791078013,791270566, + 791463130,791655706,791848294,792040893,792233504,792426127,792618762,792811408,793004066,793196735, + 793389417,793582110,793774814,793967531,794160259,794352999,794545750,794738513,794931288,795124075, + 795316873,795509683,795702505,795895338,796088183,796281039,796473908,796666788,796859680,797052583, + 797245498,797438425,797631363,797824313,798017275,798210248,798403233,798596230,798789238,798982258, + 799175290,799368333,799561388,799754455,799947533,800140623,800333725,800526838,800719963,800913099, + 801106248,801299407,801492579,801685762,801878957,802072163,802265381,802458611,802651852,802845105, + 803038370,803231646,803424934,803618233,803811544,804004867,804198201,804391547,804584905,804778274, + 804971654,805165047,805358451,805551866,805745294,805938733,806132183,806325645,806519119,806712604, + 806906101,807099609,807293129,807486661,807680204,807873759,808067326,808260904,808454493,808648094, + 808841707,809035332,809228968,809422615,809616274,809809945,810003627,810197321,810391027,810584744, + 810778472,810972213,811165964,811359728,811553503,811747289,811941087,812134897,812328718,812522551, + 812716395,812910251,813104118,813297997,813491888,813685790,813879703,814073628,814267565,814461513, + 814655473,814849445,815043427,815237422,815431428,815625445,815819475,816013515,816207567,816401631, + 816595706,816789793,816983891,817178001,817372122,817566255,817760400,817954555,818148723,818342902, + 818537092,818731294,818925508,819119733,819313969,819508217,819702477,819896748,820091031,820285325, + 820479630,820673947,820868276,821062616,821256968,821451331,821645705,821840091,822034489,822228898, + 822423319,822617751,822812194,823006649,823201116,823395594,823590083,823784584,823979097,824173621, + 824368156,824562703,824757261,824951831,825146413,825341005,825535610,825730225,825924853,826119491, + 826314141,826508803,826703476,826898160,827092856,827287564,827482283,827677013,827871755,828066508, + 828261273,828456049,828650837,828845636,829040446,829235268,829430102,829624946,829819803,830014670, + 830209550,830404440,830599342,830794256,830989181,831184117,831379065,831574024,831768994,831963976, + 832158970,832353975,832548991,832744019,832939058,833134109,833329170,833524244,833719329,833914425, + 834109533,834304652,834499782,834694924,834890077,835085242,835280418,835475605,835670804,835866015, + 836061236,836256469,836451714,836646970,836842237,837037516,837232806,837428107,837623420,837818744, + 838014080,838209427,838404785,838600155,838795536,838990928,839186332,839381747,839577174,839772612, + 839968061,840163522,840358994,840554478,840749972,840945479,841140996,841336525,841532065,841727617, + 841923180,842118754,842314340,842509937,842705546,842901165,843096797,843292439,843488093,843683758, + 843879435,844075122,844270822,844466532,844662254,844857987,845053732,845249488,845445255,845641034, + 845836823,846032625,846228437,846424261,846620096,846815943,847011801,847207670,847403550,847599442, + 847795345,847991260,848187186,848383123,848579071,848775031,848971002,849166984,849362978,849558983, + 849754999,849951027,850147065,850343116,850539177,850735250,850931334,851127429,851323536,851519654, + 851715783,851911924,852108076,852304239,852500413,852696599,852892796,853089004,853285224,853481454, + 853677697,853873950,854070215,854266491,854462778,854659076,854855386,855051707,855248039,855444383, + 855640738,855837104,856033481,856229870,856426270,856622681,856819103,857015537,857211982,857408438, + 857604905,857801384,857997874,858194375,858390888,858587411,858783946,858980492,859177050,859373619, + 859570198,859766790,859963392,860160006,860356630,860553267,860749914,860946572,861143242,861339923, + 861536615,861733319,861930034,862126760,862323497,862520245,862717005,862913775,863110557,863307351, + 863504155,863700971,863897798,864094636,864291485,864488346,864685217,864882100,865078994,865275900, + 865472816,865669744,865866683,866063633,866260595,866457567,866654551,866851546,867048552,867245569, + 867442598,867639637,867836688,868033750,868230823,868427908,868625004,868822110,869019228,869216357, + 869413498,869610649,869807812,870004986,870202171,870399367,870596574,870793793,870991023,871188264, + 871385516,871582779,871780053,871977339,872174635,872371943,872569262,872766592,872963934,873161286, + 873358650,873556024,873753410,873950807,874148216,874345635,874543065,874740507,874937960,875135424, + 875332899,875530385,875727882,875925391,876122910,876320441,876517983,876715536,876913100,877110675, + 877308262,877505859,877703468,877901088,878098719,878296361,878494014,878691678,878889353,879087040, + 879284737,879482446,879680166,879877897,880075639,880273392,880471156,880668932,880866718,881064516, + 881262324,881460144,881657975,881855817,882053670,882251534,882449409,882647296,882845193,883043102, + 883241021,883438952,883636894,883834847,884032811,884230786,884428772,884626769,884824777,885022797, + 885220827,885418869,885616921,885814985,886013060,886211145,886409242,886607350,886805469,887003599, + 887201741,887399893,887598056,887796230,887994416,888192612,888390820,888589038,888787268,888985509, + 889183760,889382023,889580297,889778582,889976878,890175185,890373503,890571832,890770172,890968523, + 891166885,891365258,891563643,891762038,891960444,892158862,892357290,892555729,892754180,892952641, + 893151114,893349597,893548092,893746597,893945114,894143642,894342180,894540730,894739291,894937862, + 895136445,895335039,895533644,895732259,895930886,896129524,896328173,896526833,896725503,896924185, + 897122878,897321582,897520297,897719022,897917759,898116507,898315266,898514036,898712816,898911608, + 899110411,899309225,899508050,899706885,899905732,900104590,900303458,900502338,900701229,900900130, + 901099043,901297967,901496901,901695847,901894803,902093771,902292749,902491739,902690739,902889750, + 903088773,903287806,903486850,903685906,903884972,904084049,904283137,904482236,904681346,904880467, + 905079599,905278742,905477896,905677061,905876237,906075423,906274621,906473829,906673049,906872279, + 907071521,907270773,907470037,907669311,907868596,908067892,908267199,908466517,908665846,908865186, + 909064537,909263899,909463271,909662655,909862049,910061455,910260871,910460298,910659737,910859186, + 911058646,911258117,911457599,911657091,911856595,912056110,912255635,912455172,912654719,912854277, + 913053846,913253426,913453017,913652619,913852232,914051856,914251490,914451136,914650792,914850459, + 915050138,915249827,915449527,915649237,915848959,916048692,916248435,916448190,916647955,916847731, + 917047518,917247316,917447125,917646945,917846775,918046617,918246469,918446332,918646206,918846091, + 919045987,919245894,919445811,919645740,919845679,920045629,920245590,920445562,920645545,920845538, + 921045543,921245558,921445584,921645621,921845669,922045728,922245797,922445878,922645969,922846071, + 923046184,923246308,923446443,923646588,923846745,924046912,924247090,924447279,924647479,924847689, + 925047911,925248143,925448386,925648640,925848904,926049180,926249466,926449764,926650072,926850391, + 927050720,927251061,927451412,927651774,927852147,928052531,928252926,928453331,928653747,928854174, + 929054612,929255061,929455521,929655991,929856472,930056964,930257467,930457980,930658504,930859040, + 931059586,931260142,931460710,931661288,931861877,932062477,932263088,932463709,932664342,932864985, + 933065639,933266303,933466979,933667665,933868362,934069070,934269789,934470518,934671258,934872009, + 935072771,935273543,935474326,935675120,935875925,936076741,936277567,936478404,936679252,936880111, + 937080980,937281861,937482751,937683653,937884566,938085489,938286423,938487368,938688323,938889289, + 939090266,939291254,939492253,939693262,939894282,940095313,940296354,940497407,940698470,940899543, + 941100628,941301723,941502829,941703946,941905073,942106212,942307361,942508520,942709691,942910872, + 943112064,943313266,943514480,943715704,943916938,944118184,944319440,944520707,944721985,944923273, + 945124572,945325882,945527203,945728534,945929876,946131229,946332592,946533966,946735351,946936747, + 947138153,947339570,947540998,947742436,947943885,948145345,948346815,948548297,948749789,948951291, + 949152804,949354328,949555863,949757409,949958965,950160531,950362109,950563697,950765296,950966905, + 951168526,951370156,951571798,951773450,951975113,952176787,952378471,952580166,952781872,952983588, + 953185315,953387053,953588801,953790560,953992330,954194110,954395901,954597703,954799515,955001338, + 955203172,955405016,955606871,955808737,956010613,956212500,956414398,956616306,956818225,957020155, + 957222095,957424046,957626008,957827980,958029963,958231956,958433960,958635975,958838001,959040037, + 959242083,959444141,959646209,959848287,960050377,960252477,960454587,960656708,960858840,961060983, + 961263136,961465299,961667474,961869659,962071854,962274060,962476277,962678505,962880743,963082991, + 963285251,963487521,963689801,963892092,964094394,964296707,964499030,964701363,964903707,965106062, + 965308428,965510804,965713190,965915588,966117995,966320414,966522843,966725283,966927733,967130194, + 967332665,967535147,967737640,967940143,968142657,968345181,968547716,968750262,968952818,969155385, + 969357962,969560550,969763149,969965758,970168378,970371008,970573649,970776300,970978962,971181635, + 971384318,971587011,971789716,971992431,972195156,972397892,972600639,972803396,973006163,973208942, + 973411731,973614530,973817340,974020160,974222991,974425833,974628685,974831548,975034421,975237305, + 975440200,975643105,975846020,976048946,976251883,976454830,976657788,976860756,977063735,977266724, + 977469724,977672734,977875755,978078787,978281829,978484881,978687944,978891018,979094102,979297197, + 979500302,979703418,979906544,980109681,980312828,980515986,980719154,980922333,981125523,981328723, + 981531933,981735154,981938386,982141628,982344880,982548143,982751417,982954701,983157995,983361300, + 983564616,983767942,983971279,984174626,984377983,984581352,984784730,984988119,985191519,985394929, + 985598350,985801781,986005222,986208675,986412137,986615610,986819094,987022588,987226092,987429608, + 987633133,987836669,988040216,988243773,988447340,988650918,988854506,989058105,989261715,989465335, + 989668965,989872606,990076257,990279919,990483591,990687274,990890967,991094671,991298385,991502109, + 991705844,991909590,992113346,992317112,992520889,992724677,992928475,993132283,993336102,993539931, + 993743770,993947620,994151481,994355352,994559234,994763125,994967028,995170941,995374864,995578798, + 995782742,995986696,996190661,996394637,996598623,996802619,997006626,997210643,997414671,997618709, + 997822757,998026816,998230886,998434965,998639056,998843156,999047267,999251389,999455521,999659663, + 999863816,1000067979,1000272153,1000476337,1000680531,1000884736,1001088952,1001293177,1001497413,1001701660, + 1001905917,1002110184,1002314462,1002518750,1002723049,1002927358,1003131677,1003336007,1003540347,1003744698, + 1003949059,1004153430,1004357812,1004562204,1004766607,1004971020,1005175443,1005379877,1005584321,1005788776, + 1005993241,1006197716,1006402202,1006606698,1006811205,1007015722,1007220249,1007424787,1007629335,1007833893, + 1008038462,1008243041,1008447631,1008652231,1008856841,1009061462,1009266093,1009470734,1009675386,1009880048, + 1010084721,1010289404,1010494097,1010698801,1010903515,1011108239,1011312974,1011517719,1011722475,1011927241, + 1012132017,1012336803,1012541600,1012746407,1012951225,1013156053,1013360891,1013565740,1013770599,1013975469, + 1014180348,1014385238,1014590139,1014795050,1014999971,1015204902,1015409844,1015614796,1015819759,1016024732, + 1016229715,1016434708,1016639712,1016844726,1017049751,1017254786,1017459831,1017664886,1017869952,1018075028, + 1018280115,1018485212,1018690319,1018895436,1019100564,1019305702,1019510851,1019716009,1019921179,1020126358, + 1020331548,1020536748,1020741958,1020947179,1021152410,1021357651,1021562903,1021768165,1021973437,1022178719, + 1022384012,1022589315,1022794629,1022999953,1023205287,1023410631,1023615986,1023821351,1024026726,1024232111, + 1024437507,1024642913,1024848330,1025053757,1025259194,1025464641,1025670099,1025875566,1026081045,1026286533, + 1026492032,1026697541,1026903060,1027108590,1027314130,1027519680,1027725240,1027930811,1028136392,1028341984, + 1028547585,1028753197,1028958819,1029164451,1029370094,1029575747,1029781410,1029987084,1030192768,1030398462, + 1030604166,1030809880,1031015605,1031221340,1031427086,1031632841,1031838607,1032044383,1032250170,1032455966, + 1032661773,1032867590,1033073418,1033279255,1033485103,1033690961,1033896830,1034102708,1034308597,1034514496, + 1034720406,1034926325,1035132255,1035338195,1035544146,1035750106,1035956077,1036162058,1036368050,1036574051, + 1036780063,1036986085,1037192117,1037398160,1037604212,1037810275,1038016348,1038222432,1038428526,1038634629, + 1038840743,1039046868,1039253002,1039459147,1039665302,1039871467,1040077643,1040283828,1040490024,1040696230, + 1040902446,1041108673,1041314910,1041521157,1041727414,1041933681,1042139959,1042346246,1042552544,1042758852, + 1042965171,1043171499,1043377838,1043584187,1043790546,1043996916,1044203295,1044409685,1044616085,1044822495, + 1045028916,1045235346,1045441787,1045648238,1045854699,1046061170,1046267652,1046474144,1046680645,1046887158, + 1047093680,1047300212,1047506755,1047713308,1047919871,1048126444,1048333027,1048539621,1048746224,1048952838, + 1049159462,1049366097,1049572741,1049779396,1049986060,1050192735,1050399420,1050606116,1050812821,1051019537, + 1051226262,1051432998,1051639744,1051846500,1052053267,1052260043,1052466830,1052673627,1052880434,1053087251, + 1053294079,1053500916,1053707764,1053914622,1054121489,1054328368,1054535256,1054742154,1054949063,1055155981, + 1055362910,1055569849,1055776798,1055983758,1056190727,1056397707,1056604696,1056811696,1057018706,1057225726, + 1057432756,1057639797,1057846847,1058053908,1058260979,1058468059,1058675150,1058882252,1059089363,1059296484, + 1059503616,1059710757,1059917909,1060125071,1060332243,1060539425,1060746617,1060953820,1061161032,1061368255, + 1061575488,1061782730,1061989983,1062197246,1062404520,1062611803,1062819096,1063026400,1063233713,1063441037, + 1063648371,1063855715,1064063069,1064270433,1064477807,1064685192,1064892586,1065099990,1065307405,1065514830, + 1065722265,1065929709,1066137164,1066344630,1066552105,1066759590,1066967085,1067174591,1067382106,1067589632, + 1067797168,1068004714,1068212269,1068419835,1068627411,1068834998,1069042594,1069250200,1069457816,1069665443, + 1069873079,1070080726,1070288383,1070496049,1070703726,1070911413,1071119110,1071326817,1071534534,1071742261, + 1071949998,1072157746,1072365503,1072573270,1072781048,1072988835,1073196633,1073404441,1073612258,1073820086, + 1074027924,1074235772,1074443630,1074651498,1074859376,1075067264,1075275162,1075483070,1075690988,1075898917, + 1076106855,1076314803,1076522762,1076730730,1076938709,1077146697,1077354696,1077562705,1077770723,1077978752, + 1078186791,1078394839,1078602898,1078810967,1079019046,1079227135,1079435234,1079643343,1079851462,1080059591, + 1080267730,1080475879,1080684038,1080892207,1081100386,1081308576,1081516775,1081724984,1081933203,1082141432, + 1082349672,1082557921,1082766180,1082974450,1083182729,1083391018,1083599318,1083807627,1084015947,1084224276, + 1084432615,1084640965,1084849324,1085057694,1085266073,1085474462,1085682862,1085891271,1086099691,1086308120, + 1086516560,1086725009,1086933468,1087141938,1087350417,1087558907,1087767406,1087975915,1088184435,1088392964, + 1088601503,1088810053,1089018612,1089227181,1089435761,1089644350,1089852949,1090061559,1090270178,1090478807, + 1090687446,1090896095,1091104754,1091313424,1091522103,1091730792,1091939491,1092148200,1092356919,1092565648, + 1092774387,1092983136,1093191894,1093400663,1093609442,1093818231,1094027030,1094235838,1094444657,1094653486, + 1094862324,1095071173,1095280031,1095488900,1095697778,1095906666,1096115565,1096324473,1096533391,1096742319, + 1096951257,1097160206,1097369164,1097578132,1097787109,1097996097,1098205095,1098414103,1098623121,1098832148, + 1099041186,1099250233,1099459291,1099668358,1099877435,1100086523,1100295620,1100504727,1100713844,1100922971, + 1101132108,1101341255,1101550412,1101759578,1101968755,1102177942,1102387138,1102596345,1102805561,1103014787, + 1103224023,1103433270,1103642526,1103851792,1104061067,1104270353,1104479649,1104688955,1104898270,1105107596, + 1105316931,1105526276,1105735631,1105944997,1106154372,1106363756,1106573151,1106782556,1106991971,1107201395, + 1107410830,1107620274,1107829728,1108039192,1108248667,1108458150,1108667644,1108877148,1109086662,1109296185, + 1109505719,1109715262,1109924815,1110134378,1110343951,1110553534,1110763127,1110972730,1111182342,1111391965, + 1111601597,1111811239,1112020891,1112230553,1112440225,1112649907,1112859598,1113069300,1113279011,1113488733, + 1113698464,1113908205,1114117956,1114327716,1114537487,1114747267,1114957058,1115166858,1115376668,1115586488, + 1115796318,1116006157,1116216007,1116425866,1116635736,1116845615,1117055504,1117265403,1117475311,1117685230, + 1117895158,1118105097,1118315045,1118525003,1118734971,1118944948,1119154936,1119364933,1119574941,1119784958, + 1119994985,1120205022,1120415068,1120625125,1120835191,1121045267,1121255353,1121465449,1121675555,1121885670, + 1122095796,1122305931,1122516076,1122726231,1122936396,1123146570,1123356755,1123566949,1123777153,1123987367, + 1124197590,1124407824,1124618067,1124828321,1125038584,1125248856,1125459139,1125669432,1125879734,1126090046, + 1126300368,1126510700,1126721041,1126931393,1127141754,1127352125,1127562506,1127772897,1127983297,1128193707, + 1128404127,1128614557,1128824997,1129035447,1129245906,1129456375,1129666854,1129877343,1130087841,1130298350, + 1130508868,1130719396,1130929934,1131140481,1131351039,1131561606,1131772183,1131982769,1132193366,1132403972, + 1132614588,1132825214,1133035850,1133246496,1133457151,1133667816,1133878491,1134089176,1134299870,1134510574, + 1134721288,1134932012,1135142746,1135353489,1135564242,1135775005,1135985778,1136196560,1136407352,1136618154, + 1136828966,1137039788,1137250619,1137461460,1137672311,1137883172,1138094042,1138304922,1138515812,1138726712, + 1138937622,1139148541,1139359470,1139570409,1139781357,1139992315,1140203284,1140414261,1140625249,1140836246, + 1141047253,1141258270,1141469297,1141680333,1141891379,1142102435,1142313501,1142524576,1142735661,1142946756, + 1143157861,1143368975,1143580099,1143791233,1144002377,1144213530,1144424693,1144635866,1144847048,1145058241, + 1145269443,1145480655,1145691876,1145903107,1146114348,1146325599,1146536859,1146748130,1146959410,1147170699, + 1147381999,1147593308,1147804626,1148015955,1148227293,1148438641,1148649999,1148861367,1149072744,1149284131, + 1149495527,1149706934,1149918350,1150129775,1150341211,1150552656,1150764111,1150975576,1151187050,1151398534, + 1151610028,1151821531,1152033044,1152244567,1152456100,1152667642,1152879194,1153090756,1153302327,1153513909, + 1153725499,1153937100,1154148710,1154360330,1154571960,1154783599,1154995248,1155206907,1155418575,1155630253, + 1155841941,1156053639,1156265346,1156477063,1156688789,1156900526,1157112272,1157324027,1157535793,1157747568, + 1157959352,1158171147,1158382951,1158594765,1158806588,1159018421,1159230264,1159442116,1159653979,1159865850, + 1160077732,1160289623,1160501524,1160713435,1160925355,1161137285,1161349224,1161561173,1161773132,1161985101, + 1162197079,1162409067,1162621064,1162833072,1163045089,1163257115,1163469151,1163681197,1163893253,1164105318, + 1164317393,1164529477,1164741571,1164953675,1165165789,1165377912,1165590045,1165802187,1166014339,1166226501, + 1166438672,1166650853,1166863044,1167075244,1167287454,1167499674,1167711903,1167924142,1168136390,1168348649, + 1168560916,1168773194,1168985481,1169197778,1169410084,1169622400,1169834726,1170047061,1170259406,1170471761, + 1170684125,1170896499,1171108882,1171321275,1171533678,1171746090,1171958512,1172170944,1172383385,1172595836, + 1172808296,1173020766,1173233246,1173445735,1173658234,1173870743,1174083261,1174295789,1174508326,1174720873, + 1174933430,1175145996,1175358572,1175571158,1175783753,1175996357,1176208972,1176421596,1176634229,1176846872, + 1177059525,1177272187,1177484859,1177697541,1177910232,1178122933,1178335643,1178548363,1178761093,1178973832, + 1179186581,1179399339,1179612107,1179824884,1180037672,1180250468,1180463275,1180676090,1180888916,1181101751, + 1181314596,1181527450,1181740314,1181953187,1182166070,1182378963,1182591865,1182804777,1183017698,1183230629, + 1183443570,1183656520,1183869480,1184082449,1184295428,1184508416,1184721414,1184934422,1185147439,1185360465, + 1185573502,1185786548,1185999603,1186212668,1186425743,1186638827,1186851920,1187065024,1187278136,1187491259, + 1187704391,1187917532,1188130683,1188343844,1188557014,1188770194,1188983383,1189196582,1189409790,1189623008, + 1189836236,1190049473,1190262720,1190475976,1190689242,1190902517,1191115802,1191329096,1191542400,1191755713, + 1191969036,1192182369,1192395711,1192609063,1192822424,1193035795,1193249175,1193462565,1193675964,1193889373, + 1194102791,1194316219,1194529657,1194743104,1194956561,1195170027,1195383502,1195596987,1195810482,1196023986, + 1196237500,1196451023,1196664556,1196878099,1197091650,1197305212,1197518783,1197732363,1197945953,1198159553, + 1198373162,1198586780,1198800408,1199014046,1199227693,1199441349,1199655015,1199868691,1200082376,1200296071, + 1200509775,1200723489,1200937212,1201150944,1201364687,1201578438,1201792200,1202005970,1202219750,1202433540, + 1202647339,1202861148,1203074966,1203288794,1203502631,1203716478,1203930334,1204144200,1204358075,1204571960, + 1204785854,1204999758,1205213671,1205427594,1205641526,1205855467,1206069419,1206283379,1206497349,1206711329, + 1206925318,1207139317,1207353325,1207567342,1207781369,1207995406,1208209452,1208423507,1208637572,1208851647, + 1209065731,1209279824,1209493927,1209708039,1209922161,1210136293,1210350433,1210564584,1210778743,1210992912, + 1211207091,1211421279,1211635477,1211849684,1212063900,1212278126,1212492362,1212706607,1212920861,1213135125, + 1213349398,1213563681,1213777973,1213992275,1214206586,1214420907,1214635237,1214849576,1215063925,1215278284, + 1215492652,1215707029,1215921416,1216135812,1216350218,1216564633,1216779057,1216993491,1217207935,1217422388, + 1217636850,1217851322,1218065803,1218280294,1218494794,1218709304,1218923823,1219138351,1219352889,1219567436, + 1219781993,1219996559,1220211135,1220425720,1220640314,1220854918,1221069532,1221284154,1221498787,1221713428, + 1221928079,1222142740,1222357410,1222572089,1222786778,1223001476,1223216184,1223430901,1223645627,1223860363, + 1224075109,1224289863,1224504627,1224719401,1224934184,1225148976,1225363778,1225578589,1225793410,1226008240, + 1226223080,1226437928,1226652787,1226867654,1227082531,1227297418,1227512314,1227727219,1227942134,1228157058, + 1228371992,1228586934,1228801887,1229016849,1229231820,1229446800,1229661790,1229876789,1230091798,1230306816, + 1230521844,1230736881,1230951927,1231166983,1231382048,1231597122,1231812206,1232027299,1232242402,1232457514, + 1232672636,1232887766,1233102907,1233318056,1233533215,1233748383,1233963561,1234178748,1234393945,1234609151, + 1234824366,1235039590,1235254824,1235470068,1235685321,1235900583,1236115854,1236331135,1236546425,1236761725, + 1236977034,1237192352,1237407680,1237623017,1237838364,1238053719,1238269085,1238484459,1238699843,1238915236, + 1239130639,1239346051,1239561472,1239776903,1239992343,1240207793,1240423251,1240638720,1240854197,1241069684, + 1241285180,1241500686,1241716201,1241931725,1242147259,1242362802,1242578354,1242793916,1243009487,1243225067, + 1243440657,1243656256,1243871864,1244087482,1244303109,1244518745,1244734391,1244950046,1245165711,1245381385, + 1245597068,1245812760,1246028462,1246244173,1246459894,1246675623,1246891363,1247107111,1247322869,1247538636, + 1247754413,1247970198,1248185993,1248401798,1248617612,1248833435,1249049267,1249265109,1249480960,1249696820, + 1249912690,1250128569,1250344458,1250560355,1250776262,1250992179,1251208104,1251424039,1251639983,1251855937, + 1252071900,1252287872,1252503854,1252719845,1252935845,1253151854,1253367873,1253583901,1253799938,1254015985, + 1254232041,1254448106,1254664181,1254880265,1255096358,1255312461,1255528572,1255744693,1255960824,1256176964, + 1256393113,1256609271,1256825438,1257041615,1257257802,1257473997,1257690202,1257906416,1258122639,1258338872, + 1258555114,1258771365,1258987626,1259203895,1259420174,1259636463,1259852760,1260069067,1260285384,1260501709, + 1260718044,1260934388,1261150741,1261367104,1261583476,1261799857,1262016248,1262232647,1262449056,1262665475, + 1262881902,1263098339,1263314785,1263531241,1263747705,1263964179,1264180662,1264397155,1264613657,1264830168, + 1265046688,1265263217,1265479756,1265696304,1265912861,1266129428,1266346004,1266562589,1266779183,1266995787, + 1267212400,1267429022,1267645653,1267862294,1268078944,1268295603,1268512271,1268728949,1268945636,1269162332, + 1269379038,1269595752,1269812476,1270029209,1270245952,1270462703,1270679464,1270896234,1271113014,1271329802, + 1271546600,1271763407,1271980224,1272197049,1272413884,1272630728,1272847582,1273064444,1273281316,1273498197, + 1273715087,1273931987,1274148895,1274365813,1274582740,1274799677,1275016622,1275233577,1275450541,1275667515, + 1275884497,1276101489,1276318490,1276535500,1276752520,1276969548,1277186586,1277403633,1277620690,1277837755, + 1278054830,1278271914,1278489007,1278706110,1278923221,1279140342,1279357472,1279574611,1279791760,1280008918, + 1280226085,1280443261,1280660446,1280877641,1281094844,1281312057,1281529279,1281746511,1281963751,1282181001, + 1282398260,1282615528,1282832806,1283050092,1283267388,1283484693,1283702007,1283919331,1284136663,1284354005, + 1284571356,1284788716,1285006085,1285223464,1285440852,1285658249,1285875655,1286093070,1286310494,1286527928, + 1286745371,1286962823,1287180284,1287397755,1287615234,1287832723,1288050221,1288267728,1288485245,1288702770, + 1288920305,1289137849,1289355402,1289572964,1289790535,1290008116,1290225706,1290443305,1290660913,1290878530, + 1291096157,1291313792,1291531437,1291749091,1291966754,1292184426,1292402108,1292619799,1292837498,1293055207, + 1293272925,1293490653,1293708389,1293926135,1294143890,1294361654,1294579427,1294797209,1295015000,1295232801, + 1295450611,1295668430,1295886258,1296104095,1296321941,1296539797,1296757661,1296975535,1297193418,1297411310, + 1297629211,1297847122,1298065041,1298282970,1298500908,1298718855,1298936811,1299154776,1299372751,1299590734, + 1299808727,1300026729,1300244740,1300462760,1300680789,1300898828,1301116875,1301334932,1301552998,1301771072, + 1301989157,1302207250,1302425352,1302643464,1302861584,1303079714,1303297853,1303516001,1303734158,1303952324, + 1304170499,1304388684,1304606878,1304825080,1305043292,1305261513,1305479743,1305697982,1305916231,1306134488, + 1306352755,1306571030,1306789315,1307007609,1307225912,1307444224,1307662546,1307880876,1308099216,1308317564, + 1308535922,1308754289,1308972665,1309191050,1309409444,1309627847,1309846259,1310064681,1310283112,1310501551, + 1310720000,1310938458,1311156925,1311375401,1311593886,1311812380,1312030884,1312249396,1312467918,1312686449, + 1312904988,1313123537,1313342095,1313560662,1313779238,1313997824,1314216418,1314435021,1314653634,1314872255, + 1315090886,1315309526,1315528175,1315746833,1315965500,1316184176,1316402861,1316621555,1316840259,1317058971, + 1317277693,1317496423,1317715163,1317933912,1318152669,1318371436,1318590212,1318808997,1319027792,1319246595, + 1319465407,1319684228,1319903059,1320121898,1320340747,1320559605,1320778471,1320997347,1321216232,1321435126, + 1321654029,1321872941,1322091862,1322310792,1322529731,1322748679,1322967637,1323186603,1323405579,1323624563, + 1323843557,1324062559,1324281571,1324500592,1324719622,1324938661,1325157708,1325376765,1325595831,1325814906, + 1326033991,1326253084,1326472186,1326691297,1326910418,1327129547,1327348685,1327567833,1327786989,1328006155, + 1328225329,1328444513,1328663706,1328882907,1329102118,1329321338,1329540567,1329759804,1329979051,1330198307, + 1330417572,1330636846,1330856129,1331075421,1331294722,1331514033,1331733352,1331952680,1332172017,1332391363, + 1332610719,1332830083,1333049456,1333268839,1333488230,1333707630,1333927040,1334146458,1334365886,1334585322, + 1334804768,1335024222,1335243686,1335463158,1335682640,1335902131,1336121630,1336341139,1336560657,1336780183, + 1336999719,1337219264,1337438817,1337658380,1337877952,1338097532,1338317122,1338536721,1338756329,1338975945, + 1339195571,1339415206,1339634850,1339854503,1340074164,1340293835,1340513515,1340733204,1340952901,1341172608, + 1341392324,1341612049,1341831783,1342051525,1342271277,1342491038,1342710808,1342930586,1343150374,1343370171, + 1343589977,1343809791,1344029615,1344249448,1344469289,1344689140,1344909000,1345128868,1345348746,1345568633, + 1345788528,1346008433,1346228346,1346448269,1346668200,1346888141,1347108090,1347328049,1347548016,1347767993, + 1347987978,1348207972,1348427976,1348647988,1348868009,1349088040,1349308079,1349528127,1349748184,1349968250, + 1350188326,1350408410,1350628503,1350848605,1351068716,1351288836,1351508965,1351729102,1351949249,1352169405, + 1352389570,1352609744,1352829926,1353050118,1353270318,1353490528,1353710747,1353930974,1354151210,1354371456, + 1354591710,1354811973,1355032246,1355252527,1355472817,1355693116,1355913424, +}; + +static real aa_cs[8] = +{ + 14386344,14793176,15932125,16497281,16702017,16763133,16775525,16777101 +}; + +static real aa_ca[8] = +{ + -8631806,-7914349,-5257601,-3051997,-1586692,-687288,-238212,-62075 +}; + +static real win[4][36] = +{ + { + 541609,1798624,3379171,5462936,8388608,12881122,20824265,39123649,129925287,-141788570,-50986933,-32687548, + -24744405,-20251891,-17326219,-15242454,-13661907,-12404893,-11366990,-10483150,-9710514,-9019459,-8388608,-7801881, + -7246655,-6712557,-6190623,-5672661,-5150726,-4616628,-4061402,-3474675,-2843824,-2152769,-1380133,-496293 + }, + { + 541609,1798624,3379171,5462936,8388608,12881122,20824265,39123649,129925287,-141788570,-50986933,-32687548, + -24744405,-20251891,-17326219,-15242454,-13661907,-12404893,-11377819,-10573609,-9946281,-9457165,-9079764,-8795700, + -8518771,-7816938,-6661470,-5111526,-3237882,-1121518, + }, + { + 1798624,8388608,39123649,-50986933,-20251891,-13661907,-10483150,-8388608,-6712557,-5150726,-3474675,-1380133, + }, + { + 0,0,0,0,0,0,5058839,24594154,117073194,-152572757,-59375541,-38425694, + -27896396,-21920489,-18167045,-15612533,-13779795,-12416710,-11366990,-10483150,-9710514,-9019459,-8388608,-7801881, + -7246655,-6712557,-6190623,-5672661,-5150726,-4616628,-4061402,-3474675,-2843824,-2152769,-1380133,-496293 + } +}; + +const real COS9[9] = +{ + 16777216,16522332,15765426,14529495,12852093,10784187,8388608,5738146,2913333 +}; + +static const real COS6_1 = 14529495; + +static const real COS6_2 = 8388608; + +const real tfcos36[9] = +{ + 8420651,8684526,9255805,10240599,11863283,14625092,19849138,32411092,96248483 +}; + +static const real tfcos12[3] = +{ + 8684526,11863283,32411092 +}; + +#ifdef NEW_DCT9 +static const real cos9[3] = +{ + 15765426,-2913333,-12852093 +}; + +static const real cos18[3] = +{ + 16522332,-5738146,-10784187 +}; +#endif + +static const real tan1_1[16] = +{ + 0,6925,11994,16384,20774,25843,32768,44762,77530,2147483647,-44762,-11994,0,6925,11994,16384 +}; + +static const real tan2_1[16] = +{ + 32768,25843,20774,16384,11994,6925,0,-11994,-44762,2147483647,77530,44762,32768,25843,20774,16384 +}; + +static const real tan1_2[16] = +{ + 0,9793,16962,23170,29379,36548,46341,63303,109644,2147483647,-63303,-16962,0,9793,16962,23170 +}; + +static real tan2_2[16] = +{ + 46341,36548,29379,23170,16962,9793,0,-16962,-63303,2147483647,109644,63303,46341,36548,29379,23170 +}; + +static const real pow1_1[2][16] = +{ + {32768,27554,32768,23170,32768,19484,32768,16384,32768,13777,32768,11585,32768,9742,32768,8192}, + {32768,23170,32768,16384,32768,11585,32768,8192,32768,5793,32768,4096,32768,2896,32768,2048} +}; + +static const real pow2_1[2][16] = +{ + {32768,32768,27554,32768,23170,32768,19484,32768,16384,32768,13777,32768,11585,32768,9742,32768}, + {32768,32768,23170,32768,16384,32768,11585,32768,8192,32768,5793,32768,4096,32768,2896,32768} +}; + +static const real pow1_2[2][16] = +{ + {46341,38968,46341,32768,46341,27554,46341,23170,46341,19484,46341,16384,46341,13777,46341,11585}, + {46341,32768,46341,23170,46341,16384,46341,11585,46341,8192,46341,5793,46341,4096,46341,2896} +}; + +static const real pow2_2[2][16] = +{ + {46341,46341,38968,46341,32768,46341,27554,46341,23170,46341,19484,46341,16384,46341,13777,46341}, + {46341,46341,32768,46341,23170,46341,16384,46341,11585,46341,8192,46341,5793,46341,4096,46341} +}; + +static const real gainpow2[256+118+4] = +{ + 1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417, + 1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301, + 1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417, + 1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301, + 1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417, + 1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301, + 1518500250,1276901417,1073741824,902905651,759250125,638450708,536870912,451452825,379625062,319225354, + 268435456,225726413,189812531,159612677,134217728,112863206,94906266,79806339,67108864,56431603, + 47453133,39903169,33554432,28215802,23726566,19951585,16777216,14107901,11863283,9975792, + 8388608,7053950,5931642,4987896,4194304,3526975,2965821,2493948,2097152,1763488, + 1482910,1246974,1048576,881744,741455,623487,524288,440872,370728,311744, + 262144,220436,185364,155872,131072,110218,92682,77936,65536,55109, + 46341,38968,32768,27554,23170,19484,16384,13777,11585,9742, + 8192,6889,5793,4871,4096,3444,2896,2435,2048,1722, + 1448,1218,1024,861,724,609,512,431,362,304, + 256,215,181,152,128,108,91,76,64,54, + 45,38,32,27,23,19,16,13,11,10, + 8,7,6,5,4,3,3,2,2,2, + 1,1,1,1,1,1,1, +}; + +#else +static real ispow[8207]; +static real aa_ca[8],aa_cs[8]; +static real win[4][36]; +static real win1[4][36]; +real COS9[9]; /* dct36_3dnow wants to use that */ +static real COS6_1,COS6_2; +real tfcos36[9]; /* dct36_3dnow wants to use that */ +static real tfcos12[3]; +#ifdef NEW_DCT9 +static real cos9[3],cos18[3]; +static real tan1_1[16],tan2_1[16],tan1_2[16],tan2_2[16]; +static real pow1_1[2][16],pow2_1[2][16],pow1_2[2][16],pow2_2[2][16]; +#endif +#endif + +static real win1[4][36]; + +static const char gainpow2_scale[256+118+4+1] = +{ + 19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27, + 27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,0 +}; + +#endif diff --git a/src/libmpg123/layer1.c b/src/libmpg123/layer1.c new file mode 100644 index 0000000..d8782e0 --- /dev/null +++ b/src/libmpg123/layer1.c @@ -0,0 +1,191 @@ +/* + layer1.c: the layer 1 decoder + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + may have a few bugs after last optimization ... +*/ + +#include "mpg123lib_intern.h" +#include "getbits.h" +#include "debug.h" + +/* + Allocation value is not allowed to be 15. Initially, libmad showed me the + error that mpg123 used to ignore. Then, I found a quote on that in + Shlien, S. (1994): Guide to MPEG-1 Audio Standard. + IEEE Transactions on Broadcasting 40, 4 + + "To avoid conflicts with the synchronization code, code '1111' is defined + to be illegal." +*/ +static int check_balloc(mpg123_handle *fr, unsigned int *balloc, unsigned int *end) +{ + unsigned int *ba; + for(ba=balloc; ba != end; ++ba) + if(*ba == 15) + { + if(NOQUIET) error("Illegal bit allocation value."); + return -1; + } + + return 0; +} + +static int I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT],mpg123_handle *fr) +{ + unsigned int *ba=balloc; + unsigned int *sca = (unsigned int *) scale_index; + + if(fr->stereo == 2) + { + int i; + int jsbound = fr->jsbound; + for(i=0;istereo == 2) + { + int jsbound = fr->jsbound; + register real *f0 = fraction[0]; + register real *f1 = fraction[1]; + ba = balloc; + for(sample=smpb,i=0;imuls[n+1][*sca++]); + else *f0++ = DOUBLE_TO_REAL(0.0); + + if((n=*ba++)) + *f1++ = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15(MINUS_SHIFT(n) + (*sample++) + 1), fr->muls[n+1][*sca++]); + else *f1++ = DOUBLE_TO_REAL(0.0); + } + for(i=jsbound;imuls[n+1][*sca++]); + *f1++ = REAL_MUL_SCALE_LAYER12(samp, fr->muls[n+1][*sca++]); + } + else *f0++ = *f1++ = DOUBLE_TO_REAL(0.0); + } + for(i=fr->down_sample_sblimit;i<32;i++) + fraction[0][i] = fraction[1][i] = 0.0; + } + else + { + register real *f0 = fraction[0]; + ba = balloc; + for(sample=smpb,i=0;imuls[n+1][*sca++]); + else *f0++ = DOUBLE_TO_REAL(0.0); + } + for(i=fr->down_sample_sblimit;i<32;i++) + fraction[0][i] = DOUBLE_TO_REAL(0.0); + } +} + +int do_layer1(mpg123_handle *fr) +{ + int clip=0; + int i,stereo = fr->stereo; + unsigned int balloc[2*SBLIMIT]; + unsigned int scale_index[2][SBLIMIT]; + real (*fraction)[SBLIMIT] = fr->layer1.fraction; /* fraction[2][SBLIMIT] */ + int single = fr->single; + + fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : 32; + + if(stereo == 1 || single == SINGLE_MIX) /* I don't see mixing handled here */ + single = SINGLE_LEFT; + + if(I_step_one(balloc,scale_index,fr)) + { + if(NOQUIET) error("Aborting layer I decoding after step one.\n"); + return clip; + } + + for(i=0;isynth_mono)(fraction[single], fr); + else + clip += (fr->synth_stereo)(fraction[0], fraction[1], fr); + } + + return clip; +} + + diff --git a/src/libmpg123/layer2.c b/src/libmpg123/layer2.c new file mode 100644 index 0000000..056e8f4 --- /dev/null +++ b/src/libmpg123/layer2.c @@ -0,0 +1,371 @@ +/* + layer2.c: the layer 2 decoder, root of mpg123 + + copyright 1994-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + mpg123 started as mp2 decoder a long time ago... + part of this file is required for layer 1, too. +*/ + + +#include "mpg123lib_intern.h" +#ifndef NO_LAYER2 +#include "l2tables.h" +#endif +#include "getbits.h" + +#ifndef NO_LAYER12 /* Stuff needed for layer I and II. */ + +static int grp_3tab[32 * 3] = { 0, }; /* used: 27 */ +static int grp_5tab[128 * 3] = { 0, }; /* used: 125 */ +static int grp_9tab[1024 * 3] = { 0, }; /* used: 729 */ + +#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES) +#include "l12_integer_tables.h" +#else +static const double mulmul[27] = +{ + 0.0 , -2.0/3.0 , 2.0/3.0 , + 2.0/7.0 , 2.0/15.0 , 2.0/31.0, 2.0/63.0 , 2.0/127.0 , 2.0/255.0 , + 2.0/511.0 , 2.0/1023.0 , 2.0/2047.0 , 2.0/4095.0 , 2.0/8191.0 , + 2.0/16383.0 , 2.0/32767.0 , 2.0/65535.0 , + -4.0/5.0 , -2.0/5.0 , 2.0/5.0, 4.0/5.0 , + -8.0/9.0 , -4.0/9.0 , -2.0/9.0 , 2.0/9.0 , 4.0/9.0 , 8.0/9.0 +}; +#endif + +void init_layer12(void) +{ + const int base[3][9] = + { + { 1 , 0, 2 , } , + { 17, 18, 0 , 19, 20 , } , + { 21, 1, 22, 23, 0, 24, 25, 2, 26 } + }; + int i,j,k,l,len; + const int tablen[3] = { 3 , 5 , 9 }; + int *itable; + int *tables[3] = { grp_3tab , grp_5tab , grp_9tab }; + + for(i=0;i<3;i++) + { + itable = tables[i]; + len = tablen[i]; + for(j=0;jmuls[k], k); + *table++ = 0.0; + } +} + +real* init_layer12_table(mpg123_handle *fr, real *table, int m) +{ +#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES) + int i; + for(i=0;i<63;i++) + *table++ = layer12_table[m][i]; +#else + int i,j; + for(j=3,i=0;i<63;i++,j--) + *table++ = DOUBLE_TO_REAL_SCALE_LAYER12(mulmul[m] * pow(2.0,(double) j / 3.0)); +#endif + + return table; +} + +#ifdef OPT_MMXORSSE +real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m) +{ + int i,j; + if(!fr->p.down_sample) + { + for(j=3,i=0;i<63;i++,j--) + *table++ = DOUBLE_TO_REAL(16384 * mulmul[m] * pow(2.0,(double) j / 3.0)); + } + else + { + for(j=3,i=0;i<63;i++,j--) + *table++ = DOUBLE_TO_REAL(mulmul[m] * pow(2.0,(double) j / 3.0)); + } + return table; +} +#endif + +#endif /* NO_LAYER12 */ + +/* The rest is the actual decoding of layer II data. */ + +#ifndef NO_LAYER2 + +static void II_step_one(unsigned int *bit_alloc,int *scale,mpg123_handle *fr) +{ + int stereo = fr->stereo-1; + int sblimit = fr->II_sblimit; + int jsbound = fr->jsbound; + int sblimit2 = fr->II_sblimit<alloc; + int i; + unsigned int scfsi_buf[64]; + unsigned int *scfsi,*bita; + int sc,step; + + bita = bit_alloc; + if(stereo) + { + for(i=jsbound;i;i--,alloc1+=(1<bits; + *bita++ = (char) getbits(fr, step); + *bita++ = (char) getbits(fr, step); + } + for(i=sblimit-jsbound;i;i--,alloc1+=(1<bits; + bita[0] = (char) getbits(fr, step); + bita[1] = bita[0]; + bita+=2; + } + bita = bit_alloc; + scfsi=scfsi_buf; + + for(i=sblimit2;i;i--) + if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2); + } + else /* mono */ + { + for(i=sblimit;i;i--,alloc1+=(1<bits; + *bita++ = (char) getbits(fr, step); + } + bita = bit_alloc; + scfsi=scfsi_buf; + for(i=sblimit;i;i--) + if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2); + } + + bita = bit_alloc; + scfsi=scfsi_buf; + for(i=sblimit2;i;i--) + if(*bita++) + switch(*scfsi++) + { + case 0: + *scale++ = getbits_fast(fr, 6); + *scale++ = getbits_fast(fr, 6); + *scale++ = getbits_fast(fr, 6); + break; + case 1 : + *scale++ = sc = getbits_fast(fr, 6); + *scale++ = sc; + *scale++ = getbits_fast(fr, 6); + break; + case 2: + *scale++ = sc = getbits_fast(fr, 6); + *scale++ = sc; + *scale++ = sc; + break; + default: /* case 3 */ + *scale++ = getbits_fast(fr, 6); + *scale++ = sc = getbits_fast(fr, 6); + *scale++ = sc; + break; + } +} + + +static void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int *scale,mpg123_handle *fr,int x1) +{ + int i,j,k,ba; + int stereo = fr->stereo; + int sblimit = fr->II_sblimit; + int jsbound = fr->jsbound; + const struct al_table *alloc2,*alloc1 = fr->alloc; + unsigned int *bita=bit_alloc; + int d1,step; + + for(i=0;ibits; + for(j=0;jbits; + if( (d1=alloc2->d) < 0) + { + real cm=fr->muls[k][scale[x1]]; + fraction[j][0][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm); + fraction[j][1][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm); + fraction[j][2][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm); + } + else + { + const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab }; + unsigned int idx,*tab,m=scale[x1]; + idx = (unsigned int) getbits(fr, k); + tab = (unsigned int *) (table[d1] + idx + idx + idx); + fraction[j][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]); + fraction[j][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]); + fraction[j][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m]); + } + scale+=3; + } + else + fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = DOUBLE_TO_REAL(0.0); + } + } + + for(i=jsbound;ibits; + bita++; /* channel 1 and channel 2 bitalloc are the same */ + if( (ba=*bita++) ) + { + k=(alloc2 = alloc1+ba)->bits; + if( (d1=alloc2->d) < 0) + { + real cm; + cm=fr->muls[k][scale[x1+3]]; + fraction[0][0][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1); + fraction[0][1][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1); + fraction[0][2][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1); + fraction[1][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm); + fraction[1][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm); + fraction[1][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm); + cm=fr->muls[k][scale[x1]]; + fraction[0][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm); + fraction[0][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm); + fraction[0][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm); + } + else + { + const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab }; + unsigned int idx,*tab,m1,m2; + m1 = scale[x1]; m2 = scale[x1+3]; + idx = (unsigned int) getbits(fr, k); + tab = (unsigned int *) (table[d1] + idx + idx + idx); + fraction[0][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]); + fraction[0][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]); + fraction[0][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m2]); + } + scale+=6; + } + else + { + fraction[0][0][i] = fraction[0][1][i] = fraction[0][2][i] = + fraction[1][0][i] = fraction[1][1][i] = fraction[1][2][i] = DOUBLE_TO_REAL(0.0); + } +/* + Historic comment... + should we use individual scalefac for channel 2 or + is the current way the right one , where we just copy channel 1 to + channel 2 ?? + The current 'strange' thing is, that we throw away the scalefac + values for the second channel ...!! + -> changed .. now we use the scalefac values of channel one !! +*/ + } + + if(sblimit > (fr->down_sample_sblimit) ) + sblimit = fr->down_sample_sblimit; + + for(i=sblimit;isampling_frequency >= 3) /* Or equivalent: (fr->lsf == 1) */ + table = 4; + else + table = translate[fr->sampling_frequency][2-fr->stereo][fr->bitrate_index]; + + sblim = sblims[table]; + fr->alloc = tables[table]; + fr->II_sblimit = sblim; +} + + +int do_layer2(mpg123_handle *fr) +{ + int clip=0; + int i,j; + int stereo = fr->stereo; + /* pick_table clears unused subbands */ + /* replacement for real fraction[2][4][SBLIMIT], needs alignment. */ + real (*fraction)[4][SBLIMIT] = fr->layer2.fraction; + unsigned int bit_alloc[64]; + int scale[192]; + int single = fr->single; + + II_select_table(fr); + fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit; + + if(fr->jsbound > fr->II_sblimit) + { + fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); + fr->jsbound=fr->II_sblimit; + } + + /* TODO: What happens with mono mixing, actually? */ + if(stereo == 1 || single == SINGLE_MIX) /* also, mix not really handled */ + single = SINGLE_LEFT; + + II_step_one(bit_alloc, scale, fr); + + for(i=0;i>2); + for(j=0;j<3;j++) + { + if(single != SINGLE_STEREO) + clip += (fr->synth_mono)(fraction[single][j], fr); + else + clip += (fr->synth_stereo)(fraction[0][j], fraction[1][j], fr); + } + } + + return clip; +} + +#endif /* NO_LAYER2 */ diff --git a/src/libmpg123/layer3.c b/src/libmpg123/layer3.c new file mode 100644 index 0000000..f17e477 --- /dev/null +++ b/src/libmpg123/layer3.c @@ -0,0 +1,2146 @@ +/* + layer3.c: the layer 3 decoder + + copyright 1995-2017 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + Dear visitor: + If you feel you don't understand fully the works of this file, your feeling might be correct. + + Optimize-TODO: put short bands into the band-field without the stride of 3 reals + Length-optimze: unify long and short band code where it is possible + + The int-vs-pointer situation has to be cleaned up. +*/ + +#include "mpg123lib_intern.h" +#ifdef USE_NEW_HUFFTABLE +#include "newhuffman.h" +#else +#include "huffman.h" +#endif +#include "getbits.h" +#include "debug.h" + + + +/* define CUT_SFB21 if you want to cut-off the frequency above 16kHz */ +#if 0 +#define CUT_SFB21 +#endif + +#ifdef REAL_IS_FIXED +#define NEW_DCT9 +#include "l3_integer_tables.h" +#else +/* static one-time calculated tables... or so */ +static real ispow[8207]; +static real aa_ca[8],aa_cs[8]; +static ALIGNED(16) real win[4][36]; +static ALIGNED(16) real win1[4][36]; +real COS9[9]; /* dct36_3dnow wants to use that */ +static real COS6_1,COS6_2; +real tfcos36[9]; /* dct36_3dnow wants to use that */ +static real tfcos12[3]; +#define NEW_DCT9 +#ifdef NEW_DCT9 +static real cos9[3],cos18[3]; +static real tan1_1[16],tan2_1[16],tan1_2[16],tan2_2[16]; +static real pow1_1[2][32],pow2_1[2][32],pow1_2[2][32],pow2_2[2][32]; +#endif +#endif + +/* Decoder state data, living on the stack of do_layer3. */ + +struct gr_info_s +{ + int scfsi; + unsigned part2_3_length; + unsigned big_values; + unsigned scalefac_compress; + unsigned block_type; + unsigned mixed_block_flag; + unsigned table_select[3]; + /* Making those two signed int as workaround for open64/pathscale/sun compilers, and also for consistency, since they're worked on together with other signed variables. */ + int maxband[3]; + int maxbandl; + unsigned maxb; + unsigned region1start; + unsigned region2start; + unsigned preflag; + unsigned scalefac_scale; + unsigned count1table_select; + real *full_gain[3]; + real *pow2gain; +}; + +struct III_sideinfo +{ + unsigned main_data_begin; + unsigned private_bits; + /* Hm, funny... struct inside struct... */ + struct { struct gr_info_s gr[2]; } ch[2]; +}; + +struct bandInfoStruct +{ + unsigned short longIdx[23]; + unsigned char longDiff[22]; + unsigned short shortIdx[14]; + unsigned char shortDiff[13]; +}; + +/* Techy details about our friendly MPEG data. Fairly constant over the years;-) */ +static const struct bandInfoStruct bandInfo[9] = +{ + { /* MPEG 1.0 */ + {0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576}, + {4,4,4,4,4,4,6,6,8, 8,10,12,16,20,24,28,34,42,50,54, 76,158}, + {0,4*3,8*3,12*3,16*3,22*3,30*3,40*3,52*3,66*3, 84*3,106*3,136*3,192*3}, + {4,4,4,4,6,8,10,12,14,18,22,30,56} + }, + { + {0,4,8,12,16,20,24,30,36,42,50,60,72, 88,106,128,156,190,230,276,330,384,576}, + {4,4,4,4,4,4,6,6,6, 8,10,12,16,18,22,28,34,40,46,54, 54,192}, + {0,4*3,8*3,12*3,16*3,22*3,28*3,38*3,50*3,64*3, 80*3,100*3,126*3,192*3}, + {4,4,4,4,6,6,10,12,14,16,20,26,66} + }, + { + {0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576}, + {4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102, 26}, + {0,4*3,8*3,12*3,16*3,22*3,30*3,42*3,58*3,78*3,104*3,138*3,180*3,192*3}, + {4,4,4,4,6,8,12,16,20,26,34,42,12} + }, + { /* MPEG 2.0 */ + {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 } , + {0,4*3,8*3,12*3,18*3,24*3,32*3,42*3,56*3,74*3,100*3,132*3,174*3,192*3} , + {4,4,4,6,6,8,10,14,18,26,32,42,18 } + }, + { /* Twiddling 3 values here (not just 330->332!) fixed bug 1895025. */ + {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576}, + {6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36 }, + {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,136*3,180*3,192*3}, + {4,4,4,6,8,10,12,14,18,24,32,44,12 } + }, + { + {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 }, + {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,134*3,174*3,192*3}, + {4,4,4,6,8,10,12,14,18,24,30,40,18 } + }, + { /* MPEG 2.5 */ + {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54}, + {0,12,24,36,54,78,108,144,186,240,312,402,522,576}, + {4,4,4,6,8,10,12,14,18,24,30,40,18} + }, + { + {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54}, + {0,12,24,36,54,78,108,144,186,240,312,402,522,576}, + {4,4,4,6,8,10,12,14,18,24,30,40,18} + }, + { + {0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576}, + {12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2}, + {0, 24, 48, 72,108,156,216,288,372,480,486,492,498,576}, + {8,8,8,12,16,20,24,28,36,2,2,2,26} + } +}; + +static int mapbuf0[9][152]; +static int mapbuf1[9][156]; +static int mapbuf2[9][44]; +static int *map[9][3]; +static int *mapend[9][3]; + +static unsigned int n_slen2[512]; /* MPEG 2.0 slen for 'normal' mode */ +static unsigned int i_slen2[256]; /* MPEG 2.0 slen for intensity stereo */ + +/* Some helpers used in init_layer3 */ + +#ifdef OPT_MMXORSSE +real init_layer3_gainpow2_mmx(mpg123_handle *fr, int i) +{ + if(!fr->p.down_sample) return DOUBLE_TO_REAL(16384.0 * pow((double)2.0,-0.25 * (double) (i+210) )); + else return DOUBLE_TO_REAL(pow((double)2.0,-0.25 * (double) (i+210))); +} +#endif + +real init_layer3_gainpow2(mpg123_handle *fr, int i) +{ +#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES) + return gainpow2[i+256]; +#else + return DOUBLE_TO_REAL_SCALE_LAYER3(pow((double)2.0,-0.25 * (double) (i+210)),i+256); +#endif +} + + +/* init tables for layer-3 ... specific with the downsampling... */ +void init_layer3(void) +{ + int i,j,k,l; + +#if !defined(REAL_IS_FIXED) || !defined(PRECALC_TABLES) + for(i=0;i<8207;i++) + ispow[i] = DOUBLE_TO_REAL_POW43(pow((double)i,(double)4.0/3.0)); + + for(i=0;i<8;i++) + { + const double Ci[8] = {-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037}; + double sq = sqrt(1.0+Ci[i]*Ci[i]); + aa_cs[i] = DOUBLE_TO_REAL(1.0/sq); + aa_ca[i] = DOUBLE_TO_REAL(Ci[i]/sq); + } + + for(i=0;i<18;i++) + { + win[0][i] = win[1][i] = + DOUBLE_TO_REAL( 0.5*sin(M_PI/72.0 * (double)(2*(i+0) +1)) / cos(M_PI * (double)(2*(i+0) +19) / 72.0) ); + win[0][i+18] = win[3][i+18] = + DOUBLE_TO_REAL( 0.5*sin(M_PI/72.0 * (double)(2*(i+18)+1)) / cos(M_PI * (double)(2*(i+18)+19) / 72.0) ); + } + for(i=0;i<6;i++) + { + win[1][i+18] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (2*(i+18)+19) / 72.0 )); + win[3][i+12] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (2*(i+12)+19) / 72.0 )); + win[1][i+24] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+13) ) / cos ( M_PI * (double) (2*(i+24)+19) / 72.0 )); + win[1][i+30] = win[3][i] = DOUBLE_TO_REAL(0.0); + win[3][i+6 ] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+1 ) ) / cos ( M_PI * (double) (2*(i+6 )+19) / 72.0 )); + } + + for(i=0;i<9;i++) + COS9[i] = DOUBLE_TO_REAL(cos( M_PI / 18.0 * (double) i)); + + for(i=0;i<9;i++) + tfcos36[i] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (i*2+1) / 36.0 )); + + for(i=0;i<3;i++) + tfcos12[i] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (i*2+1) / 12.0 )); + + COS6_1 = DOUBLE_TO_REAL(cos( M_PI / 6.0 * (double) 1)); + COS6_2 = DOUBLE_TO_REAL(cos( M_PI / 6.0 * (double) 2)); + +#ifdef NEW_DCT9 + cos9[0] = DOUBLE_TO_REAL(cos(1.0*M_PI/9.0)); + cos9[1] = DOUBLE_TO_REAL(cos(5.0*M_PI/9.0)); + cos9[2] = DOUBLE_TO_REAL(cos(7.0*M_PI/9.0)); + cos18[0] = DOUBLE_TO_REAL(cos(1.0*M_PI/18.0)); + cos18[1] = DOUBLE_TO_REAL(cos(11.0*M_PI/18.0)); + cos18[2] = DOUBLE_TO_REAL(cos(13.0*M_PI/18.0)); +#endif + + for(i=0;i<12;i++) + { + win[2][i] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+1) ) / cos ( M_PI * (double) (2*i+7) / 24.0 )); + } + + for(i=0;i<16;i++) + { + double t = tan( (double) i * M_PI / 12.0 ); + tan1_1[i] = DOUBLE_TO_REAL_15(t / (1.0+t)); + tan2_1[i] = DOUBLE_TO_REAL_15(1.0 / (1.0 + t)); + tan1_2[i] = DOUBLE_TO_REAL_15(M_SQRT2 * t / (1.0+t)); + tan2_2[i] = DOUBLE_TO_REAL_15(M_SQRT2 / (1.0 + t)); + } + + for(i=0;i<32;i++) + { + for(j=0;j<2;j++) + { + double base = pow(2.0,-0.25*(j+1.0)); + double p1=1.0,p2=1.0; + if(i > 0) + { + if( i & 1 ) p1 = pow(base,(i+1.0)*0.5); + else p2 = pow(base,i*0.5); + } + pow1_1[j][i] = DOUBLE_TO_REAL_15(p1); + pow2_1[j][i] = DOUBLE_TO_REAL_15(p2); + pow1_2[j][i] = DOUBLE_TO_REAL_15(M_SQRT2 * p1); + pow2_2[j][i] = DOUBLE_TO_REAL_15(M_SQRT2 * p2); + } + } +#endif + + for(j=0;j<4;j++) + { + const int len[4] = { 36,36,12,36 }; + for(i=0;ilongDiff; + switch_idx = (j < 3) ? 8 : 6; + for(i=0,cb = 0; cb < switch_idx ; cb++,i+=*bdf++) + { + *mp++ = (*bdf) >> 1; + *mp++ = i; + *mp++ = 3; + *mp++ = cb; + } + bdf = bi->shortDiff+3; + for(cb=3;cb<13;cb++) + { + int l = (*bdf++) >> 1; + for(lwin=0;lwin<3;lwin++) + { + *mp++ = l; + *mp++ = i + lwin; + *mp++ = lwin; + *mp++ = cb; + } + i += 6*l; + } + mapend[j][0] = mp; + + mp = map[j][1] = mapbuf1[j]; + bdf = bi->shortDiff+0; + for(i=0,cb=0;cb<13;cb++) + { + int l = (*bdf++) >> 1; + for(lwin=0;lwin<3;lwin++) + { + *mp++ = l; + *mp++ = i + lwin; + *mp++ = lwin; + *mp++ = cb; + } + i += 6*l; + } + mapend[j][1] = mp; + + mp = map[j][2] = mapbuf2[j]; + bdf = bi->longDiff; + for(cb = 0; cb < 22 ; cb++) + { + *mp++ = (*bdf++) >> 1; + *mp++ = cb; + } + mapend[j][2] = mp; + } + + /* Now for some serious loopings! */ + for(i=0;i<5;i++) + for(j=0;j<6;j++) + for(k=0;k<6;k++) + { + int n = k + j * 6 + i * 36; + i_slen2[n] = i|(j<<3)|(k<<6)|(3<<12); + } + for(i=0;i<4;i++) + for(j=0;j<4;j++) + for(k=0;k<4;k++) + { + int n = k + j * 4 + i * 16; + i_slen2[n+180] = i|(j<<3)|(k<<6)|(4<<12); + } + for(i=0;i<4;i++) + for(j=0;j<3;j++) + { + int n = j + i * 3; + i_slen2[n+244] = i|(j<<3) | (5<<12); + n_slen2[n+500] = i|(j<<3) | (2<<12) | (1<<15); + } + for(i=0;i<5;i++) + for(j=0;j<5;j++) + for(k=0;k<4;k++) + for(l=0;l<4;l++) + { + int n = l + k * 4 + j * 16 + i * 80; + n_slen2[n] = i|(j<<3)|(k<<6)|(l<<9)|(0<<12); + } + for(i=0;i<5;i++) + for(j=0;j<5;j++) + for(k=0;k<4;k++) + { + int n = k + j * 4 + i * 20; + n_slen2[n+400] = i|(j<<3)|(k<<6)|(1<<12); + } +} + + +void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i)) +{ + int i,j; + + for(i=-256;i<118+4;i++) fr->gainpow2[i+256] = gainpow2(fr,i); + + for(j=0;j<9;j++) + { + for(i=0;i<23;i++) + { + fr->longLimit[j][i] = (bandInfo[j].longIdx[i] - 1 + 8) / 18 + 1; + if(fr->longLimit[j][i] > (fr->down_sample_sblimit) ) + fr->longLimit[j][i] = fr->down_sample_sblimit; + } + for(i=0;i<14;i++) + { + fr->shortLimit[j][i] = (bandInfo[j].shortIdx[i] - 1) / 18 + 1; + if(fr->shortLimit[j][i] > (fr->down_sample_sblimit) ) + fr->shortLimit[j][i] = fr->down_sample_sblimit; + } + } +} + +/* + Observe! + Now come the actualy decoding routines. +*/ + +/* read additional side information (for MPEG 1 and MPEG 2) */ +static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si,int stereo, int ms_stereo,long sfreq,int single) +{ + int ch, gr; + int powdiff = (single == SINGLE_MIX) ? 4 : 0; + + const int tabs[2][5] = { { 2,9,5,3,4 } , { 1,8,1,2,9 } }; + const int *tab = tabs[fr->lsf]; + + si->main_data_begin = getbits(fr, tab[1]); + + if(si->main_data_begin > fr->bitreservoir) + { + if(!fr->to_ignore && VERBOSE2) fprintf(stderr, "Note: missing %d bytes in bit reservoir for frame %li\n", (int)(si->main_data_begin - fr->bitreservoir), (long)fr->num); + + /* overwrite main_data_begin for the really available bit reservoir */ + backbits(fr, tab[1]); + if(fr->lsf == 0) + { + fr->wordpointer[0] = (unsigned char) (fr->bitreservoir >> 1); + fr->wordpointer[1] = (unsigned char) ((fr->bitreservoir & 1) << 7); + } + else fr->wordpointer[0] = (unsigned char) fr->bitreservoir; + + /* zero "side-info" data for a silence-frame + without touching audio data used as bit reservoir for following frame */ + memset(fr->wordpointer+2, 0, fr->ssize-2); + + /* reread the new bit reservoir offset */ + si->main_data_begin = getbits(fr, tab[1]); + } + + /* Keep track of the available data bytes for the bit reservoir. + Think: Substract the 2 crc bytes in parser already? */ + fr->bitreservoir = fr->bitreservoir + fr->framesize - fr->ssize - (fr->error_protection ? 2 : 0); + /* Limit the reservoir to the max for MPEG 1.0 or 2.x . */ + if(fr->bitreservoir > (unsigned int) (fr->lsf == 0 ? 511 : 255)) + fr->bitreservoir = (fr->lsf == 0 ? 511 : 255); + + /* Now back into less commented territory. It's code. It works. */ + + if (stereo == 1) + si->private_bits = getbits_fast(fr, tab[2]); + else + si->private_bits = getbits_fast(fr, tab[3]); + + if(!fr->lsf) for(ch=0; chch[ch].gr[0].scfsi = -1; + si->ch[ch].gr[1].scfsi = getbits_fast(fr, 4); + } + + for (gr=0; grch[ch].gr[gr]); + + gr_info->part2_3_length = getbits(fr, 12); + gr_info->big_values = getbits(fr, 9); + if(gr_info->big_values > 288) + { + if(NOQUIET) error("big_values too large!"); + gr_info->big_values = 288; + } + gr_info->pow2gain = fr->gainpow2+256 - getbits_fast(fr, 8) + powdiff; + if(ms_stereo) gr_info->pow2gain += 2; + gr_info->scalefac_compress = getbits(fr, tab[4]); + if(gr_info->part2_3_length == 0) + { + if(gr_info->scalefac_compress > 0) + debug1( "scalefac_compress _should_ be zero instead of %i" + , gr_info->scalefac_compress ); + gr_info->scalefac_compress = 0; + } + + if(get1bit(fr)) + { /* window switch flag */ + int i; + gr_info->block_type = getbits_fast(fr, 2); + gr_info->mixed_block_flag = get1bit(fr); + gr_info->table_select[0] = getbits_fast(fr, 5); + gr_info->table_select[1] = getbits_fast(fr, 5); + /* + table_select[2] not needed, because there is no region2, + but to satisfy some verification tools we set it either. + */ + gr_info->table_select[2] = 0; + for(i=0;i<3;i++) + gr_info->full_gain[i] = gr_info->pow2gain + (getbits_fast(fr, 3)<<3); + + if(gr_info->block_type == 0) + { + if(NOQUIET) error("Blocktype == 0 and window-switching == 1 not allowed."); + return 1; + } + + /* region_count/start parameters are implicit in this case. */ + if( (!fr->lsf || (gr_info->block_type == 2)) && !fr->mpeg25) + { + gr_info->region1start = 36>>1; + gr_info->region2start = 576>>1; + } + else + { + if(fr->mpeg25) + { + int r0c,r1c; + if((gr_info->block_type == 2) && (!gr_info->mixed_block_flag) ) r0c = 5; + else r0c = 7; + + /* r0c+1+r1c+1 == 22, always. */ + r1c = 20 - r0c; + gr_info->region1start = bandInfo[sfreq].longIdx[r0c+1] >> 1 ; + gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1; + } + else + { + gr_info->region1start = 54>>1; + gr_info->region2start = 576>>1; + } + } + } + else + { + int i,r0c,r1c; + for (i=0; i<3; i++) + gr_info->table_select[i] = getbits_fast(fr, 5); + + r0c = getbits_fast(fr, 4); /* 0 .. 15 */ + r1c = getbits_fast(fr, 3); /* 0 .. 7 */ + gr_info->region1start = bandInfo[sfreq].longIdx[r0c+1] >> 1 ; + + /* max(r0c+r1c+2) = 15+7+2 = 24 */ + if(r0c+1+r1c+1 > 22) gr_info->region2start = 576>>1; + else gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1; + + gr_info->block_type = 0; + gr_info->mixed_block_flag = 0; + } + if(!fr->lsf) gr_info->preflag = get1bit(fr); + + gr_info->scalefac_scale = get1bit(fr); + gr_info->count1table_select = get1bit(fr); + } + return 0; +} + + +/* read scalefactors */ +static int III_get_scale_factors_1(mpg123_handle *fr, int *scf,struct gr_info_s *gr_info,int ch,int gr) +{ + const unsigned char slen[2][16] = + { + {0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4}, + {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3} + }; + int numbits; + int num0 = slen[0][gr_info->scalefac_compress]; + int num1 = slen[1][gr_info->scalefac_compress]; + + if(gr_info->part2_3_length == 0) + { + int i; + for(i=0;i<39;i++) + *scf++ = 0; + return 0; + } + + if(gr_info->block_type == 2) + { + int i=18; + numbits = (num0 + num1) * 18; + + if(gr_info->mixed_block_flag) + { + for (i=8;i;i--) + *scf++ = getbits_fast(fr, num0); + + i = 9; + numbits -= num0; /* num0 * 17 + num1 * 18 */ + } + + for(;i;i--) *scf++ = getbits_fast(fr, num0); + + for(i = 18; i; i--) *scf++ = getbits_fast(fr, num1); + + *scf++ = 0; *scf++ = 0; *scf++ = 0; /* short[13][0..2] = 0 */ + } + else + { + int i; + int scfsi = gr_info->scfsi; + + if(scfsi < 0) + { /* scfsi < 0 => granule == 0 */ + for(i=11;i;i--) *scf++ = getbits_fast(fr, num0); + + for(i=10;i;i--) *scf++ = getbits_fast(fr, num1); + + numbits = (num0 + num1) * 10 + num0; + *scf++ = 0; + } + else + { + numbits = 0; + if(!(scfsi & 0x8)) + { + for (i=0;i<6;i++) *scf++ = getbits_fast(fr, num0); + + numbits += num0 * 6; + } + else scf += 6; + + if(!(scfsi & 0x4)) + { + for (i=0;i<5;i++) *scf++ = getbits_fast(fr, num0); + + numbits += num0 * 5; + } + else scf += 5; + + if(!(scfsi & 0x2)) + { + for(i=0;i<5;i++) *scf++ = getbits_fast(fr, num1); + + numbits += num1 * 5; + } + else scf += 5; + + if(!(scfsi & 0x1)) + { + for (i=0;i<5;i++) *scf++ = getbits_fast(fr, num1); + + numbits += num1 * 5; + } + else scf += 5; + + *scf++ = 0; /* no l[21] in original sources */ + } + } + return numbits; +} + + +static int III_get_scale_factors_2(mpg123_handle *fr, int *scf,struct gr_info_s *gr_info,int i_stereo) +{ + const unsigned char *pnt; + int i,j,n=0,numbits=0; + unsigned int slen; + + const unsigned char stab[3][6][4] = + { + { + { 6, 5, 5,5 } , { 6, 5, 7,3 } , { 11,10,0,0}, + { 7, 7, 7,0 } , { 6, 6, 6,3 } , { 8, 8,5,0} + }, + { + { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0}, + {12,12,12,0 } , {12, 9, 9,6 } , { 15,12,9,0} + }, + { + { 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0}, + { 6,15,12,0 } , { 6,12, 9,6 } , { 6,18,9,0} + } + }; + + if(i_stereo) /* i_stereo AND second channel -> do_layer3() checks this */ + slen = i_slen2[gr_info->scalefac_compress>>1]; + else + slen = n_slen2[gr_info->scalefac_compress]; + + gr_info->preflag = (slen>>15) & 0x1; + + n = 0; + if( gr_info->block_type == 2 ) + { + n++; + if(gr_info->mixed_block_flag) n++; + } + + pnt = stab[n][(slen>>12)&0x7]; + + if(gr_info->part2_3_length == 0) + { + int i; + for(i=0;i<39;i++) + *scf++ = 0; + return 0; + } + + for(i=0;i<4;i++) + { + int num = slen & 0x7; + slen >>= 3; + if(num) + { + for(j=0;j<(int)(pnt[i]);j++) *scf++ = getbits_fast(fr, num); + + numbits += pnt[i] * num; + } + else + for(j=0;j<(int)(pnt[i]);j++) *scf++ = 0; + } + + n = (n << 1) + 1; + for(i=0;iscalefac_scale; + real *xrpnt = (real *) xr; + int l[3],l3; + int part2remain = gr_info->part2_3_length - part2bits; + int *me; +#ifdef REAL_IS_FIXED + int gainpow2_scale_idx = 378; +#endif + + /* Assumption: If there is some part2_3_length at all, there should be + enough of it to work with properly. In case of zero length we silently + zero things. */ + if(gr_info->part2_3_length > 0) + { + + /* mhipp tree has this split up a bit... */ + int num=getbitoffset(fr); + MASK_TYPE mask; + /* We must split this, because for num==0 the shift is undefined if you do it in one step. */ + mask = ((MASK_UTYPE) getbits(fr, num))<big_values; + int region1 = gr_info->region1start; + int region2 = gr_info->region2start; + l3 = ((576>>1)-bv)>>1; + + /* we may lose the 'odd' bit here !! check this later again */ + if(bv <= region1) + { + l[0] = bv; + l[1] = 0; + l[2] = 0; + } + else + { + l[0] = region1; + if(bv <= region2) + { + l[1] = bv - l[0]; + l[2] = 0; + } + else + { + l[1] = region2 - l[0]; + l[2] = bv - region2; + } + } + } + +#define CHECK_XRPNT if(xrpnt >= &xr[SBLIMIT][0]) \ +{ \ + if(NOQUIET) \ + error2("attempted xrpnt overflow (%p !< %p)", (void*) xrpnt, (void*) &xr[SBLIMIT][0]); \ + return 1; \ +} + + if(gr_info->block_type == 2) + { + /* decoding with short or mixed mode BandIndex table */ + int i,max[4]; + int step=0,lwin=3,cb=0; + register real v = 0.0; + register int *m,mc; + + if(gr_info->mixed_block_flag) + { + max[3] = -1; + max[0] = max[1] = max[2] = 2; + m = map[sfreq][0]; + me = mapend[sfreq][0]; + } + else + { + max[0] = max[1] = max[2] = max[3] = -1; + /* max[3] not really needed in this case */ + m = map[sfreq][1]; + me = mapend[sfreq][1]; + } + + mc = 0; + for(i=0;i<2;i++) + { + int lp = l[i]; + const struct newhuff *h = ht+gr_info->table_select[i]; + for(;lp;lp--,mc--) + { + register MASK_STYPE x,y; + if( (!mc) ) + { + mc = *m++; + xrpnt = ((real *) xr) + (*m++); + lwin = *m++; + cb = *m++; + if(lwin == 3) + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->pow2gain[(*scf++) << shift]; + step = 1; + } + else + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->full_gain[lwin] + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->full_gain[lwin][(*scf++) << shift]; + step = 3; + } + } + { + const short *val = h->table; + REFRESH_MASK; +#ifdef USE_NEW_HUFFTABLE + while((y=val[(MASK_UTYPE)mask>>(BITSHIFT+4)])<0) + { + val -= y; + num -= 4; + mask <<= 4; + } + num -= (y >> 8); + mask <<= (y >> 8); + x = (y >> 4) & 0xf; + y &= 0xf; +#else + while((y=*val++)<0) + { + if (MSB_MASK) val -= y; + + num--; + mask <<= 1; + } + x = y >> 4; + y &= 0xf; +#endif + } + CHECK_XRPNT; + if(x == 15 && h->linbits) + { + max[lwin] = cb; + REFRESH_MASK; + x += ((MASK_UTYPE) mask) >> (BITSHIFT+8-h->linbits); + num -= h->linbits+1; + mask <<= h->linbits; + if(MSB_MASK) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx); + else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx); + + mask <<= 1; + } + else if(x) + { + max[lwin] = cb; + if(MSB_MASK) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx); + else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt = DOUBLE_TO_REAL(0.0); + + xrpnt += step; + CHECK_XRPNT; + if(y == 15 && h->linbits) + { + max[lwin] = cb; + REFRESH_MASK; + y += ((MASK_UTYPE) mask) >> (BITSHIFT+8-h->linbits); + num -= h->linbits+1; + mask <<= h->linbits; + if(MSB_MASK) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx); + else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx); + + mask <<= 1; + } + else if(y) + { + max[lwin] = cb; + if(MSB_MASK) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx); + else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt = DOUBLE_TO_REAL(0.0); + + xrpnt += step; + } + } + + for(;l3 && (part2remain+num > 0);l3--) + { + const struct newhuff* h; + const short* val; + register short a; + + h = htc+gr_info->count1table_select; + val = h->table; + + REFRESH_MASK; + while((a=*val++)<0) + { + if(MSB_MASK) val -= a; + + num--; + mask <<= 1; + } + if(part2remain+num <= 0) + { + num -= part2remain+num; + break; + } + + for(i=0;i<4;i++) + { + if(!(i & 1)) + { + if(!mc) + { + mc = *m++; + xrpnt = ((real *) xr) + (*m++); + lwin = *m++; + cb = *m++; + if(lwin == 3) + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->pow2gain[(*scf++) << shift]; + step = 1; + } + else + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->full_gain[lwin] + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->full_gain[lwin][(*scf++) << shift]; + step = 3; + } + } + mc--; + } + CHECK_XRPNT; + if( (a & (0x8>>i)) ) + { + max[lwin] = cb; + if(part2remain+num <= 0) + break; + + if(MSB_MASK) *xrpnt = -REAL_SCALE_LAYER3(v, gainpow2_scale_idx); + else *xrpnt = REAL_SCALE_LAYER3(v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt = DOUBLE_TO_REAL(0.0); + + xrpnt += step; + } + } + + if(lwin < 3) + { /* short band? */ + while(1) + { + for(;mc > 0;mc--) + { + CHECK_XRPNT; + *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3; /* short band -> step=3 */ + *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3; + } + if(m >= me) + break; + + mc = *m++; + xrpnt = ((real *) xr) + *m++; + if(*m++ == 0) + break; /* optimize: field will be set to zero at the end of the function */ + + m++; /* cb */ + } + } + + gr_info->maxband[0] = max[0]+1; + gr_info->maxband[1] = max[1]+1; + gr_info->maxband[2] = max[2]+1; + gr_info->maxbandl = max[3]+1; + + { + int rmax = max[0] > max[1] ? max[0] : max[1]; + rmax = (rmax > max[2] ? rmax : max[2]) + 1; + gr_info->maxb = rmax ? fr->shortLimit[sfreq][rmax] : fr->longLimit[sfreq][max[3]+1]; + } + + } + else + { + /* decoding with 'long' BandIndex table (block_type != 2) */ + const unsigned char *pretab = pretab_choice[gr_info->preflag]; + int i,max = -1; + int cb = 0; + int *m = map[sfreq][2]; + register real v = 0.0; + int mc = 0; + + /* long hash table values */ + for(i=0;i<3;i++) + { + int lp = l[i]; + const struct newhuff *h = ht+gr_info->table_select[i]; + + for(;lp;lp--,mc--) + { + MASK_STYPE x,y; + if(!mc) + { + mc = *m++; + cb = *m++; +#ifdef CUT_SFB21 + if(cb == 21) + v = 0.0; + else +#endif + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->pow2gain[(*(scf++) + (*pretab++)) << shift]; + } + } + { + const short *val = h->table; + REFRESH_MASK; +#ifdef USE_NEW_HUFFTABLE + while((y=val[(MASK_UTYPE)mask>>(BITSHIFT+4)])<0) + { + val -= y; + num -= 4; + mask <<= 4; + } + num -= (y >> 8); + mask <<= (y >> 8); + x = (y >> 4) & 0xf; + y &= 0xf; +#else + while((y=*val++)<0) + { + if (MSB_MASK) val -= y; + + num--; + mask <<= 1; + } + x = y >> 4; + y &= 0xf; +#endif + } + + CHECK_XRPNT; + if(x == 15 && h->linbits) + { + max = cb; + REFRESH_MASK; + x += ((MASK_UTYPE) mask) >> (BITSHIFT+8-h->linbits); + num -= h->linbits+1; + mask <<= h->linbits; + if(MSB_MASK) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx); + else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx); + + mask <<= 1; + } + else if(x) + { + max = cb; + if(MSB_MASK) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx); + else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx); + num--; + + mask <<= 1; + } + else *xrpnt++ = DOUBLE_TO_REAL(0.0); + + CHECK_XRPNT; + if(y == 15 && h->linbits) + { + max = cb; + REFRESH_MASK; + y += ((MASK_UTYPE) mask) >> (BITSHIFT+8-h->linbits); + num -= h->linbits+1; + mask <<= h->linbits; + if(MSB_MASK) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx); + else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx); + + mask <<= 1; + } + else if(y) + { + max = cb; + if(MSB_MASK) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx); + else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt++ = DOUBLE_TO_REAL(0.0); + } + } + + /* short (count1table) values */ + for(;l3 && (part2remain+num > 0);l3--) + { + const struct newhuff *h = htc+gr_info->count1table_select; + const short *val = h->table; + register short a; + + REFRESH_MASK; + while((a=*val++)<0) + { + if (MSB_MASK) val -= a; + + num--; + mask <<= 1; + } + if(part2remain+num <= 0) + { + num -= part2remain+num; + break; + } + + for(i=0;i<4;i++) + { + if(!(i & 1)) + { + if(!mc) + { + mc = *m++; + cb = *m++; +#ifdef CUT_SFB21 + if(cb == 21) + v = 0.0; + else +#endif + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->pow2gain[((*scf++) + (*pretab++)) << shift]; + } + } + mc--; + } + CHECK_XRPNT; + if( (a & (0x8>>i)) ) + { + max = cb; + if(part2remain+num <= 0) + break; + + if(MSB_MASK) *xrpnt++ = -REAL_SCALE_LAYER3(v, gainpow2_scale_idx); + else *xrpnt++ = REAL_SCALE_LAYER3(v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt++ = DOUBLE_TO_REAL(0.0); + } + } + + gr_info->maxbandl = max+1; + gr_info->maxb = fr->longLimit[sfreq][gr_info->maxbandl]; + } + + part2remain += num; + backbits(fr, num); + num = 0; + } + else + { + part2remain = 0; + /* Not entirely sure what good values are, must be > 0. */ + gr_info->maxband[0] = + gr_info->maxband[1] = + gr_info->maxband[2] = + gr_info->maxbandl = 1; /* sfb=maxband[lwin]*3 + lwin - mixed_block_flag must be >= 0 */ + gr_info->maxb = 1; + } + + while(xrpnt < &xr[SBLIMIT][0]) + *xrpnt++ = DOUBLE_TO_REAL(0.0); + + while( part2remain > 16 ) + { + skipbits(fr, 16); /* Dismiss stuffing Bits */ + part2remain -= 16; + } + if(part2remain > 0) skipbits(fr, part2remain); + else if(part2remain < 0) + { + debug1("Can't rewind stream by %d bits!",-part2remain); + return 1; /* -> error */ + } + return 0; +} + + +/* calculate real channel values for Joint-I-Stereo-mode */ +static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac, struct gr_info_s *gr_info,int sfreq,int ms_stereo,int lsf) +{ + real (*xr)[SBLIMIT*SSLIMIT] = (real (*)[SBLIMIT*SSLIMIT] ) xr_buf; + const struct bandInfoStruct *bi = &bandInfo[sfreq]; + + const real *tab1,*tab2; + +#if 1 + int tab; +/* TODO: optimize as static */ + const real *tabs[3][2][2] = + { + { { tan1_1,tan2_1 } , { tan1_2,tan2_2 } }, + { { pow1_1[0],pow2_1[0] } , { pow1_2[0],pow2_2[0] } }, + { { pow1_1[1],pow2_1[1] } , { pow1_2[1],pow2_2[1] } } + }; + + tab = lsf + (gr_info->scalefac_compress & lsf); + tab1 = tabs[tab][ms_stereo][0]; + tab2 = tabs[tab][ms_stereo][1]; +#else + if(lsf) + { + int p = gr_info->scalefac_compress & 0x1; + if(ms_stereo) + { + tab1 = pow1_2[p]; + tab2 = pow2_2[p]; + } + else + { + tab1 = pow1_1[p]; + tab2 = pow2_1[p]; + } + } + else + { + if(ms_stereo) + { + tab1 = tan1_2; + tab2 = tan2_2; + } + else + { + tab1 = tan1_1; + tab2 = tan2_1; + } + } +#endif + + if(gr_info->block_type == 2) + { + int lwin,do_l = 0; + if( gr_info->mixed_block_flag ) do_l = 1; + + for(lwin=0;lwin<3;lwin++) + { /* process each window */ + /* get first band with zero values */ + int is_p,sb,idx,sfb = gr_info->maxband[lwin]; /* sfb is minimal 3 for mixed mode */ + if(sfb > 3) do_l = 0; + + for(;sfb<12;sfb++) + { + is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ + if(is_p != 7) + { + real t1,t2; + sb = bi->shortDiff[sfb]; + idx = bi->shortIdx[sfb] + lwin; + t1 = tab1[is_p]; t2 = tab2[is_p]; + for (; sb > 0; sb--,idx+=3) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + } + +#if 1 +/* in the original: copy 10 to 11 , here: copy 11 to 12 +maybe still wrong??? (copy 12 to 13?) */ + is_p = scalefac[11*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ + sb = bi->shortDiff[12]; + idx = bi->shortIdx[12] + lwin; +#else + is_p = scalefac[10*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ + sb = bi->shortDiff[11]; + idx = bi->shortIdx[11] + lwin; +#endif + if(is_p != 7) + { + real t1,t2; + t1 = tab1[is_p]; t2 = tab2[is_p]; + for( ; sb > 0; sb--,idx+=3 ) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + } /* end for(lwin; .. ; . ) */ + + /* also check l-part, if ALL bands in the three windows are 'empty' and mode = mixed_mode */ + if(do_l) + { + int sfb = gr_info->maxbandl; + int idx; + if(sfb > 21) return; /* similarity fix related to CVE-2006-1655 */ + + idx = bi->longIdx[sfb]; + for( ; sfb<8; sfb++ ) + { + int sb = bi->longDiff[sfb]; + int is_p = scalefac[sfb]; /* scale: 0-15 */ + if(is_p != 7) + { + real t1,t2; + t1 = tab1[is_p]; t2 = tab2[is_p]; + for( ; sb > 0; sb--,idx++) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + else idx += sb; + } + } + } + else + { /* ((gr_info->block_type != 2)) */ + int sfb = gr_info->maxbandl; + int is_p,idx; + if(sfb > 21) return; /* tightened fix for CVE-2006-1655 */ + + idx = bi->longIdx[sfb]; + for ( ; sfb<21; sfb++) + { + int sb = bi->longDiff[sfb]; + is_p = scalefac[sfb]; /* scale: 0-15 */ + if(is_p != 7) + { + real t1,t2; + t1 = tab1[is_p]; t2 = tab2[is_p]; + for( ; sb > 0; sb--,idx++) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + else idx += sb; + } + + is_p = scalefac[20]; + if(is_p != 7) + { /* copy l-band 20 to l-band 21 */ + int sb; + real t1 = tab1[is_p],t2 = tab2[is_p]; + + for( sb = bi->longDiff[21]; sb > 0; sb--,idx++ ) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + } +} + + +static void III_antialias(real xr[SBLIMIT][SSLIMIT],struct gr_info_s *gr_info) +{ + int sblim; + + if(gr_info->block_type == 2) + { + if(!gr_info->mixed_block_flag) return; + + sblim = 1; + } + else sblim = gr_info->maxb-1; + + /* 31 alias-reduction operations between each pair of sub-bands */ + /* with 8 butterflies between each pair */ + + { + int sb; + real *xr1=(real *) xr[1]; + + for(sb=sblim; sb; sb--,xr1+=10) + { + int ss; + real *cs=aa_cs,*ca=aa_ca; + real *xr2 = xr1; + + for(ss=7;ss>=0;ss--) + { /* upper and lower butterfly inputs */ + register real bu = *--xr2,bd = *xr1; + *xr2 = REAL_MUL(bu, *cs) - REAL_MUL(bd, *ca); + *xr1++ = REAL_MUL(bd, *cs++) + REAL_MUL(bu, *ca++); + } + } + } +} + +/* + This is an optimized DCT from Jeff Tsay's maplay 1.2+ package. + Saved one multiplication by doing the 'twiddle factor' stuff + together with the window mul. (MH) + + This uses Byeong Gi Lee's Fast Cosine Transform algorithm, but the + 9 point IDCT needs to be reduced further. Unfortunately, I don't + know how to do that, because 9 is not an even number. - Jeff. + + Original Message: + + 9 Point Inverse Discrete Cosine Transform + + This piece of code is Copyright 1997 Mikko Tommila and is freely usable + by anybody. The algorithm itself is of course in the public domain. + + Again derived heuristically from the 9-point WFTA. + + The algorithm is optimized (?) for speed, not for small rounding errors or + good readability. + + 36 additions, 11 multiplications + + Again this is very likely sub-optimal. + + The code is optimized to use a minimum number of temporary variables, + so it should compile quite well even on 8-register Intel x86 processors. + This makes the code quite obfuscated and very difficult to understand. + + References: + [1] S. Winograd: "On Computing the Discrete Fourier Transform", + Mathematics of Computation, Volume 32, Number 141, January 1978, + Pages 175-199 +*/ + +/* Calculation of the inverse MDCT + used to be static without 3dnow - does that really matter? */ +void dct36(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf) +{ +#ifdef NEW_DCT9 + real tmp[18]; +#endif + + { + register real *in = inbuf; + + in[17]+=in[16]; in[16]+=in[15]; in[15]+=in[14]; + in[14]+=in[13]; in[13]+=in[12]; in[12]+=in[11]; + in[11]+=in[10]; in[10]+=in[9]; in[9] +=in[8]; + in[8] +=in[7]; in[7] +=in[6]; in[6] +=in[5]; + in[5] +=in[4]; in[4] +=in[3]; in[3] +=in[2]; + in[2] +=in[1]; in[1] +=in[0]; + + in[17]+=in[15]; in[15]+=in[13]; in[13]+=in[11]; in[11]+=in[9]; + in[9] +=in[7]; in[7] +=in[5]; in[5] +=in[3]; in[3] +=in[1]; + + +#ifdef NEW_DCT9 +#if 1 + { + real t3; + { + real t0, t1, t2; + + t0 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4])); + t1 = REAL_MUL(COS6_2, in[12]); + + t3 = in[0]; + t2 = t3 - t1 - t1; + tmp[1] = tmp[7] = t2 - t0; + tmp[4] = t2 + t0 + t0; + t3 += t1; + + t2 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2])); + tmp[1] -= t2; + tmp[7] += t2; + } + { + real t0, t1, t2; + + t0 = REAL_MUL(cos9[0], (in[4] + in[8] )); + t1 = REAL_MUL(cos9[1], (in[8] - in[16])); + t2 = REAL_MUL(cos9[2], (in[4] + in[16])); + + tmp[2] = tmp[6] = t3 - t0 - t2; + tmp[0] = tmp[8] = t3 + t0 + t1; + tmp[3] = tmp[5] = t3 - t1 + t2; + } + } + { + real t1, t2, t3; + + t1 = REAL_MUL(cos18[0], (in[2] + in[10])); + t2 = REAL_MUL(cos18[1], (in[10] - in[14])); + t3 = REAL_MUL(COS6_1, in[6]); + + { + real t0 = t1 + t2 + t3; + tmp[0] += t0; + tmp[8] -= t0; + } + + t2 -= t3; + t1 -= t3; + + t3 = REAL_MUL(cos18[2], (in[2] + in[14])); + + t1 += t3; + tmp[3] += t1; + tmp[5] -= t1; + + t2 -= t3; + tmp[2] += t2; + tmp[6] -= t2; + } + +#else + { + real t0, t1, t2, t3, t4, t5, t6, t7; + + t1 = REAL_MUL(COS6_2, in[12]); + t2 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4])); + + t3 = in[0] + t1; + t4 = in[0] - t1 - t1; + t5 = t4 - t2; + tmp[4] = t4 + t2 + t2; + + t0 = REAL_MUL(cos9[0], (in[4] + in[8])); + t1 = REAL_MUL(cos9[1], (in[8] - in[16])); + + t2 = REAL_MUL(cos9[2], (in[4] + in[16])); + + t6 = t3 - t0 - t2; + t0 += t3 + t1; + t3 += t2 - t1; + + t2 = REAL_MUL(cos18[0], (in[2] + in[10])); + t4 = REAL_MUL(cos18[1], (in[10] - in[14])); + t7 = REAL_MUL(COS6_1, in[6]); + + t1 = t2 + t4 + t7; + tmp[0] = t0 + t1; + tmp[8] = t0 - t1; + t1 = REAL_MUL(cos18[2], (in[2] + in[14])); + t2 += t1 - t7; + + tmp[3] = t3 + t2; + t0 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2])); + tmp[5] = t3 - t2; + + t4 -= t1 + t7; + + tmp[1] = t5 - t0; + tmp[7] = t5 + t0; + tmp[2] = t6 + t4; + tmp[6] = t6 - t4; + } +#endif + + { + real t0, t1, t2, t3, t4, t5, t6, t7; + + t1 = REAL_MUL(COS6_2, in[13]); + t2 = REAL_MUL(COS6_2, (in[9] + in[17] - in[5])); + + t3 = in[1] + t1; + t4 = in[1] - t1 - t1; + t5 = t4 - t2; + + t0 = REAL_MUL(cos9[0], (in[5] + in[9])); + t1 = REAL_MUL(cos9[1], (in[9] - in[17])); + + tmp[13] = REAL_MUL((t4 + t2 + t2), tfcos36[17-13]); + t2 = REAL_MUL(cos9[2], (in[5] + in[17])); + + t6 = t3 - t0 - t2; + t0 += t3 + t1; + t3 += t2 - t1; + + t2 = REAL_MUL(cos18[0], (in[3] + in[11])); + t4 = REAL_MUL(cos18[1], (in[11] - in[15])); + t7 = REAL_MUL(COS6_1, in[7]); + + t1 = t2 + t4 + t7; + tmp[17] = REAL_MUL((t0 + t1), tfcos36[17-17]); + tmp[9] = REAL_MUL((t0 - t1), tfcos36[17-9]); + t1 = REAL_MUL(cos18[2], (in[3] + in[15])); + t2 += t1 - t7; + + tmp[14] = REAL_MUL((t3 + t2), tfcos36[17-14]); + t0 = REAL_MUL(COS6_1, (in[11] + in[15] - in[3])); + tmp[12] = REAL_MUL((t3 - t2), tfcos36[17-12]); + + t4 -= t1 + t7; + + tmp[16] = REAL_MUL((t5 - t0), tfcos36[17-16]); + tmp[10] = REAL_MUL((t5 + t0), tfcos36[17-10]); + tmp[15] = REAL_MUL((t6 + t4), tfcos36[17-15]); + tmp[11] = REAL_MUL((t6 - t4), tfcos36[17-11]); + } + +#define MACRO(v) { \ + real tmpval; \ + tmpval = tmp[(v)] + tmp[17-(v)]; \ + out2[9+(v)] = REAL_MUL(tmpval, w[27+(v)]); \ + out2[8-(v)] = REAL_MUL(tmpval, w[26-(v)]); \ + tmpval = tmp[(v)] - tmp[17-(v)]; \ + ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(tmpval, w[8-(v)]); \ + ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(tmpval, w[9+(v)]); } + + { + register real *out2 = o2; + register real *w = wintab; + register real *out1 = o1; + register real *ts = tsbuf; + + MACRO(0); + MACRO(1); + MACRO(2); + MACRO(3); + MACRO(4); + MACRO(5); + MACRO(6); + MACRO(7); + MACRO(8); + } + +#else + + { + +#define MACRO0(v) { \ + real tmp; \ + out2[9+(v)] = REAL_MUL((tmp = sum0 + sum1), w[27+(v)]); \ + out2[8-(v)] = REAL_MUL(tmp, w[26-(v)]); } \ + sum0 -= sum1; \ + ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(sum0, w[8-(v)]); \ + ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(sum0, w[9+(v)]); +#define MACRO1(v) { \ + real sum0,sum1; \ + sum0 = tmp1a + tmp2a; \ + sum1 = REAL_MUL((tmp1b + tmp2b), tfcos36[(v)]); \ + MACRO0(v); } +#define MACRO2(v) { \ + real sum0,sum1; \ + sum0 = tmp2a - tmp1a; \ + sum1 = REAL_MUL((tmp2b - tmp1b), tfcos36[(v)]); \ + MACRO0(v); } + + register const real *c = COS9; + register real *out2 = o2; + register real *w = wintab; + register real *out1 = o1; + register real *ts = tsbuf; + + real ta33,ta66,tb33,tb66; + + ta33 = REAL_MUL(in[2*3+0], c[3]); + ta66 = REAL_MUL(in[2*6+0], c[6]); + tb33 = REAL_MUL(in[2*3+1], c[3]); + tb66 = REAL_MUL(in[2*6+1], c[6]); + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = REAL_MUL(in[2*1+0], c[1]) + ta33 + REAL_MUL(in[2*5+0], c[5]) + REAL_MUL(in[2*7+0], c[7]); + tmp1b = REAL_MUL(in[2*1+1], c[1]) + tb33 + REAL_MUL(in[2*5+1], c[5]) + REAL_MUL(in[2*7+1], c[7]); + tmp2a = REAL_MUL(in[2*2+0], c[2]) + REAL_MUL(in[2*4+0], c[4]) + ta66 + REAL_MUL(in[2*8+0], c[8]); + tmp2b = REAL_MUL(in[2*2+1], c[2]) + REAL_MUL(in[2*4+1], c[4]) + tb66 + REAL_MUL(in[2*8+1], c[8]); + + MACRO1(0); + MACRO2(8); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = REAL_MUL(( in[2*1+0] - in[2*5+0] - in[2*7+0] ), c[3]); + tmp1b = REAL_MUL(( in[2*1+1] - in[2*5+1] - in[2*7+1] ), c[3]); + tmp2a = REAL_MUL(( in[2*2+0] - in[2*4+0] - in[2*8+0] ), c[6]) - in[2*6+0] + in[2*0+0]; + tmp2b = REAL_MUL(( in[2*2+1] - in[2*4+1] - in[2*8+1] ), c[6]) - in[2*6+1] + in[2*0+1]; + + MACRO1(1); + MACRO2(7); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = REAL_MUL(in[2*1+0], c[5]) - ta33 - REAL_MUL(in[2*5+0], c[7]) + REAL_MUL(in[2*7+0], c[1]); + tmp1b = REAL_MUL(in[2*1+1], c[5]) - tb33 - REAL_MUL(in[2*5+1], c[7]) + REAL_MUL(in[2*7+1], c[1]); + tmp2a = - REAL_MUL(in[2*2+0], c[8]) - REAL_MUL(in[2*4+0], c[2]) + ta66 + REAL_MUL(in[2*8+0], c[4]); + tmp2b = - REAL_MUL(in[2*2+1], c[8]) - REAL_MUL(in[2*4+1], c[2]) + tb66 + REAL_MUL(in[2*8+1], c[4]); + + MACRO1(2); + MACRO2(6); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = REAL_MUL(in[2*1+0], c[7]) - ta33 + REAL_MUL(in[2*5+0], c[1]) - REAL_MUL(in[2*7+0], c[5]); + tmp1b = REAL_MUL(in[2*1+1], c[7]) - tb33 + REAL_MUL(in[2*5+1], c[1]) - REAL_MUL(in[2*7+1], c[5]); + tmp2a = - REAL_MUL(in[2*2+0], c[4]) + REAL_MUL(in[2*4+0], c[8]) + ta66 - REAL_MUL(in[2*8+0], c[2]); + tmp2b = - REAL_MUL(in[2*2+1], c[4]) + REAL_MUL(in[2*4+1], c[8]) + tb66 - REAL_MUL(in[2*8+1], c[2]); + + MACRO1(3); + MACRO2(5); + } + + { + real sum0,sum1; + sum0 = in[2*0+0] - in[2*2+0] + in[2*4+0] - in[2*6+0] + in[2*8+0]; + sum1 = REAL_MUL((in[2*0+1] - in[2*2+1] + in[2*4+1] - in[2*6+1] + in[2*8+1] ), tfcos36[4]); + MACRO0(4); + } + } +#endif + + } +} + + +/* new DCT12 */ +static void dct12(real *in,real *rawout1,real *rawout2,register real *wi,register real *ts) +{ +#define DCT12_PART1 \ + in5 = in[5*3]; \ + in5 += (in4 = in[4*3]); \ + in4 += (in3 = in[3*3]); \ + in3 += (in2 = in[2*3]); \ + in2 += (in1 = in[1*3]); \ + in1 += (in0 = in[0*3]); \ + \ + in5 += in3; in3 += in1; \ + \ + in2 = REAL_MUL(in2, COS6_1); \ + in3 = REAL_MUL(in3, COS6_1); + +#define DCT12_PART2 \ + in0 += REAL_MUL(in4, COS6_2); \ + \ + in4 = in0 + in2; \ + in0 -= in2; \ + \ + in1 += REAL_MUL(in5, COS6_2); \ + \ + in5 = REAL_MUL((in1 + in3), tfcos12[0]); \ + in1 = REAL_MUL((in1 - in3), tfcos12[2]); \ + \ + in3 = in4 + in5; \ + in4 -= in5; \ + \ + in2 = in0 + in1; \ + in0 -= in1; + + { + real in0,in1,in2,in3,in4,in5; + register real *out1 = rawout1; + ts[SBLIMIT*0] = out1[0]; ts[SBLIMIT*1] = out1[1]; ts[SBLIMIT*2] = out1[2]; + ts[SBLIMIT*3] = out1[3]; ts[SBLIMIT*4] = out1[4]; ts[SBLIMIT*5] = out1[5]; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + ts[(17-1)*SBLIMIT] = out1[17-1] + REAL_MUL(tmp0, wi[11-1]); + ts[(12+1)*SBLIMIT] = out1[12+1] + REAL_MUL(tmp0, wi[6+1]); + ts[(6 +1)*SBLIMIT] = out1[6 +1] + REAL_MUL(tmp1, wi[1]); + ts[(11-1)*SBLIMIT] = out1[11-1] + REAL_MUL(tmp1, wi[5-1]); + } + + DCT12_PART2 + + ts[(17-0)*SBLIMIT] = out1[17-0] + REAL_MUL(in2, wi[11-0]); + ts[(12+0)*SBLIMIT] = out1[12+0] + REAL_MUL(in2, wi[6+0]); + ts[(12+2)*SBLIMIT] = out1[12+2] + REAL_MUL(in3, wi[6+2]); + ts[(17-2)*SBLIMIT] = out1[17-2] + REAL_MUL(in3, wi[11-2]); + + ts[(6 +0)*SBLIMIT] = out1[6+0] + REAL_MUL(in0, wi[0]); + ts[(11-0)*SBLIMIT] = out1[11-0] + REAL_MUL(in0, wi[5-0]); + ts[(6 +2)*SBLIMIT] = out1[6+2] + REAL_MUL(in4, wi[2]); + ts[(11-2)*SBLIMIT] = out1[11-2] + REAL_MUL(in4, wi[5-2]); + } + + in++; + + { + real in0,in1,in2,in3,in4,in5; + register real *out2 = rawout2; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + out2[5-1] = REAL_MUL(tmp0, wi[11-1]); + out2[0+1] = REAL_MUL(tmp0, wi[6+1]); + ts[(12+1)*SBLIMIT] += REAL_MUL(tmp1, wi[1]); + ts[(17-1)*SBLIMIT] += REAL_MUL(tmp1, wi[5-1]); + } + + DCT12_PART2 + + out2[5-0] = REAL_MUL(in2, wi[11-0]); + out2[0+0] = REAL_MUL(in2, wi[6+0]); + out2[0+2] = REAL_MUL(in3, wi[6+2]); + out2[5-2] = REAL_MUL(in3, wi[11-2]); + + ts[(12+0)*SBLIMIT] += REAL_MUL(in0, wi[0]); + ts[(17-0)*SBLIMIT] += REAL_MUL(in0, wi[5-0]); + ts[(12+2)*SBLIMIT] += REAL_MUL(in4, wi[2]); + ts[(17-2)*SBLIMIT] += REAL_MUL(in4, wi[5-2]); + } + + in++; + + { + real in0,in1,in2,in3,in4,in5; + register real *out2 = rawout2; + out2[12]=out2[13]=out2[14]=out2[15]=out2[16]=out2[17]=0.0; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + out2[11-1] = REAL_MUL(tmp0, wi[11-1]); + out2[6 +1] = REAL_MUL(tmp0, wi[6+1]); + out2[0+1] += REAL_MUL(tmp1, wi[1]); + out2[5-1] += REAL_MUL(tmp1, wi[5-1]); + } + + DCT12_PART2 + + out2[11-0] = REAL_MUL(in2, wi[11-0]); + out2[6 +0] = REAL_MUL(in2, wi[6+0]); + out2[6 +2] = REAL_MUL(in3, wi[6+2]); + out2[11-2] = REAL_MUL(in3, wi[11-2]); + + out2[0+0] += REAL_MUL(in0, wi[0]); + out2[5-0] += REAL_MUL(in0, wi[5-0]); + out2[0+2] += REAL_MUL(in4, wi[2]); + out2[5-2] += REAL_MUL(in4, wi[5-2]); + } +} + + +static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT], real tsOut[SSLIMIT][SBLIMIT], int ch,struct gr_info_s *gr_info, mpg123_handle *fr) +{ + real (*block)[2][SBLIMIT*SSLIMIT] = fr->hybrid_block; + int *blc = fr->hybrid_blc; + + real *tspnt = (real *) tsOut; + real *rawout1,*rawout2; + int bt = 0; + size_t sb = 0; + + { + int b = blc[ch]; + rawout1=block[b][ch]; + b=-b+1; + rawout2=block[b][ch]; + blc[ch] = b; + } + + if(gr_info->mixed_block_flag) + { + sb = 2; + opt_dct36(fr)(fsIn[0],rawout1,rawout2,win[0],tspnt); + opt_dct36(fr)(fsIn[1],rawout1+18,rawout2+18,win1[0],tspnt+1); + rawout1 += 36; rawout2 += 36; tspnt += 2; + } + + bt = gr_info->block_type; + if(bt == 2) + { + for(; sbmaxb; sb+=2,tspnt+=2,rawout1+=36,rawout2+=36) + { + dct12(fsIn[sb] ,rawout1 ,rawout2 ,win[2] ,tspnt); + dct12(fsIn[sb+1],rawout1+18,rawout2+18,win1[2],tspnt+1); + } + } + else + { + for(; sbmaxb; sb+=2,tspnt+=2,rawout1+=36,rawout2+=36) + { + opt_dct36(fr)(fsIn[sb],rawout1,rawout2,win[bt],tspnt); + opt_dct36(fr)(fsIn[sb+1],rawout1+18,rawout2+18,win1[bt],tspnt+1); + } + } + + for(;sbstereo; + int single = fr->single; + int ms_stereo,i_stereo; + int sfreq = fr->sampling_frequency; + int stereo1,granules; + + if(stereo == 1) + { /* stream is mono */ + stereo1 = 1; + single = SINGLE_LEFT; + } + else if(single != SINGLE_STEREO) /* stream is stereo, but force to mono */ + stereo1 = 1; + else + stereo1 = 2; + + if(fr->mode == MPG_MD_JOINT_STEREO) + { + ms_stereo = (fr->mode_ext & 0x2)>>1; + i_stereo = fr->mode_ext & 0x1; + } + else ms_stereo = i_stereo = 0; + + granules = fr->lsf ? 1 : 2; + + /* quick hack to keep the music playing */ + /* after having seen this nasty test file... */ + if(III_get_side_info(fr, &sideinfo,stereo,ms_stereo,sfreq,single)) + { + if(NOQUIET) error("bad frame - unable to get valid sideinfo"); + return clip; + } + + set_pointer(fr,sideinfo.main_data_begin); + + for(gr=0;grlayer3.hybrid_in; + /* hybridOut[2][SSLIMIT][SBLIMIT] */ + real (*hybridOut)[SSLIMIT][SBLIMIT] = fr->layer3.hybrid_out; + + { + struct gr_info_s *gr_info = &(sideinfo.ch[0].gr[gr]); + long part2bits; + if(fr->lsf) + part2bits = III_get_scale_factors_2(fr, scalefacs[0],gr_info,0); + else + part2bits = III_get_scale_factors_1(fr, scalefacs[0],gr_info,0,gr); + + if(III_dequantize_sample(fr, hybridIn[0], scalefacs[0],gr_info,sfreq,part2bits)) + { + if(VERBOSE2) error("dequantization failed!"); + return clip; + } + } + + if(stereo == 2) + { + struct gr_info_s *gr_info = &(sideinfo.ch[1].gr[gr]); + long part2bits; + if(fr->lsf) + part2bits = III_get_scale_factors_2(fr, scalefacs[1],gr_info,i_stereo); + else + part2bits = III_get_scale_factors_1(fr, scalefacs[1],gr_info,1,gr); + + if(III_dequantize_sample(fr, hybridIn[1],scalefacs[1],gr_info,sfreq,part2bits)) + { + if(VERBOSE2) error("dequantization failed!"); + return clip; + } + + if(ms_stereo) + { + int i; + unsigned int maxb = sideinfo.ch[0].gr[gr].maxb; + if(sideinfo.ch[1].gr[gr].maxb > maxb) maxb = sideinfo.ch[1].gr[gr].maxb; + + for(i=0;ilsf); + + if(ms_stereo || i_stereo || (single == SINGLE_MIX) ) + { + if(gr_info->maxb > sideinfo.ch[0].gr[gr].maxb) + sideinfo.ch[0].gr[gr].maxb = gr_info->maxb; + else + gr_info->maxb = sideinfo.ch[0].gr[gr].maxb; + } + + switch(single) + { + case SINGLE_MIX: + { + register int i; + register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1]; + for(i=0;imaxb;i++,in0++) + *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */ + } + break; + case SINGLE_RIGHT: + { + register int i; + register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1]; + for(i=0;imaxb;i++) + *in0++ = *in1++; + } + break; + } + } + + for(ch=0;chaf.encoding != MPG123_ENC_SIGNED_16 || fr->down_sample != 0) + { +#endif + for(ss=0;sssynth_mono)(hybridOut[0][ss], fr); + else + clip += (fr->synth_stereo)(hybridOut[0][ss], hybridOut[1][ss], fr); + + } +#ifdef OPT_I486 + } else + { + /* Only stereo, 16 bits benefit from the 486 optimization. */ + ss=0; + while(ss < SSLIMIT) + { + int n; + n=(fr->buffer.size - fr->buffer.fill) / (2*2*32); + if(n > (SSLIMIT-ss)) n=SSLIMIT-ss; + + /* Clip counting makes no sense with this function. */ + absynth_1to1_i486(hybridOut[0][ss], 0, fr, n); + absynth_1to1_i486(hybridOut[1][ss], 1, fr, n); + ss+=n; + fr->buffer.fill+=(2*2*32)*n; + } + } +#endif + } + + return clip; +} diff --git a/src/libmpg123/lfs_alias.c b/src/libmpg123/lfs_alias.c new file mode 100644 index 0000000..45cb53d --- /dev/null +++ b/src/libmpg123/lfs_alias.c @@ -0,0 +1,228 @@ +/* + lfs_alias: Aliases to the small/native API functions with the size of long int as suffix. + + copyright 2010-2013 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis + + Use case: Client code on Linux/x86-64 that defines _FILE_OFFSET_BITS to 64, + which is the only choice on that platform anyway. It should be no-op, but + prompts the platform-agnostic header of mpg123 to define API calls with the + corresponding suffix. This file provides the names for this case. It's cruft, + but glibc does it, too -- so people rely on it. + Oh, and it also caters for the lunatics that define _FILE_OFFSET_BITS=32 on + 32 bit platforms. In addition, it's needed for platforms that always have + off_t /= long, and clients still insisting on defining _FILE_OFFSET_BITS. + + Depending on use case, the aliases map to 32 (small) or 64 bit (large) offset + functions, to the ones from libmpg123 or the ones from lfs_wrap. + + So, two basic cases: + 1. mpg123_bla_32 alias for mpg123_bla (native) + 2. mpg123_bla alias for mpg123_bla_32 (wrapper) + Same for 64 bits. Confusing, I know. It sucks. + + Note that the mpg123 header is _not_ used here to avoid definition with whacky off_t. + The aliases are always about arguments of native alias_t type. This can be off_t, but + on Linux/x86, this is long int. The off_t declarations in mpg123.h confuse things, + so reproduce definitions for the wrapper functions in that case. The definitions are + pulled by an inline Perl script in any case ... no need to copy anything manually! + As a benefit, one can skip undefining possible largefile namings. +*/ + +#include "config.h" + +/* Hack for Solaris: Some system headers included from compat.h might force _FILE_OFFSET_BITS. Need to follow that here. + Also, want it around to have types defined. */ +#include "compat.h" + +#ifndef LFS_ALIAS_BITS +#error "I need the count of alias bits here." +#endif + +#define MACROCAT_REALLY(a, b) a ## b +#define MACROCAT(a, b) MACROCAT_REALLY(a, b) + +/* This is wicked switchery: Decide which way the aliases are facing. */ + +#if _FILE_OFFSET_BITS+0 == LFS_ALIAS_BITS + +/* The native functions have suffix, the aliases not. */ +#define NATIVE_SUFFIX MACROCAT(_, _FILE_OFFSET_BITS) +#define NATIVE_NAME(func) MACROCAT(func, NATIVE_SUFFIX) +#define ALIAS_NAME(func) func + +#else + +/* The alias functions have suffix, the native ones not. */ +#define ALIAS_SUFFIX MACROCAT(_, LFS_ALIAS_BITS) +#define ALIAS_NAME(func) MACROCAT(func, ALIAS_SUFFIX) +#define NATIVE_NAME(func) func + +#endif + +/* Copy of necessary definitions, actually just forward declarations. */ +struct mpg123_handle_struct; +typedef struct mpg123_handle_struct mpg123_handle; + + +/* Get attribute_align_arg, to stay safe. */ +#include "abi_align.h" + +/* + Extract the list of functions we need wrappers for, pregenerating the wrappers for simple cases (inline script for nedit): +perl -ne ' +if(/^\s*MPG123_EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/) +{ + my $type = $1; + my $name = $2; + my $args = $3; + next unless ($type =~ /off_t/ or $args =~ /off_t/ or ($name =~ /open/ and $name ne mpg123_open_feed)); + $type =~ s/off_t/lfs_alias_t/g; + my @nargs = (); + $args =~ s/off_t/lfs_alias_t/g; + foreach my $a (split(/,/, $args)) + { + $a =~ s/^.*\s\**([a-z_]+)$/$1/; + push(@nargs, $a); + } + my $nargs = join(", ", @nargs); + $nargs = "Human: figure me out." if($nargs =~ /\(/); + print < +#include +#include +#include "compat.h" +#include "debug.h" + +/* + Now, start off easy... translate simple API calls. + I need to deal with these here: +perl -ne ' +if(/^\s*MPG123_EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/) +{ + $type = $1; + $name = $2; + $args = $3; + next unless ($type =~ /off_t/ or $args =~ /off_t/); + print "$name\n" unless grep {$_ eq $name} + ("mpg123_open", "mpg123_open_fd", "mpg123_open_handle", "mpg123_replace_reader", "mpg123_replace_reader_handle"); +}' < mpg123.h.in + +mpg123_decode_frame +mpg123_framebyframe_decode +mpg123_framepos +mpg123_tell +mpg123_tellframe +mpg123_tell_stream +mpg123_seek +mpg123_feedseek +mpg123_seek_frame +mpg123_timeframe +mpg123_index +mpg123_set_index +mpg123_position +mpg123_length +mpg123_set_filesize +mpg123_decode_raw ... that's experimental. + +Let's work on them in that order. +*/ + +/* I see that I will need custom data storage. Main use is for the replaced I/O later, but the seek table for small file offsets needs extra storage, too. */ + +/* The wrapper handle for descriptor and handle I/O. */ + +/* The handle is used for nothing (0), or one of these two modes of operation: */ +#define IO_FD 1 /* Wrapping over callbacks operation on integer file descriptor. */ +#define IO_HANDLE 2 /* Wrapping over custom handle callbacks. */ + +struct wrap_data +{ + /* Storage for small offset index table. */ + long *indextable; + /* I/O handle stuff */ + int iotype; /* IO_FD or IO_HANDLE */ + /* Data for IO_FD. */ + int fd; + int my_fd; /* A descriptor that the wrapper code opened itself. */ + /* The actual callbacks from the outside. */ + ssize_t (*r_read) (int, void *, size_t); + long (*r_lseek)(int, long, int); + /* Data for IO_HANDLE. */ + void* handle; + ssize_t (*r_h_read)(void *, void *, size_t); + long (*r_h_lseek)(void*, long, int); + void (*h_cleanup)(void*); +}; + + +/* Cleanup I/O part of the handle handle... but not deleting the wrapper handle itself. + That is stored in the frame and only deleted on mpg123_delete(). */ +static void wrap_io_cleanup(void *handle) +{ + struct wrap_data *ioh = handle; + if(ioh->iotype == IO_HANDLE) + { + if(ioh->h_cleanup != NULL && ioh->handle != NULL) + ioh->h_cleanup(ioh->handle); + + ioh->handle = NULL; + } + if(ioh->my_fd >= 0) + { + close(ioh->my_fd); + ioh->my_fd = -1; + } +} + +/* Really finish off the handle... freeing all memory. */ +static void wrap_destroy(void *handle) +{ + struct wrap_data *wh = handle; + wrap_io_cleanup(handle); + if(wh->indextable != NULL) + free(wh->indextable); + + free(wh); +} + +/* More helper code... extract the special wrapper handle, possible allocate and initialize it. */ +static struct wrap_data* wrap_get(mpg123_handle *mh) +{ + struct wrap_data* whd; + if(mh == NULL) return NULL; + + /* Access the private storage inside the mpg123 handle. + The real callback functions and handles are stored there. */ + if(mh->wrapperdata == NULL) + { + /* Create a new one. */ + mh->wrapperdata = malloc(sizeof(struct wrap_data)); + if(mh->wrapperdata == NULL) + { + mh->err = MPG123_OUT_OF_MEM; + return NULL; + } + /* When we have wrapper data present, the callback for its proper cleanup is needed. */ + mh->wrapperclean = wrap_destroy; + + whd = mh->wrapperdata; + whd->indextable = NULL; + whd->iotype = 0; + whd->fd = -1; + whd->my_fd = -1; + whd->r_read = NULL; + whd->r_lseek = NULL; + whd->handle = NULL; + whd->r_h_read = NULL; + whd->r_h_lseek = NULL; + whd->h_cleanup = NULL; + } + else whd = mh->wrapperdata; + + return whd; +} + +/* After settling the data... start with some simple wrappers. */ + +#undef mpg123_decode_frame +/* int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes) */ +int attribute_align_arg mpg123_decode_frame(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes) +{ + off_t largenum; + int err; + + err = MPG123_LARGENAME(mpg123_decode_frame)(mh, &largenum, audio, bytes); + if(err == MPG123_OK && num != NULL) + { + *num = largenum; + if(*num != largenum) + { + mh->err = MPG123_LFS_OVERFLOW; + err = MPG123_ERR; + } + } + return err; +} + +#undef mpg123_framebyframe_decode +/* int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); */ +int attribute_align_arg mpg123_framebyframe_decode(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes) +{ + off_t largenum; + int err; + + err = MPG123_LARGENAME(mpg123_framebyframe_decode)(mh, &largenum, audio, bytes); + if(err == MPG123_OK && num != NULL) + { + *num = largenum; + if(*num != largenum) + { + mh->err = MPG123_LFS_OVERFLOW; + err = MPG123_ERR; + } + } + return err; +} + +#undef mpg123_framepos +/* off_t mpg123_framepos(mpg123_handle *mh); */ +long attribute_align_arg mpg123_framepos(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_framepos)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_tell +/* off_t mpg123_tell(mpg123_handle *mh); */ +long attribute_align_arg mpg123_tell(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_tell)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_tellframe +/* off_t mpg123_tellframe(mpg123_handle *mh); */ +long attribute_align_arg mpg123_tellframe(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_tellframe)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_tell_stream +/* off_t mpg123_tell_stream(mpg123_handle *mh); */ +long attribute_align_arg mpg123_tell_stream(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_tell_stream)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_seek +/* off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); */ +long attribute_align_arg mpg123_seek(mpg123_handle *mh, long sampleoff, int whence) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_seek)(mh, sampleoff, whence); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_feedseek +/* off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); */ +long attribute_align_arg mpg123_feedseek(mpg123_handle *mh, long sampleoff, int whence, long *input_offset) +{ + long val; + off_t largeioff; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_feedseek)(mh, sampleoff, whence, &largeioff); + /* Error/message codes are small... */ + if(largeval < 0) return (long)largeval; + + val = largeval; + *input_offset = largeioff; + if(val != largeval || *input_offset != largeioff) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_seek_frame +/* off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); */ +long attribute_align_arg mpg123_seek_frame(mpg123_handle *mh, long frameoff, int whence) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_seek_frame)(mh, frameoff, whence); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_timeframe +/* off_t mpg123_timeframe(mpg123_handle *mh, double sec); */ +long attribute_align_arg mpg123_timeframe(mpg123_handle *mh, double sec) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_timeframe)(mh, sec); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +/* Now something less simple: Index retrieval and manipulation. + The index is an _array_ of off_t, which means that I need to construct a copy with translated long values. */ +#undef mpg123_index +/* int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill) */ +int attribute_align_arg mpg123_index(mpg123_handle *mh, long **offsets, long *step, size_t *fill) +{ + int err; + size_t i; + long smallstep; + size_t thefill; + off_t largestep; + off_t *largeoffsets; + struct wrap_data *whd; + + whd = wrap_get(mh); + if(whd == NULL) return MPG123_ERR; + + err = MPG123_LARGENAME(mpg123_index)(mh, &largeoffsets, &largestep, &thefill); + if(err != MPG123_OK) return err; + + /* For a _very_ large file, even the step could overflow. */ + smallstep = largestep; + if(smallstep != largestep) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + if(step != NULL) *step = smallstep; + + /* When there are no values stored, there is no table content to take care of. + Table pointer does not matter. Mission completed. */ + if(thefill == 0) return MPG123_OK; + + if(fill != NULL) *fill = thefill; + + /* Construct a copy of the index to hand over to the small-minded client. */ + *offsets = safe_realloc(whd->indextable, (*fill)*sizeof(long)); + if(*offsets == NULL) + { + mh->err = MPG123_OUT_OF_MEM; + return MPG123_ERR; + } + whd->indextable = *offsets; + /* Elaborate conversion of each index value, with overflow check. */ + for(i=0; i<*fill; ++i) + { + whd->indextable[i] = largeoffsets[i]; + if(whd->indextable[i] != largeoffsets[i]) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + } + /* If we came that far... there should be a valid copy of the table now. */ + return MPG123_OK; +} + +/* The writing does basically the same than the above, just the opposite. + Oh, and the overflow checks are not needed -- off_t is bigger than long. */ +#undef mpg123_set_index +/* int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); */ +int attribute_align_arg mpg123_set_index(mpg123_handle *mh, long *offsets, long step, size_t fill) +{ + int err; + size_t i; + struct wrap_data *whd; + off_t *indextmp; + + whd = wrap_get(mh); + if(whd == NULL) return MPG123_ERR; + + /* Expensive temporary storage... for staying outside at the API layer. */ + indextmp = malloc(fill*sizeof(off_t)); + if(indextmp == NULL) + { + mh->err = MPG123_OUT_OF_MEM; + return MPG123_ERR; + } + + if(fill > 0 && offsets == NULL) + { + mh->err = MPG123_BAD_INDEX_PAR; + err = MPG123_ERR; + } + else + { + /* Fill the large-file copy of the provided index, then feed it to mpg123. */ + for(i=0; ierr = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + + if(current_frame != NULL) *current_frame = small_curframe; + + if(frames_left != NULL) *frames_left = small_frameleft; + + + return MPG123_OK; +} + +#undef mpg123_framelength +/* off_t mpg123_framelength(mpg123_handle *mh); */ +long attribute_align_arg mpg123_framelength(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_framelength)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_length +/* off_t mpg123_length(mpg123_handle *mh); */ +long attribute_align_arg mpg123_length(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_length)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +/* The simplest wrapper of all... */ +#undef mpg123_set_filesize +/* int mpg123_set_filesize(mpg123_handle *mh, off_t size); */ +int attribute_align_arg mpg123_set_filesize(mpg123_handle *mh, long size) +{ + return MPG123_LARGENAME(mpg123_set_filesize)(mh, size); +} + + +/* ========================================= + THE BOUNDARY OF SANITY + Behold, stranger! + ========================================= */ + + +/* + The messy part: Replacement of I/O core (actally, this is only due to lseek()). + Both descriptor and handle replaced I/O are mapped to replaced handle I/O, the handle wrapping over the actual callbacks and the actual handle/descriptor. + You got multiple levels of handles and callbacks to think about. Have fun reading and comprehending. +*/ + +/* Could go into compat.h ... Windows needs that flag. */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +/* Read callback needs nothing special. */ +ssize_t wrap_read(void* handle, void *buf, size_t count) +{ + struct wrap_data *ioh = handle; + switch(ioh->iotype) + { + case IO_FD: return ioh->r_read(ioh->fd, buf, count); + case IO_HANDLE: return ioh->r_h_read(ioh->handle, buf, count); + } + error("Serious breakage - bad IO type in LFS wrapper!"); + return -1; +} + +/* Seek callback needs protection from too big offsets. */ +off_t wrap_lseek(void *handle, off_t offset, int whence) +{ + struct wrap_data *ioh = handle; + long smalloff = offset; + if(smalloff == offset) + { + switch(ioh->iotype) + { + case IO_FD: return ioh->r_lseek(ioh->fd, smalloff, whence); + case IO_HANDLE: return ioh->r_h_lseek(ioh->handle, smalloff, whence); + } + error("Serious breakage - bad IO type in LFS wrapper!"); + return -1; + } + else + { + errno = EOVERFLOW; + return -1; + } +} + + +/* + Now, let's replace the API dealing with replacement I/O. + Start with undefining the renames... +*/ + +#undef mpg123_replace_reader +#undef mpg123_replace_reader_handle +#undef mpg123_open +#undef mpg123_open_fd +#undef mpg123_open_handle + + +/* Normal reader replacement needs fallback implementations. */ +static ssize_t fallback_read(int fd, void *buf, size_t count) +{ + return read(fd, buf, count); +} + +static long fallback_lseek(int fd, long offset, int whence) +{ + /* Since the offset is long int already, the returned value really should fit into a long... but whatever. */ + long newpos_long; + off_t newpos; + newpos = lseek(fd, offset, whence); + newpos_long = newpos; + if(newpos_long == newpos) + return newpos_long; + else + { + errno = EOVERFLOW; + return -1; + } +} + +/* Reader replacement prepares the hidden handle storage for next mpg123_open_fd() or plain mpg123_open(). */ +int attribute_align_arg mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), long (*r_lseek)(int, long, int) ) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + ioh = wrap_get(mh); + if(ioh == NULL) return MPG123_ERR; + + /* If both callbacks are NULL, switch totally to internal I/O, else just use fallback for at most half of them. */ + if(r_read == NULL && r_lseek == NULL) + { + /* Only the type is actually important to disable the code. */ + ioh->iotype = 0; + ioh->fd = -1; + ioh->r_read = NULL; + ioh->r_lseek = NULL; + } + else + { + ioh->iotype = IO_FD; + ioh->fd = -1; /* On next mpg123_open_fd(), this gets a value. */ + ioh->r_read = r_read != NULL ? r_read : fallback_read; + ioh->r_lseek = r_lseek != NULL ? r_lseek : fallback_lseek; + } + + /* The real reader replacement will happen while opening. */ + return MPG123_OK; +} + +int attribute_align_arg mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void*, void *, size_t), long (*r_lseek)(void*, long, int), void (*cleanup)(void*)) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + ioh = wrap_get(mh); + if(ioh == NULL) return MPG123_ERR; + + ioh->iotype = IO_HANDLE; + ioh->handle = NULL; + ioh->r_h_read = r_read; + ioh->r_h_lseek = r_lseek; + ioh->h_cleanup = cleanup; + + /* The real reader replacement will happen while opening. */ + return MPG123_OK; +} + +/* + The open routines always need to watch out for a prepared wrapper handle to use replaced normal I/O. + Two cases to consider: + 1. Plain normal open using internal I/O. + 2. Client called mpg123_replace_reader() before. + The second case needs hackery to activate the client I/O callbacks. For that, we create a custom I/O handle and use the guts of mpg123_open_fd() on it. +*/ +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + ioh = mh->wrapperdata; + /* Mimic the use of mpg123_replace_reader() functions by lower levels... + IO_HANDLE is not valid here, though. Only IO_FD. */ + if(ioh != NULL && ioh->iotype == IO_FD) + { + int err; + err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup); + if(err != MPG123_OK) return MPG123_ERR; + + /* The above call implied mpg123_close() already */ + /* + I really need to open the file here... to be able to use the replacer handle I/O ... + my_fd is used to indicate closing of the descriptor on cleanup. + */ + ioh->my_fd = compat_open(path, O_RDONLY|O_BINARY); + if(ioh->my_fd < 0) + { + if(!(mh->p.flags & MPG123_QUIET)) error2("Cannot open file %s: %s", path, strerror(errno)); + + mh->err = MPG123_BAD_FILE; + return MPG123_ERR; + } + /* Store a copy of the descriptor where it is actually used. */ + ioh->fd = ioh->my_fd; + /* Initiate I/O operating on my handle now. */ + err = open_stream_handle(mh, ioh); + if(err != MPG123_OK) + { + wrap_io_cleanup(ioh); + return MPG123_ERR; + } + /* All fine... */ + return MPG123_OK; + } + else return MPG123_LARGENAME(mpg123_open)(mh, path); +} + +/* + This is in fact very similar to the above: + The open routines always need to watch out for a prepared wrapper handle to use replaced normal I/O. + Two cases to consider: + 1. Plain normal open_fd using internal I/O. + 2. Client called mpg123_replace_reader() before. + The second case needs hackery to activate the client I/O callbacks. For that, we create a custom I/O handle and use the guts of mpg123_open_fd() on it. +*/ + +int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + ioh = mh->wrapperdata; + if(ioh != NULL && ioh->iotype == IO_FD) + { + int err; + err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup); + if(err != MPG123_OK) return MPG123_ERR; + + /* The above call implied mpg123_close() already */ + + /* Store the real file descriptor inside the handle. */ + ioh->fd = fd; + /* Initiate I/O operating on my handle now. */ + err = open_stream_handle(mh, ioh); + if(err != MPG123_OK) + { + wrap_io_cleanup(ioh); + return MPG123_ERR; + } + /* All fine... */ + return MPG123_OK; + } + else return MPG123_LARGENAME(mpg123_open_fd)(mh, fd); +} + +int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *handle) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + ioh = mh->wrapperdata; + if(ioh != NULL && ioh->iotype == IO_HANDLE && ioh->r_h_read != NULL) + { + /* Wrap the custom handle into my handle. */ + int err; + err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup); + if(err != MPG123_OK) return MPG123_ERR; + + ioh->handle = handle; + /* No extra error handling, keep behaviour of the original open_handle. */ + return open_stream_handle(mh, ioh); + } + else + { + /* This is an error ... you need to prepare the I/O before using it. */ + mh->err = MPG123_BAD_CUSTOM_IO; + return MPG123_ERR; + } +} + diff --git a/src/libmpg123/libmpg123.c b/src/libmpg123/libmpg123.c new file mode 100644 index 0000000..cc77905 --- /dev/null +++ b/src/libmpg123/libmpg123.c @@ -0,0 +1,1706 @@ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ + +#include "mpg123lib_intern.h" +#include "icy2utf8.h" +#include "debug.h" + +#include "gapless.h" +/* Want accurate rounding function regardless of decoder setup. */ +#define FORCE_ACCURATE +#include "sample.h" + +#define SEEKFRAME(mh) ((mh)->ignoreframe < 0 ? 0 : (mh)->ignoreframe) + +static int initialized = 0; + +int attribute_align_arg mpg123_init(void) +{ + if((sizeof(short) != 2) || (sizeof(long) < 4)) return MPG123_BAD_TYPES; + + if(initialized) return MPG123_OK; /* no need to initialize twice */ + +#ifndef NO_LAYER12 + init_layer12(); /* inits also shared tables with layer1 */ +#endif +#ifndef NO_LAYER3 + init_layer3(); +#endif + prepare_decode_tables(); + check_decoders(); + initialized = 1; +#if (defined REAL_IS_FLOAT) && (defined IEEE_FLOAT) + /* This is rather pointless but it eases my mind to check that we did + not enable the special rounding on a VAX or something. */ + if(12346 != REAL_TO_SHORT_ACCURATE(12345.67f)) + { + error("Bad IEEE 754 rounding. Re-build libmpg123 properly."); + return MPG123_ERR; + } +#endif + return MPG123_OK; +} + +void attribute_align_arg mpg123_exit(void) +{ + /* nothing yet, but something later perhaps */ +} + +/* create a new handle with specified decoder, decoder can be "", "auto" or NULL for auto-detection */ +mpg123_handle attribute_align_arg *mpg123_new(const char* decoder, int *error) +{ + return mpg123_parnew(NULL, decoder, error); +} + +/* ...the full routine with optional initial parameters to override defaults. */ +mpg123_handle attribute_align_arg *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error) +{ + mpg123_handle *fr = NULL; + int err = MPG123_OK; + + if(initialized) fr = (mpg123_handle*) malloc(sizeof(mpg123_handle)); + else err = MPG123_NOT_INITIALIZED; + if(fr != NULL) + { + frame_init_par(fr, mp); + debug("cpu opt setting"); + if(frame_cpu_opt(fr, decoder) != 1) + { + err = MPG123_BAD_DECODER; + frame_exit(fr); + free(fr); + fr = NULL; + } + } + if(fr != NULL) + { + fr->decoder_change = 1; + } + else if(err == MPG123_OK) err = MPG123_OUT_OF_MEM; + + if(error != NULL) *error = err; + return fr; +} + +int attribute_align_arg mpg123_decoder(mpg123_handle *mh, const char* decoder) +{ + enum optdec dt = dectype(decoder); + + if(mh == NULL) return MPG123_BAD_HANDLE; + + if(dt == nodec) + { + mh->err = MPG123_BAD_DECODER; + return MPG123_ERR; + } + if(dt == mh->cpu_opts.type) return MPG123_OK; + + /* Now really change. */ + /* frame_exit(mh); + frame_init(mh); */ + debug("cpu opt setting"); + if(frame_cpu_opt(mh, decoder) != 1) + { + mh->err = MPG123_BAD_DECODER; + frame_exit(mh); + return MPG123_ERR; + } + /* New buffers for decoder are created in frame_buffers() */ + if((frame_outbuffer(mh) != 0)) + { + mh->err = MPG123_NO_BUFFERS; + frame_exit(mh); + return MPG123_ERR; + } + /* Do _not_ call decode_update here! That is only allowed after a first MPEG frame has been met. */ + mh->decoder_change = 1; + return MPG123_OK; +} + +int attribute_align_arg mpg123_param(mpg123_handle *mh, enum mpg123_parms key, long val, double fval) +{ + int r; + + if(mh == NULL) return MPG123_BAD_HANDLE; + r = mpg123_par(&mh->p, key, val, fval); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + else + { /* Special treatment for some settings. */ +#ifdef FRAME_INDEX + if(key == MPG123_INDEX_SIZE) + { /* Apply frame index size and grow property on the fly. */ + r = frame_index_setup(mh); + if(r != MPG123_OK) mh->err = MPG123_INDEX_FAIL; + } +#endif +#ifndef NO_FEEDER + /* Feeder pool size is applied right away, reader will react to that. */ + if(key == MPG123_FEEDPOOL || key == MPG123_FEEDBUFFER) + bc_poolsize(&mh->rdat.buffer, mh->p.feedpool, mh->p.feedbuffer); +#endif + } + return r; +} + +int attribute_align_arg mpg123_par(mpg123_pars *mp, enum mpg123_parms key, long val, double fval) +{ + int ret = MPG123_OK; + + if(mp == NULL) return MPG123_BAD_PARS; + switch(key) + { + case MPG123_VERBOSE: + mp->verbose = val; + break; + case MPG123_FLAGS: +#ifndef GAPLESS + if(val & MPG123_GAPLESS) ret = MPG123_NO_GAPLESS; +#endif + if(ret == MPG123_OK) mp->flags = val; + debug1("set flags to 0x%lx", (unsigned long) mp->flags); + break; + case MPG123_ADD_FLAGS: +#ifndef GAPLESS + /* Enabling of gapless mode doesn't work when it's not there, but disabling (below) is no problem. */ + if(val & MPG123_GAPLESS) ret = MPG123_NO_GAPLESS; + else +#endif + mp->flags |= val; + debug1("set flags to 0x%lx", (unsigned long) mp->flags); + break; + case MPG123_REMOVE_FLAGS: + mp->flags &= ~val; + debug1("set flags to 0x%lx", (unsigned long) mp->flags); + break; + case MPG123_FORCE_RATE: /* should this trigger something? */ +#ifdef NO_NTOM + if(val > 0) + ret = MPG123_BAD_RATE; +#else + if(val > 96000) ret = MPG123_BAD_RATE; + else mp->force_rate = val < 0 ? 0 : val; /* >0 means enable, 0 disable */ +#endif + break; + case MPG123_DOWN_SAMPLE: +#ifdef NO_DOWNSAMPLE + if(val != 0) ret = MPG123_BAD_RATE; +#else + if(val < 0 || val > 2) ret = MPG123_BAD_RATE; + else mp->down_sample = (int)val; +#endif + break; + case MPG123_RVA: + if(val < 0 || val > MPG123_RVA_MAX) ret = MPG123_BAD_RVA; + else mp->rva = (int)val; + break; + case MPG123_DOWNSPEED: + mp->halfspeed = val < 0 ? 0 : val; + break; + case MPG123_UPSPEED: + mp->doublespeed = val < 0 ? 0 : val; + break; + case MPG123_ICY_INTERVAL: +#ifndef NO_ICY + mp->icy_interval = val > 0 ? val : 0; +#else + if(val > 0) ret = MPG123_BAD_PARAM; +#endif + break; + case MPG123_OUTSCALE: + /* Choose the value that is non-zero, if any. + Downscaling integers to 1.0 . */ + mp->outscale = val == 0 ? fval : (double)val/SHORT_SCALE; + break; + case MPG123_TIMEOUT: +#ifdef TIMEOUT_READ + mp->timeout = val >= 0 ? val : 0; +#else + if(val > 0) ret = MPG123_NO_TIMEOUT; +#endif + break; + case MPG123_RESYNC_LIMIT: + mp->resync_limit = val; + break; + case MPG123_INDEX_SIZE: +#ifdef FRAME_INDEX + mp->index_size = val; +#else + ret = MPG123_NO_INDEX; +#endif + break; + case MPG123_PREFRAMES: + if(val >= 0) mp->preframes = val; + else ret = MPG123_BAD_VALUE; + break; + case MPG123_FEEDPOOL: +#ifndef NO_FEEDER + if(val >= 0) mp->feedpool = val; + else ret = MPG123_BAD_VALUE; +#else + ret = MPG123_MISSING_FEATURE; +#endif + break; + case MPG123_FEEDBUFFER: +#ifndef NO_FEEDER + if(val > 0) mp->feedbuffer = val; + else ret = MPG123_BAD_VALUE; +#else + ret = MPG123_MISSING_FEATURE; +#endif + break; + default: + ret = MPG123_BAD_PARAM; + } + return ret; +} + +int attribute_align_arg mpg123_getparam(mpg123_handle *mh, enum mpg123_parms key, long *val, double *fval) +{ + int r; + + if(mh == NULL) return MPG123_BAD_HANDLE; + r = mpg123_getpar(&mh->p, key, val, fval); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + return r; +} + +int attribute_align_arg mpg123_getpar(mpg123_pars *mp, enum mpg123_parms key, long *val, double *fval) +{ + int ret = 0; + + if(mp == NULL) return MPG123_BAD_PARS; + switch(key) + { + case MPG123_VERBOSE: + if(val) *val = mp->verbose; + break; + case MPG123_FLAGS: + case MPG123_ADD_FLAGS: + if(val) *val = mp->flags; + break; + case MPG123_FORCE_RATE: + if(val) +#ifdef NO_NTOM + *val = 0; +#else + *val = mp->force_rate; +#endif + break; + case MPG123_DOWN_SAMPLE: + if(val) *val = mp->down_sample; + break; + case MPG123_RVA: + if(val) *val = mp->rva; + break; + case MPG123_DOWNSPEED: + if(val) *val = mp->halfspeed; + break; + case MPG123_UPSPEED: + if(val) *val = mp->doublespeed; + break; + case MPG123_ICY_INTERVAL: +#ifndef NO_ICY + if(val) *val = (long)mp->icy_interval; +#else + if(val) *val = 0; +#endif + break; + case MPG123_OUTSCALE: + if(fval) *fval = mp->outscale; + if(val) *val = (long)(mp->outscale*SHORT_SCALE); + break; + case MPG123_RESYNC_LIMIT: + if(val) *val = mp->resync_limit; + break; + case MPG123_INDEX_SIZE: + if(val) +#ifdef FRAME_INDEX + *val = mp->index_size; +#else + *val = 0; /* graceful fallback: no index is index of zero size */ +#endif + break; + case MPG123_PREFRAMES: + *val = mp->preframes; + break; + case MPG123_FEEDPOOL: +#ifndef NO_FEEDER + *val = mp->feedpool; +#else + ret = MPG123_MISSING_FEATURE; +#endif + break; + case MPG123_FEEDBUFFER: +#ifndef NO_FEEDER + *val = mp->feedbuffer; +#else + ret = MPG123_MISSING_FEATURE; +#endif + break; + default: + ret = MPG123_BAD_PARAM; + } + return ret; +} + +int attribute_align_arg mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval) +{ + int ret = MPG123_OK; + long theval = 0; + double thefval = 0.; + + if(mh == NULL) return MPG123_BAD_HANDLE; + + switch(key) + { + case MPG123_ACCURATE: + theval = mh->state_flags & FRAME_ACCURATE; + break; + case MPG123_FRANKENSTEIN: + theval = mh->state_flags & FRAME_FRANKENSTEIN; + break; + case MPG123_BUFFERFILL: +#ifndef NO_FEEDER + { + size_t sval = bc_fill(&mh->rdat.buffer); + theval = (long)sval; + if(theval < 0 || (size_t)theval != sval) + { + mh->err = MPG123_INT_OVERFLOW; + ret = MPG123_ERR; + } + } +#else + mh->err = MPG123_MISSING_FEATURE; + ret = MPG123_ERR; +#endif + break; + case MPG123_FRESH_DECODER: + theval = mh->state_flags & FRAME_FRESH_DECODER; + mh->state_flags &= ~FRAME_FRESH_DECODER; + break; + default: + mh->err = MPG123_BAD_KEY; + ret = MPG123_ERR; + } + + if(val != NULL) *val = theval; + if(fval != NULL) *fval = thefval; + + return ret; +} +int attribute_align_arg mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val) +{ +#ifndef NO_EQUALIZER + if(mh == NULL) return MPG123_BAD_HANDLE; + if(band < 0 || band > 31){ mh->err = MPG123_BAD_BAND; return MPG123_ERR; } + switch(channel) + { + case MPG123_LEFT|MPG123_RIGHT: + mh->equalizer[0][band] = mh->equalizer[1][band] = DOUBLE_TO_REAL(val); + break; + case MPG123_LEFT: mh->equalizer[0][band] = DOUBLE_TO_REAL(val); break; + case MPG123_RIGHT: mh->equalizer[1][band] = DOUBLE_TO_REAL(val); break; + default: + mh->err=MPG123_BAD_CHANNEL; + return MPG123_ERR; + } + mh->have_eq_settings = TRUE; +#endif + return MPG123_OK; +} + +double attribute_align_arg mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band) +{ + double ret = 0.; +#ifndef NO_EQUALIZER + + /* Handle this gracefully. When there is no band, it has no volume. */ + if(mh != NULL && band > -1 && band < 32) + switch(channel) + { + case MPG123_LEFT|MPG123_RIGHT: + ret = 0.5*(REAL_TO_DOUBLE(mh->equalizer[0][band])+REAL_TO_DOUBLE(mh->equalizer[1][band])); + break; + case MPG123_LEFT: ret = REAL_TO_DOUBLE(mh->equalizer[0][band]); break; + case MPG123_RIGHT: ret = REAL_TO_DOUBLE(mh->equalizer[1][band]); break; + /* Default case is already handled: ret = 0 */ + } +#endif + return ret; +} + +/* plain file access, no http! */ +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return open_stream(mh, path, -1); +} + +int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return open_stream(mh, NULL, fd); +} + +int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + if(mh->rdat.r_read_handle == NULL) + { + mh->err = MPG123_BAD_CUSTOM_IO; + return MPG123_ERR; + } + return open_stream_handle(mh, iohandle); +} + +int attribute_align_arg mpg123_open_feed(mpg123_handle *mh) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return open_feed(mh); +} + +int attribute_align_arg mpg123_replace_reader( mpg123_handle *mh, + ssize_t (*r_read) (int, void *, size_t), + off_t (*r_lseek)(int, off_t, int) ) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + mh->rdat.r_read = r_read; + mh->rdat.r_lseek = r_lseek; + return MPG123_OK; +} + +int attribute_align_arg mpg123_replace_reader_handle( mpg123_handle *mh, + ssize_t (*r_read) (void*, void *, size_t), + off_t (*r_lseek)(void*, off_t, int), + void (*cleanup)(void*) ) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + mh->rdat.r_read_handle = r_read; + mh->rdat.r_lseek_handle = r_lseek; + mh->rdat.cleanup_handle = cleanup; + return MPG123_OK; +} + +/* Update decoding engine for + a) a new choice of decoder + b) a changed native format of the MPEG stream + ... calls are only valid after parsing some MPEG frame! */ +int decode_update(mpg123_handle *mh) +{ + long native_rate; + int b; + + if(mh->num < 0) + { + if(!(mh->p.flags & MPG123_QUIET)) error("decode_update() has been called before reading the first MPEG frame! Internal programming error."); + + mh->err = MPG123_BAD_DECODER_SETUP; + return MPG123_ERR; + } + + mh->state_flags |= FRAME_FRESH_DECODER; + native_rate = frame_freq(mh); + + b = frame_output_format(mh); /* Select the new output format based on given constraints. */ + if(b < 0) return MPG123_ERR; + + if(b == 1) mh->new_format = 1; /* Store for later... */ + + debug3("updating decoder structure with native rate %li and af.rate %li (new format: %i)", native_rate, mh->af.rate, mh->new_format); + if(mh->af.rate == native_rate) mh->down_sample = 0; + else if(mh->af.rate == native_rate>>1) mh->down_sample = 1; + else if(mh->af.rate == native_rate>>2) mh->down_sample = 2; + else mh->down_sample = 3; /* flexible (fixed) rate */ + switch(mh->down_sample) + { + case 0: + case 1: + case 2: + mh->down_sample_sblimit = SBLIMIT>>(mh->down_sample); + /* With downsampling I get less samples per frame */ + mh->outblock = outblock_bytes(mh, (mh->spf>>mh->down_sample)); + break; +#ifndef NO_NTOM + case 3: + { + if(synth_ntom_set_step(mh) != 0) return -1; + if(frame_freq(mh) > mh->af.rate) + { + mh->down_sample_sblimit = SBLIMIT * mh->af.rate; + mh->down_sample_sblimit /= frame_freq(mh); + } + else mh->down_sample_sblimit = SBLIMIT; + mh->outblock = outblock_bytes(mh, + ( ( NTOM_MUL-1+mh->spf + * (((size_t)NTOM_MUL*mh->af.rate)/frame_freq(mh)) + )/NTOM_MUL )); + } + break; +#endif + } + + if(!(mh->p.flags & MPG123_FORCE_MONO)) + { + if(mh->af.channels == 1) mh->single = SINGLE_MIX; + else mh->single = SINGLE_STEREO; + } + else mh->single = (mh->p.flags & MPG123_FORCE_MONO)-1; + if(set_synth_functions(mh) != 0) return -1;; + + /* The needed size of output buffer may have changed. */ + if(frame_outbuffer(mh) != MPG123_OK) return -1; + + do_rva(mh); + debug3("done updating decoder structure with native rate %li and af.rate %li and down_sample %i", frame_freq(mh), mh->af.rate, mh->down_sample); + + return 0; +} + +size_t attribute_align_arg mpg123_safe_buffer(void) +{ + /* real is the largest possible output (it's 32bit float, 32bit int or 64bit double). */ + return sizeof(real)*2*1152*NTOM_MAX; +} + +size_t attribute_align_arg mpg123_outblock(mpg123_handle *mh) +{ + /* Try to be helpful and never return zero output block size. */ + if(mh != NULL && mh->outblock > 0) return mh->outblock; + else return mpg123_safe_buffer(); +} + +/* Read in the next frame we actually want for decoding. + This includes skipping/ignoring frames, in additon to skipping junk in the parser. */ +static int get_next_frame(mpg123_handle *mh) +{ + int change = mh->decoder_change; + /* Ensure we got proper decoder for ignoring frames. + Header can be changed from seeking around. But be careful: Only after at + least one frame got read, decoder update makes sense. */ + if(mh->header_change > 1 && mh->num >= 0) + { + change = 1; + mh->header_change = 0; + debug("starting with big header change"); + if(decode_update(mh) < 0) + return MPG123_ERR; + } + + do + { + int b; + /* Decode & discard some frame(s) before beginning. */ + if(mh->to_ignore && mh->num < mh->firstframe && mh->num >= mh->ignoreframe) + { + debug1("ignoring frame %li", (long)mh->num); + /* Decoder structure must be current! decode_update has been called before... */ + (mh->do_layer)(mh); mh->buffer.fill = 0; +#ifndef NO_NTOM + /* The ignored decoding may have failed. Make sure ntom stays consistent. */ + if(mh->down_sample == 3) ntom_set_ntom(mh, mh->num+1); +#endif + mh->to_ignore = mh->to_decode = FALSE; + } + /* Read new frame data; possibly breaking out here for MPG123_NEED_MORE. */ + debug("read frame"); + mh->to_decode = FALSE; + b = read_frame(mh); /* That sets to_decode only if a full frame was read. */ + debug4("read of frame %li returned %i (to_decode=%i) at sample %li", (long)mh->num, b, mh->to_decode, (long)mpg123_tell(mh)); + if(b == MPG123_NEED_MORE) return MPG123_NEED_MORE; /* need another call with data */ + else if(b <= 0) + { + /* More sophisticated error control? */ + if(b==0 || (mh->rdat.filelen >= 0 && mh->rdat.filepos == mh->rdat.filelen)) + { /* We simply reached the end. */ + mh->track_frames = mh->num + 1; + debug("What about updating/checking gapless sample count here?"); + return MPG123_DONE; + } + else return MPG123_ERR; /* Some real error. */ + } + /* Now, there should be new data to decode ... and also possibly new stream properties */ + if(mh->header_change > 1) + { + debug("big header change"); + change = 1; + mh->header_change = 0; + /* Need to update decoder structure right away since frame might need to + be decoded on next loop iteration for properly ignoring its output. */ + if(decode_update(mh) < 0) + return MPG123_ERR; + } + /* Now some accounting: Look at the numbers and decide if we want this frame. */ + ++mh->playnum; + /* Plain skipping without decoding, only when frame is not ignored on next cycle. */ + if(mh->num < mh->firstframe || (mh->p.doublespeed && (mh->playnum % mh->p.doublespeed))) + { + if(!(mh->to_ignore && mh->num < mh->firstframe && mh->num >= mh->ignoreframe)) + { + frame_skip(mh); + /* Should one fix NtoM here or not? + It is not work the trouble for doublespeed, but what with leading frames? */ + } + } + /* Or, we are finally done and have a new frame. */ + else break; + } while(1); + + /* If we reach this point, we got a new frame ready to be decoded. + All other situations resulted in returns from the loop. */ + if(change) + { + mh->decoder_change = 0; + if(mh->fresh) + { +#ifdef GAPLESS + int b=0; + /* Prepare offsets for gapless decoding. */ + debug1("preparing gapless stuff with native rate %li", frame_freq(mh)); + frame_gapless_realinit(mh); + frame_set_frameseek(mh, mh->num); +#endif + mh->fresh = 0; +#ifdef GAPLESS + /* Could this possibly happen? With a real big gapless offset... */ + if(mh->num < mh->firstframe) b = get_next_frame(mh); + if(b < 0) return b; /* Could be error, need for more, new format... */ +#endif + } + } + return MPG123_OK; +} + +/* Assumption: A buffer full of zero samples can be constructed by repetition of this byte. + Oh, and it handles some format conversion. + Only to be used by decode_the_frame() ... */ +static int zero_byte(mpg123_handle *fr) +{ +#ifndef NO_8BIT + return fr->af.encoding & MPG123_ENC_8 ? fr->conv16to8[0] : 0; +#else + return 0; /* All normal signed formats have the zero here (even in byte form -- that may be an assumption for your funny machine...). */ +#endif +} + +/* + Not part of the api. This just decodes the frame and fills missing bits with zeroes. + There can be frames that are broken and thus make do_layer() fail. +*/ +static void decode_the_frame(mpg123_handle *fr) +{ + size_t needed_bytes = decoder_synth_bytes(fr, frame_expect_outsamples(fr)); + fr->clip += (fr->do_layer)(fr); + /*fprintf(stderr, "frame %"OFF_P": got %"SIZE_P" / %"SIZE_P"\n", fr->num,(size_p)fr->buffer.fill, (size_p)needed_bytes);*/ + /* There could be less data than promised. + Also, then debugging, we look out for coding errors that could result in _more_ data than expected. */ +#ifdef DEBUG + if(fr->buffer.fill != needed_bytes) + { +#endif + if(fr->buffer.fill < needed_bytes) + { + if(VERBOSE2) + fprintf(stderr, "Note: broken frame %li, filling up with %"SIZE_P" zeroes, from %"SIZE_P"\n", (long)fr->num, (size_p)(needed_bytes-fr->buffer.fill), (size_p)fr->buffer.fill); + + /* + One could do a loop with individual samples instead... but zero is zero + Actually, that is wrong: zero is mostly a series of null bytes, + but we have funny 8bit formats that have a different opinion on zero... + Unsigned 16 or 32 bit formats are handled later. + */ + memset( fr->buffer.data + fr->buffer.fill, zero_byte(fr), needed_bytes - fr->buffer.fill ); + + fr->buffer.fill = needed_bytes; +#ifndef NO_NTOM + /* ntom_val will be wrong when the decoding wasn't carried out completely */ + ntom_set_ntom(fr, fr->num+1); +#endif + } +#ifdef DEBUG + else + { + if(NOQUIET) + error2("I got _more_ bytes than expected (%"SIZE_P" / %"SIZE_P"), that should not be possible!", (size_p)fr->buffer.fill, (size_p)needed_bytes); + } + } +#endif + postprocess_buffer(fr); +} + +/* + Decode the current frame into the frame structure's buffer, accessible at the location stored in
+ Note: + This API doc is automatically generated from the current development version that you can get via Subversion or as a daily snapshot from http://mpg123.org/snapshot. + There may be differences (additions) compared to the latest stable release. See + NEWS.libmpg123, + NEWS.libout123, + and the overall NEWS file on libmpg123 versions and important changes between them.
+ Let me emphasize that the policy for libmpg123 and libout123 is to always stay backwards compatible -- only additions are planned (and it's not yet planned to change the plans;-). +